diff --git a/COPYING b/COPYING index 0712e040f1da325fc81474b5202b6421091a844d..617ea1d78060886e525dcf1b4dd43e824355ef03 100644 --- a/COPYING +++ b/COPYING @@ -1,3 +1,5 @@ + SLURM LICENSE AGREEMENT + All SLURM code and documentation is available under the GNU General Public License. Some tools in the "contribs" directory have other licenses. See the documentation for individual contributed tools for details. @@ -13,14 +15,18 @@ 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. +NO WARRANTY: Because the program is licensed free of charge, there is no +warranty for the program. See section 11 below for full details. + ============================================================================= OUR NOTICE AND TERMS OF AND CONDITIONS OF THE GNU GENERAL PUBLIC LICENSE Auspices -This work performed under the auspices of the U.S. Department of Energy by -Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. +Portions of this work were performed under the auspices of the U.S. Department +of Energy by Lawrence Livermore National Laboratory under Contract +DE-AC52-07NA27344. Disclaimer @@ -98,7 +104,7 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -153,7 +159,7 @@ above, provided that you also meet all of these conditions: License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in diff --git a/META b/META index 44b842aa6eb59a9c37fa84b9eb5c5b54caa22c49..ae6c2e4ee314c12406eb6e9b81fb8a66a5113a19 100644 --- a/META +++ b/META @@ -8,10 +8,11 @@ Meta: 1 Name: slurm Major: 2 - Minor: 4 + Minor: 5 Micro: 0 - Version: 2.4.0 - Release: 0.pre4 + Version: 2.5.0 + Release: 0.pre1 + ## # When changing API_CURRENT update src/common/slurm_protocol_common.h # with a new SLURM_PROTOCOL_VERSION signifing the old one and the version @@ -20,6 +21,6 @@ # and _get_slurm_version() # need to be updated also when changes are added also. ## - API_CURRENT: 24 + API_CURRENT: 25 API_AGE: 0 API_REVISION: 0 diff --git a/Makefile.am b/Makefile.am index d8122c99365dc8f61c12e794979619f140ad135a..ef26c31993e89868b084a06c79cdcdac64671dd4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,6 @@ SUBDIRS = auxdir src testsuite doc EXTRA_DIST = \ etc/bluegene.conf.example \ - etc/federation.conf.example \ etc/slurm.conf.example \ etc/slurmdbd.conf.example \ etc/slurm.epilog.clean \ diff --git a/Makefile.in b/Makefile.in index 08505e7cfb6f7565aea2c89a1c9f26f7f08c2a54..5c6801dc3816937caf00c3cd8ec57e946a784534 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -63,9 +63,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -73,6 +71,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -125,6 +124,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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)$(pkgincludedir)" HEADERS = $(pkginclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ @@ -139,9 +144,11 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -170,6 +177,8 @@ am__relativize = \ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -211,9 +220,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -221,9 +228,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -255,6 +261,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -282,6 +290,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -377,7 +386,6 @@ ACLOCAL_AMFLAGS = -I auxdir SUBDIRS = auxdir src testsuite doc EXTRA_DIST = \ etc/bluegene.conf.example \ - etc/federation.conf.example \ etc/slurm.conf.example \ etc/slurmdbd.conf.example \ etc/slurm.epilog.clean \ @@ -418,7 +426,7 @@ all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -454,10 +462,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -468,10 +474,8 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) touch $@ slurm/slurm.h: slurm/stamp-h2 - @if test ! -f $@; then \ - rm -f slurm/stamp-h2; \ - $(MAKE) $(AM_MAKEFLAGS) slurm/stamp-h2; \ - else :; fi + @if test ! -f $@; then rm -f slurm/stamp-h2; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) slurm/stamp-h2; else :; fi slurm/stamp-h2: $(top_srcdir)/slurm/slurm.h.in $(top_builddir)/config.status @rm -f slurm/stamp-h2 @@ -513,9 +517,7 @@ uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -724,7 +726,11 @@ dist-gzip: distdir $(am__remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir @@ -732,7 +738,7 @@ dist-lzma: distdir $(am__remove_distdir) dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir @@ -763,6 +769,8 @@ distcheck: dist bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ @@ -782,6 +790,7 @@ distcheck: dist && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -810,8 +819,16 @@ distcheck: dist list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -845,10 +862,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: @@ -937,8 +959,8 @@ uninstall-am: uninstall-pkgincludeHEADERS .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-generic distclean-hdr \ + dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-local distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ diff --git a/NEWS b/NEWS index 50d42342d4e8781c5e393927a3e1b1655e5c8e5d..1495a2aa7f971523e1e47e639191677c361ad656 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,134 @@ This file describes changes in recent versions of SLURM. It primarily documents those changes that are of interest to users and admins. -* Changes in SLURM 2.4.0.pre5 +* Changes in SLURM 2.5.0.pre2 +============================= + -- When running with multiple slurmd daemons per node, enable specifying a + range of ports on a single line of the node configuration in slurm.conf. + -- Add reservation flag of Part_Nodes to allocate all nodes in a partition to + a reservation and automatically change the reservation when nodes are + added to or removed from the reservation. Based upon work by + Bill Brophy, Bull. + -- Add support for advanced reservation for specific cores rather than whole + nodes. Current limiations: homogeneous cluster, nodes idle when reservation + created, and no more than one reservation per node. Code is still under + development. Work by Alejandro Lucero Palau, et. al, BSC. + -- Add DebugFlag of Switch to log switch plugin details. + -- Correct job node_cnt value in job completion plugin when job fails due to + down node. Previously was too low by one. + -- Add new srun option --cpu-freq to enable user control over the job's CPU + frequency and thus it's power consumption. NOTE: cpu frequency is not + currently preserved for jobs being suspended and later resumed. Work by + Don Albert, Bull. + +* Changes in SLURM 2.5.0.pre1 +============================= + -- Add new output to "scontrol show configuration" of LicensesUsed. Output is + "name:used/total" + -- Changed jobacct_gather plugin infrastructure to be cleaner and easier to + maintain. + -- Change license option count separator from "*" to ":" for consistency with + the gres option (e.g. "--licenses=foo:2 --gres=gpu:2"). The "*" will still + be accepted, but is no longer documented. + -- Permit more than 100 jobs to be scheduled per node (new limit is 10,000 + jobs). + -- Restructure of srun code to allow outside programs to utilize existing + logic. + +* Changes in SLURM 2.4.2 +======================== + -- BLUEGENE - Correct potential deadlock issue when hardware goes bad and + there are jobs running on that hardware. + -- If job is submitted to more than one partition, it's partition pointer can + be set to an invalid value. This can result in the count of CPUs allocated + on a node being bad, resulting in over- or under-allocation of its CPUs. + Patch by Carles Fenoy, BSC. + -- Fix bug in task layout with select/cons_res plugin and --ntasks-per-node + option. Patch by Martin Perry, Bull. + -- BLUEGENE - remove race condition where if a block is removed while waiting + for a job to finish on it the number of unused cpus wasn't updated + correctly. + -- BGQ - make sure we have a valid block when creating or finishing a step + allocation. + -- BLUEGENE - If a large block (> 1 midplane) is in error and underlying + hardware is marked bad remove the larger block and create a block over + just the bad hardware making the other hardware available to run on. + -- BLUEGENE - Handle job completion correctly if an admin removes a block + where other blocks on an overlapping midplane are running jobs. + -- BLUEGENE - correctly remove running jobs when freeing a block. + -- BGQ - correct logic to place multiple (< 1 midplane) steps inside a + multi midplane block allocation. + -- BGQ - Make it possible for a multi midplane allocation to run on more + than 1 midplane but not the entire allocation. + -- BGL - Fix for syncing users on block from Tim Wickberg + -- Fix initialization of protocol_version for some messages to make sure it + is always set when sending or receiving a message. + +* Changes in SLURM 2.4.1 +======================== + -- Fix bug for job state change from 2.3 -> 2.4 job state can now be preserved + correctly when transitioning. This also applies for 2.4.0 -> 2.4.1, no + state will be lost. (Thanks to Carles Fenoy) + +* Changes in SLURM 2.4.0 +======================== + -- Cray - Improve support for zero compute note resource allocations. + Partition used can now be configured with no nodes nodes. + -- BGQ - make it so srun -i works correctly. + -- Fix parse_uint32/16 to complain if a non-digit is given. + -- Add SUBMITHOST to job state passed to Moab vial sched/wiki2. Patch by Jon + Bringhurst (LANL). + -- BGQ - Fix issue when running with AllowSubBlockAllocations=Yes without + compiling with --enable-debug + -- Modify scontrol to require "-dd" option to report batch job's script. Patch + from Don Albert, Bull. + -- Modify SchedulerParamters option to match documentation: "bf_res=" + changed to "bf_resolution=". Patch from Rod Schultz, Bull. + -- Fix bug that clears job pending reason field. Patch fron Don Lipari, LLNL. + -- In etc/init.d/slurm move check for scontrol after sourcing + /etc/sysconfig/slurm. Patch from Andy Wettstein, University of Chicago. + -- Fix in scheduling logic that can delay jobs with min/max node counts. + -- BGQ - fix issue where if a step uses the entire allocation and then + the next step in the allocation only uses part of the allocation it gets + the correct cnodes. + -- BGQ - Fix checking for IO on a block with new IBM driver V1R1M1 previous + function didn't always work correctly. + -- BGQ - Fix issue when a nodeboard goes down and you want to combine blocks + to make a larger small block and are running with sub-blocks. + -- BLUEGENE - Better logic for making small blocks around bad nodeboard/card. + -- BGQ - When using an old IBM driver cnodes that go into error because of + a job kill timeout aren't always reported to the system. This is now + handled by the runjob_mux plugin. + -- BGQ - Added information on how to setup the runjob_mux to run as SlurmUser. + -- Improve memory consumption on step layouts with high task count. + -- BGQ - quiter debug when the real time server comes back but there are + still messages we find when we poll but haven't given it back to the real + time yet. + -- BGQ - fix for if a request comes in smaller than the smallest block and + we must use a small block instead of a shared midplane block. + -- Fix issues on large jobs (>64k tasks) to have the correct counter type when + packing the step layout structure. + -- BGQ - fix issue where if a user was asking for tasks and ntasks-per-node + but not node count the node count is correctly figured out. + -- Move logic to always use the 1st alphanumeric node as the batch host for + batch jobs. + -- BLUEGENE - fix race condition where if a nodeboard/card goes down at the + same time a block is destroyed and that block just happens to be the + smallest overlapping block over the bad hardware. + -- Fix bug when querying accounting looking for a job node size. + -- BLUEGENE - fix possible race condition if cleaning up a block and the + removal of the job on the block failed. + -- BLUEGENE - fix issue if a cable was in an error state make it so we can + check if a block is still makable if the cable wasn't in error. + -- Put nodes names in alphabetic order in node table. + -- If preempted job should have a grace time and preempt mode is not cancel + but job is going to be canceled because it is interactive or other reason + it now receives the grace time. + -- BGQ - Modified documents to explain new plugin_flags needed in bg.properties + in order for the runjob_mux to run correctly. + -- BGQ - change linking from libslurm.o to libslurmhelper.la to avoid warning. + +* Changes in SLURM 2.4.0.rc1 ============================= -- Improve task binding logic by making fuller use of HWLOC library, especially with respect to Opteron 6000 series processors. Work contributed @@ -229,6 +356,14 @@ documents those changes that are of interest to users and admins. -- If job time limit exceeds partition maximum, but job's minimum time limit does not, set job's time limit to partition maximum at allocation time. +* Changes in SLURM 2.3.6 +======================== + -- Fix DefMemPerCPU for partition definitions. + -- Fix to create a reservation with licenses and no nodes. + -- Fix issue with assoc_mgr if a bad state file is given and the database + isn't up at the time the slurmctld starts, not running the + priority/multifactor plugin, and then the database is started up later. + * Changes in SLURM 2.3.5 ======================== -- Improve support for overlapping advanced reservations. Patch from diff --git a/README.rst b/README.rst index eedb043ff290988ed8f6adb9d190b55a45b5ccbe..8a07ce8d924820fe087a76aaa5f960a3dcfc24cb 100644 --- a/README.rst +++ b/README.rst @@ -66,12 +66,12 @@ COMPILING AND INSTALLING THE DISTRIBUTION ----------------------------------------- Please see the instructions at - http://www.llnl.gov/linux/slurm/quickstart_admin.html + http://www.schedmd.com/slurmdocs/quickstart_admin.html Extensive documentation is available from our home page at - http://www.llnl.gov/linux/slurm + http://www.schedmd.com/slurmdocs/slurm.html PROBLEMS -------- -If you experience problems compiling, installing, or running SLURM -please send e-mail to either slurm-dev@lists.llnl.gov. +If you experience problems compiling, installing, or running SLURM, see + http://www.schedmd.com/slurmdocs/help.html diff --git a/RELEASE_NOTES b/RELEASE_NOTES index dc4247c55e26f6b8574481df809711067c07bb84..ef727f706e77ae9a6cdfcf796d2317875575cb0e 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -1,10 +1,10 @@ -RELEASE NOTES FOR SLURM VERSION 2.4 -10 May 2012 +RELEASE NOTES FOR SLURM VERSION 2.5 +6 June 2012 IMPORTANT NOTE: If using the slurmdbd (SLURM DataBase Daemon) you must update this first. -The 2.4 slurmdbd will work with SLURM daemons of version 2.1.3 and above. +The 2.5 slurmdbd will work with SLURM daemons of version 2.1.3 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 @@ -18,78 +18,29 @@ innodb_buffer_pool_size=64M under the [mysqld] reference in the my.cnf file and restarting the mysqld. This is needed when converting large tables over to the new database schema. -SLURM can be upgraded from version 2.3 to version 2.4 without loss of jobs or +SLURM can be upgraded from version 2.4 to version 2.5 without loss of jobs or other state information. HIGHLIGHTS ========== -* Up to 500% higher throughput for short-lived jobs (depending upon - configuration). -* Major modifications to support IBM BlueGene/Q systems. -* New SPANK callbacks added to slurmd: slurm_spank_slurmd_{init,exit} and - job epilog/prolog: slurm_spank_job_{prolog,epilog}. -* Added MPI plugin, mpi/pmi2, which supports MPI_Comm_spawn() function. + CONFIGURATION FILE CHANGES (see "man slurm.conf" for details) ============================================================= -* "PriorityFlags" added -* "RebootProgram" added -* "ReconfigFlags" added -* "SlurmdDebugLevel" and "SlurmctldDebugLevel" now accept string names in - addition to numeric values (e.g. "info", "verbose", "debug", etc.). Output - of scontrol and sview commands also use the string names. -* Changed default value of "StateSaveLocation" configuration parameter from - "/tmp" to "/var/spool" to help avoid purging. -* Change default "SchedulerParameters" "max_switch_wait" field value from 60 to - 300 seconds. -* Added new "SchedulerParameters" of "bf_max_job_user", maximum number of jobs - to attempt backfilling per user. + COMMAND CHANGES (see man pages for details) =========================================== -* Modified advance reservation to select resources optimized for network - topology and accept multiple specific block sizes rather than a single node - count. -* Added trigger flag for a permanent trigger. The trigger will NOT be purged - after an event occurs, but only when explicitly deleted. -* Added the ability to reboot all compute nodes after they become idle. The - RebootProgram configuration parameter must be set and an authorized user - must execute the command "scontrol reboot_nodes". -* Added the ability to update a node's NodeAddr and NodeHostName with scontrol. -* Added the option "--name" to the sacct and squeue commands. -* Add support for job allocations with multiple job constraint counts. For - example: salloc -C "[rack1*2&rack2*4]" ... will allocate the job 2 nodes - from rack1 and 4 nodes from rack2. Support for only a single constraint - name been added to job step support. -* Changed meaning of squeue "-n" option to job name from node name for - consistency with other commands. The "-w" option was added for a short - node name option. Long options --names and --nodes remain unchanged. -* Sinfo output format of "%P" now prints "*" after default partition even if - no field width is specified (previously included "*" only if no field width - was specified. Added output format of "%R" to print partition name only - without identifying the default partition with "*"). -* Added cpu_run_min to the output of sshare --long. + OTHER CHANGES ============= -* Improve task binding logic by making fuller use of HWLOC library, - especially with respect to Opteron 6000 series processors. -* Changde to output tools labels from "BP" to "Midplane" (i.e. "BP_List" was - changed to "MidplaneList"). -* Modified srun to fork a processes which can terminate the job and/or step - allocation if the initial srun process is abnormallly terminated (e.g. by - SIGKILL). -* Added support for Cray GPU memory allocation as GRES (Generic RESources). -* Correct setting of CUDA_VISIBLE_DEVICES for gres/gpu plugin if device files - to be used are not in numeric order (e.g. GPU 1 maps to "/dev/nvidia4"). -* Cray - Add support for zero compute note resource allocation to run batch - script on front-end node with no ALPS reservation. Useful for pre- or post- - processing. NOTE: The partition must be configured with MinNodes=0. + API CHANGES =========== -* Added the UserID of the user issuing the RPC to the job_submit/lua functions. + Changed members of the following structs ======================================== @@ -97,17 +48,10 @@ Changed members of the following structs Added the following struct definitions ====================================== -block_info_t: cnode_err_cnt added -slurm_ctl_conf_t priority_flags, reboot_program and reconfig_flags added -trigger_info_t: flags added -update_node_msg_t: node_addr and node_hostname added -slurmdb_association_cond_t: grp_mem_list added -slurmdb_association_rec_t: grp_mem added -slurmdb_qos_rec_t: grp_mem added + Changed the following enums and #defines ======================================== -TRIGGER_FLAG_PERM Added Added the following API's @@ -116,3 +60,4 @@ Added the following API's Changed the following API's =========================== +slurm_step_ctx_daemon_per_node_hack - ported to newer poe interface diff --git a/aclocal.m4 b/aclocal.m4 index d1afa71a7210a9eaf9ab824a9090b59ae17c156d..1c163cde43d503edc482a94c2b5424f9be5c9098 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.3 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # 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. @@ -376,12 +377,15 @@ else fi[]dnl ])# PKG_CHECK_MODULES -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # 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 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -391,7 +395,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.11.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -407,19 +411,21 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # 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 1 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -501,14 +507,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. # # 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 10 +# serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -548,6 +554,7 @@ AC_CACHE_CHECK([dependency style of $depcc], # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -612,7 +619,7 @@ AC_CACHE_CHECK([dependency style of $depcc], break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -677,10 +684,13 @@ AC_DEFUN([AM_DEP_TRACK], if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -902,12 +912,15 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # 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 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -947,8 +960,8 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -968,7 +981,7 @@ AC_DEFUN([AM_MAINTAINER_MODE], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful @@ -1079,12 +1092,15 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # 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 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -1107,13 +1123,14 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # 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 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -1121,13 +1138,13 @@ AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -1203,12 +1220,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # 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 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -1231,13 +1250,13 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # 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 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -1246,13 +1265,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1274,10 +1293,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) @@ -1363,9 +1383,7 @@ m4_include([auxdir/x_ac_cray.m4]) m4_include([auxdir/x_ac_databases.m4]) m4_include([auxdir/x_ac_debug.m4]) m4_include([auxdir/x_ac_dlfcn.m4]) -m4_include([auxdir/x_ac_elan.m4]) m4_include([auxdir/x_ac_env.m4]) -m4_include([auxdir/x_ac_federation.m4]) m4_include([auxdir/x_ac_gpl_licensed.m4]) m4_include([auxdir/x_ac_hwloc.m4]) m4_include([auxdir/x_ac_iso.m4]) @@ -1373,6 +1391,7 @@ m4_include([auxdir/x_ac_lua.m4]) m4_include([auxdir/x_ac_man2html.m4]) m4_include([auxdir/x_ac_munge.m4]) m4_include([auxdir/x_ac_ncurses.m4]) +m4_include([auxdir/x_ac_nrt.m4]) m4_include([auxdir/x_ac_pam.m4]) m4_include([auxdir/x_ac_printf_null.m4]) m4_include([auxdir/x_ac_ptrace.m4]) diff --git a/auxdir/Makefile.am b/auxdir/Makefile.am index 0a92cda80f55a5ac2ed6faab2c0ca63d723cf112..c4ee546a97a1524222802bcba978cc5c5185fd10 100644 --- a/auxdir/Makefile.am +++ b/auxdir/Makefile.am @@ -28,6 +28,7 @@ EXTRA_DIST = \ x_ac_man2html.m4 \ x_ac_munge.m4 \ x_ac_ncurses.m4 \ + x_ac_nrt.m4 \ x_ac_pam.m4 \ x_ac_printf_null.m4 \ x_ac_ptrace.m4 \ diff --git a/auxdir/Makefile.in b/auxdir/Makefile.in index 58e81ab56a4498f5f2be2b0748419698248016ce..79dcc6a70bebfb55a4d2ade42b856397c8eff2ba 100644 --- a/auxdir/Makefile.in +++ b/auxdir/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -55,9 +55,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -65,6 +63,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -125,9 +124,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -135,9 +132,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -169,6 +165,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -196,6 +194,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -310,6 +309,7 @@ EXTRA_DIST = \ x_ac_man2html.m4 \ x_ac_munge.m4 \ x_ac_ncurses.m4 \ + x_ac_nrt.m4 \ x_ac_pam.m4 \ x_ac_printf_null.m4 \ x_ac_ptrace.m4 \ @@ -411,10 +411,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/auxdir/config.guess b/auxdir/config.guess index 40eaed4821ec09567afae2b5e90cdc7aa2a55082..d622a44e551f209d5e8c5462b3fe53a162f7b330 100755 --- a/auxdir/config.guess +++ b/auxdir/config.guess @@ -2,9 +2,9 @@ # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2011-05-11' +timestamp='2012-02-10' # 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 @@ -17,9 +17,7 @@ timestamp='2011-05-11' # 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., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -57,8 +55,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +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." @@ -145,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -792,13 +790,12 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -807,6 +804,9 @@ EOF *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 @@ -861,6 +861,13 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -895,13 +902,16 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -943,7 +953,7 @@ EOF test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -978,13 +988,13 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1315,6 +1325,9 @@ EOF i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/auxdir/config.sub b/auxdir/config.sub index 30fdca81215f7b8a3e71430dc026507740b2c900..c894da45500c4af1bf5688e713a8895622d18182 100755 --- a/auxdir/config.sub +++ b/auxdir/config.sub @@ -2,9 +2,9 @@ # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2011-03-23' +timestamp='2012-02-10' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ timestamp='2011-03-23' # 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., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -76,8 +74,8 @@ version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +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." @@ -132,6 +130,10 @@ case $maybe_os in os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -247,17 +249,22 @@ case $basic_machine in # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -291,7 +298,7 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | rx \ + | 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 \ | sh64 | sh64le \ @@ -300,7 +307,7 @@ case $basic_machine in | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ - | v850 | v850e \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -315,8 +322,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -329,7 +335,10 @@ case $basic_machine in strongarm | thumb | xscale) basic_machine=arm-unknown ;; - + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; xscaleeb) basic_machine=armeb-unknown ;; @@ -352,11 +361,13 @@ case $basic_machine in # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ @@ -365,8 +376,10 @@ case $basic_machine in | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -400,7 +413,7 @@ case $basic_machine in | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* | rx-* \ + | 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-* \ @@ -408,10 +421,11 @@ case $basic_machine in | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile-* | tilegx-* \ + | tile*-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | vax-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -711,7 +725,6 @@ case $basic_machine in i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -808,10 +821,18 @@ case $basic_machine in ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -1120,13 +1141,8 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1336,7 +1352,7 @@ case $os in | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1548,9 +1564,6 @@ case $basic_machine in ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout diff --git a/auxdir/depcomp b/auxdir/depcomp index df8eea7e4ce8862105fcd7929b20bdb45488048b..bd0ac089584a762069b7e0b3f2937e89b9144cc7 100755 --- a/auxdir/depcomp +++ b/auxdir/depcomp @@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-12-04.11; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 2011 Free Software Foundation, Inc. # 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 @@ -44,7 +44,7 @@ Environment variables: object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. + tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . @@ -90,10 +90,18 @@ if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 - cygpath_u="sed s,\\\\\\\\,/,g" + cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -158,10 +166,12 @@ gcc) ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as -## well. +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -405,6 +415,52 @@ tru64) rm -f "$tmpdepfile" ;; +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/ \1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/ / + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. @@ -503,7 +559,9 @@ makedepend) touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation diff --git a/auxdir/install-sh b/auxdir/install-sh index 6781b987bdbcbc23efe6bbe1654a1e3637b9af07..a9244eb0786534553fdd9eb0050bb4b172bad0a3 100755 --- a/auxdir/install-sh +++ b/auxdir/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -156,6 +156,10 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac shift;; -T) no_target_directory=true;; @@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac done fi @@ -200,7 +208,11 @@ if test $# -eq 0; then fi if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -228,9 +240,9 @@ fi for src do - # Protect names starting with `-'. + # Protect names problematic for `test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,12 +264,7 @@ do echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -385,7 +392,7 @@ do case $dstdir in /*) prefix='/';; - -*) prefix='./';; + [-=\(\)!]*) prefix='./';; *) prefix='';; esac @@ -403,7 +410,7 @@ do for d do - test -z "$d" && continue + test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then diff --git a/auxdir/libtool.m4 b/auxdir/libtool.m4 index 8ff3c76f8ba4307e0985ea285e1a7384a75c3146..828104cfde21845bcd4632d75a4f63ce9fca60fb 100644 --- a/auxdir/libtool.m4 +++ b/auxdir/libtool.m4 @@ -1,8 +1,8 @@ # 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 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -11,8 +11,8 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -146,6 +146,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -637,7 +639,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2010 Free Software Foundation, Inc. +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." @@ -801,6 +803,7 @@ AC_DEFUN([LT_LANG], m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -822,6 +825,31 @@ m4_defun([_LT_LANG], ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -852,6 +880,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ], m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -954,7 +986,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + 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 lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -962,6 +1000,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -973,6 +1012,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF @@ -990,7 +1030,9 @@ _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + 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 lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1035,8 +1077,8 @@ _LT_EOF ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -1047,6 +1089,8 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _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\"`' + 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 @@ -1330,14 +1374,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + 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" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1414,13 +1471,13 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -1600,6 +1657,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1639,7 +1701,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # 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"`func_fallback_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 do @@ -2185,7 +2247,7 @@ need_version=unknown case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2194,7 +2256,7 @@ aix3*) ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2259,7 +2321,7 @@ beos*) ;; bsdi[[45]]*) - version_type=linux + 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' @@ -2398,7 +2460,7 @@ m4_if([$1], [],[ ;; dgux*) - version_type=linux + 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' @@ -2406,10 +2468,6 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -2417,7 +2475,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[[123]]*) objformat=aout ;; + freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -2435,7 +2493,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -2455,7 +2513,7 @@ freebsd* | dragonfly*) ;; gnu*) - version_type=linux + 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}' @@ -2466,7 +2524,7 @@ gnu*) ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -2527,7 +2585,7 @@ hpux9* | hpux10* | hpux11*) ;; interix[[3-9]]*) - version_type=linux + 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}' @@ -2543,7 +2601,7 @@ irix5* | irix6* | nonstopux*) nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2580,9 +2638,9 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + 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}' @@ -2657,7 +2715,7 @@ netbsd*) ;; newsos6) - version_type=linux + 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}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2726,7 +2784,7 @@ rdos*) ;; solaris*) - version_type=linux + 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}' @@ -2751,7 +2809,7 @@ sunos4*) ;; sysv4 | sysv4.3*) - version_type=linux + 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' shlibpath_var=LD_LIBRARY_PATH @@ -2775,7 +2833,7 @@ sysv4 | sysv4.3*) sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + 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' shlibpath_var=LD_LIBRARY_PATH @@ -2806,7 +2864,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + 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}' @@ -2816,7 +2874,7 @@ tpf*) ;; uts4*) - version_type=linux + 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' shlibpath_var=LD_LIBRARY_PATH @@ -3238,7 +3296,7 @@ irix5* | irix6* | nonstopux*) lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3658,6 +3716,7 @@ for ac_symprfx in "" "_"; do # 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};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -4242,7 +4301,9 @@ m4_if([$1], [CXX], [ case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi ;; esac else @@ -4334,18 +4395,33 @@ m4_if([$1], [CXX], [ ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; + *Intel*\ [[CF]]*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' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; esac ;; esac @@ -4505,7 +4581,9 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) ;; + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] @@ -4533,7 +4611,6 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4787,8 +4864,7 @@ _LT_EOF 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)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $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 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ @@ -5084,6 +5160,7 @@ _LT_EOF # 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 + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' @@ -5130,10 +5207,6 @@ _LT_EOF _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -5146,7 +5219,7 @@ _LT_EOF ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5185,7 +5258,6 @@ _LT_EOF fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -5627,9 +5699,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1], _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5787,7 +5856,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -6157,7 +6225,7 @@ if test "$_lt_caught_CXX_error" != yes; then esac ;; - freebsd[[12]]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no @@ -6918,12 +6986,18 @@ public class foo { } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary @@ -7120,7 +7194,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7253,7 +7326,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7440,6 +7512,77 @@ CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# 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'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -7509,6 +7652,13 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], diff --git a/auxdir/ltmain.sh b/auxdir/ltmain.sh old mode 100755 new mode 100644 index b4a3231ca3b530f9ddfec6fe1112ff3e5ac3f8a7..c2852d856135458112c39b5f156145980860253a --- a/auxdir/ltmain.sh +++ b/auxdir/ltmain.sh @@ -1,9 +1,9 @@ -# libtool (GNU libtool) 2.4 +# libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# 2007, 2008, 2009, 2010, 2011 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. @@ -41,6 +41,7 @@ # --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 @@ -69,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4 Debian-2.4-2ubuntu1 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # @@ -79,9 +80,9 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4 Debian-2.4-2ubuntu1" +VERSION="2.4.2 Debian-2.4.2-1ubuntu1" TIMESTAMP="" -package_revision=1.3293 +package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -136,15 +137,10 @@ progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -387,7 +383,7 @@ case $progpath in ;; *) save_IFS="$IFS" - IFS=: + IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break @@ -771,8 +767,8 @@ func_help () s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } @@ -1052,6 +1048,7 @@ opt_finish=false opt_help=false opt_help_all=false opt_silent=: +opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false @@ -1118,6 +1115,10 @@ esac ;; --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) @@ -2059,7 +2060,7 @@ func_mode_compile () *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -3201,11 +3202,13 @@ func_mode_install () # Set up the ranlib parameters. oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. @@ -3470,7 +3473,7 @@ static const void *lt_preloaded_setup() { # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; @@ -3982,14 +3985,17 @@ func_exec_program_core () # launches target application with the remaining arguments. func_exec_program () { - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac func_exec_program_core \${1+\"\$@\"} } @@ -5057,9 +5063,15 @@ void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' - + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' cat <<"EOF" } EOF @@ -5643,7 +5655,8 @@ func_mode_link () continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -6150,7 +6163,8 @@ func_mode_link () lib= found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" @@ -6834,7 +6848,7 @@ func_mode_link () test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" + 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 @@ -7319,6 +7333,7 @@ func_mode_link () # which 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) func_arith $number_major + $number_minor current=$func_arith_result @@ -7438,7 +7453,7 @@ func_mode_link () versuffix="$major.$revision" ;; - linux) + linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" @@ -8026,6 +8041,11 @@ EOF # 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. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= @@ -8056,7 +8076,7 @@ EOF elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) func_apped perm_rpath " $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi done @@ -8064,11 +8084,7 @@ EOF if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. @@ -9158,6 +9174,8 @@ EOF esac done fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" @@ -9267,7 +9285,8 @@ EOF *.la) func_basename "$deplib" name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + func_resolve_sysroot "$deplib" + 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_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" diff --git a/auxdir/ltoptions.m4 b/auxdir/ltoptions.m4 index 17cfd51c0b34ed2f118b8b5d4d28947889eec9c3..5d9acd8e23bcfd20d353804aff13666ecbed54f4 100644 --- a/auxdir/ltoptions.m4 +++ b/auxdir/ltoptions.m4 @@ -326,9 +326,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # 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], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) diff --git a/auxdir/ltversion.m4 b/auxdir/ltversion.m4 index 9c7b5d4118584728f6ebb2d6f461378be0e872f2..07a8602d48d615a65800b14446d8c8c8694f2818 100644 --- a/auxdir/ltversion.m4 +++ b/auxdir/ltversion.m4 @@ -9,15 +9,15 @@ # @configure_input@ -# serial 3293 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/auxdir/missing b/auxdir/missing index 28055d2ae6f2a2c584afcd769d7881e11f62ecd9..86a8fc31e3c2aa268688a5be47d161c586772e78 100755 --- a/auxdir/missing +++ b/auxdir/missing @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -84,7 +84,6 @@ Supported PROGRAM values: help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and @@ -122,15 +121,6 @@ case $1 in # Not GNU programs, they don't have --version. ;; - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. @@ -226,7 +216,7 @@ WARNING: \`$1' $msg. You should only need it if \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -256,7 +246,7 @@ WARNING: \`$1' is $msg. You should only need it if \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -318,41 +308,6 @@ WARNING: \`$1' is $msg. You should only need it if touch $file ;; - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. diff --git a/auxdir/x_ac_bluegene.m4 b/auxdir/x_ac_bluegene.m4 index 2fcef514d913275977eea6a0c52eeb266195ee1c..d1e53bf2afd362121635b1d5a8560903e9671039 100644 --- a/auxdir/x_ac_bluegene.m4 +++ b/auxdir/x_ac_bluegene.m4 @@ -295,6 +295,15 @@ AC_DEFUN([X_AC_BGQ], log4cxx::LoggerPtr logger_ptr(log4cxx::Logger::getLogger( "ibm" ));]])], [have_bgq_files=yes], [AC_MSG_ERROR(There is a problem linking to the BG/Q api.)]) + # In later versions of the driver IBM added a better function + # to see if blocks were IO connected or not. Here is a check + # to not break backwards compatibility + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[#include + #include ]], + [[ bgsched::Block::checkIO("", NULL, NULL);]])], + [have_bgq_new_io_check=yes], + [AC_MSG_RESULT(Using old iocheck.)]) AC_LANG_POP(C++) LDFLAGS="$saved_LDFLAGS" fi @@ -312,6 +321,9 @@ AC_DEFUN([X_AC_BGQ], AC_DEFINE(HAVE_FRONT_END, 1, [Define to 1 if running slurmd on front-end only]) AC_DEFINE(HAVE_BG_FILES, 1, [Define to 1 if have Blue Gene files]) #AC_DEFINE_UNQUOTED(BG_BRIDGE_SO, "$soloc", [Define the BG_BRIDGE_SO value]) + if test ! -z "$have_bgq_new_io_check" ; then + AC_DEFINE(HAVE_BG_NEW_IO_CHECK, 1, [Define to 1 if using code with new iocheck]) + fi AC_MSG_NOTICE([Running on a legitimate BG/Q system]) # AC_MSG_CHECKING(for BG serial value) diff --git a/auxdir/x_ac_federation.m4 b/auxdir/x_ac_federation.m4 index b377a9811c59954f40c38d0235dc31be3db5ce14..4394c56ab5d12966b1ebb50b98501c7f59216a5f 100644 --- a/auxdir/x_ac_federation.m4 +++ b/auxdir/x_ac_federation.m4 @@ -43,7 +43,7 @@ AC_DEFUN([X_AC_FEDERATION], if test "x$ac_have_federation" != "xyes" ; then AC_MSG_RESULT([no]) - AC_MSG_NOTICE([Cannot support Federation without libntbl]) + AC_MSG_NOTICE([Cannot support Federation without libntbl]) else AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_LIBNTBL, 1, [define if you have libntbl.]) diff --git a/auxdir/x_ac_nrt.m4 b/auxdir/x_ac_nrt.m4 new file mode 100644 index 0000000000000000000000000000000000000000..fa1dd962a9b93ad518d201a108d1f2c4cee9aaf4 --- /dev/null +++ b/auxdir/x_ac_nrt.m4 @@ -0,0 +1,72 @@ +##***************************************************************************** +# AUTHOR: +# Morris Jette +# +# SYNOPSIS: +# AC_NRT +# +# DESCRIPTION: +# Checks for availability of the libraries necessary to support +# IBM NRT (Network Resource Table) switch management +# +# WARNINGS: +# This macro must be placed after AC_PROG_CC or equivalent. +##***************************************************************************** + +AC_DEFUN([X_AC_NRT], +[ + nrt_default_dirs="/usr/include" + AC_ARG_WITH([nrth], AS_HELP_STRING(--with-nrth=PATH,Parent directory of nrt.h), [ nrt_default_dirs="$withval $nrt_default_dirs"]) + AC_MSG_CHECKING([Checking NRT header file]) + for nrt_dir in $nrt_default_dirs; do + # skip dirs that don't exist + if test ! -z "$nrt_dir" -a ! -d "$nrt_dir" ; then + continue; + fi + # search for required NRT API libraries + if test -f "$nrt_dir/nrt.h"; then + ac_have_nrt_h="yes" + NRT_CPPFLAGS="-I$nrt_dir" + break; + fi + done + if test "x$ac_have_nrt_h" != "xyes" ; then + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([Cannot support IBM NRT API without nrt.h]) + else + AC_MSG_RESULT([yes]) + fi + AC_SUBST(NRT_CPPFLAGS) + + + nrt_default_dirs="/usr/lib64 /usr/lib" + AC_ARG_WITH([libnrt], AS_HELP_STRING(--with-libnrt=PATH,Parent directory of libnrt.so), [ nrt_default_dirs="$withval $nrt_default_dirs"]) + AC_MSG_CHECKING([whether to enable IBM NRT support]) + for nrt_dir in $nrt_default_dirs; do + # skip dirs that don't exist + if test ! -z "$nrt_dir" -a ! -d "$nrt_dir" ; then + continue; + fi + # search for required NRT API libraries + if test -f "$nrt_dir/libnrt.so"; then + ac_have_libnrt="yes" + NRT_LDFLAGS="-L$nrt_dir -lnrt" + break; + fi + done + AC_SUBST(NRT_LDFLAGS) + + if test "x$ac_have_libnrt" != "xyes" ; then + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([Cannot support IBM NRT API without libnrt.]) + else + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_LIBNRT, 1, [define if you have libnrt.]) + fi + + if test "x$ac_have_nrt_h" == "xyes" && test "x$ac_have_libnrt" == "xyes"; then + ac_have_nrt="yes" + fi + AM_CONDITIONAL(HAVE_NRT, test "x$ac_have_nrt" = "xyes") + AC_SUBST(HAVE_NRT) +]) diff --git a/config.h.in b/config.h.in index 8ba64051354f818ab94483ce0821e208ff70cda6..52cb1666ffe4fda4e03371b4021b0bec67167cb7 100644 --- a/config.h.in +++ b/config.h.in @@ -63,6 +63,9 @@ /* Define to 1 if emulating or running on Blue Gene/L or P system */ #undef HAVE_BG_L_P +/* Define to 1 if using code with new iocheck */ +#undef HAVE_BG_NEW_IO_CHECK + /* Define to 1 if you have the `cfmakeraw' function. */ #undef HAVE_CFMAKERAW @@ -133,23 +136,14 @@ /* Define to 1 if you have the header file. */ #undef HAVE_KSTAT_H -/* define if you have libelan3. */ -#undef HAVE_LIBELAN3 - -/* define if you have libelanctrl. */ -#undef HAVE_LIBELANCTRL - -/* define if you have libelanhosts. */ -#undef HAVE_LIBELANHOSTS - /* Define to 1 if you have the `expat' library (-lexpat). */ #undef HAVE_LIBEXPAT /* Define to 1 if you have the `job' library (-ljob). */ #undef HAVE_LIBJOB -/* define if you have libntbl. */ -#undef HAVE_LIBNTBL +/* define if you have libnrt. */ +#undef HAVE_LIBNRT /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H @@ -182,9 +176,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H -/* Define to 1 if you have the header file. */ -#undef HAVE_NRT_H - /* define if numa library installed */ #undef HAVE_NUMA diff --git a/configure b/configure index dc8e58f3931db44ddadfff890e1951e7b6c5d326..c068457ca29bb925dc468c3f53abc4030882613b 100755 --- a/configure +++ b/configure @@ -651,14 +651,11 @@ lua_LIBS lua_CFLAGS HAVE_SGI_JOB_FALSE HAVE_SGI_JOB_TRUE -HAVE_FEDERATION -HAVE_FEDERATION_FALSE -HAVE_FEDERATION_TRUE -FEDERATION_LDFLAGS -HAVE_ELAN -HAVE_ELAN_FALSE -HAVE_ELAN_TRUE -ELAN_LIBS +HAVE_NRT +HAVE_NRT_FALSE +HAVE_NRT_TRUE +NRT_LDFLAGS +NRT_CPPFLAGS SLURM_PREFIX SLURMCTLD_PORT_COUNT SLURMDBD_PORT @@ -757,6 +754,9 @@ CMD_LDFLAGS BLUEGENE_LOADED BLUEGENE_LOADED_FALSE BLUEGENE_LOADED_TRUE +REAL_BGQ_LOADED +REAL_BGQ_LOADED_FALSE +REAL_BGQ_LOADED_TRUE BGQ_LOADED BGQ_LOADED_FALSE BGQ_LOADED_TRUE @@ -781,6 +781,7 @@ BG_INCLUDES am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -927,6 +928,8 @@ with_slurmctld_port with_slurmd_port with_slurmdbd_port with_slurmctld_port_count +with_nrth +with_libnrt with_readline with_ssl with_munge @@ -1617,7 +1620,7 @@ Optional Packages: --with-bg-serial=NAME set BG_SERIAL value --with-proctrack=PATH Specify path to proctrack sources - --with-pic try to use only PIC/non-PIC objects [default=use + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR @@ -1639,6 +1642,8 @@ Optional Packages: --with-slurmdbd-port=N set slurmdbd default port [6819] --with-slurmctld-port-count=N set slurmctld default port count [1] + --with-nrth=PATH Parent directory of nrt.h + --with-libnrt=PATH Parent directory of libnrt.so --without-readline compile without readline support --with-ssl=PATH Specify path to OpenSSL installation --with-munge=PATH Specify path to munge installation @@ -3362,11 +3367,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -3474,6 +3479,7 @@ fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -4287,6 +4293,7 @@ else # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -4346,7 +4353,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -5023,6 +5030,7 @@ else # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -5082,7 +5090,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -5261,6 +5269,29 @@ if ac_fn_cxx_try_link "$LINENO"; then : else as_fn_error $? "There is a problem linking to the BG/Q api." "$LINENO" 5 fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + # In later versions of the driver IBM added a better function + # to see if blocks were IO connected or not. Here is a check + # to not break backwards compatibility + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main () +{ + bgsched::Block::checkIO("", NULL, NULL); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + have_bgq_new_io_check=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using old iocheck." >&5 +$as_echo "Using old iocheck." >&6; } +fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c @@ -5297,6 +5328,11 @@ $as_echo "#define HAVE_FRONT_END 1" >>confdefs.h $as_echo "#define HAVE_BG_FILES 1" >>confdefs.h #AC_DEFINE_UNQUOTED(BG_BRIDGE_SO, "$soloc", [Define the BG_BRIDGE_SO value]) + if test ! -z "$have_bgq_new_io_check" ; then + +$as_echo "#define HAVE_BG_NEW_IO_CHECK 1" >>confdefs.h + + fi { $as_echo "$as_me:${as_lineno-$LINENO}: Running on a legitimate BG/Q system" >&5 $as_echo "$as_me: Running on a legitimate BG/Q system" >&6;} @@ -5326,6 +5362,17 @@ fi + if test "x$ac_real_bluegene_loaded" = "xyes"; then + REAL_BGQ_LOADED_TRUE= + REAL_BGQ_LOADED_FALSE='#' +else + REAL_BGQ_LOADED_TRUE='#' + REAL_BGQ_LOADED_FALSE= +fi + + + + if test "x$ac_bluegene_loaded" = "xyes"; then BLUEGENE_LOADED_TRUE= BLUEGENE_LOADED_FALSE='#' @@ -6614,6 +6661,7 @@ else # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -6673,7 +6721,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -6998,6 +7046,7 @@ else # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -7057,7 +7106,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -7151,8 +7200,8 @@ esac -macro_version='2.4' -macro_revision='1.3293' +macro_version='2.4.2' +macro_revision='1.3337' @@ -7796,6 +7845,11 @@ else lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -7835,7 +7889,7 @@ else # 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"`func_fallback_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 do @@ -8264,7 +8318,7 @@ irix5* | irix6* | nonstopux*) lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -8904,13 +8958,13 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -9057,6 +9111,7 @@ for ac_symprfx in "" "_"; do # 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};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -9445,7 +9500,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -9456,7 +9511,20 @@ sparc*-*solaris*) case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + 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" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -10096,7 +10164,13 @@ else $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + 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 lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -10107,6 +10181,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : @@ -10139,6 +10214,7 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : @@ -10160,7 +10236,9 @@ _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + 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 lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -10308,7 +10386,22 @@ fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : - withval=$with_pic; pic_mode="$withval" + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else pic_mode=default fi @@ -10381,6 +10474,10 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + @@ -10845,7 +10942,9 @@ lt_prog_compiler_static= case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' - lt_prog_compiler_pic='-Xcompiler -fPIC' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi ;; esac else @@ -10936,18 +11035,33 @@ lt_prog_compiler_static= ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; esac ;; esac @@ -11309,7 +11423,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported @@ -11562,8 +11675,7 @@ _LT_EOF 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= - hardcode_libdir_flag_spec_ld='-rpath $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 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ @@ -11943,6 +12055,7 @@ fi # 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 + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' @@ -11988,6 +12101,7 @@ fi 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\"`' + else whole_archive_flag_spec='' fi @@ -12016,10 +12130,6 @@ fi hardcode_shlibpath_var=no ;; - freebsd1*) - ld_shlibs=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -12032,7 +12142,7 @@ fi ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes @@ -12071,7 +12181,6 @@ fi fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes @@ -12689,11 +12798,6 @@ esac - - - - - @@ -12789,7 +12893,7 @@ need_version=unknown case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -12798,7 +12902,7 @@ aix3*) ;; aix[4-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -12863,7 +12967,7 @@ beos*) ;; bsdi[45]*) - version_type=linux + 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' @@ -13002,7 +13106,7 @@ darwin* | rhapsody*) ;; dgux*) - version_type=linux + 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' @@ -13010,10 +13114,6 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -13021,7 +13121,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -13039,7 +13139,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -13059,7 +13159,7 @@ freebsd* | dragonfly*) ;; gnu*) - version_type=linux + 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}' @@ -13070,7 +13170,7 @@ gnu*) ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -13131,7 +13231,7 @@ hpux9* | hpux10* | hpux11*) ;; interix[3-9]*) - version_type=linux + 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}' @@ -13147,7 +13247,7 @@ irix5* | irix6* | nonstopux*) nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -13184,9 +13284,9 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + 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}' @@ -13280,7 +13380,7 @@ netbsd*) ;; newsos6) - version_type=linux + 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}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -13349,7 +13449,7 @@ rdos*) ;; solaris*) - version_type=linux + 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}' @@ -13374,7 +13474,7 @@ sunos4*) ;; sysv4 | sysv4.3*) - version_type=linux + 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' shlibpath_var=LD_LIBRARY_PATH @@ -13398,7 +13498,7 @@ sysv4 | sysv4.3*) sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + 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' shlibpath_var=LD_LIBRARY_PATH @@ -13429,7 +13529,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + 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}' @@ -13439,7 +13539,7 @@ tpf*) ;; uts4*) - version_type=linux + 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' shlibpath_var=LD_LIBRARY_PATH @@ -14364,7 +14464,6 @@ export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported @@ -14948,6 +15047,7 @@ fi 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\"`' + else whole_archive_flag_spec_CXX='' fi @@ -14992,7 +15092,7 @@ fi esac ;; - freebsd[12]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no @@ -15668,6 +15768,7 @@ _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -16457,7 +16558,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) ;; + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' @@ -16610,8 +16713,6 @@ esac - - @@ -16640,7 +16741,7 @@ need_version=unknown case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -16649,7 +16750,7 @@ aix3*) ;; aix[4-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -16714,7 +16815,7 @@ beos*) ;; bsdi[45]*) - version_type=linux + 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' @@ -16851,7 +16952,7 @@ darwin* | rhapsody*) ;; dgux*) - version_type=linux + 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' @@ -16859,10 +16960,6 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -16870,7 +16967,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -16888,7 +16985,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -16908,7 +17005,7 @@ freebsd* | dragonfly*) ;; gnu*) - version_type=linux + 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}' @@ -16919,7 +17016,7 @@ gnu*) ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -16980,7 +17077,7 @@ hpux9* | hpux10* | hpux11*) ;; interix[3-9]*) - version_type=linux + 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}' @@ -16996,7 +17093,7 @@ irix5* | irix6* | nonstopux*) nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -17033,9 +17130,9 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + 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}' @@ -17129,7 +17226,7 @@ netbsd*) ;; newsos6) - version_type=linux + 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}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -17198,7 +17295,7 @@ rdos*) ;; solaris*) - version_type=linux + 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}' @@ -17223,7 +17320,7 @@ sunos4*) ;; sysv4 | sysv4.3*) - version_type=linux + 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' shlibpath_var=LD_LIBRARY_PATH @@ -17247,7 +17344,7 @@ sysv4 | sysv4.3*) sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + 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' shlibpath_var=LD_LIBRARY_PATH @@ -17278,7 +17375,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + 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}' @@ -17288,7 +17385,7 @@ tpf*) ;; uts4*) - version_type=linux + 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' shlibpath_var=LD_LIBRARY_PATH @@ -17427,6 +17524,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_config_commands="$ac_config_commands libtool" @@ -17808,7 +17907,7 @@ for ac_header in mcheck.h values.h socket.h sys/socket.h \ pty.h utmp.h \ sys/syslog.h linux/sched.h \ kstat.h paths.h limits.h sys/statfs.h sys/ptrace.h sys/termios.h \ - llapi.h nrt.h \ + llapi.h \ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -21091,272 +21190,90 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rms_prgcreate in -lrmscall" >&5 -$as_echo_n "checking for rms_prgcreate in -lrmscall... " >&6; } -if ${ac_cv_lib_rmscall_rms_prgcreate+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lrmscall $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 rms_prgcreate (); -int -main () -{ -return rms_prgcreate (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_rmscall_rms_prgcreate=yes -else - ac_cv_lib_rmscall_rms_prgcreate=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_rmscall_rms_prgcreate" >&5 -$as_echo "$ac_cv_lib_rmscall_rms_prgcreate" >&6; } -if test "x$ac_cv_lib_rmscall_rms_prgcreate" = xyes; then : - ac_elan_have_rmscall=yes; ELAN_LIBS="-lrmscall" -fi - - - if test "$ac_elan_have_rmscall" != "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot support QsNet without librmscall" >&5 -$as_echo "$as_me: Cannot support QsNet without librmscall" >&6;} - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elan3_create in -lelan3" >&5 -$as_echo_n "checking for elan3_create in -lelan3... " >&6; } -if ${ac_cv_lib_elan3_elan3_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lelan3 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + nrt_default_dirs="/usr/include" -/* 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 elan3_create (); -int -main () -{ -return elan3_create (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_elan3_elan3_create=yes -else - ac_cv_lib_elan3_elan3_create=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_elan3_elan3_create" >&5 -$as_echo "$ac_cv_lib_elan3_elan3_create" >&6; } -if test "x$ac_cv_lib_elan3_elan3_create" = xyes; then : - ac_elan_have_elan3=yes -else - ac_elan_noelan3=1 +# Check whether --with-nrth was given. +if test "${with_nrth+set}" = set; then : + withval=$with_nrth; nrt_default_dirs="$withval $nrt_default_dirs" fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elanctrl_open in -lelanctrl" >&5 -$as_echo_n "checking for elanctrl_open in -lelanctrl... " >&6; } -if ${ac_cv_lib_elanctrl_elanctrl_open+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lelanctrl $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 elanctrl_open (); -int -main () -{ -return elanctrl_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_elanctrl_elanctrl_open=yes -else - ac_cv_lib_elanctrl_elanctrl_open=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_elanctrl_elanctrl_open" >&5 -$as_echo "$ac_cv_lib_elanctrl_elanctrl_open" >&6; } -if test "x$ac_cv_lib_elanctrl_elanctrl_open" = xyes; then : - ac_elan_have_elanctrl=yes -else - ac_elan_noelanctrl=1 -fi - - - if test "$ac_elan_have_elan3" = "yes"; then - -$as_echo "#define HAVE_LIBELAN3 1" >>confdefs.h - - ELAN_LIBS="$ELAN_LIBS -lelan3" - test "$ac_elan_have_rmscall" = "yes" && ac_have_elan="yes" - elif test "$ac_elan_have_elanctrl" = "yes"; then - -$as_echo "#define HAVE_LIBELANCTRL 1" >>confdefs.h - - ELAN_LIBS="$ELAN_LIBS -lelanctrl" - test "$ac_elan_have_rmscall" = "yes" && ac_have_elan="yes" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking NRT header file" >&5 +$as_echo_n "checking Checking NRT header file... " >&6; } + for nrt_dir in $nrt_default_dirs; do + # skip dirs that don't exist + if test ! -z "$nrt_dir" -a ! -d "$nrt_dir" ; then + continue; + fi + # search for required NRT API libraries + if test -f "$nrt_dir/nrt.h"; then + ac_have_nrt_h="yes" + NRT_CPPFLAGS="-I$nrt_dir" + break; + fi + done + if test "x$ac_have_nrt_h" != "xyes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot support IBM NRT API without nrt.h" >&5 +$as_echo "$as_me: Cannot support IBM NRT API without nrt.h" >&6;} else - { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot support QsNet without libelan3 or libelanctrl!" >&5 -$as_echo "$as_me: Cannot support QsNet without libelan3 or libelanctrl!" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi - if test "$ac_have_elan" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elanhost_config_create in -lelanhosts" >&5 -$as_echo_n "checking for elanhost_config_create in -lelanhosts... " >&6; } -if ${ac_cv_lib_elanhosts_elanhost_config_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lelanhosts $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 elanhost_config_create (); -int -main () -{ -return elanhost_config_create (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_elanhosts_elanhost_config_create=yes -else - ac_cv_lib_elanhosts_elanhost_config_create=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_elanhosts_elanhost_config_create" >&5 -$as_echo "$ac_cv_lib_elanhosts_elanhost_config_create" >&6; } -if test "x$ac_cv_lib_elanhosts_elanhost_config_create" = xyes; then : - ac_elan_have_elanhosts=yes -fi - - if test "$ac_elan_have_elanhosts" = "yes"; then -$as_echo "#define HAVE_LIBELANHOSTS 1" >>confdefs.h + nrt_default_dirs="/usr/lib64 /usr/lib" - ELAN_LIBS="$ELAN_LIBS -lelanhosts" - else - ac_have_elan="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot build QsNet modules without libelanhosts" >&5 -$as_echo "$as_me: Cannot build QsNet modules without libelanhosts" >&6;} - fi - fi - - - - if test "x$ac_have_elan" = "xyes"; then - HAVE_ELAN_TRUE= - HAVE_ELAN_FALSE='#' -else - HAVE_ELAN_TRUE='#' - HAVE_ELAN_FALSE= +# Check whether --with-libnrt was given. +if test "${with_libnrt+set}" = set; then : + withval=$with_libnrt; nrt_default_dirs="$withval $nrt_default_dirs" fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable AIX Federation switch support" >&5 -$as_echo_n "checking whether to enable AIX Federation switch support... " >&6; } - ntbl_default_dirs="/usr/lib" - for ntbl_dir in $ntbl_default_dirs; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable IBM NRT support" >&5 +$as_echo_n "checking whether to enable IBM NRT support... " >&6; } + for nrt_dir in $nrt_default_dirs; do # skip dirs that don't exist - if test ! -z "$ntbl_dir" -a ! -d "$ntbl_dir" ; then + if test ! -z "$nrt_dir" -a ! -d "$nrt_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; + # search for required NRT API libraries + if test -f "$nrt_dir/libnrt.so"; then + ac_have_libnrt="yes" + NRT_LDFLAGS="-L$nrt_dir -lnrt" + break; fi - done - if test "x$ac_have_federation" != "xyes" ; then + + if test "x$ac_have_libnrt" != "xyes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot support Federation without libntbl" >&5 -$as_echo "$as_me: Cannot support Federation without libntbl" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot support IBM NRT API without libnrt." >&5 +$as_echo "$as_me: Cannot support IBM NRT API without libnrt." >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -$as_echo "#define HAVE_LIBNTBL 1" >>confdefs.h +$as_echo "#define HAVE_LIBNRT 1" >>confdefs.h fi - - - if test "x$ac_have_federation" = "xyes"; then - HAVE_FEDERATION_TRUE= - HAVE_FEDERATION_FALSE='#' + if test "x$ac_have_nrt_h" == "xyes" && test "x$ac_have_libnrt" == "xyes"; then + ac_have_nrt="yes" + fi + if test "x$ac_have_nrt" = "xyes"; then + HAVE_NRT_TRUE= + HAVE_NRT_FALSE='#' else - HAVE_FEDERATION_TRUE='#' - HAVE_FEDERATION_FALSE= + HAVE_NRT_TRUE='#' + HAVE_NRT_FALSE= fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for job_attachpid in -ljob" >&5 $as_echo_n "checking for job_attachpid in -ljob... " >&6; } if ${ac_cv_lib_job_job_attachpid+:} false; then : @@ -22266,7 +22183,7 @@ fi -ac_config_files="$ac_config_files Makefile config.xml auxdir/Makefile contribs/Makefile contribs/arrayrun/Makefile contribs/cray/Makefile contribs/lua/Makefile contribs/pam/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/sjobexit/Makefile contribs/slurmdb-direct/Makefile src/Makefile src/api/Makefile src/common/Makefile src/db_api/Makefile src/database/Makefile src/sacct/Makefile src/sacctmgr/Makefile src/sreport/Makefile src/sstat/Makefile src/sshare/Makefile src/salloc/Makefile src/sbatch/Makefile src/sattach/Makefile src/sdiag/Makefile src/sprio/Makefile src/srun/Makefile src/srun_cr/Makefile src/slurmd/Makefile src/slurmd/common/Makefile src/slurmd/slurmd/Makefile src/slurmd/slurmstepd/Makefile src/slurmdbd/Makefile src/slurmctld/Makefile src/sbcast/Makefile src/scontrol/Makefile src/scancel/Makefile src/squeue/Makefile src/sinfo/Makefile src/smap/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/pgsql/Makefile src/plugins/accounting_storage/none/Makefile src/plugins/accounting_storage/slurmdbd/Makefile src/plugins/auth/Makefile src/plugins/auth/authd/Makefile src/plugins/auth/munge/Makefile src/plugins/auth/none/Makefile src/plugins/checkpoint/Makefile src/plugins/checkpoint/aix/Makefile src/plugins/checkpoint/none/Makefile src/plugins/checkpoint/ompi/Makefile src/plugins/checkpoint/blcr/Makefile src/plugins/checkpoint/blcr/cr_checkpoint.sh src/plugins/checkpoint/blcr/cr_restart.sh src/plugins/crypto/Makefile src/plugins/crypto/munge/Makefile src/plugins/crypto/openssl/Makefile src/plugins/gres/Makefile src/plugins/gres/gpu/Makefile src/plugins/gres/nic/Makefile src/plugins/jobacct_gather/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/filetxt/Makefile src/plugins/jobcomp/none/Makefile src/plugins/jobcomp/script/Makefile src/plugins/jobcomp/mysql/Makefile src/plugins/jobcomp/pgsql/Makefile src/plugins/job_submit/Makefile src/plugins/job_submit/cnode/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/preempt/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/cgroup/Makefile src/plugins/proctrack/pgid/Makefile src/plugins/proctrack/linuxproc/Makefile src/plugins/proctrack/rms/Makefile src/plugins/proctrack/sgi_job/Makefile src/plugins/proctrack/lua/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/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/cray/libalps/Makefile src/plugins/select/cray/libemulate/Makefile src/plugins/select/linear/Makefile src/plugins/switch/Makefile src/plugins/switch/elan/Makefile src/plugins/switch/none/Makefile src/plugins/switch/federation/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/none/Makefile src/plugins/topology/Makefile src/plugins/topology/3d_torus/Makefile src/plugins/topology/node_rank/Makefile src/plugins/topology/none/Makefile src/plugins/topology/tree/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 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 config.xml auxdir/Makefile contribs/Makefile contribs/arrayrun/Makefile contribs/cray/Makefile contribs/lua/Makefile contribs/pam/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/sjobexit/Makefile contribs/slurmdb-direct/Makefile src/Makefile src/api/Makefile src/common/Makefile src/db_api/Makefile src/database/Makefile src/sacct/Makefile src/sacctmgr/Makefile src/sreport/Makefile src/sstat/Makefile src/sshare/Makefile src/salloc/Makefile src/sbatch/Makefile src/sattach/Makefile src/sdiag/Makefile src/sprio/Makefile src/srun/Makefile src/srun/libsrun/Makefile src/srun_cr/Makefile src/slurmd/Makefile src/slurmd/common/Makefile src/slurmd/slurmd/Makefile src/slurmd/slurmstepd/Makefile src/slurmdbd/Makefile src/slurmctld/Makefile src/sbcast/Makefile src/scontrol/Makefile src/scancel/Makefile src/squeue/Makefile src/sinfo/Makefile src/smap/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/pgsql/Makefile src/plugins/accounting_storage/none/Makefile src/plugins/accounting_storage/slurmdbd/Makefile src/plugins/auth/Makefile src/plugins/auth/authd/Makefile src/plugins/auth/munge/Makefile src/plugins/auth/none/Makefile src/plugins/checkpoint/Makefile src/plugins/checkpoint/aix/Makefile src/plugins/checkpoint/none/Makefile src/plugins/checkpoint/ompi/Makefile src/plugins/checkpoint/blcr/Makefile src/plugins/checkpoint/blcr/cr_checkpoint.sh src/plugins/checkpoint/blcr/cr_restart.sh src/plugins/crypto/Makefile src/plugins/crypto/munge/Makefile src/plugins/crypto/openssl/Makefile src/plugins/gres/Makefile src/plugins/gres/gpu/Makefile src/plugins/gres/nic/Makefile src/plugins/jobacct_gather/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/filetxt/Makefile src/plugins/jobcomp/none/Makefile src/plugins/jobcomp/script/Makefile src/plugins/jobcomp/mysql/Makefile src/plugins/jobcomp/pgsql/Makefile src/plugins/job_submit/Makefile src/plugins/job_submit/cnode/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/launch/Makefile src/plugins/launch/poe/Makefile src/plugins/launch/runjob/Makefile src/plugins/launch/slurm/Makefile src/plugins/preempt/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/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/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/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/cray/libalps/Makefile src/plugins/select/cray/libemulate/Makefile src/plugins/select/linear/Makefile src/plugins/select/serial/Makefile src/plugins/switch/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/none/Makefile src/plugins/topology/Makefile src/plugins/topology/3d_torus/Makefile src/plugins/topology/node_rank/Makefile src/plugins/topology/none/Makefile src/plugins/topology/tree/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 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 @@ -22418,6 +22335,10 @@ if test -z "${BGQ_LOADED_TRUE}" && test -z "${BGQ_LOADED_FALSE}"; then as_fn_error $? "conditional \"BGQ_LOADED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${REAL_BGQ_LOADED_TRUE}" && test -z "${REAL_BGQ_LOADED_FALSE}"; then + as_fn_error $? "conditional \"REAL_BGQ_LOADED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BLUEGENE_LOADED_TRUE}" && test -z "${BLUEGENE_LOADED_FALSE}"; then as_fn_error $? "conditional \"BLUEGENE_LOADED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -22503,12 +22424,8 @@ if test -z "${DEBUG_MODULES_TRUE}" && test -z "${DEBUG_MODULES_FALSE}"; then as_fn_error $? "conditional \"DEBUG_MODULES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_ELAN_TRUE}" && test -z "${HAVE_ELAN_FALSE}"; then - as_fn_error $? "conditional \"HAVE_ELAN\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_FEDERATION_TRUE}" && test -z "${HAVE_FEDERATION_FALSE}"; then - as_fn_error $? "conditional \"HAVE_FEDERATION\" was never defined. +if test -z "${HAVE_NRT_TRUE}" && test -z "${HAVE_NRT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_NRT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SGI_JOB_TRUE}" && test -z "${HAVE_SGI_JOB_FALSE}"; then @@ -23167,6 +23084,7 @@ pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $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"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' @@ -23249,7 +23167,6 @@ with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' @@ -23321,7 +23238,6 @@ with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' @@ -23360,6 +23276,7 @@ _LTECHO_EOF' # Quote evaled strings. for var in SHELL \ ECHO \ +PATH_SEPARATOR \ SED \ GREP \ EGREP \ @@ -23410,7 +23327,6 @@ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ @@ -23444,7 +23360,6 @@ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ -hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ @@ -23574,6 +23489,7 @@ do "src/sdiag/Makefile") CONFIG_FILES="$CONFIG_FILES src/sdiag/Makefile" ;; "src/sprio/Makefile") CONFIG_FILES="$CONFIG_FILES src/sprio/Makefile" ;; "src/srun/Makefile") CONFIG_FILES="$CONFIG_FILES src/srun/Makefile" ;; + "src/srun/libsrun/Makefile") CONFIG_FILES="$CONFIG_FILES src/srun/libsrun/Makefile" ;; "src/srun_cr/Makefile") CONFIG_FILES="$CONFIG_FILES src/srun_cr/Makefile" ;; "src/slurmd/Makefile") CONFIG_FILES="$CONFIG_FILES src/slurmd/Makefile" ;; "src/slurmd/common/Makefile") CONFIG_FILES="$CONFIG_FILES src/slurmd/common/Makefile" ;; @@ -23631,6 +23547,10 @@ do "src/plugins/job_submit/logging/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/job_submit/logging/Makefile" ;; "src/plugins/job_submit/lua/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/job_submit/lua/Makefile" ;; "src/plugins/job_submit/partition/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/job_submit/partition/Makefile" ;; + "src/plugins/launch/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/launch/Makefile" ;; + "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/preempt/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/preempt/Makefile" ;; "src/plugins/preempt/none/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/preempt/none/Makefile" ;; "src/plugins/preempt/partition_prio/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/preempt/partition_prio/Makefile" ;; @@ -23643,7 +23563,6 @@ do "src/plugins/proctrack/cgroup/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/proctrack/cgroup/Makefile" ;; "src/plugins/proctrack/pgid/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/proctrack/pgid/Makefile" ;; "src/plugins/proctrack/linuxproc/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/proctrack/linuxproc/Makefile" ;; - "src/plugins/proctrack/rms/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/proctrack/rms/Makefile" ;; "src/plugins/proctrack/sgi_job/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/proctrack/sgi_job/Makefile" ;; "src/plugins/proctrack/lua/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/proctrack/lua/Makefile" ;; "src/plugins/sched/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/sched/Makefile" ;; @@ -23664,10 +23583,11 @@ do "src/plugins/select/cray/libalps/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/select/cray/libalps/Makefile" ;; "src/plugins/select/cray/libemulate/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/select/cray/libemulate/Makefile" ;; "src/plugins/select/linear/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/select/linear/Makefile" ;; + "src/plugins/select/serial/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/select/serial/Makefile" ;; "src/plugins/switch/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/switch/Makefile" ;; - "src/plugins/switch/elan/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/switch/elan/Makefile" ;; "src/plugins/switch/none/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/switch/none/Makefile" ;; - "src/plugins/switch/federation/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/switch/federation/Makefile" ;; + "src/plugins/switch/nrt/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/switch/nrt/Makefile" ;; + "src/plugins/switch/nrt/libpermapi/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/switch/nrt/libpermapi/Makefile" ;; "src/plugins/mpi/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/mpi/Makefile" ;; "src/plugins/mpi/mpich1_p4/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/mpi/mpich1_p4/Makefile" ;; "src/plugins/mpi/mpich1_shmem/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/mpi/mpich1_shmem/Makefile" ;; @@ -24413,8 +24333,8 @@ $as_echo X"$file" | # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -24468,6 +24388,9 @@ SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + # The host system. host_alias=$host_alias host=$host @@ -24769,10 +24692,6 @@ no_undefined_flag=$lt_no_undefined_flag # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator @@ -25115,10 +25034,6 @@ no_undefined_flag=$lt_no_undefined_flag_CXX # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX - # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX diff --git a/configure.ac b/configure.ac index 88e50e3a27811418427acaf6f11e6b93fb61cb1f..3c02b3baff74eae64de832e373d97f091a6b9d45 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,12 @@ dnl We need to know if this is a Q system AM_CONDITIONAL(BGQ_LOADED, test "x$ac_bgq_loaded" = "xyes") AC_SUBST(BGQ_LOADED) +dnl ok now check if We are on a real L or P system, (test if to build srun +dnl or not. If we are emulating things we should build it. +AM_CONDITIONAL(REAL_BGQ_LOADED, test "x$ac_real_bluegene_loaded" = "xyes") +AC_SUBST(REAL_BGQ_LOADED) + + dnl ok now check if any bluegene was loaded. AM_CONDITIONAL(BLUEGENE_LOADED, test "x$ac_bluegene_loaded" = "xyes") AC_SUBST(BLUEGENE_LOADED) @@ -118,7 +124,7 @@ AC_CHECK_HEADERS(mcheck.h values.h socket.h sys/socket.h \ pty.h utmp.h \ sys/syslog.h linux/sched.h \ kstat.h paths.h limits.h sys/statfs.h sys/ptrace.h sys/termios.h \ - llapi.h nrt.h \ + llapi.h \ ) AC_HEADER_SYS_WAIT AC_HEADER_TIME @@ -282,17 +288,9 @@ else fi AC_SUBST(SLURM_PREFIX) -dnl check for whether to include Elan support -dnl -X_AC_ELAN -AM_CONDITIONAL(HAVE_ELAN, test "x$ac_have_elan" = "xyes") -AC_SUBST(HAVE_ELAN) - -dnl check for whether to include Federation support +dnl check for whether to include IBM NRT (Network Resource Table) support dnl -X_AC_FEDERATION -AM_CONDITIONAL(HAVE_FEDERATION, test "x$ac_have_federation" = "xyes") -AC_SUBST(HAVE_FEDERATION) +X_AC_NRT dnl check for SGI job container support dnl @@ -431,6 +429,7 @@ AC_CONFIG_FILES([Makefile src/sdiag/Makefile src/sprio/Makefile src/srun/Makefile + src/srun/libsrun/Makefile src/srun_cr/Makefile src/slurmd/Makefile src/slurmd/common/Makefile @@ -488,6 +487,10 @@ AC_CONFIG_FILES([Makefile src/plugins/job_submit/logging/Makefile src/plugins/job_submit/lua/Makefile src/plugins/job_submit/partition/Makefile + src/plugins/launch/Makefile + src/plugins/launch/poe/Makefile + src/plugins/launch/runjob/Makefile + src/plugins/launch/slurm/Makefile src/plugins/preempt/Makefile src/plugins/preempt/none/Makefile src/plugins/preempt/partition_prio/Makefile @@ -500,7 +503,6 @@ AC_CONFIG_FILES([Makefile src/plugins/proctrack/cgroup/Makefile src/plugins/proctrack/pgid/Makefile src/plugins/proctrack/linuxproc/Makefile - src/plugins/proctrack/rms/Makefile src/plugins/proctrack/sgi_job/Makefile src/plugins/proctrack/lua/Makefile src/plugins/sched/Makefile @@ -521,10 +523,11 @@ AC_CONFIG_FILES([Makefile src/plugins/select/cray/libalps/Makefile src/plugins/select/cray/libemulate/Makefile src/plugins/select/linear/Makefile + src/plugins/select/serial/Makefile src/plugins/switch/Makefile - src/plugins/switch/elan/Makefile src/plugins/switch/none/Makefile - src/plugins/switch/federation/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 diff --git a/contribs/Makefile.in b/contribs/Makefile.in index a54e356a293ddeda9b695a445da5d99d2a40ac88..89ae922bf1ebc02e2c68e7c8607e7623f8e30b05 100644 --- a/contribs/Makefile.in +++ b/contribs/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -164,9 +163,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -174,9 +171,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -208,6 +204,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -235,6 +233,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -585,10 +584,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/contribs/arrayrun/Makefile.in b/contribs/arrayrun/Makefile.in index 40469943ee797c293796127391787d112de347a3..35671cd8c626a3f775cddc6075c4392e9bdf84a9 100644 --- a/contribs/arrayrun/Makefile.in +++ b/contribs/arrayrun/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -124,9 +123,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -134,9 +131,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -168,6 +164,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -195,6 +193,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -380,10 +379,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/contribs/cray/Makefile.in b/contribs/cray/Makefile.in index ad1be9cd10646507c93eb4dfe1ae8a7e80ad3de3..2ccf3422916222a8f5c6402342e8344fa8cd226b 100644 --- a/contribs/cray/Makefile.in +++ b/contribs/cray/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -59,9 +59,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -69,6 +67,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -107,6 +106,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) SOURCES = @@ -152,9 +157,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -162,9 +165,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -196,6 +198,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -223,6 +227,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -418,10 +423,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/contribs/lua/Makefile.in b/contribs/lua/Makefile.in index 1c5231a3feca8d2c0388631d76e0be952e4c3e43..34120e6c4f5db76f4b0c2c9953ed990f8d62e476 100644 --- a/contribs/lua/Makefile.in +++ b/contribs/lua/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -124,9 +123,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -134,9 +131,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -168,6 +164,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -195,6 +193,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -380,10 +379,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/contribs/pam/Makefile.in b/contribs/pam/Makefile.in index 112089959dff3b08d14150221a7b2cb10ac5092e..e5a4c204c1219bf15a0a4ee2e0a470bad6a5eeff 100644 --- a/contribs/pam/Makefile.in +++ b/contribs/pam/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -106,6 +105,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) @HAVE_PAM_TRUE@pam_slurm_la_DEPENDENCIES = \ @@ -178,9 +183,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -188,9 +191,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -222,6 +224,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -249,6 +253,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -420,7 +425,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -pam_slurm.la: $(pam_slurm_la_OBJECTS) $(pam_slurm_la_DEPENDENCIES) +pam_slurm.la: $(pam_slurm_la_OBJECTS) $(pam_slurm_la_DEPENDENCIES) $(EXTRA_pam_slurm_la_DEPENDENCIES) $(pam_slurm_la_LINK) $(am_pam_slurm_la_rpath) $(pam_slurm_la_OBJECTS) $(pam_slurm_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -557,10 +562,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/contribs/perlapi/Makefile.in b/contribs/perlapi/Makefile.in index fe67980995ca9c678704a963f8f565ec0e4ed88a..6b5c7ea40cfc248c6d8d0451253ffe0c095b170f 100644 --- a/contribs/perlapi/Makefile.in +++ b/contribs/perlapi/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -164,9 +163,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -174,9 +171,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -208,6 +204,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -235,6 +233,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -574,10 +573,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/contribs/perlapi/libslurm/Makefile.in b/contribs/perlapi/libslurm/Makefile.in index 7dfa142f5c214ec11cd6d14728ef216b4dc54599..a4f9a10a093577042b4ccbbbccffefde2b7e7c71 100644 --- a/contribs/perlapi/libslurm/Makefile.in +++ b/contribs/perlapi/libslurm/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -124,9 +123,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -134,9 +131,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -168,6 +164,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -195,6 +193,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -415,10 +414,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: maintainer-clean-generic: diff --git a/contribs/perlapi/libslurm/perl/Slurm.xs b/contribs/perlapi/libslurm/perl/Slurm.xs index 652860dcf33ac1c50be021c3a9676fdd9d9354f0..1cb6e5e12103b274862692f4039648f1edd4c84d 100644 --- a/contribs/perlapi/libslurm/perl/Slurm.xs +++ b/contribs/perlapi/libslurm/perl/Slurm.xs @@ -785,7 +785,7 @@ slurm_step_ctx_get(slurm_step_ctx_t *ctx, int ctx_key, INOUT ...) #slurm_job_info_ctx_get(switch_jobinfo_t *jobinfo, int data_type, void *data) int -slurm_step_ctx_daemon_per_node_hack(slurm_step_ctx_t *ctx) +slurm_step_ctx_daemon_per_node_hack(slurm_step_ctx_t *ctx, char **addr_array, uint32_t node_cnt) void slurm_step_ctx_DESTROY(slurm_step_ctx_t *ctx) diff --git a/contribs/perlapi/libslurm/perl/node.c b/contribs/perlapi/libslurm/perl/node.c index 1b25255e0716d8930fc7a1a00a1cdbe060fce533..e59694f893303d208f8136a9a1036bc7f024d5e3 100644 --- a/contribs/perlapi/libslurm/perl/node.c +++ b/contribs/perlapi/libslurm/perl/node.c @@ -57,6 +57,7 @@ node_info_to_hv(node_info_t *node_info, uint16_t node_scaling, HV *hv) STORE_FIELD(hv, node_info, reason_time, time_t); STORE_FIELD(hv, node_info, reason_uid, uint32_t); STORE_FIELD(hv, node_info, slurmd_start_time, time_t); + STORE_FIELD(hv, node_info, boards, uint16_t); STORE_FIELD(hv, node_info, sockets, uint16_t); STORE_FIELD(hv, node_info, threads, uint16_t); STORE_FIELD(hv, node_info, tmp_disk, uint32_t); @@ -112,6 +113,7 @@ hv_to_node_info(HV *hv, node_info_t *node_info) FETCH_FIELD(hv, node_info, reason_time, time_t, TRUE); FETCH_FIELD(hv, node_info, reason_uid, uint32_t, TRUE); FETCH_FIELD(hv, node_info, slurmd_start_time, time_t, TRUE); + FETCH_FIELD(hv, node_info, boards, uint16_t, TRUE); FETCH_FIELD(hv, node_info, sockets, uint16_t, TRUE); FETCH_FIELD(hv, node_info, threads, uint16_t, TRUE); FETCH_FIELD(hv, node_info, tmp_disk, uint32_t, TRUE); diff --git a/contribs/perlapi/libslurm/perl/step_ctx.c b/contribs/perlapi/libslurm/perl/step_ctx.c index 9f50a9ccf27fccd15a2e18af192653c9fbb69862..5f693096ab60a8bd2d21a4eb1cac2a7f68177b1e 100644 --- a/contribs/perlapi/libslurm/perl/step_ctx.c +++ b/contribs/perlapi/libslurm/perl/step_ctx.c @@ -186,6 +186,7 @@ hv_to_slurm_step_launch_params(HV *hv, slurm_step_launch_params_t *params) FETCH_FIELD(hv, params, task_epilog, charp, FALSE); FETCH_FIELD(hv, params, cpu_bind_type, uint16_t, FALSE); FETCH_FIELD(hv, params, cpu_bind, charp, FALSE); + FETCH_FIELD(hv, params, cpu_freq, uint32_t, FALSE); FETCH_FIELD(hv, params, mem_bind_type, uint16_t, FALSE); FETCH_FIELD(hv, params, mem_bind, charp, FALSE); diff --git a/contribs/perlapi/libslurmdb/Makefile.in b/contribs/perlapi/libslurmdb/Makefile.in index 78d09d453370336e76df335c2568f4bffe2139ae..710b524b20d18fc815a59347957a1a988e457928 100644 --- a/contribs/perlapi/libslurmdb/Makefile.in +++ b/contribs/perlapi/libslurmdb/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -124,9 +123,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -134,9 +131,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -168,6 +164,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -195,6 +193,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -395,10 +394,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: maintainer-clean-generic: diff --git a/contribs/phpext/Makefile.in b/contribs/phpext/Makefile.in index 4d75ad2f3024195b4d22275af5c816fc4d8abcd1..71dc211abe97f53614d3369b699742148163d760 100644 --- a/contribs/phpext/Makefile.in +++ b/contribs/phpext/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -124,9 +123,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -134,9 +131,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -168,6 +164,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -195,6 +193,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -380,10 +379,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: maintainer-clean-generic: diff --git a/contribs/sjobexit/Makefile.in b/contribs/sjobexit/Makefile.in index 7f383e7ddcccd538bcece69c54f731292d14a59c..ff0f5ed6d1bc01cf70383ed412c072cd878d2002 100644 --- a/contribs/sjobexit/Makefile.in +++ b/contribs/sjobexit/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -106,6 +105,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) SOURCES = @@ -151,9 +156,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -161,9 +164,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -195,6 +197,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -222,6 +226,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -408,10 +413,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/contribs/slurmdb-direct/Makefile.in b/contribs/slurmdb-direct/Makefile.in index 6bb533640c5da7399bfb91597adba98b613cd041..f21a994a1a5aecba9d58401921015bc65ad62332 100644 --- a/contribs/slurmdb-direct/Makefile.in +++ b/contribs/slurmdb-direct/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -106,6 +105,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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)$(sbindir)" SCRIPTS = $(sbin_SCRIPTS) SOURCES = @@ -151,9 +156,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -161,9 +164,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -195,6 +197,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -222,6 +226,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -409,10 +414,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/contribs/torque/Makefile.in b/contribs/torque/Makefile.in index e51e5b32b1c0d4bea6f59d8807f62f20440f765e..4e53f3d3a932fa9e65edf1d1a43c29af43f1ca86 100644 --- a/contribs/torque/Makefile.in +++ b/contribs/torque/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -106,6 +105,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) SOURCES = @@ -151,9 +156,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -161,9 +164,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -195,6 +197,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -222,6 +226,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -408,10 +413,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/doc/Makefile.in b/doc/Makefile.in index efea2f63aeeb5baa71d882585402f07573ac3646..10fbbf938f6a6784f71ea66ca9c0a7178f8193b6 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -164,9 +163,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -174,9 +171,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -208,6 +204,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -235,6 +233,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -584,10 +583,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/doc/html/Makefile.am b/doc/html/Makefile.am index 059c66bc111bddc270856e2d5401625ff1563e0a..a8b5a26032a0a0916d965a22030e803b86f11d27 100644 --- a/doc/html/Makefile.am +++ b/doc/html/Makefile.am @@ -8,6 +8,7 @@ generated_html = \ authplugins.html \ big_sys.html \ bluegene.html \ + cgroups.html \ checkpoint_blcr.html \ checkpoint_plugins.html \ cons_res.html \ @@ -33,6 +34,7 @@ generated_html = \ job_launch.html \ job_submit_plugins.html \ jobcompplugins.html \ + launch_plugins.html \ mail.html \ man_index.html \ maui.html \ @@ -44,6 +46,7 @@ generated_html = \ multi_cluster.html \ news.html \ overview.html \ + poe.html \ platforms.html \ plugins.html \ power_save.html \ diff --git a/doc/html/Makefile.in b/doc/html/Makefile.in index 858c9ce8a0f44f0948e114230836494d54c310f5..380302c2bef3836b91bc40d987594ccf4953687e 100644 --- a/doc/html/Makefile.in +++ b/doc/html/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -107,6 +106,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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)$(htmldir)" DATA = $(html_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -150,9 +155,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -160,9 +163,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -194,6 +196,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -221,6 +225,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -318,6 +323,7 @@ generated_html = \ authplugins.html \ big_sys.html \ bluegene.html \ + cgroups.html \ checkpoint_blcr.html \ checkpoint_plugins.html \ cons_res.html \ @@ -343,6 +349,7 @@ generated_html = \ job_launch.html \ job_submit_plugins.html \ jobcompplugins.html \ + launch_plugins.html \ mail.html \ man_index.html \ maui.html \ @@ -354,6 +361,7 @@ generated_html = \ multi_cluster.html \ news.html \ overview.html \ + poe.html \ platforms.html \ plugins.html \ power_save.html \ @@ -477,9 +485,7 @@ uninstall-htmlDATA: @$(NORMAL_UNINSTALL) @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(htmldir)" && rm -f $$files + dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: @@ -534,10 +540,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) diff --git a/doc/html/bluegene.shtml b/doc/html/bluegene.shtml index e08d15d152f80b2e9539fc93ae00222d23378f06..472cd7dca4c9d8fee5589f86ed8d63f06fe38cd5 100644 --- a/doc/html/bluegene.shtml +++ b/doc/html/bluegene.shtml @@ -98,9 +98,11 @@ Note that this is a c-node count.

Task Launch on BlueGene/Q only

-

Use SLURM's srun command to launch tasks (srun is a wrapper for IBM's -runjob command. -SLURM job step information, including accounting, functions as expected.

+

Use SLURM's srun command to launch tasks (srun uses + an api interface into IBM's runjob command). +SLURM job step information, including accounting, functions as + expected. Totalview and other debuggers will also work with srun. + IBM's runjob will not work under SLURM.

Task Launch on BlueGene/L and BlueGene/P only

@@ -159,7 +161,7 @@ In example of this with a BGQ system of [0000x2333] but only can use [2000x2333] you could define it in your slurm.conf like this.
 ...
-NodeName=bgq[0000x1333] sate=down
+NodeName=bgq[0000x1333] state=down
 NodeName=bgq[2000x2333] state=unknown
 ...
 
@@ -265,8 +267,9 @@ SLURM plugin for the IBM runjob_mux. This can be done by altering the bg.properties file. In the [runjob.mux] section of the bg.properties file change the plugin option to $prefix/lib/slurm/runjob_plugin.so and also set the plugin_flags -option to 0x0101 (RTLD_LAZY | RTLD_GLOBAL) which allows the -forwarding of symbols to shared objects like SLURM uses for plugins.

+option to 0x0109 (RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND) +which allows the forwarding of symbols to shared objects like SLURM +uses for plugins.

 [runjob.mux]
 ...
@@ -276,18 +279,63 @@ plugin = /usr/lib64/slurm/runjob_plugin.so
     # runjob_mux_refresh_config command on the
     # Login Node where a runjob_mux process runs.
 ...
-plugin_flags = 0x0101 # RTLD_LAZY | RTLD_GLOBAL
+plugin_flags = 0x0109 # RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND
 
-

After these settings are set (re)start each runjob_mux running on your -system.

+

You also need to set things up so the runjob_mux is ran by the + SlurmUser. This can be done by editting 2 files.

+

Back in your bg.properties file alter the [master.user] section. +

+[master.user]
+...
+runjob_mux=slurm
+
+

Then in /etc/init.d/bgagent add SlurmUser to the --users line.

+
+OPTIONS="--users bgqadmin,bgws,bgqsysdb,slurm"
+
+

After these settings are set flush the runjob_server and (re)start + each runjob_mux running on your system.

+
+> /bgsys/drivers/ppcfloor/sbin/master_stop binaries
+stopped
+> sudo /etc/init.d/bgagent restart
+Shutting down bgagentd:                                    [  OK  ]
+Starting bgagentd:
+Startup of bgagentd completed:                             [  OK  ]
+> /bgsys/drivers/ppcfloor/sbin/master_start binaries
+> /bgsys/drivers/ppcfloor/sbin/bgmaster_server_refresh_config
+success!
+> /bgsys/drivers/ppcfloor/sbin/master_start runjob_mux
+started runjob_mux
+> ps aux | grep runjob_mux
+slurm       25461  0.0  0.3 518528 48064 ?        Sl   13:00   0:00 runjob_mux
+

When a new version of SLURM is installed it is a wise idea to "refresh" the -runjob_mux with the new plugin. This can be done with no job loss -using the IBM runjob_mux_refresh_config command. This will -reload the plugin and all should be good afterway. After doing this +runjob_mux with the new plugin. This can be done in one of two ways. +

    +
  • Stopping and restarting the runjob_mux. While this + option works every time jobs running under the runjob_mux will not + survive so plan your updates accordingly. +
    +> /bgsys/drivers/ppcfloor/sbin/master_stop runjob_mux
    +stopped runjob_mux
    +> /bgsys/drivers/ppcfloor/sbin/master_start runjob_mux
    +started runjob_mux
    +
    +
  • +
  • WARNING! As of IBM driver V1R1M1 this +method did not work. It appears to in the logs, but loads the old +plugin (presumably still in memory) other than the new one, +so use at your own risk and don't complain if it doesn't work. +

    This method allows no job loss using the +IBM runjob_mux_refresh_config command. This should +reload the plugin and all should be good afterwards. After doing this you may see some warning/error messages about the current running jobs -when finishing not being known. This is expected and can usually be ignored. +when finishing not being known. This is expected and can usually be +ignored.

  • +

Notes about sub-block allocations:

@@ -818,6 +866,6 @@ scheduling logic, etc.

-

Last modified 30 January 2012

+

Last modified 3 July 2012

diff --git a/doc/html/cgroups.shtml b/doc/html/cgroups.shtml new file mode 100644 index 0000000000000000000000000000000000000000..44899f77bfda32d81dd2c55f7be0b59de232c764 --- /dev/null +++ b/doc/html/cgroups.shtml @@ -0,0 +1,176 @@ + + +

Cgroups Guide

+

Cgroups Overview

+For a comprehensive description of Linux Control Groups (cgroups) see the + +cgroups documentation at kernel.org. Detailed knowledge of cgroups is not +required to use cgroups in SLURM, but a basic understanding of the +following features of cgroups is helpful: +
    +
  • Cgroup - a container for a set of processes subject to common +controls or monitoring, implemented as a directory and a set of files +(state objects) in the cgroup +virtual filesystem.
  • +
  • Subsystem - a module, typically a resource controller, that applies +a set of parameters to the cgroups in a hierarchy.
  • +
  • Hierarchy - a set of cgroups organized in a tree structure, with one +or more associated subsystems.
  • +
  • State Objects - pseudofiles that represent the state of a cgroup or +apply controls to a cgroup: +
      +
    • tasks - identifies the processes (PIDs) in the cgroup. +
    • release_agent - specifies the location of the script or program to +be called when the cgroup becomes empty.
    • +
    • notify_on_release - controls whether the release_agent is called for +the cgroup.
    • +
    • additional state objects specific to each subsystem.
    • +
    +
+
+

Use of Cgroups in SLURM

+SLURM provides cgroup versions of a number of plugins. +
    +
  • proctrack (process tracking)
  • +
  • task (task management)
  • +
  • jobacct_gather (job accounting statistics)
  • +The cgroup plugins can provide a number of benefits over the +other more standard plugins, as described below. +
+
+

SLURM Cgroups Configuration Overview

+There are several sets of configuration options for SLURM cgroups: +
    +
  • slurm.conf provides options to enable the +cgroup plugins. Each plugin may be enabled or disabled independently +of the others.
  • +
  • cgroup.conf provides general options that +are common to all cgroup plugins, plus additional options that apply only to +specific plugins.
  • +
  • Additional configuration is required to enable automatic removal of SLURM +cgroups when they are no longer in use. +See Cleanup of SLURM Cgroups below for details.
  • +
+ +
+

Currently Available Cgroup Plugins

+

proctrack/cgroup plugin

+The proctrack/cgroup plugin is an alternative to other proctrack +plugins such as proctrack/linux for process tracking and +suspend/resume capability. proctrack/cgroup uses the freezer subsystem +which is more reliable for tracking and control than proctrack/linux. +

+To enable this plugin, configure the following option in slurm.conf: +

ProctrackType=proctrack/cgroup
+

+There are no specific options for this plugin in cgroup.conf, but the general +options apply. See the cgroup.conf man page for +details. +

task/cgroup plugin

+The task/cgroup plugin is an alternative other task plugins such as +task/affinity plugin for task management. task/cgroup provides the +following features: +
    +
  • The ability to confine jobs and steps to their allocated cpuset.
  • +
  • The ability to bind tasks to sockets, cores and threads within their step's +allocated cpuset on a node.
  • +
      +
    • Supports block and cyclic distribution of allocated cpus to tasks for +binding.
    • +
    +
  • The ability to confine jobs and steps to specific memory resources.
  • +
  • The ability to confine jobs to their allocated set of generic resources +(gres devices).
  • +
+The task/cgroup plugin uses the cpuset, memory and devices subsystems. +

+To enable this plugin, configure the following option in slurm.conf: +

TaskPlugin=task/cgroup
+

+There are many specific options for this plugin in cgroup.conf. The general +options also apply. See the cgroup.conf man page +for details. +

jobacct_gather/cgroup plugin

+At present, jobacct_gather/cgroup should be considered experimental. +

+The jobacct_gather/cgroup plugin is an alternative to the jobacct_gather/linux +plugin for the collection of accounting statistics for jobs, steps and tasks. +The cgroup plugin may provide improved performance over jobacct_gather/linux. +jobacct_gather/cgroup uses the cpuacct and memory subsystems. Note: the cpu and +memory statistics collected by this plugin do not represent the same resources +as the cpu and memory statistics collected by the jobacct_gather/linux plugin +(sourced from /proc stat). +

+To enable this plugin, configure the following option in slurm.conf: +

JobacctGatherType=jobacct_gather/cgroup
+

+There are no specific options for this plugin in cgroup.conf, but the general +options apply. See the cgroup.conf man page for +details. +

+

Organization of SLURM Cgroups

+SLURM cgroups are organized as follows. A base directory (mount point) is +created at /cgroup, or as configured by the CgroupMountpoint option in +cgroup.conf. 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 slurm is created below +the root cgroup in each hierarchy. Below each slurm cgroup, cgroups for +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): +

/cgroup/cpuset/slurm/uid_100/job_123/step_0/task_2

+Note that this structure applies to a specific compute node. Jobs that use more +than one node will have a cgroup structure on each node. + +

+

Cleanup of SLURM Cgroups

+Linux provides a mechanism for the automatic removal of a cgroup when its +state changes from non-empty to empty. A cgroup is empty when no processes are +attached to it and it has no child cgroups. The SLURM cgroups implementation +allows this mechanism to be used to automatically remove the relevant SLURM +cgroups when tasks, steps and jobs terminate. To enable this automatic removal +feature, follow these steps: +
    +
  • If desired, configure the location of the SLURM Cgroup release agent +directory. This is done using the CgroupReleaseAgentDir option in +cgroup.conf. +The default location is /etc/slurm/cgroup.
  • +
    +
    +       [sulu] (slurm) etc> cat cgroup.conf | grep CgroupReleaseAgentDir
    +       CgroupReleaseAgentDir="/etc/slurm/cgroup"
    +
    +
  • Create the common release agent file. This file should be named +release_common. An example script for this file is provided in the +SLURM delivery at etc/cgroup.release_common.example. The example script will +automatically remove user, job, step and task cgroups as they become empty. The +file must have execute permission for root.

  • +
  • Create release agent files for each cgroup subsystem to be used by SLURM. +This depends on which cgroup plugins are enabled. For example, the +proctrack/cgroup plugin uses the freezer subsystem. See +Currently Available Cgroup Plugins above to find out +which subsystems are used by each plugin. The name of each release agent file +must be of the form release_<subsystem name>. These files should +be created as symbolic links to the common release agent file, +release_common. The files must have execute permission for root. See +the following example.
  • +
    +
    +       [sulu] (slurm) etc> ls -al /etc/slurm/cgroup
    +       total 12
    +       drwxr-xr-x 2 root root 4096 2010-04-23 14:55 .
    +       drwxr-xr-x 4 root root 4096 2010-07-22 14:48 ..
    +       -rwxrwxrwx 1 root root  234 2010-04-23 14:52 release_common
    +       lrwxrwxrwx 1 root root   32 2010-04-23 11:04 release_cpuset -> /etc/slurm/cgroup/release_common
    +       lrwxrwxrwx 1 root root   32 2010-04-23 11:03 release_freezer -> /etc/slurm/cgroup/release_common
    +
    +
    +
+ + +

Last modified 6 June 2012

+ + diff --git a/doc/html/checkpoint_blcr.shtml b/doc/html/checkpoint_blcr.shtml index b400f59278e192141f5676777d9f3aa378ab0ff9..c5ac40abfbc696e9913ac5204258106f9b9b12ca 100644 --- a/doc/html/checkpoint_blcr.shtml +++ b/doc/html/checkpoint_blcr.shtml @@ -4,7 +4,7 @@

Overview

SLURM version 2.0 has been integrated with - + Berkeley Lab Checkpoint/Restart (BLCR) in order to provide automatic job checkpoint/restart support. Functionality provided includes: @@ -193,6 +193,6 @@ option at job submit time or scontrol's ImageDir option.

-

Last modified 26 March 2012

+

Last modified 20 June 2012

diff --git a/doc/html/checkpoint_plugins.shtml b/doc/html/checkpoint_plugins.shtml index 2e21ec7a573e437e6f43c80419ff3c08d3520cad..de5054a43dc6a91546371459d007e6f1746084c2 100644 --- a/doc/html/checkpoint_plugins.shtml +++ b/doc/html/checkpoint_plugins.shtml @@ -18,7 +18,7 @@ We recommend, for example:

  • aix—AIX system checkpoint.
  • blcr— - + Berkeley Lab Checkpoint/Restart (BLCR)
  • none—No job checkpoint.
  • ompi—OpenMPI checkpoint (requires OpenMPI version 1.3 or higher).
  • @@ -186,6 +186,6 @@ A checkpoint plugin conveys its ability to implement a particular API version using the mechanism outlined for SLURM plugins.

    -

    Last modified 10 March 2009

    +

    Last modified 20 June 2012

    diff --git a/doc/html/configurator.easy.html.in b/doc/html/configurator.easy.html.in index a188e9aa21d8c19963e6536baf0116ba33b34582..f7eb8d939f4976e0bf28f49121959684b2e67af0 100644 --- a/doc/html/configurator.easy.html.in +++ b/doc/html/configurator.easy.html.in @@ -200,7 +200,7 @@ function displayfile()
    -

    SLURM Version @SLURM_MAJOR@.@SLURM_MINOR@ Configuration Tool

    +

    SLURM Version @SLURM_MAJOR@.@SLURM_MINOR@ Configuration Tool - Easy Version

    This form can be used to create a SLURM configuration file with you controlling many of the important configuration parameters.

    @@ -454,11 +454,13 @@ Select one value for SelectType:
    Core and Memory as consumable resources. + +BlueGene: For IBM Blue Gene systems only
    Linear: Node-base resource allocation, does not manage individual processor allocation
    - -BlueGene: For IBM Blue Gene systems only
    + +Serial: Execute single CPU jobs only

    Task Launch

    @@ -541,5 +543,5 @@ Specify a specify the fully qualified pathname for the file.

    Legal Notices
    -Last modified 3 April 2012

    +Last modified 21 June 2012

    diff --git a/doc/html/configurator.html.in b/doc/html/configurator.html.in index be6e768128365cc4fb67364ba7f2ac036bae41c2..1dfc45f834e254d92730bed17f28d20199046a4a 100644 --- a/doc/html/configurator.html.in +++ b/doc/html/configurator.html.in @@ -548,6 +548,7 @@ Select one value for SwitchType:
    Federation Switch
    None: No special handling required (InfiniBand, Myrinet, Ethernet, etc.)
    + NRT: IBM Network Resource Table

    Default MPI Type

    @@ -635,11 +636,13 @@ Select one value for SelectType:
    Core and Memory as consumable resources. + +BlueGene: For IBM Blue Gene systems only
    Linear: Node-base resource allocation, does not manage individual processor allocation
    - -BlueGene: For IBM Blue Gene systems only
    + +Serial: Supports single CPU job allocations only

    Task Launch

    @@ -850,5 +853,5 @@ before terminating all remaining tasks. A value of zero indicates unlimited wait
    Legal Notices
    -Last modified 3 April 2012

    +Last modified 21 June 2012

    diff --git a/doc/html/cpu_management.shtml b/doc/html/cpu_management.shtml index 7d57f1148c71f2b9f2ececfdf77a327c5a40dc03..7ef79ca61d362170e601850a7bfcd7da20dcaedf 100644 --- a/doc/html/cpu_management.shtml +++ b/doc/html/cpu_management.shtml @@ -18,7 +18,7 @@ is divided into the following sections:

    chosen by the SLURM administrator. The interactions between different CPU management options are complex and often difficult to predict. Some experimentation may be required to discover the exact combination of options needed to produce a desired outcome. Users and administrators should refer to the man pages -for slurm.conf, cgroup.conf +for slurm.conf, cgroup.conf, salloc, sbatch and srun for detailed explanations of each option. The following html documents may also be useful:

    @@ -32,7 +32,7 @@ Architectures

    This document describes SLURM CPU management for conventional Linux clusters only. For information on Cray and IBM BlueGene systems, please refer to the appropriate documents.

    -

    The information and examples in this document have been verified on SLURM version 2.3.0. Some +

    The information and examples in this document have been verified on SLURM version 2.4.0. Some information may not be valid for previous SLURM versions.


    CPU Management Steps performed by SLURM

    @@ -88,7 +88,7 @@ Step 1 is performed by slurmctld and the select plugin.

    Defines - a node. This includes the number and layout of sockets, cores, + a node. This includes the number and layout of boards, sockets, cores, threads and processors (logical CPUs) on the node.

    @@ -525,7 +525,7 @@ Step 2 is performed by slurmctld and the select plugin.

    Defines - a node. This includes the number and layout of sockets, cores, + a node. This includes the number and layout of boards, sockets, cores, threads and processors (logical CPUs) on the node.

    @@ -3538,6 +3538,6 @@ and binding for this job. For example, task id 2 is bound to CPU id 2. -

    Last modified 26 September 2011

    +

    Last modified 7 February 2012

    diff --git a/doc/html/documentation.shtml b/doc/html/documentation.shtml index 494072beb7cd689dc490a48664c5341179600502..746127f4b70057f9307c4857892f32ce4e8fb0c9 100644 --- a/doc/html/documentation.shtml +++ b/doc/html/documentation.shtml @@ -19,6 +19,7 @@ Also see Publications and Presentations.
  • Blue Gene User and Administrator Guide
  • Cray User and Administrator Guide
  • IBM AIX User and Administrator Guide
  • +
  • IBM Parallel Environment User and Administrator Guide
@@ -26,16 +27,17 @@ Also see Publications and Presentations. @@ -83,6 +86,7 @@ Also see Publications and Presentations.
  • Job Checkpoint Plugin Programmer Guide
  • Job Completion Logging Plugin Programmer Guide
  • Job Submission Plugin Programmer Guide
  • +
  • Launch Plugin Programmer Guide
  • MPI Plugin Programmer Guide
  • Preemption Plugin Programmer Guide
  • Priority Plugin Programmer Guide
  • @@ -95,6 +99,6 @@ Also see Publications and Presentations. -

    Last modified 2 April 2012

    +

    Last modified 6 July 2012

    diff --git a/doc/html/download.shtml b/doc/html/download.shtml index 3b6732dbca65b3244d9e8b6c0ea69b78d6dc3e32..1eaea1b65c5ba5d33312fdd32cf7c91b1d4836af 100644 --- a/doc/html/download.shtml +++ b/doc/html/download.shtml @@ -125,6 +125,7 @@ http://io-watchdog.googlecode.com/files/io-watchdog-0.6.tar.bz2
    • ChaMPIon, MPI Software Technology
    • HP-MPI
    • +
    • Intel-MPI
    • LAM/MPI
    • MPICH1
    • MPICH2
    • @@ -154,6 +155,9 @@ SLURM's PAM module has also been packaged for -

      Last modified 6 March 2012

      +

      Last modified 17 May 2012

      diff --git a/doc/html/elastic_computing.shtml b/doc/html/elastic_computing.shtml index 1cc8bf71c27704460242fe22280427abd94001d5..9c3a692a6f14f7ee20f7ebebb581db0b1fa3138a 100644 --- a/doc/html/elastic_computing.shtml +++ b/doc/html/elastic_computing.shtml @@ -14,6 +14,16 @@ cluster. Good responsiveness and throughput can be achieved while you only pay for the resources needed.

      +

      The +StarCluster +cloud computing toolkit has a +SLURM port available. + +Instructions for the SLURM port of StartCLuster are available online.

      + +

      The rest of this document describes details about SLURM's infrastructure that +can be used to support Elastic Computing.

      +

      SLURM's Elastic Computing logic relies heavily upon the existing power save logic. Review of SLURM's Power Saving Guide is strongly @@ -162,6 +172,6 @@ expands (adds resources).

      -

      Last modified 14 October 2011

      +

      Last modified 15 May 2012

      diff --git a/doc/html/faq.shtml b/doc/html/faq.shtml index f0495c578471660bf3234e2519f619bca01b4bf3..69237344033df6e69b403debf52459de5341b283 100644 --- a/doc/html/faq.shtml +++ b/doc/html/faq.shtml @@ -46,6 +46,8 @@ the slurm-dev mailing list? running?
    • Why is my MPIHCH2 or MVAPICH2 job not running with SLURM? Why does the DAKOTA program not run with SLURM?
    • +
    • Why does squeue (and "scontrol show +jobid") sometimes not display a job's estimated start time?
    • For Administrators

      @@ -816,6 +818,17 @@ rather than the appropriate library, the application will fail. In the case of Rename DAKOTA's function and references from regcomp to something else to make it work properly.

      +

      26. Why does squeue (and "scontrol show +jobid") sometimes not display a job's estimated start time?
      +When the backfill scheduler is configured, it provides an estimated start time +for jobs that are candidates for backfill. Pending jobs with dependencies +will not have an estimate as it is difficult to predict what resources will +be available when the jobs they are dependent on terminate. Also note that +the estimate is better for jobs expected to start soon, as most running jobs +end before their estimated time. There are other restrictions on backfill that +may apply. See the backfill section for more details. +

      + @@ -1500,6 +1513,6 @@ https://github.com/SchedMD/slurm/commit/91e543d433bed11e0df13ce0499be641774c99a3 -

      Last modified 23 March 2012

      +

      Last modified 24 June 2012

      diff --git a/doc/html/gang_scheduling.shtml b/doc/html/gang_scheduling.shtml index b52a9590b1476f261e2e2e87c1b3394188b0993a..1838bc1529d606d960757cf0c161f5dc796095a2 100644 --- a/doc/html/gang_scheduling.shtml +++ b/doc/html/gang_scheduling.shtml @@ -69,6 +69,8 @@ It may also be desirable to configure MaxMemPerNode (maximum memory per allocated node) in slurm.conf. Users can use the --mem or --mem-per-cpu option at job submission time to specify their memory requirements. +Note that in order to gang schedule jobs, all jobs must be able to fit into +memory at the same time.
    • JobAcctGatherType and JobAcctGatherFrequency: @@ -525,6 +527,6 @@ For now this idea could be experimented with by disabling memory support in the selector and submitting appropriately sized jobs.

      -

      Last modified 24 June 2011

      +

      Last modified 29 June 2012

      diff --git a/doc/html/gres.shtml b/doc/html/gres.shtml index b3c5535f92ba270e658ffe1bb65d02053fa17063..e88795421411db65b3d3664499d702dd49da382e 100644 --- a/doc/html/gres.shtml +++ b/doc/html/gres.shtml @@ -43,7 +43,8 @@ values in slurm.conf ).
    • The default value is set to the number of File values specified (if any), otherwise the default value is one. A suffix of "K", "M" or "G" may be used to mulitply the number by 1024, 1048576 or 1073741824 respectively -(e.g. "Count=10G"). +(e.g. "Count=10G"). Note that Count is a 32-bit field and the maximum value +is 4,294,967,295.
    • CPUs Specify the CPU index numbers for the specific CPUs which can use this resources. For example, it may be strongly preferable to use specific @@ -150,6 +151,6 @@ JobStep=1234.2 CUDA_VISIBLE_DEVICES=3 file and insure they are in the increasing numeric order.

      -

      Last modified 8 May 2012

      +

      Last modified 2 July 2012

      diff --git a/doc/html/high_throughput.shtml b/doc/html/high_throughput.shtml index 8f2d89d01a9bc986dc5b8f87c9195abf89f7e855..8a4606d8a280305430b6e7ed65222f9d925d2fa8 100644 --- a/doc/html/high_throughput.shtml +++ b/doc/html/high_throughput.shtml @@ -11,7 +11,7 @@ for this material.

      Performance Results

      -

      SLURM has also been validated to process 100,000 jobs and job steps per hour +

      SLURM has also been validated to execute 500 simple batch jobs per second on a sustained basis with short bursts of activity at a much higher level. Actual performance depends upon the jobs to be executed plus the hardware and configuration used.

      @@ -52,14 +52,30 @@ be set quite high for memory size, open file count and stack size.

      SLURM Configuration

      +

      NOTE: Substantial changes were made in SLURM version 2.4 to support higher +throughput rates. Version 2.5 includes more enhancements.

      +

      Several SLURM configuration parameters should be adjusted to -reflect the needs of high throughput computing.

      +reflect the needs of high throughput computing. The changes described below +will not be possible in all environments, but these are the configuration +options that you may want to consider for higher throughput.

        +
      • AccountingStorageType: +Disabling accounting will improve job throughput. Disable storing of +accounting by using the accounting_storage/none plugin.
      • +
      • JobAcctGatherType: +Disabling the collection of job accounting information will improve job +throughput. Disable collection of accounting by using the +jobacct_gather/none plugin.
      • +
      • JobCompType: +Disabling recording of job completion information will improve job +throughput. Disable recording of job completion information by using the +jobcomp/none plugin.
      • MaxJobCount: Controls how many jobs may be in the slurmctld daemon records at any point in time (pending, running, suspended or completed[temporarily]). -The default value is 10,000
      • +The default value is 10,000.
      • MessageTimeout: Controls how long to wait for a response to messages. The default value is 10 seconds. @@ -70,7 +86,12 @@ Controls how soon the record of a completed job can be purged from the slurmctld memory and thus not visible using the squeue command. The record of jobs run will be preserved in accounting records and logs. The default value is 300 seconds. The value should be reduced to a few -seconds if possible.
      • +seconds if possible. Use of accounting records for older jobs can increase +the job throughput rate compared with retaining old jobs in the memory of +the slurmctld daemon. +
      • PriorityType: +The priority/builtin is considerably faster than other options, but +schedules jobs only on a First In First Out (FIFO) basis.
      • SchedulerParameters: Several scheduling parameters are available.
          @@ -91,16 +112,42 @@ jobs or less) and interval to 30 seconds or more will limit the overhead of backfill scheduling (NOTE: the default values are fine for both of these parameters).
      • +
      • SchedulerType: +If most jobs are short lived then use of the sched/builtin plugin is +recomended. This manages a queue of jobs on a First-In-First-Out (FIFO) basis +and eliminates logic used to sort the queue by priority. +
      • SelectType: +If only serial jobs (single CPU jobs) are to be executed, use of the +select/serial plugin is recommended. This plugin eliminates much of +the logic found in other select plugins to optimize job allocations with +respect to network topology. It also reduces communications required to +executed batch jobs by 75 percent through the use of a "pull" model, where +the completeion of each job by the slurmd daemon initiates a single +message to the slurmctld daemon upon completion of the job's epilog +script. The response to this message can be information required to initiate +another job utilizing the resources just released by the previous job. +NOTE: The use of select/serial prevents the job's Epilog +program from being initiated with any SPANK environment variables.
      • SlurmctldPort: It is desirable to configure the slurmctld daemon to accept incoming messages on more than one port in order to avoid having incoming messages discarded by the operating system due to exceeding the SOMAXCONN limit described above. Using between two and ten ports is suggested when large numbers of simultaneous requests are to be supported.
      • +
      • SlurmctldDebug: +More detailed logging will decrease system throughput. Set to 2 (log errors +only) or 3 (general information logging). Each increment in the logging level +will increase the number of message by a factor of about 3.
      • +
      • SlurmdDebug: +More detailed logging will decrease system throughput. Set to 2 (log errors +only) or 3 (general information logging). Each increment in the logging level +will increase the number of message by a factor of about 3.
      • +
      • SlurmdLogFile: +Writing to local storage is recommended.
      • Other: Configure logging, accounting and other overhead to a minimum appropriate for your environment.
      -

      Last modified 30 August 2010

      +

      Last modified 12 July 2012

      diff --git a/doc/html/jobacct_gatherplugins.shtml b/doc/html/jobacct_gatherplugins.shtml index e2f619b7e439fae9e7897a5bddf53d9a59e4cf65..3fa76ad3f7689d5587641d010fa9e84b918d520b 100644 --- a/doc/html/jobacct_gatherplugins.shtml +++ b/doc/html/jobacct_gatherplugins.shtml @@ -5,8 +5,7 @@

      Overview

      This document describes SLURM job accounting gather plugins and the API that defines them. It is intended as a resource to programmers wishing to write -their own SLURM job accounting gather plugins. This is version 1 of the API. - +their own SLURM job accounting gather plugins.

      SLURM job accounting gather plugins must conform to the SLURM Plugin API with the following specifications: @@ -25,6 +24,10 @@ for the type of accounting package. We currently use

      • aix— Gathers information from AIX /proc table and adds this information to the standard rusage information also gathered for each job. +
      • cgroup—Gathers information from Linux cgroup +infrastructure and adds this information to the standard rusage +information also gathered for each job. (Experimental, not to be used + in production.)
      • linux—Gathers information from Linux /proc table and adds this information to the standard rusage information also gathered for each job.
      • none—No information gathered. @@ -33,7 +36,7 @@ The sacct program can be used to display gathered data from regular accounting and from these plugins.

        The programmer is urged to study src/plugins/jobacct_gather/linux and -src/common/jobacct_common.c/.h +src/common/slurm_jobacct_gather.[c|h] for a sample implementation of a SLURM job accounting gather plugin.

        All of the following functions are required. Functions which are not implemented must be stubbed. -

        jobacctinfo_t *jobacct_gather_p_create(jobacct_id_t *jobacct_id) +

        int jobacct_gather_p_poll_data(List task_list, bool pgid_plugin, uint64_t cont_id)

        Description:
        -jobacct_gather_p_alloc() used to alloc a pointer to and initialize a -new jobacctinfo structure.

        -You will need to free the information returned by this function! +Build a table of all current processes.

        Arguments:
        -tid -(input) id of the task send in (uint16_t)NO_VAL if no specfic task. -

        Returns:
        -jobacctinfo structure pointer on success, or
        -NULL on failure. + task_list (in/out) List containing +current processes
        + pgid_plugin (input) if we are +running with the pgid plugin
        + cont_id (input) container id of processes if not running with pgid -

        void jobacct_gather_p_destroy(jobacctinfo_t *jobacct) +

        int jobacct_gather_p_endpoll(void)

        Description:
        -jobacct_gather_p_free() used to free the allocation made by jobacct_gather_p_alloc(). +Called when the process is finished to stop the +polling thread.

        Arguments:
        -jobacct -(input) structure to be freed.
        none

        Returns:
        -none +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. -

        -int jobacct_gather_p_setinfo(jobacctinfo_t *jobacct, - enum jobacct_data_type type, void *data) +

        int jobacct_gather_p_add_task(pid_t pid, uint16_t tid)

        Description:
        -jobacct_gather_p_setinfo() is called to set the values of a jobacctinfo_t to -specific values based on inputs. +Used to add a task to the poller.

        Arguments:
        -jobacct -(input/output) structure to be altered.
        -type -(input) enum of specific part of jobacct to alter.
        -data -(input) corresponding data to set jobacct part to. + pid (input) Process id
        + tid (input) slurm global task id +

        Returns:
        +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. + + + +

        Job Account Gathering

        +

        All of the following functions are not required but may be used. + +

        int jobacct_gather_init(void) +

        Description:
        +Loads the job account gather plugin. +

        Returns:
        +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. + +

        int jobacct_gather_fini(void) +

        Description:
        +Unloads the job account gathering plugin.

        Returns:
        SLURM_SUCCESS on success, or
        SLURM_ERROR on failure. -

        -int jobacct_gather_p_getinfo(jobacctinfo_t *jobacct, - enum jobacct_data_type type, void *data) +

        int jobacct_gather_startpoll(uin16_t frequency)

        Description:
        -jobacct_gather_p_getinfo() is called to get the values of a jobacctinfo_t -specific values based on inputs. +Creates and starts the polling thread.

        Arguments:
        -jobacct -(input) structure to be queried.
        -type -(input) enum of specific part of jobacct to get.
        -data -(output) corresponding data to from jobacct part. + frequency (input) frequency of the polling.

        Returns:
        SLURM_SUCCESS on success, or
        SLURM_ERROR on failure. -

        -void jobacct_gather_p_pack(jobacctinfo_t *jobacct, Buf buffer) +

        void jobacct_gather_change_poll(uint16_t frequency)

        Description:
        -jobacct_gather_p_pack() pack jobacctinfo_t in a buffer to send across the network. +Changes the polling thread to a new frequency.

        Arguments:
        -jobacct -(input) structure to pack.
        -buffer -(input/output) buffer to pack structure into. + frequency (input) frequency of the polling

        Returns:
        -none +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. + +

        void jobacct_gather_suspend_poll(void) +

        Description:
        +Temporarily stops the polling thread. +

        Returns:
        +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. + +

        void jobacct_gather_resume_poll(void) +

        Description:
        +Resumes the polling thread that was stopped. +

        Returns:
        +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. -

        -void jobacct_gather_p_unpack(jobacctinfo_t *jobacct, Buf buffer) +

        jobacctinfo_t *jobacct_gather_stat_task(pid_t + pid)

        Description:
        -jobacct_gather_p_unpack() unpack jobacctinfo_t from a buffer received from -the network. -You will need to free the jobacctinfo_t returned by this function! +Gets the basis of the information of the task.

        Arguments:
        -jobacct -(input/output) structure to fill.
        -buffer -(input) buffer to unpack structure from.
        -

        Returns: +pid (input) process id. +

        Returns:
        SLURM_SUCCESS on success, or
        SLURM_ERROR on failure. -

        -void jobacct_gather_p_aggregate(jobacctinfo_t *dest, jobacctinfo_t *from) +

        jobacctinfo_t *jobacct_gather_remove_task(pid_t pid)

        Description:
        -jobacct_gather_p_aggregate() is called to aggregate and get max values from two -different jobacctinfo structures. +Removes the task.

        Arguments:
        -dest -(input/output) initial structure to be applied to.
        -from -(input) new info to apply to dest. +pid (input) process id.

        Returns:
        -none +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. -

        int + jobacct_gather_set_proctrack_container_id(uint64_t id) +

        Description:
        + Sets the proctrack container to a given id. +

        Arguments:
        +id (input) id to set. +

        Returns:
        +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. -

        int jobacct_gather_p_startpoll(int frequency) +

        int jobacct_gather_set_mem_limit(uint32_t job_id, + uint32_t step_id,uint32_t mem_limit)

        Description:
        -jobacct_gather_p_startpoll() is called at the start of the slurmstepd, -this starts a thread that should poll information to be queried at any time -during throughout the end of the process. -Put global initialization here. +Sets the memory limit of the job account.

        Arguments:
        -frequency (input) poll frequency for polling -thread. +job_id (input) id of the job.
        +sted_id (input) id of the step.
        +mem_limit (input) memory limit in megabytes.

        Returns:
        SLURM_SUCCESS on success, or
        SLURM_ERROR on failure. -

        int jobacct_gather_p_endpoll() +

        void jobacct_gather_handle_mem_limit(uint32_t total_job_mem, uint32_t total_job_vsize)

        Description:
        -jobacct_gather_p_endpoll() is called when the process is finished to stop the -polling thread. +Called to find out how much memory is used.

        Arguments:
        -none + total_job_mem (input) total +amount of memory for jobs.
        + total_job_vsize (input) the +total job size.

        Returns:
        SLURM_SUCCESS on success, or
        SLURM_ERROR on failure. -

        void jobacct_gather_p_suspend_poll(void) +

        Job Account Info

        +

        All of the following functions are not required but may be used. + +

        jobacctinfo_t *jobacctinfo_create(jobacct_id_t *jobacct_id)

        Description:
        -jobacct_gather_p_suspend_poll() is called when the process is suspended. -This causes the polling thread to halt until the process is resumed. +Creates the job account info.

        Arguments:
        -none + jobacct_id (input) the job +account id.

        Returns:
        -none +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. -

        void jobacct_gather_p_resume_poll(void) +

        void jobacctinfo_destroy(void *object)

        Description:
        -jobacct_gather_p_resume_poll() is called when the process is resumed. -This causes the polling thread to resume operation. -

        Arguments:
        -none -

        Returns:
        -none +Destroys the job account info. +

        Arguments:
        + object (input) the job that needs to be destroyed +

        Returns:
        +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. -

        int jobacct_gather_p_set_proctrack_container_id(uint64_t cont_id) +

        int jobacctinfo_setinfo(jobacctinfo_t *jobacct, enum jobacct_data_type type, void *data)

        Description:
        -jobacct_gather_p_set_proctrack_container_id() is called after the -proctrack container id is known at the start of the slurmstepd, -if using a proctrack plugin to track processes this will set the head -of the process tree in the plugin. +Set the information for the job.

        Arguments:
        -cont_id (input) procktrack container id. + jobacct (input) job account
        + type(input) enum telling the plugin how to transform the data.
        + data (input/output) Is a void * and +the actual data type depends upon the first argument to this function (type).

        Returns:
        SLURM_SUCCESS on success, or
        SLURM_ERROR on failure. -

        int jobacct_gather_p_add_task(pid_t pid, uint16_t tid) +

        int jobacctinfo_getinfo(jobacctinfo_t *jobacct, enum jobacct_data_type type, void *data)

        Description:
        -jobacct_gather_p_add_task() used to add a task to the poller. +Gets the information about the job.

        Arguments:
        - pid (input) Process id
        - tid (input) slurm global task id + jobacct (input) job account.
        +type (input) the +data type of the job account. +data

        Returns:
        SLURM_SUCCESS on success, or
        SLURM_ERROR on failure. -

        jobacctinfo_t *jobacct_gather_p_stat_task(pid_t pid) +

        void jobacctinfo_pack(jobacctinfo_t *jobacct, +uint16_t rpc_version, Buf buffer)

        Description:
        -jobacct_gather_p_stat_task() used to get most recent information about task. -You need to FREE the information returned by this function! +Packs the job account information.

        Arguments:
        - pid (input) Process id +jobacct (input) the job account.
        +rpc_version (input) the +rpc version.
        +buffer (input) the buffer.

        Returns:
        -jobacctinfo structure pointer on success, or
        -NULL on failure. +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. -

        jobacctinfo_t *jobacct_gather_p_remove_task(pid_t pid) +

        int jobacctinfo_unpack(jobacctinfo_t **jobacct, +uint16_t rpc_version, Buf buffer)

        Description:
        -jobacct_gather_p_remove_task() used to remove a task from the poller. -You need to FREE the information returned by this function! +Unpacks the job account information.

        Arguments:
        - pid (input) Process id +jobacct (input) the job account.
        +rpc_version (input) the rpc +version.
        +buffer (input) the buffer.

        Returns:
        -Pointer to removed jobacctinfo_t structure -on success, or
        -NULL on failure. +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. -

        -void jobacct_gather_p_2_sacct(sacct_t *sacct, jobacctinfo_t *jobacct) +

        void jobacctinfo_aggregate(jobacctinfo_t *dest, jobacctinfo_t *from)

        Description:
        -jobacct_gather_p_2_sacct() is called to transfer information from data structure -jobacct to structure sacct. +Aggregates the jobs.

        Arguments:
        -sacct -(input/output) initial structure to be applied to.
        -jobacct -(input) jobacctinfo_t structure containing information to apply to sacct. +dest (input) New destination of the job.
        +from (input) Original location of job.

        Returns:
        -none +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. -

        void jobacctinfo_2_stats(slurmdb_stats_t *stats, jobacctinfo_t *jobacct) +

        Description:
        +Gets the stats of the job in accounting. +

        Arguments:
        +stats (input) slurm data base stat.
        +jobacct (input) the job account. +

        Returns:
        +SLURM_SUCCESS on success, or
        +SLURM_ERROR on failure. +

        Parameters

        -

        These parameters can be used in the slurm.conf to set up type of -plugin and the frequency at which to gather information about running jobs. +

        These parameters can be used in the slurm.conf to configure the +plugin and the frequency at which to gather information about running jobs.

        JobAcctGatherType
        Specifies which plugin should be used.
        JobAcctGatherFrequency -
        Let the plugin know how long between pollings. +
        Time interval between pollings in seconds.

        Versioning

        -

        This document describes version 1 of the SLURM Job Accounting Gather API. Future +

        This document describes version 2 of the SLURM Job Accounting Gather API. Future releases of SLURM may revise this API. A job accounting gather plugin conveys its ability to implement a particular API version using the mechanism outlined -for SLURM plugins. +for SLURM plugins.

        +

        Last modified 15 April 2011

        +

        Last modified 21 June 2012

        diff --git a/doc/html/launch_plugins.shtml b/doc/html/launch_plugins.shtml new file mode 100644 index 0000000000000000000000000000000000000000..c0bd9443194c863fe138dfa5762d82f5e4403e20 --- /dev/null +++ b/doc/html/launch_plugins.shtml @@ -0,0 +1,118 @@ + + +

        Launch Plugin API

        + +

        Overview

        +

        This document describes the launch plugin that is responsible for + launching a parallel task in SLURM and the API that defines them. It + is intended as a resource to programmers wishing to write their own + launch plugin. + +

        const char +plugin_name[]="launch SLURM plugin" +

        + +

        const char +plugin_type[]="launch/slurm"
        +

        + +

      • poe—Use IBM's poe to launch tasks - used with IBM's PE + typically when using an IBM proprietary interconnect. +
      • runjob—Use IBM's runjob to launch tasks - used on + BlueGene/Q machines. +
      • slurm—Use SLURM's default launching infrastructure
        +

        The programmer is urged to study +src/plugins/launch/slurm/launch_slurm.c +for a sample implementation of a SLURM launch plugin. +

        API Functions

        + +

        int init(void) +

        Description:
        + Called when the plugin is loaded, before any other functions are + called. Put global initialization here. +

        Returns:
        + SLURM_SUCCESS on success, or
        + SLURM_ERROR on failure. + +

        int fini(void) +

        Description:
        + Called when the plugin is removed. Clear any allocated storage here. +

        Returns:
        + SLURM_SUCCESS on success, or
        + SLURM_ERROR on failure. + +

        int launch_p_setup_srun_opt(char **rest) +

        Description:
        + Sets up the srun operation. +

        Arguments:
        + rest: extra parameters on the + command line not processed by srun +

        Returns:
        + SLURM_SUCCESS on success, or
        + SLURM_ERROR on failure. + +

        int launch_p_create_job_step(srun_job_t *job, + bool use_all_cpus, void (*signal_function)(int), sig_atomic_t + *destroy_job) +

        Description:
        + Creates the job step. +

        Arguments:
        + job: the job to run.
        + use_all_cpus: choice whether to use + all cpus.
        + signal_function: function that + handles the signals coming in.
        + destroy_job: pointer to a global + flag signifying if the job was canceled while allocating. +

        Returns:
        + SLURM_SUCCESS on success, or
        + SLURM_ERROR on failure. + +

        launch_p_step_launch(srun_job_t *job, + slurm_step_io_fds_t *cio_fds, uint32_t *global_rc) +

        Description:
        + Launches the job step. +

        Arguments:
        + job: the job to launch.
        + cio_fds: filled in io descriptors
        + global_rc: srun global return code. +

        Returns:
        + SLURM_SUCCESS on success, or
        + SLURM_ERROR on failure. + +

        int launch_p_step_wait(srun_job_t *job, bool + got_alloc) +

        Description:
        + Waits for the job to be finished. +

        Arguments:
        + job: the job to wait for.
        + got_alloc: if the resource + allocation was created inside srun. +

        Returns:
        + SLURM_SUCCESS on success, or
        + SLURM_ERROR on failure. + +

        int launch_p_step_terminate(void) +

        Description:
        + Terminates the job step. +

        Returns:
        + SLURM_SUCCESS on success, or
        + SLURM_ERROR on failure. + +

        void launch_p_print_status(void) +

        Description:
        + Gets the status of the job. + +

        void launch_p_fwd_signal(int signal) +

        Description:
        + Sends a forward signal to any underlying tasks. +

        Arguments:
        + signal: the signal that needs to be sent. + +

        Last modified 28 June 2012

        + + diff --git a/doc/html/news.shtml b/doc/html/news.shtml index f757d9e956414bd798a40305162c57b88735deef..29d30d20adaf7a820a80eea12957273bd9d04663 100644 --- a/doc/html/news.shtml +++ b/doc/html/news.shtml @@ -4,87 +4,45 @@

        Index

        -

        Major Updates in SLURM Version 2.1

        -

        SLURM Version 2.1 was released in January 2010. -Major enhancements include: -

          -
        • Optimized resource allocation based upon network topology (e.g. -hierarchical switches).
        • -
        • Support for job preemption based upon job Quality of Service (QOS) in -addition to queue priority.
        • -
        • Support for time limits on individual job steps (in addition to the -job time limit).
        • -
        • Improve fault-tolerance in recognizing compute node reboots.
        • -
        • Add sinfo and squeue information about specific cores allocated.
        • -
        • Support for Solaris (OpenSolaris build 119).
        • -
        - -

        Major Updates in SLURM Version 2.2

        -

        SLURM Version 2.2 was released in December 2010. -Major enhancements include: -

          -
        • Permit resource allocations (jobs) to shrink in size.
        • -
        • Add support for job time limit range. The job's time limit will get it's -maximum time limit unless reducing it to a lower value within the range will -permit it to start earlier via backfill scheduling.
        • -
        • Add support for allocation of generic resources (e.g. GPUs).
        • -
        • Add a job submission plugin that can be use to set site-specific default -job parameters including default partition (based upon job size, etc.).
        • -
        • Add support for TotalView partitial attach (debugger attach to selected -tasks only).
        • -
        • Add support for draining partitions (job queues) with alternate partition -specification available.
        • -
        • The MySQL database has been restructured for a 50-75% performance -improvement.
        • -
        • RPCs have been modified to prevent job loss on SLURM upgrades and permit -different versions of the commands and deamons to interoperate.
        • -
        • Major enhancements made to PostGreSQL database plugin (still beta).
        • -
        • Permit SLURM commands to operate between clusters (e.g. status jobs on a -different cluster or submit a job on one cluster to run on another).
        • -
        • Major enhancements for high-throughput computing. Job throughput -rates now exceed 120,000 jobs per hour with bursts of job submissions at -several times that rate.
        • -
        - -

        Major Updates in SLURM Version 2.3

        -

        SLURM Version 2.2 was released in September 2011. -Major enhancements currently planned include: -

          -
        • Support for Cray XT and XE computers (integration with ALPS/BASIL).
        • -
        • Support for BlueGene/Q computers (partially implemented).
        • -
        • Support for multiple front-end nodes running slurmd daemons (for Cray and -BlueGene architectures, improves performance and fault tolerance).
        • -
        • Support for Linux cgroup job containers including integration with -generic resources.
        • -
        • Support for growing job allocations (support for shrinking jobs was added -in version 2.2).
        • -
        -

        Major Updates in SLURM Version 2.4

        -

        SLURM Version 2.4 release is planned for June 2012. -Major enhancements currently planned include: +

        SLURM Version 2.4 was release in June 2012. +Major enhancements include:

        • Major improvement in job throuhgput: Up to 500 jobs per second (actual -throughput depends upon configuration, hardware, etc.).
        • -
        • Support for BlueGene/Q computers (fully implemented).
        • +throughput depends upon configuration, hardware, etc.). +
        • Support for BlueGene/Q computers.
        • Resource reservations with a node count specification will select those nodes optimized for the system topology.
        • -
        • Support for SLURM commands operating over a LoadLeveler resource manager.
        • Support for job and step constraints with resource counts (e.g. a job request for two nodes with a feature of "Intel" plus four nodes with a feature of "AMD").
        • New tool sdiag reports scheduling statistics.
        • +
        • Support for SLURM commands operating over a LoadLeveler resource manager +(in branch of SLURM code, not in main release).
        • +
        + +

        Major Updates in SLURM Version 2.5

        +

        SLURM Version 2.5 is scheduled for release in November 2012. +Major enhancements planned include: +

          +
        • Recording power usage information for each job.
        • +
        • Job specification of desired CPU frequency, which will effect it's +power usage and possibly its execution cost.
        • +
        • Integration with FlexLM license management.
        • +
        • Integration with IBM's +Parallel Environment +including POE (Parallel Operating Environment) and NRT (Network Resource Table) API.
        • +
        • Highly optimized thoughput for serial jobs in a new "select/serial" +plugin.
        -

        Major Updates in SLURM Version 2.5 and beyond

        +

        Major Updates in SLURM Version 2.6 and beyond

        Detailed plans for release dates and contents of additional SLURM releases have not been finalized. Anyone desiring to perform SLURM development should notify slurm-dev@schedmd.com @@ -93,7 +51,6 @@ to coordinate activities. Future development plans includes:

      • Faster and more powerful job step management support (e.g. step dependencies).
      • Improved user support for fault-tolerance (e.g. "hot spare" resources).
      • -
      • Integration with FlexLM license management.
      • Numerous enhancements to advanced resource reservations (e.g. start or end the reservation early depending upon the workload).
      • Add Kerberos credential support including credential forwarding @@ -126,6 +83,6 @@ trojan library, then that library will be used by the SLURM daemon with unpredictable results. This was fixed in SLURM version 2.1.14.
      -

      Last modified 10 May 2012

      +

      Last modified 6 July 2012

      diff --git a/doc/html/poe.shtml b/doc/html/poe.shtml new file mode 100644 index 0000000000000000000000000000000000000000..c232eeaffd1130a6f81c68ae74a392193aeed7c7 --- /dev/null +++ b/doc/html/poe.shtml @@ -0,0 +1,223 @@ + + +

      IBM Parallel Environment User and Administrator Guide

      + +

      Overview

      + +

      This document describes the unique features of SLURM on the +IBM computers with the +Parallel Environment (PE) +software. You should be familiar with the SLURM's mode of operation on Linux +clusters before studying the relatively few differences in operation on systems +with PE, which are described in this document.

      + +

      User Tools

      + +

      The normal set of SLURM user tools: srun, scancel, sinfo, smap, squeue and +scontrol provide all of the expected services. Job steps are launched using the +srun command, which translates its options and invokes IBM's poe command. The +poe command actually launches the tasks. The poe command may also be invoked +directly if desired. The actual task launch process is as follows:

      +
        +
      1. Invoke srun command with desired options.
      2. +
      3. The srun command creates a job allocation (if necessary).
      4. +
      5. The srun command translates its options and invokes the poe command.
      6. +
      7. The poe command loads a SLURM library that provides various resource +management functionality.
      8. +
      9. The poe command, through the SLURM library, launches a process named +"pmdv12" on the appropriate compute nodes. Note that the "v12" on the end of +the process name represents the version number of the "pmd" process and is +subject to change.
      10. +
      11. The poe command interacts with the pmdv12 process to launch the application +tasks, handle their I/O, etc. Since the task launch procedure occurs outside of +SLURM's control, none of the normal task-level SLURM support is available.
      12. +
      13. The poe command, through the SLURM library, notes the completion of the +job step.
      14. +
      + +

      Network Options

      +

      Each job step can specify it's desired network options. +For example, one job step may use IP mode communications and the next use +User Space (US) mode communications. +Network specifications may be specified using srun's --network option or the +SLURM_NETWORK environment variable. Supported network options include:

      +
        +
      • Network protocol
      • +
          +
        • ip Internet protocol, version 4
        • +
        • ipv4 Internet protocol, version 4 (default)
        • +
        • ipv6 Internet protocol, version 6
        • +
        • us User Space protocol, may be combined with ibv4 or ipv6
        • +
        +
      • Programming interface
      • +
          +
        • lapi Low-level Application Programming Interface
        • +
        • mpi Message Passing Interface (default)
        • +
        • pami Parallel Active Message Interface
        • +
        • upc Unified Parallel C Interface
        • +
        +
      • Other options
      • +
          +
        • bulk_xfer [=resources] + Enable bulk transfer of data using Remote Direct-Memory Access (RDMA). + The optional resources specification is a numeric value which can have + a suffix of "k", "K", "m", "M", "g" or "G" for kilobytes, megabytes or + gigabytes. + NOTE: The resources specification is not supported by the + underlying IBM infrastructure as of Parallel Environment version 2.2 and no + value should be specified at this time.
        • +
        • cau=count + Specify the count of Collective Acceleration Units (CAU) required per + programming interface. + Default value is zero. + Applies only to IBM Power7-IH processors. +
        • devname=name + Specify the name of an network adapter to use. + For example: "eth0" or "mlx4_0".
        • +
        • devtype=type + Specify the device type to use for communications. + The supported values of type are: + "IB" (InfiniBand), "HFI" (P7 Host Fabric Interface), + "IPONLY" (IP-Only interfaces), "HPCE" (HPC Ethernet), and + "KMUX" (Kernel Emulation of HPCE). + The devices allocated to a job must all be of the same type. + The default value depends upon depends upon what hardware is available and in + order of preferences is IPONLY (which is not considered in User Space mode), + HFI, IB, HPCE, and KMUX.
        • +
        • immed=count + Specify the count of immediate send slots per adapter window. + Default value is zero. + Applies only to IBM Power7-IH processors. +
        • instances=count + Specify number of network connections for each task on each network connection. + The default instance count is 1.
        • +
        • sn_all Use all available switch adapters (default). + This option can not be combined with sn_single.
        • +
        • sn_single Use only one switch adapters. + This option can not be combined withsn_all. + If multiple adapters of different types exist, the devname and/or + devtype option can also be used to select one of them.
        • +
        +
      + +

      Examples of network option use: +

      +--network=sn_all,mpi
      +Allocate one switch window per task on each node and every network supporting +MPI. +

      +--network=sn_all,mpi,bulk_xfer=100m,us
      +Allocate one switch window per task on each node and every network supporting +MPI and user space communications. Reserve 100 MB for RDMA. +

      +--network=sn_all,instances=3,mpi
      +Allocate three switch window per task on each node and every network supporting +MPI. +

      +--network=sn_all,mpi,pami
      +Allocate one switch window per task on each node and every network supporting +MPI and a second window supporting PAMI. +

      +--network=devtype=ib,instances=2,lapi,mpi
      +On every Infiniband network connection, allocate two switch windows each for +both lapi and mpi interfaces. If each node has one Infinband network connection, +this would result in four switch windows per task. +

      + +

      Debugging

      + +

      Most debuggers require detailed information about launched tasks such as +host name, process ID, etc. Since that information is only available from +poe (which launches those tasks), the srun command wrapper can not be used +for most debugging purposes. You or the debugging tool must invoke the poe +command directly. In order to facilitate use of poe, srun's +
      FIXME: We need to add this functionality +option may be used with the options +normally used in order to generate the equivalent poe command line, which +can subsequently be used with the debugger.

      + +

      Checkpoint

      + +

      FIXME: We need to validate all of this +SLURM supports checkpoint via poe. +In order to enable checkpoint, the shell executing the poe command must +itself be initiated with the environment variable CHECKPOINT=yes. +One file is written for each node on which the job is executing, plus +another for the script executing poe.a +By default, the checkpoint files will be written to the current working +directory of the job. +Names and locations of these files can be controlled using the +environment variables MP_CKPTFILE and MP_CKPTDIR. +Use the squeue command to identify the job and job step of interest. +To initiate a checkpoint in which the job step will continue execution, +use the command:
      +scontrol check create job_id.step_id
      +To initiate a checkpoint in which the job step will terminate afterwards, +use the command:
      +scontrol check vacate job_id.step_id

      + +

      Unsupported Options

      + +

      Some SLURM options can not be supported by PE and the following srun options +are silently ignored:

      +
        +
      • -K, --kill-on-bad-exit (terminate step if any task has a non-zero exit code)
      • +
      • -k, --no-kill (set to not kill job upon node failure)
      • +
      • --ntasks-per-core (number of tasks to invoke per code)
      • +
      • --ntasks-per-socket (number of tasks to invoke per socket)
      • +
      • -O, --overcommit (over subscribe resources)
      • +
      • --resv-ports (communication ports reserved for OpenMPI)
      • +
      • --runjob-opts (used only on IBM BlueGene/Q systems)
      • +
      • --signal (signal to send when near time limit and the remaining time required)
      • +
      • --sockets-per-node (number of sockets per node required)
      • +
      • -u, --unbuffered (avoid line buffering)
      • +
      • -W, --wait (specify job swait time after first task exit)
      • +
      • -Z, --no-allocate (launch tasks without creating job allocation>
      • +
      + +

      System Administration

      + +

      There are two critical SLURM configuration parameters for use with PE. +These configuration parameters should be set in your slurm.conf file. +SwitchType defines the mechanism used to manage the network switch and +it must be set to switch/nrt and use IBM's Network Resource Table (NRT) +interface. In order for the switch/nrt plugin to be built, the NRT header file +and library must be found at the time the SLURM is built. SLURM searches for +the nrt.h file in the /usr/include directory by default. If the file is not +installed there, you can specify a different location using the +--with-nrth=PATH option to the configure program, where "PATH" is the +fully qualified pathname of the parent directory of the nrt.h file. +SLURM searches for the libnrt.so file in the /usr/lib and /usr/lib64 directories +by default. If the file is not installed there, you can specify a different +location using the --with-nrtlib=PATH option to the configure program, +where "PATH" is the fully qualified pathname of the parent directory of the +libnrt.so file. +Alternately these values may be specified in your ~/.rpmmacros file. +For example:

      +
      +%_with_nrth      "/opt/ibmhpc/pecurrent/base/include"
      +%_with_libnrt    "/opt/ibmhpc/pecurrent/base/intel/lib64"
      +
      + +

      The poe command interacts with SLURM by loading a SLURM library providing +a variety of functions for its use. You must specify the location of that +library and note that SLURM is the resource manager in the file named +"/etc/poe.limits". +The library name is "libpermapi.so" and it is in installed with the other SLURM +libraries in the subdirectory "lib/slurm". A sample "/etc/poe.limits" file is +shown below. You will need to modify the value of MP_PE_RMLIB to match SLURM's +installation location on your system. +

      +#
      +# Sample /etc/poe.limits
      +# Modify the path below as appropriate
      +#
      +MP_PE_RMLIB=/usr/local/lib/slurm/libpermapi.so
      +MP_POOL=slurm
      +
      + + + +

      Last modified 16 July 2012

      + + diff --git a/doc/html/reservations.shtml b/doc/html/reservations.shtml index 07ddaf94cb4a343a1009c7d704530571480cffb5..ea8af85b2b057be459d17abaacdec609fd9e8ff7 100644 --- a/doc/html/reservations.shtml +++ b/doc/html/reservations.shtml @@ -75,7 +75,7 @@ license from being scheduled on this cluster during this reservation.

       $ scontrol create reservation starttime=2009-04-06T16:00:00 \
          duration=120 user=root flags=ignore_jobs \
      -   licenses=lustre*1000
      +   licenses=lustre:1000
       Reservation created: root_4
       
       $ scontrol show reservation
      @@ -168,11 +168,11 @@ licenses field to require one "cpu" for each physical CPU required to satisfy
       the request.

       $ scontrol show configuration | grep Licenses
      -Licenses  = cpu*64
      +Licenses  = cpu:64
       
       $ scontrol create reservation starttime=2009-04-06T16:00:00 \
      -   duration=120 user=bob flags=ignore_jobs \
      -   licenses=cpu*32
      +   duration=120 user=bob flags=license_only \
      +   licenses=cpu:32
       Reservation created: bob_5
       
      @@ -301,7 +301,7 @@ before a reservation given fewer jobs to time-slice with.
    • nodes be reserved (work around described above). -

      Last modified 31 January 2012

      +

      Last modified 23 May 2012

      diff --git a/doc/html/selectplugins.shtml b/doc/html/selectplugins.shtml index aec9d76a596ec3cd86d0aa6a15aa45a8bc19daf6..9f3d66b0459b4c6f0a651b8b81b30c8f60ce8500 100644 --- a/doc/html/selectplugins.shtml +++ b/doc/html/selectplugins.shtml @@ -61,7 +61,7 @@ if (select_p_job_test(all available nodes) != SLURM_SUCCESS) { /* leave the job queued for later execution */ else { while (!select_p_job_ready()) - wait + wait /* execute the job */ /* wait for job to end or be terminated */ select_p_job_fini() @@ -226,13 +226,9 @@ to the updated job.

      Returns: SLURM_SUCCESS if successful. On failure, the plugin should return SLURM_ERROR.

      -

      int select_p_select_nodeinfo_set_all(time_t last_query_time);

      +

      int select_p_select_nodeinfo_set_all(void);

      Description: Update select plugin specific information about every node as needed.

      -

      Argument: - last_query_time    (input) Time -of previous node state query. Only update the information if data has changed -since this time.

      Returns: SLURM_SUCCESS if successful. On failure, the plugin should return SLURM_ERROR.

      @@ -441,7 +437,7 @@ to the select plugin specific information about a job.
      Call xfree() to release the memory allocated for the return value.

      int select_p_job_test (struct job_record *job_ptr, -bitstr_t *bitmap, int min_nodes, int max_nodes, int req_nodes, int mode, +bitstr_t *bitmap, uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, uint32_t mode, List preemption_candidates, List *preempted_jobs);

      Description: Given a job's scheduling requirement specification and a set of nodes which might be used to satisfy the request, identify @@ -640,6 +636,15 @@ Pointer to the step which has completed execution.

      Returns: SLURM_SUCCESS if successful. On failure, the plugin should return SLURM_ERROR.

      +

      int select_p_fail_cnode(struct step_record *step_ptr);

      +

      Description: This function fails + certain cnodes in a blocks midplane.

      +

      Arguments:
      +step_ptr    (input) +information on the step that has failed cnodes.

      +

      Returns: SLURM_SUCCESS if successful. On failure, +the plugin should return SLURM_ERROR.

      + @@ -664,7 +669,7 @@ be used for an advanced reservation.

      Get Information Functions

      -

      int select_p_get_info_from_plugin(enum select_data_info info, +

      int select_p_get_info_from_plugin(enum select_plugindata_info dinfo, struct job_record *job_ptr, void *data);

      Description: Get plugin-specific information about a job.

      @@ -742,6 +747,6 @@ to maintain data format compatibility across different versions of the plugin.top

      -

      Last modified 3 August 2011

      +

      Last modified 12 June 2012

      diff --git a/doc/html/slurm.shtml b/doc/html/slurm.shtml index 559432ee5e8b7d588904d62f50f277ba897a227f..1b1afed8147c160b6df5bb866e3403d56df37501 100644 --- a/doc/html/slurm.shtml +++ b/doc/html/slurm.shtml @@ -32,9 +32,8 @@ or supporting sophisticated respects:
      • It is designed to operate in a heterogeneous cluster with up to millions of -processors (2.1 million sockets scheduled on an emulated IBM BlueGene/Q system).
      • -
      • It can sustain a throughput rate of over 120,000 jobs per hour with -bursts of job submissions at several times that rate.
      • +processors. +
      • It can accept 1,000 job submissions per second and fully execute 500 simple jobs per second (the rate is dependent upon hardware and system configuration).
      • Its source code is freely available under the GNU General Public License.
      • It is portable; written in C with a GNU autoconf configuration engine. @@ -50,6 +49,10 @@ for the motivated end user to understand the source and add functionality.
      • SLURM provides resource management on many of the most powerful computers in the world including:

          +
        • Sequoia +at Lawrence Livermore National Laboratory. +A 20-petaflop IBM BlueGene/Q system with 98,304 compute nodes and 1.6 million +cores.
        • Tianhe-1A designed by The National University of Defence Technology (NUDT) @@ -81,9 +84,6 @@ named after Monte Rosa in the Swiss-Italian Alps, elevation 4,634m. 3,688 AMD hexa-core Opteron @ 2.4 GHz, 28.8 TB DDR2 RAM, 290 TB Disk, 9.6 GB/s interconnect bandwidth (Seastar).
        • -
        • EKA at Computational Research Laboratories, -India with 14,240 Xeon processors and Infiniband interconnect
        • -
        • MareNostrum a Linux cluster at the Barcelona Supercomputer Center with 10,240 PowerPC processors and a Myrinet switch
        • @@ -95,6 +95,6 @@ for molecular dynamics simulation using 512 custom-designed ASICs and a three-dimensional torus interconnect.
        -

        Last modified 26 November 2011

        +

        Last modified 17 May 2012

        diff --git a/doc/html/switchplugins.shtml b/doc/html/switchplugins.shtml index 00a0a5d774a408f3e85910f47fd694f524c68932..eaa72f383d4d0083788d2e8619a8a1ef8c43e171 100644 --- a/doc/html/switchplugins.shtml +++ b/doc/html/switchplugins.shtml @@ -5,7 +5,7 @@

        Overview

        This document describes SLURM switch (interconnect) plugins and the API that defines them. It is intended as a resource to programmers wishing to write their own SLURM -switch plugins. This is version 0 of the API. +switch plugins. This is version 100 of the API. Note that many of the API functions are used only by one of the daemons. For example the slurmctld daemon builds a job step's switch credential (switch_p_build_jobinfo) while the @@ -22,9 +22,7 @@ abbreviation for the type of switch. We recommend, for example:

        • none—A plugin that implements the API without providing any actual switch service. This is the case for Ethernet and Myrinet interconnects.
        • -
        • elanQuadrics Elan3 or Elan4 -interconnect.
        • -
        • federation—IBM Federation interconnects (presently under development).
        • +
        • nrt—IBM Network Resource Table (presently under development).

        The plugin_name and plugin_version @@ -203,7 +201,7 @@ the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.

        int switch_p_build_jobinfo (switch_jobinfo_t switch_job, -char *nodelist, int *tasks_per_node, int cyclic_alloc, char *network);

        +char *nodelist, uint16_t *tasks_per_node, uint32_t **tids, char *network);

        Description: Build a job's switch credential. It is recommended that the credential's magic number be validated.

        Arguments:
        @@ -212,12 +210,11 @@ switch credential to be updated
        nodelist    (input) List of nodes allocated to the job. This may contain expressions to specify node ranges (e.g. "linux[1-20]" or "linux[2,4,6,8]").
        -tasks_per_node    (input) List +tasks_per_node    (input) count of processes per node to be initiated as part of the job.
        -cyclic_alloc    (input) Non-zero -if job's processes are to be allocated across nodes in a cyclic fashion (task 0 on node 0, -task 1 on node 1, etc). If zero, processes are allocated sequentially on a node before -moving to the next node (tasks 0 and 1 on node 0, tasks 2 and 3 on node 1, etc.).
        +tids    (input) List of task +IDs to be initiated. The first array index is the node ID. The second array +index ranges from 0 to tasks_per_node of that node ID minus 1.
        network    (input) Job's network specification from srun command.

        Returns: SLURM_SUCCESS if successful. On failure, @@ -513,6 +510,6 @@ plugin that transmitted it. It is at the discretion of the plugin author whether to maintain data format compatibility across different versions of the plugin.

        -

        Last modified 5 September 2008

        +

        Last modified 25 April 2012

        diff --git a/doc/html/team.shtml b/doc/html/team.shtml index c430beed0ecc9d79a0c3d6a9f29e9cce81a330b9..8ed569027e4245f6264777ea1ded1dadd947dda2 100644 --- a/doc/html/team.shtml +++ b/doc/html/team.shtml @@ -28,14 +28,15 @@ organizations. Lead SLURM developers are:
      • Daniel Christians (HP)
      • Gilles Civario (Bull)
      • Chuck Clouston (Bull)
      • -
      • Phil Eckert (Lawrence Livermore National Laboratory)
      • Yuri D'Elia (Center for Biomedicine, EURAC Research, Italy)
      • -
      • Carles Fenoy (Barcelona Supercomputer Center, Spain)
      • Joseph Donaghy (Lawrence Livermore National Laboratory)
      • Chris Dunlap (Lawrence Livermore National Laboratory)
      • +
      • Phil Eckert (Lawrence Livermore National Laboratory)
      • Joey Ekstrom (Lawrence Livermore National Laboratory/Bringham Young University)
      • Josh England (TGS Management Corporation)
      • Kent Engström (National Supercomputer Centre, Sweden)
      • +
      • Carles Fenoy (Barcelona Supercomputer Center, Spain)
      • +
      • Damien François (Université catholique de Louvain, Belgium)
      • Jim Garlick (Lawrence Livermore National Laboratory)
      • Didier Gazen (Laboratoire d'Aerologie, France)
      • Raphael Geissert (Debian)
      • @@ -101,14 +102,15 @@ organizations. Lead SLURM developers are:
      • Adam Todorski (Rensselaer Polytechnic Institute)
      • Stephen Trofinoff (Swiss National Supercomputing Centre)
      • Nathan Weeks (Iowa State University)
      • +
      • Andy Wettstein (University of Chicago)
      • Tim Wickberg (Rensselaer Polytechnic Institute)
      • Ramiro Brito Willmersdorf (Universidade Federal de Pemambuco, Brazil)
      • Jay Windley (Linux NetworX)
      • Anne-Marie Wunderlin (Bull)
      • Nathan Yee (SchedMD)
      • -
      • Damien François (UCL)
      • +
      -

      Last modified 14 May 2012

      +

      Last modified 30 May 2012

      diff --git a/doc/man/Makefile.in b/doc/man/Makefile.in index fe96aa8e6ef9c0e41b25a35a173f358d6ec4f9a8..7cb1bfe96ea869ada0ca6b295cb9fba5593b0e71 100644 --- a/doc/man/Makefile.in +++ b/doc/man/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -164,9 +163,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -174,9 +171,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -208,6 +204,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -235,6 +233,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -574,10 +573,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/doc/man/man1/Makefile.in b/doc/man/man1/Makefile.in index a3ab2717a225d050e077419fe06da138fee27298..11b1f5d6ea05e444d7d9620af83a9eff80685986 100644 --- a/doc/man/man1/Makefile.in +++ b/doc/man/man1/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -106,6 +105,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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; }; \ + } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(htmldir)" NROFF = nroff @@ -152,9 +157,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -162,9 +165,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -196,6 +198,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -223,6 +227,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -432,9 +437,7 @@ uninstall-man1: files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-htmlDATA: $(html_DATA) @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" @@ -452,9 +455,7 @@ uninstall-htmlDATA: @$(NORMAL_UNINSTALL) @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(htmldir)" && rm -f $$files + dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: @@ -522,10 +523,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) diff --git a/doc/man/man1/sacct.1 b/doc/man/man1/sacct.1 index 3a2dc0bead9255f6b97c099652ec9556c07bb518..3b0609bbe1cf0630c5a203182dad9589e904ae30 100644 --- a/doc/man/man1/sacct.1 +++ b/doc/man/man1/sacct.1 @@ -792,7 +792,7 @@ this value is the number of non\-leap seconds since the Epoch (00:00:00 UTC, January 1, 1970) .TP 5 -\f3uid.gid\fP +blockid (if job ran on a BlueGene cluster) .TP 6 (Reserved) @@ -850,7 +850,7 @@ this value is the number of non\-leap seconds since the Epoch (00:00:00 UTC, January 1, 1970) .TP 5 -\f3uid.gid\fP +blockid (if job ran on a BlueGene cluster) .TP 6 (Reserved) @@ -1000,7 +1000,7 @@ this value is the number of non\-leap seconds since the Epoch (00:00:00 UTC, January 1, 1970) .TP 5 -\f3uid.gid\fP +blockid (if job ran on a BlueGene cluster) .TP 6 (Reserved) diff --git a/doc/man/man1/salloc.1 b/doc/man/man1/salloc.1 index ab9884990919bebb7c36b1fd47989b759af223e6..97e07596938a75a99625673d4f86e89a6f62dcc8 100644 --- a/doc/man/man1/salloc.1 +++ b/doc/man/man1/salloc.1 @@ -1,4 +1,4 @@ -.TH "salloc" "1" "SLURM 2.4" "October 2011" "SLURM Commands" +.TH "salloc" "1" "SLURM 2.5" "June 2012" "SLURM Commands" .SH "NAME" salloc \- Obtain a SLURM job allocation (a set of nodes), execute a command, @@ -21,8 +21,8 @@ section). If no command is specified, then the value of \fBSallocDefaultCommand\fR is not set, then \fBsalloc\fR runs the user's default shell. -The following document describes the the influence of various options on the -allocation of cpus to jobs and tasks. +The following document describes the the influence of various options on the +allocation of cpus to jobs and tasks. .br http://www.schedmd.com/slurmdocs/cpu_management.html @@ -141,7 +141,7 @@ Users can specify which of these \fBfeatures\fR are required by their job 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, exclusive OR, +Multiple constraints may be specified with AND, OR, exclusive OR, resource counts, etc. Supported \fbconstraint\fR options include: .PD 1 @@ -180,7 +180,7 @@ Specific counts of multiple resources may be specified by using the AND operator and enclosing the options within square brackets. For example: "\fB\-\-constraint=[rack1*2&rack2*4]"\fR might be used to specify that two nodes must be allocated from nodes with the feature -of "rack1" and four nodes must be allocated from nodes with the feature +of "rack1" and four nodes must be allocated from nodes with the feature "rack2". .RE @@ -209,9 +209,9 @@ the SLURM_CPU_BIND environment variable value to "verbose". The following informational environment variables are set when \fB\-\-cpu_bind\fR is in use: .nf - SLURM_CPU_BIND_VERBOSE - SLURM_CPU_BIND_TYPE - SLURM_CPU_BIND_LIST + SLURM_CPU_BIND_VERBOSE + SLURM_CPU_BIND_TYPE + SLURM_CPU_BIND_LIST .fi See the \fBENVIRONMENT VARIABLE\fR section for a more detailed description @@ -453,7 +453,10 @@ time period specified. If no argument is given, resources must be available immediately for the request to succeed. By default, \fB\-\-immediate\fR is off, and the command -will block until resources become available. +will block until resources become available. Since this option's +argument is optional, for proper parsing the single letter option must +be followed immediately with the value and not include a space between +them. For example "\-I60" and not "\-I 60". .TP \fB\-J\fR, \fB\-\-job\-name\fR=<\fIjobname\fR> @@ -476,8 +479,11 @@ allocation has been revoked. The job allocation can be revoked for a couple of reasons: someone used \fBscancel\fR to revoke the allocation, or the allocation reached its time limit. If you do not specify a signal name or number and SLURM is configured to signal the spawned command at job -termination, the default signal is SIGHUP for interactive and SIGTERM for -non\-interactive sessions. +termination, the default signal is SIGHUP for interactive and SIGTERM for +non\-interactive sessions. Since this option's argument is optional, +for proper parsing the single letter option must be followed +immediately with the value and not include a space between them. For +example "\-K1" and not "\-K 1". .TP \fB\-k\fR, \fB\-\-no\-kill\fR @@ -495,10 +501,10 @@ range of allocated nodes. \fB\-L\fR, \fB\-\-licenses\fR=<\fBlicense\fR> Specification of licenses (or other resources available on all nodes of the cluster) which must be allocated to this job. -License names can be followed by an asterisk and count +License names can be followed by a colon and count (the default count is one). Multiple license names should be comma separated (e.g. -"\-\-licenses=foo*4,bar"). +"\-\-licenses=foo:4,bar"). .TP \fB\-m\fR, \fB\-\-distribution\fR= @@ -567,8 +573,13 @@ Inside the hostfile must contain at minimum the number of hosts requested and be one per line or comma separated. If specifying a task count (\fB\-n\fR, \fB\-\-ntasks\fR=<\fInumber\fR>), your tasks will be laid out on the nodes in the order of the file. -.TP +.br +\fBNOTE:\fR The arbitrary distribution option on a job allocation only +controls the nodes to be allocated to the job and not the allocation of +CPUs on those nodes. This option is meant primarily to control a job step's +task layout in an existing job allocation for the srun command. +.TP Second distribution method: .TP .B block @@ -603,6 +614,10 @@ This parameter would generally be used if whole nodes are allocated to jobs (\fBSelectType=select/linear\fR). Also see \fB\-\-mem\-per\-cpu\fR. \fB\-\-mem\fR and \fB\-\-mem\-per\-cpu\fR are mutually exclusive. +NOTE: Enforcement of memory limits currently requires enabling of +accounting, which samples memory use on a periodic basis (data need +not be stored, just collected). A task may exceed the memory limit +until the next periodic accounting sample. .TP \fB\-\-mem\-per\-cpu\fR=<\fIMB\fR> @@ -613,7 +628,7 @@ seen using the \fBscontrol show config\fR command. Note that if the job's \fB\-\-mem\-per\-cpu\fR value exceeds the configured \fBMaxMemPerCPU\fR, then the user's limit will be treated as a memory limit per task; \fB\-\-mem\-per\-cpu\fR will be reduced to a value no larger than -\fBMaxMemPerCPU\fR; \fB\-\-cpus\-per\-task\fR will be set and value of +\fBMaxMemPerCPU\fR; \fB\-\-cpus\-per\-task\fR will be set and value of \fB\-\-cpus\-per\-task\fR multiplied by the new \fB\-\-mem\-per\-cpu\fR value will equal the original \fB\-\-mem\-per\-cpu\fR value specified by the user. @@ -644,9 +659,9 @@ The following informational environment variables are set when \fB\-\-mem_bind\fR is in use: .nf - SLURM_MEM_BIND_VERBOSE - SLURM_MEM_BIND_TYPE - SLURM_MEM_BIND_LIST + SLURM_MEM_BIND_VERBOSE + SLURM_MEM_BIND_TYPE + SLURM_MEM_BIND_LIST .fi See the \fBENVIRONMENT VARIABLES\fR section for a more detailed description @@ -729,18 +744,105 @@ that the \fB\-\-cpus\-per\-task\fR option will change this default. .TP \fB\-\-network\fR=<\fItype\fR> Specify the communication protocol to be used. -This option is supported on AIX systems. -Since POE is used to launch tasks, this option is not normally used or -is specified using the \fBSLURM_NETWORK\fR environment variable. The interpretation of \fItype\fR is system dependent. -For systems with an IBM Federation switch, the following -comma\-separated and case insensitive types are recognized: -\fBIP\fR (the default is user\-space), \fBSN_ALL\fR, \fBSN_SINGLE\fR, -\fBBULK_XFER\fR and adapter names (e.g. \fBSNI0\fR and \fBSNI1\fR). -For more information, on IBM systems see \fIpoe\fR documentation on -the environment variables \fBMP_EUIDEVICE\fR and \fBMP_USE_BULK_XFER\fR. -Note that only four jobs steps may be active at once on a node with the -\fBBULK_XFER\fR option due to limitations in the Federation switch driver. +This option is current supported on systems with IBM's Parallel Environment (PE). +See IBM's LoadLeveler job command keyword documentation about the keyword +"network" for more information. +Multiple values may be specified in a comma separated list. +All options are case in\-sensitive. +Supported values include: +.RS +.TP 12 +\fBBULK_XFER\fR[=<\fIresources\fR>] +Enable bulk transfer of data using Remote Direct-Memory Access (RDMA). +The optional \fIresources\fR specification is a numeric value which can have +a suffix of "k", "K", "m", "M", "g" or "G" for kilobytes, megabytes or +gigabytes. +NOTE: The \fIresources\fR specification is not supported by the underlying +IBM infrastructure as of Parallel Environment version 2.2 and no value should +be specified at this time. +.TP +\fBCAU\fR=<\fIcount\fR> +Number of Collecitve Accelleration Units (CAU) required. +Applies only to IBM Power7-IH processors. +Default value is zero. +Independent CAU will be allocated for each programming interface (MPI, LAPI, etc.) +.TP +\fBDEVNAME\fR=<\fIname\fR> +Specify the device name to use for communications (e.g. "eth0" or "mlx4_0"). +.TP +\fBDEVTYPE\fR=<\fItype\fR> +Specify the device type to use for communications. +The supported values of \fItype\fR are: +"IB" (InfiniBand), "HFI" (P7 Host Fabric Interface), +"IPONLY" (IP-Only interfaces), "HPCE" (HPC Ethernet), and +"KMUX" (Kernel Emulation of HPCE). +The devices allocated to a job must all be of the same type. +The default value depends upon depends upon what hardware is available and in +order of preferences is IPONLY (which is not considered in User Space mode), +HFI, IB, HPCE, and KMUX. +.TP +\fBIMMED\fR =<\fIcount\fR> +Number of immediate send slots per window required. +Applies only to IBM Power7-IH processors. +Default value is zero. +.TP +\fBINSTANCES\fR =<\fIcount\fR> +Specify number of network connections for each task on each network connection. +The default instance count is 1. +.TP +\fBIPV4\fR +Use Internet Protocol (IP) version 4 communications (default). +.TP +\fBIPV6\fR +Use Internet Protocol (IP) version 6 communications. +.TP +\fBLAPI\fR +Use the LAPI programming interface. +.TP +\fBMPI\fR +Use the MPI programming interface. +MPI is the default interface. +.TP +\fBPAMI\fR +Use the PAMI programming interface. +.TP +\fBSN_ALL\fR +Use all available switch networks (default). +.TP +\fBSN_SINGLE\fR +Use one available switch network. +.TP +\fBUPC\fR +Use the UPC programming interface. +.TP +\fBUS\fR +Use User Space communications. +.TP + +Some examples of network specifications: +.TP +\fBInstances=2,US,MPI,SN_ALL\fR +Create two user space connections for MPI communications on every switch +network for each task. +.TP +\fBUS,MPI,Instances=3,Devtype=IB\fR +Create three user space connections for MPI communications on every InfiniBand +network for each task. +.TP +\fBIPV4,LAPI,SN_Single\fR +Create a IP version 4 connection for LAPI communications on one switch network +for each task. +.TP +\fBInstances=2,US,LAPI,MPI\fR +Create two user space connections each for LAPI and MPI communcations on every +switch network for each task. Note that SN_ALL is the default option so every +switch network is used. Also note that Instances=2 specifies that two +connections are established for each protocol (LAPI and MPI) and each task. +If there are two networks and four tasks on the node then a total +of 32 connections are estabhished (2 instances x 2 protocols x 2 networks x +4 tasks). +.RE .TP \fB\-\-nice\fR[=\fIadjustment\fR] @@ -808,7 +910,7 @@ other jobs cannot use them for some period of time. (Note that the SLURM job is subject to the normal constraints on jobs, including time limits, so that eventually the job will terminate and the resources will be freed, or you can terminate the job manually using the -\fBscancel\fR command.) +\fBscancel\fR command.) .TP \fB\-O\fR, \fB\-\-overcommit\fR @@ -876,7 +978,7 @@ When a tree topology is used, this defines the maximum count of switches desired for the job allocation and optionally the maximum time to wait for that number of switches. If SLURM finds an allocation containing more switches than the count specified, the job remains pending until it either finds -an allocation with desired switch count or the time limit expires. +an allocation with desired switch count or the time limit expires. It there is no switch count limit, there is no delay in starting the job. Acceptable time formats include "minutes", "minutes:seconds", "hours:minutes:seconds", "days\-hours", "days\-hours:minutes" and @@ -891,8 +993,8 @@ The default max\-time is the max_switch_wait SchedulerParameter. Set a limit on the total run time of the job allocation. If the requested time limit exceeds the partition's time limit, the job will be left in a PENDING state (possibly indefinitely). The default time -limit is the partition's time limit. When the time limit is reached, -the each task in each job step is sent SIGTERM followed by SIGKILL. The +limit is the partition's default time limit. When the time limit is reached, +each task in each job step is sent SIGTERM followed by SIGKILL. The interval between signals is specified by the SLURM configuration parameter \fBKillWait\fR. A time limit of zero requests that no time limit be imposed. Acceptable time formats include "minutes", @@ -910,12 +1012,12 @@ above when task/affinity plugin is enabled. Set a minimum time limit on the job allocation. If specified, the job may have it's \fB\-\-time\fR limit lowered to a value no lower than \fB\-\-time\-min\fR if doing so permits the job to begin -execution earlier than otherwise possible. +execution earlier than otherwise possible. The job's time limit will not be changed after the job is allocated resources. -This is performed by a backfill scheduling algorithm to allocate resources +This is performed by a backfill scheduling algorithm to allocate resources otherwise reserved for higher priority jobs. -Acceptable time formats include "minutes", "minutes:seconds", -"hours:minutes:seconds", "days\-hours", "days\-hours:minutes" and +Acceptable time formats include "minutes", "minutes:seconds", +"hours:minutes:seconds", "days\-hours", "days\-hours:minutes" and "days\-hours:minutes:seconds". .TP diff --git a/doc/man/man1/sbatch.1 b/doc/man/man1/sbatch.1 index 16d7e13ba8cef03a5fa21342a148bbb1133c966a..9fe80edfa72110455d2c3ef750d7c5520ee6ed0e 100644 --- a/doc/man/man1/sbatch.1 +++ b/doc/man/man1/sbatch.1 @@ -1,4 +1,4 @@ -.TH "sbatch" "1" "SLURM 2.4" "October 2011" "SLURM Commands" +.TH "sbatch" "1" "SLURM 2.5" "June 2012" "SLURM Commands" .SH "NAME" sbatch \- Submit a batch script to SLURM. @@ -495,6 +495,7 @@ The batch script will only be submitted to the controller if the resources necessary to grant its job allocation are immediately available. If the job allocation will have to wait in a queue of pending jobs, the batch script will not be submitted. +NOTE: There is limitted support for this option with batch jobs. .TP \fB\-i\fR, \fB\-\-input\fR=<\fIfilename pattern\fR> @@ -510,12 +511,11 @@ The filename pattern may contain one or more replacement symbols, which are a percent sign "%" followed by a letter (e.g. %j). Supported replacement symbols are: -.PD 0 -.RS 10 +.PD +.RS .TP \fB%j\fR Job allocation number. -.PD 0 .TP \fB%N\fR Node name. Only one file is created, so %N will be replaced by the name of the @@ -550,10 +550,10 @@ range of allocated nodes. \fB\-L\fR, \fB\-\-licenses\fR=<\fBlicense\fR> Specification of licenses (or other resources available on all nodes of the cluster) which must be allocated to this job. -License names can be followed by an asterisk and count +License names can be followed by a colon and count (the default count is one). Multiple license names should be comma separated (e.g. -"\-\-licenses=foo*4,bar"). +"\-\-licenses=foo:4,bar"). .TP \fB\-M\fR, \fB\-\-clusters\fR=<\fIstring\fR> @@ -631,8 +631,13 @@ Inside the hostfile must contain at minimum the number of hosts requested and be one per line or comma separated. If specifying a task count (\fB\-n\fR, \fB\-\-ntasks\fR=<\fInumber\fR>), your tasks will be laid out on the nodes in the order of the file. -.TP +.br +\fBNOTE:\fR The arbitrary distribution option on a job allocation only +controls the nodes to be allocated to the job and not the allocation of +CPUs on those nodes. This option is meant primarily to control a job step's +task layout in an existing job allocation for the srun command. +.TP Second distribution method: .TP .B block @@ -667,6 +672,10 @@ This parameter would generally be used if whole nodes are allocated to jobs (\fBSelectType=select/linear\fR). Also see \fB\-\-mem\-per\-cpu\fR. \fB\-\-mem\fR and \fB\-\-mem\-per\-cpu\fR are mutually exclusive. +NOTE: Enforcement of memory limits currently requires enabling of +accounting, which samples memory use on a periodic basis (data need +not be stored, just collected). A task may exceed the memory limit +until the next periodic accounting sample. .TP \fB\-\-mem\-per\-cpu\fR=<\fIMB\fR> @@ -793,18 +802,105 @@ that the \fB\-\-cpus\-per\-task\fR option will change this default. .TP \fB\-\-network\fR=<\fItype\fR> Specify the communication protocol to be used. -This option is supported on AIX systems. -Since POE is used to launch tasks, this option is not normally used or -is specified using the \fBSLURM_NETWORK\fR environment variable. The interpretation of \fItype\fR is system dependent. -For systems with an IBM Federation switch, the following -comma\-separated and case insensitive types are recognized: -\fBIP\fR (the default is user\-space), \fBSN_ALL\fR, \fBSN_SINGLE\fR, -\fBBULK_XFER\fR and adapter names (e.g. \fBSNI0\fR and \fBSNI1\fR). -For more information, on IBM systems see \fIpoe\fR documentation on -the environment variables \fBMP_EUIDEVICE\fR and \fBMP_USE_BULK_XFER\fR. -Note that only four jobs steps may be active at once on a node with the -\fBBULK_XFER\fR option due to limitations in the Federation switch driver. +This option is current supported on systems with IBM's Parallel Environment (PE). +See IBM's LoadLeveler job command keyword documentation about the keyword +"network" for more information. +Multiple values may be specified in a comma separated list. +All options are case in\-sensitive. +Supported values include: +.RS +.TP 12 +\fBBULK_XFER\fR[=<\fIresources\fR>] +Enable bulk transfer of data using Remote Direct-Memory Access (RDMA). +The optional \fIresources\fR specification is a numeric value which can have +a suffix of "k", "K", "m", "M", "g" or "G" for kilobytes, megabytes or +gigabytes. +NOTE: The \fIresources\fR specification is not supported by the underlying +IBM infrastructure as of Parallel Environment version 2.2 and no value should +be specified at this time. +.TP +\fBCAU\fR=<\fIcount\fR> +Number of Collecitve Accelleration Units (CAU) required. +Applies only to IBM Power7-IH processors. +Default value is zero. +Independent CAU will be allocated for each programming interface (MPI, LAPI, etc.) +.TP +\fBDEVNAME\fR=<\fIname\fR> +Specify the device name to use for communications (e.g. "eth0" or "mlx4_0"). +.TP +\fBDEVTYPE\fR=<\fItype\fR> +Specify the device type to use for communications. +The supported values of \fItype\fR are: +"IB" (InfiniBand), "HFI" (P7 Host Fabric Interface), +"IPONLY" (IP-Only interfaces), "HPCE" (HPC Ethernet), and +"KMUX" (Kernel Emulation of HPCE). +The devices allocated to a job must all be of the same type. +The default value depends upon depends upon what hardware is available and in +order of preferences is IPONLY (which is not considered in User Space mode), +HFI, IB, HPCE, and KMUX. +.TP +\fBIMMED\fR =<\fIcount\fR> +Number of immediate send slots per window required. +Applies only to IBM Power7-IH processors. +Default value is zero. +.TP +\fBINSTANCES\fR =<\fIcount\fR> +Specify number of network connections for each task on each network connection. +The default instance count is 1. +.TP +\fBIPV4\fR +Use Internet Protocol (IP) version 4 communications (default). +.TP +\fBIPV6\fR +Use Internet Protocol (IP) version 6 communications. +.TP +\fBLAPI\fR +Use the LAPI programming interface. +.TP +\fBMPI\fR +Use the MPI programming interface. +MPI is the default interface. +.TP +\fBPAMI\fR +Use the PAMI programming interface. +.TP +\fBSN_ALL\fR +Use all available switch networks (default). +.TP +\fBSN_SINGLE\fR +Use one available switch network. +.TP +\fBUPC\fR +Use the UPC programming interface. +.TP +\fBUS\fR +Use User Space communications. +.TP + +Some examples of network specifications: +.TP +\fBInstances=2,US,MPI,SN_ALL\fR +Create two user space connections for MPI communications on every switch +network for each task. +.TP +\fBUS,MPI,Instances=3,Devtype=IB\fR +Create three user space connections for MPI communications on every InfiniBand +network for each task. +.TP +\fBIPV4,LAPI,SN_Single\fR +Create a IP version 4 connection for LAPI communications on one switch network +for each task. +.TP +\fBInstances=2,US,LAPI,MPI\fR +Create two user space connections each for LAPI and MPI communcations on every +switch network for each task. Note that SN_ALL is the default option so every +switch network is used. Also note that Instances=2 specifies that two +connections are established for each protocol (LAPI and MPI) and each task. +If there are two networks and four tasks on the node then a total +of 32 connections are estabhished (2 instances x 2 protocols x 2 networks x +4 tasks). +.RE .TP \fB\-\-nice\fR[=\fIadjustment\fR] @@ -1015,7 +1111,7 @@ The default max\-time is the max_switch_wait SchedulerParameter. Set a limit on the total run time of the job allocation. If the requested time limit exceeds the partition's time limit, the job will be left in a PENDING state (possibly indefinitely). The default time -limit is the partition's time limit. When the time limit is reached, +limit is the partition's default time limit. When the time limit is reached, each task in each job step is sent SIGTERM followed by SIGKILL. The interval between signals is specified by the SLURM configuration parameter \fBKillWait\fR. A time limit of zero requests that no time diff --git a/doc/man/man1/scontrol.1 b/doc/man/man1/scontrol.1 index 7ade312b8153828824d7aa1a4f31bbeaa93eaf09..59178e2a12e5b4ab1730eb685525ebb6a5bd9dfb 100644 --- a/doc/man/man1/scontrol.1 +++ b/doc/man/man1/scontrol.1 @@ -30,7 +30,9 @@ that are configured as hidden and partitions that are unavailable to user's group. .TP \fB\-d\fR, \fB\-\-details\fR -Causes the \fBshow\fR command to provide additional details where available. +Causes the \fIshow\fR command to provide additional details where available. +Repeating the option more than once (e.g., "\-dd") will cause the \fIshow job\fR +command to also list the batch script, if the job was a batch job. .TP \fB\-h\fR, \fB\-\-help\fR Print a help message describing the usage of scontrol. @@ -151,8 +153,6 @@ If the specified partition is in use, the request is denied. .TP \fBdetails\fP Causes the \fIshow\fP command to provide additional details where available. -Batch job information will include the batch script for jobs the user is -authorized to view. Job information will include CPUs and NUMA memory allocated on each node. Note that on computers with hyperthreading enabled and SLURM configured to allocate cores, each listed CPU represents one physical core. @@ -161,7 +161,8 @@ CPU count and task count may differ. See the \fB\-\-cpu_bind\fR and \fB\-\-mem_bind\fR option descriptions in srun man pages for more information. The \fBdetails\fP option is currently only supported for the \fIshow job\fP -command. +command. To also list the batch script for batch jobs, in addition to the +details, use the \fBscript\fP option described below instead of this option. .TP \fBexit\fP @@ -275,6 +276,12 @@ daemon reads the slurm.conf configuration file (e.g. when the daemon is restarted or \fBscontrol reconfigure\fR is executed) if the SlurmSchedLogLevel parameter is present. +.TP +\fBscript\fP +Causes the \fIshow job\fP command to list the batch script for batch +jobs in addition to the detail information described under the +\fBdetails\fP option above. + .TP \fBsetdebug\fP \fILEVEL\fP Change the debug level of the slurmctld daemon. @@ -1070,13 +1077,19 @@ E.g. Accounts=physcode1,physcode2. A user in any of the accounts may use the reserved nodes. A new reservation must specify Users and/or Accounts. +.TP +\fICoreCnt\fP= +Identify number of cores to be reserved. This should only be used for +reservations that are less than one node in size. Otherwise use the +\fINodeCnt\fP option described below. + .TP \fILicenses\fP= Specification of licenses (or other resources available on all nodes of the cluster) which are to be reserved. -License names can be followed by an asterisk and count +License names can be followed by a colon and count (the default count is one). -Multiple license names should be comma separated (e.g. "Licenses=foo*4,bar"). +Multiple license names should be comma separated (e.g. "Licenses=foo:4,bar"). A new reservation must specify one or more resource to be included: NodeCnt, Nodes and/or Licenses. @@ -1168,6 +1181,11 @@ Ignore currently running jobs when creating the reservation. This can be especially useful when reserving all nodes in the system for maintenance. .TP +\fIPART_NODES\fR +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 \fIDAILY\fR Repeat the reservation at the same time every day .TP @@ -1197,20 +1215,39 @@ E.g. Users=jones1,smith2. A new reservation must specify Users and/or Accounts. .TP -\fBSPECIFICATIONS FOR UPDATE, BLOCK \fR +\fBSPECIFICATIONS FOR UPDATE BLOCK/SUBMP \fR .TP Bluegene systems only! .TP \fIBlockName\fP= Identify the bluegene block to be updated. This specification is required. .TP -\fIState\fP= -This will update the state of a bluegene block to either FREE or ERROR. -(i.e. update BlockName=RMP0 STATE=ERROR) State error will not allow jobs -to run on the block. \fBWARNING!!!!\fR This will cancel any -running job on the block! On dynamically laid out systems REMOVE will -free and remove the block from the system. If the block is smaller -than a midplane every block on that midplane will be removed. +\fIState\fP= +This will update the state of a bluegene block. +(i.e. update BlockName=RMP0 STATE=ERROR) +\fBWARNING!!!!\fR With the exception of the RESUME state, all other +state values will cancel any running job on the block! +.RS +.TP 10 +\fIFREE\fP +Return the block to a free state. +.TP +\fIERROR\fP +Make it so jobs don't run on the block. +.TP +\fIRECREATE\fP +Destroy the current block and create a new one to take its place. +.TP +\fIREMOVE\fP +Free and remove the block from the system. If the block is smaller +than a midplane every block on that midplane will be removed. (only +available on dynamic laid out systems) +.TP +\fIRESUME\fP +If a block is in ERROR state RESUME will return the block to its +previous usable state (FREE or READY). +.RE + .TP \fISubMPName\fP= Identify the bluegene ionodes to be updated (i.e. bg000[0\-3]). This diff --git a/doc/man/man1/sinfo.1 b/doc/man/man1/sinfo.1 index 39a405a3d78103473a25e6f8add9b3dc1d7d318f..bd5cae9b84c0eabd5a8488c7bb0edd9a201fb8b9 100644 --- a/doc/man/man1/sinfo.1 +++ b/doc/man/man1/sinfo.1 @@ -193,10 +193,6 @@ Only user root may initiate jobs, "yes" or "no" \fB%R\fR Partition name, also see \fB%P\fR .TP -\fB%R\fR -The reason a node is unavailable (down, drained, draining, -fail or failing states) -.TP \fB%s\fR Maximum job size in nodes .TP diff --git a/doc/man/man1/sprio.1 b/doc/man/man1/sprio.1 index a0d8532faff0ac35054db0034a8127366f31ee36..1e4941fd31efb2b51e5891e6da9650524a71ec8b 100644 --- a/doc/man/man1/sprio.1 +++ b/doc/man/man1/sprio.1 @@ -26,7 +26,11 @@ Print a help message describing all options \fBsprio\fR. .TP \fB\-j \fR, \fB\-\-jobs=\fR -Requests a comma separated list of job ids to display. Defaults to all jobs. +Requests a comma separated list of job ids to display. Defaults to +all jobs. Since this option's argument is optional, for proper parsing +the single letter option must be followed immediately with the value +and not include a space between them. For example "\-j1008,1009" and +not "\-j 1008,1009". .TP \fB\-l\fR, \fB\-\-long\fR diff --git a/doc/man/man1/squeue.1 b/doc/man/man1/squeue.1 index 20dfd05c3c3f6ad147b1809727a81e0597561a6a..e03ee1bb9b6d985100f6ebb7920d3b6589b57b84 100644 --- a/doc/man/man1/squeue.1 +++ b/doc/man/man1/squeue.1 @@ -49,7 +49,10 @@ Requests a comma separated list of job ids to display. Defaults to all jobs. The \fB\-\-jobs=\fR option may be used in conjunction with the \fB\-\-steps\fR option to print step information about specific jobs. Note: If a list of job ids is provided, the jobs are displayed even if -they are on hidden partitions. +they are on hidden partitions. Since this option's argument is optional, +for proper parsing the single letter option must be followed immediately +with the value and not include a space between them. For example "\-j1008" +and not "\-j 1008". .TP \fB\-l\fR, \fB\-\-long\fR @@ -354,7 +357,11 @@ Specify the reservation of the jobs to view. \fB\-s\fR, \fB\-\-steps\fR Specify the job steps to view. This flag indicates that a comma separated list of job steps to view follows without an equal sign (see examples). -The job step format is "job_id.step_id". Defaults to all job steps. +The job step format is "job_id.step_id". Defaults to all job +steps. Since this option's argument is optional, for proper parsing +the single letter option must be followed immediately with the value +and not include a space between them. For example "\-s1008.0" and not +"\-s 1008.0". .TP \fB\-S \fR, \fB\-\-sort=\fR diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1 index d838de8e6577d491090fee320fc50dc5ac062c38..9e20abdb6d989dca8436f3712080b063d31882f1 100644 --- a/doc/man/man1/srun.1 +++ b/doc/man/man1/srun.1 @@ -1,17 +1,17 @@ -.TH "srun" "1" "SLURM 2.4" "October 2011" "SLURM Commands" +.TH "srun" "1" "SLURM 2.5" "July 2012" "SLURM Commands" .SH "NAME" srun \- Run parallel jobs .SH "SYNOPSIS" -\fBsrun\fR [\fIOPTIONS\fR...] \fIexecutable \fR[\fIargs\fR...] +\fBsrun\fR [\fIOPTIONS\fR...] \fIexecutable \fR[\fIargs\fR...] .SH "DESCRIPTION" Run a parallel job on cluster managed by SLURM. If necessary, srun will first create a resource allocation in which to run the parallel job. -The following document describes the the influence of various options on the -allocation of cpus to jobs and tasks. +The following document describes the the influence of various options on the +allocation of cpus to jobs and tasks. .br http://www.schedmd.com/slurmdocs/cpu_management.html @@ -132,7 +132,7 @@ Users can specify which of these \fBfeatures\fR are required by their job 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, exclusive OR, +Multiple constraints may be specified with AND, OR, exclusive OR, resource counts, etc. Supported \fbconstraint\fR options include: .PD 1 @@ -171,7 +171,7 @@ Specific counts of multiple resources may be specified by using the AND operator and enclosing the options within square brackets. For example: "\fB\-\-constraint=[rack1*2&rack2*4]"\fR might be used to specify that two nodes must be allocated from nodes with the feature -of "rack1" and four nodes must be allocated from nodes with the feature +of "rack1" and four nodes must be allocated from nodes with the feature "rack2". .RE @@ -205,9 +205,9 @@ the SLURM_CPU_BIND environment variable value to "verbose". The following informational environment variables are set when \fB\-\-cpu_bind\fR is in use: .nf - SLURM_CPU_BIND_VERBOSE - SLURM_CPU_BIND_TYPE - SLURM_CPU_BIND_LIST + SLURM_CPU_BIND_VERBOSE + SLURM_CPU_BIND_TYPE + SLURM_CPU_BIND_LIST .fi See the \fBENVIRONMENT VARIABLES\fR section for a more detailed description @@ -315,6 +315,43 @@ this can result in sub\-optimal binding. Show help message for cpu_bind .RE +.TP +\fB\-\-cpu\-freq\fR =<\fIrequested frequency in kilohertz\fR> + +Request that the job step initiated by this srun be run at the +requested frequency if possible, on the cpus selected for the step on +the compute node(s). In addition to specifying a numerical frequency in +kilohertz, the request can specify \fIlow\fR, \fImedium\fR, or +\fIhigh\fR for the value. "Low" will select the lowest available +frequency, "high" will select the highest available frequency, while +"medium" attempts to set a frequency in the middle of the available +range. If the numeric value specified does not exactly match a legal +available frequency, SLURM will attempt to pick a legal frequency +close to the request. + +The following informational environment variable is set in the job +step when \fB\-\-cpu\-freq\fR option is requested. +.nf + SLURM_CPU_FREQ_REQ +.fi + +This environment variable can also be used to supply the value for the +cpu frequency request if it is set when the 'srun' command is issued. +The \fB\-\-cpu\-freq\fR on the command line will override the +environment variable value. See the \fBENVIRONMENT VARIABLES\fR +section for a description of the SLURM_CPU_FREQ_REQ variable. + +\fBNOTE\fR: This parameter is treated as a request, not a requirement. +If the job step's node does not support setting the cpu frequency, or +the requested value is outside the bounds of the legal frequencies, an +error is logged, but the job step is allowed to continue. + +\fBNOTE\fR: Setting the frequency for just the cpus of the job step +implies that the tasks are confined to those cpus. If task +confinement (i.e., TaskPlugin=task/affinity or +TaskPlugin=task/cgroup with the "ConstrainCores" option) is not +configured, this parameter is ignored. + .TP \fB\-c\fR, \fB\-\-cpus\-per\-task\fR=<\fIncpus\fR> Request that \fIncpus\fR be allocated \fBper process\fR. This may be @@ -339,8 +376,9 @@ allocation will include four CPUs. The job step allocation will then launch two threads per CPU for a total of two tasks. \fBWARNING\fR: When srun is executed from within salloc or sbatch, -there are configurations and options which can result in inconsistent +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\-d\fR, \fB\-\-dependency\fR=<\fIdependency_list\fR> Defer the start of this job until the specified dependencies have been @@ -493,7 +531,10 @@ time period specified. If no argument is given, resources must be available immediately for the request to succeed. By default, \fB\-\-immediate\fR is off, and the command -will block until resources become available. +will block until resources become available. Since this option's +argument is optional, for proper parsing the single letter option +must be followed immediately with the value and not include a +space between them. For example "\-I60" and not "\-I 60". .TP \fB\-i\fR, \fB\-\-input\fR=<\fImode\fR> @@ -508,10 +549,10 @@ a terminal is not possible. \fB\-J\fR, \fB\-\-job\-name\fR=<\fIjobname\fR> Specify a name for the job. The specified name will appear along with the job id number when querying running jobs on the system. The default -is the supplied \fBexecutable\fR program's name. NOTE: This information +is the supplied \fBexecutable\fR program's name. NOTE: This information may be written to the slurm_jobacct.log file. This file is space delimited -so if a space is used in the \fIjobname\fR name it will cause problems in -properly displaying the contents of the slurm_jobacct.log file when the +so if a space is used in the \fIjobname\fR name it will cause problems in +properly displaying the contents of the slurm_jobacct.log file when the \fBsacct\fR command is used. .TP @@ -530,18 +571,21 @@ argument of zero will not terminate the job. A non\-zero argument or no argument will terminate the job. Note: This option takes precedence over the \fB\-W\fR, \fB\-\-wait\fR option to terminate the job immediately if a task exits with a non\-zero exit code. +Since this option's argument is optional, for proper parsing the +single letter option must be followed immediately with the value and +not include a space between them. For example "\-K1" and not "\-K 1". .TP \fB\-k\fR, \fB\-\-no\-kill\fR Do not automatically terminate a job of one of the nodes it has been allocated fails. This option is only recognized on a job allocation, not for the submission of individual job steps. -The job will assume all responsibilities for fault\-tolerance. +The job will assume all responsibilities for fault\-tolerance. Tasks launch using this option will not be considered terminated (e.g. \fB\-K\fR, \fB\-\-kill\-on\-bad\-exit\fR and \fB\-W\fR, \fB\-\-wait\fR options will have no effect upon the job step). The active job step (MPI job) will likely suffer a fatal error, -but subsequent job steps may be run if this option is specified. +but subsequent job steps may be run if this option is specified. The default action is to terminate the job upon node failure. .TP @@ -556,10 +600,10 @@ task id. \fB\-L\fR, \fB\-\-licenses\fR=<\fBlicense\fR> Specification of licenses (or other resources available on all nodes of the cluster) which must be allocated to this job. -License names can be followed by an asterisk and count +License names can be followed by a colon and count (the default count is one). Multiple license names should be comma separated (e.g. -"\-\-licenses=foo*4,bar"). +"\-\-licenses=foo:4,bar"). .TP \fB\-m\fR, \fB\-\-distribution\fR= @@ -625,8 +669,13 @@ Inside the hostfile must contain at minimum the number of hosts requested and be one per line or comma separated. If specifying a task count (\fB\-n\fR, \fB\-\-ntasks\fR=<\fInumber\fR>), your tasks will be laid out on the nodes in the order of the file. -.TP +.br +\fBNOTE:\fR The arbitrary distribution option on a job allocation only +controls the nodes to be allocated to the job and not the allocation of +CPUs on those nodes. This option is meant primarily to control a job step's +task layout in an existing job allocation for the srun command. +.TP Second distribution method: .TP .B block @@ -661,6 +710,10 @@ This parameter would generally be used if whole nodes are allocated to jobs (\fBSelectType=select/linear\fR). Also see \fB\-\-mem\-per\-cpu\fR. \fB\-\-mem\fR and \fB\-\-mem\-per\-cpu\fR are mutually exclusive. +NOTE: Enforcement of memory limits currently requires enabling of +accounting, which samples memory use on a periodic basis (data need +not be stored, just collected). A task may exceed the memory limit +until the next periodic accounting sample. .TP \fB\-\-mem\-per\-cpu\fR=<\fIMB\fR> @@ -671,7 +724,7 @@ seen using the \fBscontrol show config\fR command. Note that if the job's \fB\-\-mem\-per\-cpu\fR value exceeds the configured \fBMaxMemPerCPU\fR, then the user's limit will be treated as a memory limit per task; \fB\-\-mem\-per\-cpu\fR will be reduced to a value no larger than -\fBMaxMemPerCPU\fR; \fB\-\-cpus\-per\-task\fR will be set and value of +\fBMaxMemPerCPU\fR; \fB\-\-cpus\-per\-task\fR will be set and value of \fB\-\-cpus\-per\-task\fR multiplied by the new \fB\-\-mem\-per\-cpu\fR value will equal the original \fB\-\-mem\-per\-cpu\fR value specified by the user. @@ -702,9 +755,9 @@ The following informational environment variables are set when \fB\-\-mem_bind\fR is in use: .nf - SLURM_MEM_BIND_VERBOSE - SLURM_MEM_BIND_TYPE - SLURM_MEM_BIND_LIST + SLURM_MEM_BIND_VERBOSE + SLURM_MEM_BIND_TYPE + SLURM_MEM_BIND_LIST .fi See the \fBENVIRONMENT VARIABLES\fR section for a more detailed description @@ -831,18 +884,109 @@ that the \fB\-\-cpus\-per\-task\fR option will change this default. .TP \fB\-\-network\fR=<\fItype\fR> Specify the communication protocol to be used. -This option is supported on AIX systems. -Since POE is used to launch tasks, this option is not normally used or -is specified using the \fBSLURM_NETWORK\fR environment variable. The interpretation of \fItype\fR is system dependent. -For systems with an IBM Federation switch, the following -comma\-separated and case insensitive types are recognized: -\fBIP\fR (the default is user\-space), \fBSN_ALL\fR, \fBSN_SINGLE\fR, -\fBBULK_XFER\fR and adapter names (e.g. \fBSNI0\fR and \fBSNI1\fR). -For more information, on IBM systems see \fIpoe\fR documentation on -the environment variables \fBMP_EUIDEVICE\fR and \fBMP_USE_BULK_XFER\fR. -Note that only four jobs steps may be active at once on a node with the -\fBBULK_XFER\fR option due to limitations in the Federation switch driver. +This option is current supported on systems with IBM's Parallel Environment (PE). +See IBM's LoadLeveler job command keyword documentation about the keyword +"network" for more information. +Multiple values may be specified in a comma separated list. +All options are case in\-sensitive. +Supported values include: +.RS +.TP 12 +\fBBULK_XFER\fR[=<\fIresources\fR>] +Enable bulk transfer of data using Remote Direct-Memory Access (RDMA). +The optional \fIresources\fR specification is a numeric value which can have +a suffix of "k", "K", "m", "M", "g" or "G" for kilobytes, megabytes or +gigabytes. +NOTE: The \fIresources\fR specification is not supported by the underlying +IBM infrastructure as of Parallel Environment version 2.2 and no value should +be specified at this time. +The devices allocated to a job must all be of the same type. +The default value depends upon depends upon what hardware is available and in +order of preferences is IPONLY (which is not considered in User Space mode), +HFI, IB, HPCE, and KMUX. +.TP +\fBCAU\fR=<\fIcount\fR> +Number of Collecitve Accelleration Units (CAU) required. +Applies only to IBM Power7-IH processors. +Default value is zero. +Independent CAU will be allocated for each programming interface (MPI, LAPI, etc.) +.TP +\fBDEVNAME\fR=<\fIname\fR> +Specify the device name to use for communications (e.g. "eth0" or "mlx4_0"). +.TP +\fBDEVTYPE\fR=<\fItype\fR> +Specify the device type to use for communications. +The supported values of \fItype\fR are: +"IB" (InfiniBand), "HFI" (P7 Host Fabric Interface), +"IPONLY" (IP-Only interfaces), "HPCE" (HPC Ethernet), and +"KMUX" (Kernel Emulation of HPCE). +The devices allocated to a job must all be of the same type. +The default value depends upon depends upon what hardware is available and in +order of preferences is IPONLY (which is not considered in User Space mode), +HFI, IB, HPCE, and KMUX. +.TP +\fBIMMED\fR =<\fIcount\fR> +Number of immediate send slots per window required. +Applies only to IBM Power7-IH processors. +Default value is zero. +.TP +\fBINSTANCES\fR =<\fIcount\fR> +Specify number of network connections for each task on each network connection. +The default instance count is 1. +.TP +\fBIPV4\fR +Use Internet Protocol (IP) version 4 communications (default). +.TP +\fBIPV6\fR +Use Internet Protocol (IP) version 6 communications. +.TP +\fBLAPI\fR +Use the LAPI programming interface. +.TP +\fBMPI\fR +Use the MPI programming interface. +MPI is the default interface. +.TP +\fBPAMI\fR +Use the PAMI programming interface. +.TP +\fBSN_ALL\fR +Use all available switch networks (default). +.TP +\fBSN_SINGLE\fR +Use one available switch network. +.TP +\fBUPC\fR +Use the UPC programming interface. +.TP +\fBUS\fR +Use User Space communications. +.TP + +Some examples of network specifications: +.TP +\fBInstances=2,US,MPI,SN_ALL\fR +Create two user space connections for MPI communications on every switch +network for each task. +.TP +\fBUS,MPI,Instances=3,Devtype=IB\fR +Create three user space connections for MPI communications on every InfiniBand +network for each task. +.TP +\fBIPV4,LAPI,SN_Single\fR +Create a IP version 4 connection for LAPI communications on one switch network +for each task. +.TP +\fBInstances=2,US,LAPI,MPI\fR +Create two user space connections each for LAPI and MPI communcations on every +switch network for each task. Note that SN_ALL is the default option so every +switch network is used. Also note that Instances=2 specifies that two +connections are established for each protocol (LAPI and MPI) and each task. +If there are two networks and four tasks on the node then a total +of 32 connections are estabhished (2 instances x 2 protocols x 2 networks x +4 tasks). +.RE .TP \fB\-\-nice\fR[=\fIadjustment\fR] @@ -898,9 +1042,9 @@ NOTE: This option is not supported unless Overcommit resources. Normally, \fBsrun\fR will not allocate more than one process per CPU. By specifying \fB\-\-overcommit\fR you are explicitly allowing more than one process -per CPU. However no more than \fBMAX_TASKS_PER_NODE\fR tasks are -permitted to execute per node. NOTE: \fBMAX_TASKS_PER_NODE\fR is -defined in the file \fIslurm.h\fR and is not a variable, it is set at +per CPU. However no more than \fBMAX_TASKS_PER_NODE\fR tasks are +permitted to execute per node. NOTE: \fBMAX_TASKS_PER_NODE\fR is +defined in the file \fIslurm.h\fR and is not a variable, it is set at SLURM build time. .TP @@ -966,7 +1110,7 @@ The maximum size of a process's data segment .TP \fBFSIZE\fR The maximum size of files created. Note that if the user sets FSIZE to less -than the current size of the slurmd.log, job launches will fail with +than the current size of the slurmd.log, job launches will fail with a 'File size limit exceeded' error. .TP \fBMEMLOCK\fR @@ -990,7 +1134,7 @@ The maximum stack size Execute task zero in pseudo terminal mode. Implicitly sets \fB\-\-unbuffered\fR. Implicitly sets \fB\-\-error\fR and \fB\-\-output\fR to /dev/null -for all tasks except task zero, which may cause those tasks to +for all tasks except task zero, which may cause those tasks to exit immediately (e.g. shells will typically exit immediately in that situation). Not currently supported on AIX platforms. @@ -1021,7 +1165,7 @@ This option may be used to spread several job steps out among the nodes of the current job. If \fB\-r\fR is used, the current job step will begin at node \fIn\fR of the allocated nodelist, where the first node is considered node 0. The \fB\-r\fR option is not -permitted with \fB\-w\fR or \fB\-x\fR option and will result in a +permitted with \fB\-w\fR or \fB\-x\fR option and will result in a fatal error when not running within a prior allocation (i.e. when SLURM_JOB_ID is not set). The default for \fIn\fR is 0. If the value of \fB\-\-nodes\fR exceeds the number of nodes identified @@ -1089,7 +1233,7 @@ When a tree topology is used, this defines the maximum count of switches desired for the job allocation and optionally the maximum time to wait for that number of switches. If SLURM finds an allocation containing more switches than the count specified, the job remains pending until it either finds -an allocation with desired switch count or the time limit expires. +an allocation with desired switch count or the time limit expires. It there is no switch count limit, there is no delay in starting the job. Acceptable time formats include "minutes", "minutes:seconds", "hours:minutes:seconds", "days\-hours", "days\-hours:minutes" and @@ -1117,8 +1261,8 @@ requested time limit for a job exceeds the partition's time limit, the job will be left in a PENDING state (possibly indefinitely). If the requested time limit for a job step exceeds the partition's time limit, the job step will not be initiated. The default time -limit is the partition's time limit. When the time limit is reached, -the job's tasks are sent SIGTERM followed by SIGKILL. If the time +limit is the partition's default time limit. When the time limit is reached, +each task in each job step is sent SIGTERM followed by SIGKILL. The limit is for the job, all job steps are signaled. If the time limit is for a single job step within an existing job allocation, only that job step will be affected. A job time limit supercedes all job step time @@ -1168,12 +1312,12 @@ above when task/affinity plugin is enabled. Set a minimum time limit on the job allocation. If specified, the job may have it's \fB\-\-time\fR limit lowered to a value no lower than \fB\-\-time\-min\fR if doing so permits the job to begin -execution earlier than otherwise possible. +execution earlier than otherwise possible. The job's time limit will not be changed after the job is allocated resources. -This is performed by a backfill scheduling algorithm to allocate resources +This is performed by a backfill scheduling algorithm to allocate resources otherwise reserved for higher priority jobs. -Acceptable time formats include "minutes", "minutes:seconds", -"hours:minutes:seconds", "days\-hours", "days\-hours:minutes" and +Acceptable time formats include "minutes", "minutes:seconds", +"hours:minutes:seconds", "days\-hours", "days\-hours:minutes" and "days\-hours:minutes:seconds". .TP @@ -1218,7 +1362,7 @@ parameter in the slurm configuration file (see \fBslurm.conf(5)\fR). This option can be useful to insure that a job is terminated in a timely fashion in the event that one or more tasks terminate prematurely. Note: The \fB\-K\fR, \fB\-\-kill\-on\-bad\-exit\fR option takes precedence -over \fB\-W\fR, \fB\-\-wait\fR to terminate the job immediately if a task +over \fB\-W\fR, \fB\-\-wait\fR to terminate the job immediately if a task exits with a non\-zero exit code. .TP @@ -1254,8 +1398,8 @@ if it contains a "/"character. \fB\-Z\fR, \fB\-\-no\-allocate\fR Run the specified tasks on a set of nodes without creating a SLURM "job" in the SLURM queue structure, bypassing the normal resource -allocation step. The list of nodes must be specified with the -\fB\-w\fR, \fB\-\-nodelist\fR option. This is a privileged option +allocation step. The list of nodes must be specified with the +\fB\-w\fR, \fB\-\-nodelist\fR option. This is a privileged option only available for the users "SlurmUser" and "root". .PP @@ -1381,8 +1525,15 @@ standard input of \fBsrun\fR to all remote tasks. If stdin is only to be read by a subset of the spawned tasks, specifying a file to read from rather than forwarding stdin from the \fBsrun\fR command may be preferable as it avoids moving and storing data that will never be read. +.PP For OS X, the poll() function does not support stdin, so input from a terminal is not possible. +.PP +For BGQ srun only supports stdin to 1 task running on the system. By +default it is taskid 0 but can be changed with the \-i as +described below, or \-\-runjob\-opt="\-\-stdinrank=". Outside +of the taskid option none of the options below are available for a BGQ system. +.PP This behavior may be changed with the \fB\-\-output\fR, \fB\-\-error\fR, and \fB\-\-input\fR (\fB\-o\fR, \fB\-e\fR, \fB\-i\fR) options. Valid format specifications @@ -1397,14 +1548,14 @@ stdin is broadcast to all remote tasks. stdout and stderr is not received from any task. stdin is not sent to any task (stdin is closed). .TP -\fItaskid\fR +\fBtaskid\fR stdout and/or stderr are redirected from only the task with relative id equal to \fItaskid\fR, where 0 <= \fItaskid\fR <= \fIntasks\fR, where \fIntasks\fR is the total number of tasks in the current job step. stdin is redirected from the stdin of \fBsrun\fR to this same task. This file will be written on the node executing the task. .TP -\fIfilename\fR +\fBfilename\fR \fBsrun\fR will redirect stdout and/or stderr to the named file from all tasks. stdin will be redirected from the named file and broadcast to all @@ -1413,7 +1564,7 @@ that runs \fBsrun\fR. Depending on the cluster's file system layout, this may result in the output appearing in different places depending on whether the job is run in batch mode. .TP -format string +\fBformat string\fR \fBsrun\fR allows for a format string to be used to generate the named IO file described above. The following list of format specifiers may be @@ -1526,6 +1677,16 @@ Same as \fB\-\-conn\-type\fR \fBSLURM_CPU_BIND\fR Same as \fB\-\-cpu_bind\fR .TP +\fBSLURM_CPU_FREQ_REQ\fR +Same as \fB\-\-cpu\-freq\fR. Can specify a numerical frequency in +kilohertz, or the request can specify \fIlow\fR, \fImedium\fR, or +\fIhigh\fR for the value. "Low" will select the lowest available +frequency, "high" will select the highest available frequency, while +"medium" attempts to set a frequency in the middle of the available +range. If the numeric value specified does not exactly match a legal +available frequency, SLURM will attempt to pick a legal frequency +close to the request. +.TP \fBSLURM_CPUS_PER_TASK\fR Same as \fB\-c, \-\-cpus\-per\-task\fR .TP @@ -1704,6 +1865,13 @@ if specified on the execute line. \fBSLURM_CPU_BIND_LIST\fR \-\-cpu_bind map or mask list () +.TP +\fBSLURM_CPU_FREQ_REQ\fR +Contains the value requested for cpu frequency on the srun command as +a numerical frequency in kilohertz, or a coded value for a request of +\fIlow\fR, \fImedium\fR, or \fIhigh\fR for the frequency. See the +description of the \fB\-\-cpu\-freq\fR option or the +\fBSLURM_CPU_FREQ_REQ\fR input environment variable. .TP \fBSLURM_CPUS_ON_NODE\fR Count of processors available to the job on this node. @@ -1805,6 +1973,13 @@ 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 +\fBSRUN_DEBUG\fR +Set to the logging level of the \fBsrun\fR command. +Default value is 3 (info level). +The value is incremented or decremented based upon the \-\-verbose and +\-\-quiet options. + .TP \fBMPIRUN_NOALLOCATE\fR Do not allocate a block on Blue Gene systems only. diff --git a/doc/man/man1/strigger.1 b/doc/man/man1/strigger.1 index 437f1985a321ef245375660acc09aab68af33c83..33019382db2fa2c5282842eec59662b99bec684e 100644 --- a/doc/man/man1/strigger.1 +++ b/doc/man/man1/strigger.1 @@ -168,7 +168,10 @@ with the \fB\-\-jobid\fR option. When the \fB\-\-jobid\fR option is used in conjunction with the \fB\-\-up\fR, \fB\-\-down\fR or \fB\-\-drained\fR option, all nodes allocated to that job will considered the nodes used as a -trigger event. +trigger event.Since this option's argument is optional, for proper +parsing the single letter option must be followed immediately with +the value and not include a space between them. For example "\-ntux" +and not "\-n tux". .TP \fB\-M\fR, \fB\-\-clusters\fR=<\fIstring\fR> diff --git a/doc/man/man3/Makefile.in b/doc/man/man3/Makefile.in index 4baaee0c493d2d4c54ff264abc3e427039430b04..7e251b960a7654197beca54074acbc0f29e91479 100644 --- a/doc/man/man3/Makefile.in +++ b/doc/man/man3/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -104,6 +103,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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; }; \ + } man3dir = $(mandir)/man3 am__installdirs = "$(DESTDIR)$(man3dir)" NROFF = nroff @@ -149,9 +154,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -159,9 +162,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -193,6 +195,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -220,6 +224,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -513,9 +518,7 @@ uninstall-man3: files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man3dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man3dir)" && rm -f $$files; } + dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: @@ -583,10 +586,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/doc/man/man3/slurm_allocate_resources.3 b/doc/man/man3/slurm_allocate_resources.3 index 886b8beaf3c9e0fb63fb63fa00c18a794c6852cc..e646152e74d71f53fd361c494eddda4803c30a43 100644 --- a/doc/man/man3/slurm_allocate_resources.3 +++ b/doc/man/man3/slurm_allocate_resources.3 @@ -213,6 +213,8 @@ On success, zero is returned. On error, \-1 is returned, and Slurm error code is .LP \fBSLURM_PROTOCOL_VERSION_ERROR\fR Protocol version has changed, re\-link your code. .LP +\fBESLURM_CAN_NOT_START_IMMEDIATELY\fR the job can not be started immeidately as requested. +.LP \fBESLURM_DEFAULT_PARTITION_NOT_SET\fR the system lacks a valid default partition. .LP \fBESLURM_JOB_MISSING_PARTITION_KEY\fR use of this partition is restricted through a credential provided only to user root. This job lacks such a valid credential. diff --git a/doc/man/man5/Makefile.in b/doc/man/man5/Makefile.in index b8e0052f2a184d9e9b2a7ab3175bf9b3e14cb8ce..bbc754551d1fb93b6d141dd6a69b69c825581c1e 100644 --- a/doc/man/man5/Makefile.in +++ b/doc/man/man5/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -106,6 +105,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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; }; \ + } man5dir = $(mandir)/man5 am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(htmldir)" NROFF = nroff @@ -152,9 +157,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -162,9 +165,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -196,6 +198,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -223,6 +227,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,9 +410,7 @@ uninstall-man5: files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man5dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man5dir)" && rm -f $$files; } + dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-htmlDATA: $(html_DATA) @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" @@ -425,9 +428,7 @@ uninstall-htmlDATA: @$(NORMAL_UNINSTALL) @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(htmldir)" && rm -f $$files + dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: @@ -495,10 +496,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) diff --git a/doc/man/man5/cgroup.conf.5 b/doc/man/man5/cgroup.conf.5 index 5a06a0e7653c616b296774e5a1da95270ff9fa25..c5807b680d592dd122100e24485034bf05768cad 100644 --- a/doc/man/man5/cgroup.conf.5 +++ b/doc/man/man5/cgroup.conf.5 @@ -1,4 +1,4 @@ -.TH "cgroup.conf" "5" "December 2010" "cgroup.conf 2.2" \ +.TH "cgroup.conf" "5" "June 2012" "cgroup.conf 2.2" \ "Slurm cgroup configuration file" .SH "NAME" @@ -6,7 +6,7 @@ cgroup.conf \- Slurm configuration file for the cgroup support .SH "DESCRIPTION" -\fBcgroup.conf\fP is an ASCII file which defines parameters used by +\fBcgroup.conf\fP is an ASCII file which defines parameters used by Slurm's Linux cgroup related plugins. 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 @@ -20,9 +20,10 @@ The size of each line in the file is limited to 1024 characters. 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 -Two cgroup plugins are currently available in SLURM. The first -one is a proctrack plugin, the second one a task plugin. +For general Slurm Cgroups information, see the Cgroups Guide at +. .LP The following cgroup.conf parameters are defined to control the general behavior @@ -38,98 +39,33 @@ one per subsystem. The default \fIPATH\fR is /cgroup. \fBCgroupAutomount\fR= Slurm cgroup plugins require valid and functional cgroup subsystem to be mounted under /cgroup/. -When launched, plugins check their subsystem availability. If not available, -the plugin launch fails unless CgroupAutomount is set to yes. In that case, the +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. .TP \fBCgroupReleaseAgentDir\fR= -Used to tune the cgroup system behavior. This parameter identifies the location -of the directory containing Slurm cgroup release_agent files. A release_agent file -is required for each mounted subsystem. The release_agent file name must have the -following format: release_. For instance, the release_agent file -for the cpuset subsystem must be named release_cpuset. See also CLEANUP OF -CGROUPS below. - -.SH "PROCTRACK/CGROUP PLUGIN" - -Slurm \fBproctrack/cgroup\fP plugin is used to track processes using the -freezer control group subsystem. It creates a hierarchical set of -directories for each step, putting the step tasks into the leaf. -.LP -This directory structure is like the following: -.br -/cgroup/freezer/uid_%uid/job_%jobid/step_%stepid -.LP -Slurm cgroup proctrack plugin is enabled with the following parameter -in slurm.conf: -.br -ProctrackType=proctrack/cgroup - -.LP -No particular cgroup.conf parameter is defined to control the behavior -of this particular plugin. - -.SH "JOBACCT_GATHER/CGROUP PLUGIN" - -Slurm \fBjobacct_gather/cgroup\fP plugin is an experimental plugin -that uses cgroups to generate accounting statistics instead of the linux -/proc table. The plugin creates a hierarchical set of -directories for each task. -.LP -This directory structure is like the following: -.br -/cgroup/cpuacct/uid_%uid/job_%jobid/step_%stepid/task_%taskid -.LP -Slurm cgroup jobacct_gather plugin is enabled with the following parameter -in slurm.conf: -.br -JobAcctGatherType=jobacct_gather/cgroup - -.LP -No particular cgroup.conf parameter is defined to control the behavior -of this particular plugin. +Used to tune the cgroup system behavior. This parameter identifies the location +of the directory containing Slurm cgroup release_agent files. .SH "TASK/CGROUP PLUGIN" -.LP -Slurm \fBtask/cgroup\fP plugin is used to enforce allocated resources -constraints, thus avoiding tasks to use unallocated resources. It currently -only uses cpuset subsystem but could use memory and devices subsystems in a -near future too. - -.LP -It creates a hierarchical set of directories for each task and subsystem. -The directory structure is like the following: -.br -/cgroup/%subsys/uid_%uid/job_%jobid/step_%stepid/task_%taskid - -.LP -Slurm cgroup task plugin is enabled with the following parameter -in slurm.conf: -.br -TaskPlugin=task/cgroup - .LP The following cgroup.conf parameters are defined to control the behavior of this particular plugin: .TP \fBConstrainCores\fR= -If configured to "yes" then constrain allowed cores to the subset of +If configured to "yes" then constrain allowed cores to the subset of allocated resources. It uses the cpuset subsystem. The default value is "no". + .TP \fBTaskAffinity\fR= -If configured to "yes" then set a default task affinity to bind each step +If configured to "yes" then set a default task affinity to bind each step task to a subset of the allocated cores using \fBsched_setaffinity\fP. The default value is "no". -.LP -The following cgroup.conf parameters could be defined to control the behavior -of this particular plugin in a next version where memory and devices support -would be added : - .TP \fBAllowedRAMSpace\fR= Constrain the job cgroup RAM to this percentage of the allocated memory. @@ -190,13 +126,13 @@ The default value is "no". .TP \fBAllowedDevicesFile\fR= -If the ConstrainDevices field is set to "yes" then this file has to be used to declare -the devices that need to be allowed by default for all the jobs. The current implementation +If the ConstrainDevices field is set to "yes" then this file has to be used to declare +the devices that need to be allowed by default for all the jobs. The current implementation of cgroup devices subsystem works as a whitelist of entries, which means that in order to isolate the access of a job upon particular devices we need to allow the access on all -the devices, supported by default and then deny on those that the job does not have the -permission to use. The default value is "/etc/slurm/cgroup_allowed_devices_file.conf". The syntax of -the file accepts one device per line and it permits lines like /dev/sda* or /dev/cpu/*/*. +the devices, supported by default and then deny on those that the job does not have the +permission to use. The default value is "/etc/slurm/cgroup_allowed_devices_file.conf". The syntax of +the file accepts one device per line and it permits lines like /dev/sda* or /dev/cpu/*/*. See also an example of this file in etc/allowed_devices_file.conf.example. @@ -217,72 +153,8 @@ ConstrainCores=yes .br # -.SH "NOTES" -.LP -Only one instance of a cgroup subsystem is valid at a time in the kernel. -If you try to mount another cgroup hierarchy that uses the same cpuset -subsystem it will fail. -However you can mount another cgroup hierarchy for a different cpuset -subsystem. - -.SH CLEANUP OF CGROUPS -.LP -To allow cgroups to be removed automatically when they are no longer in use -the notify_on_release flag is set in each cgroup when the cgroup is -instantiated. The release_agent file for each subsystem is set up when the -subsystem is mounted. The name of each release_agent file is -release_. The directory is specified via the -CgroupReleaseAgentDir parameter in cgroup.conf. A simple release agent -mechanism to remove slurm cgroups when they become empty may be set up by -creating the release agent files for each required subsystem as symbolic -links to a common release agent script, as shown in the example below: - -[sulu] (slurm) etc> cat cgroup.conf | grep CgroupReleaseAgentDir -.br -CgroupReleaseAgentDir="/etc/slurm/cgroup" -.br - -[sulu] (slurm) etc> ls \-al /etc/slurm/cgroup -.br -total 12 -.br -drwxr-xr-x 2 root root 4096 2010-04-23 14:55 . -.br -drwxr-xr-x 4 root root 4096 2010-07-22 14:48 .. -.br -\-rwxrwxrwx 1 root root 234 2010-04-23 14:52 release_common -.br -lrwxrwxrwx 1 root root 32 2010-04-23 11:04 release_cpuset -> /etc/slurm/cgroup/release_common -.br -lrwxrwxrwx 1 root root 32 2010-04-23 11:03 release_freezer -> /etc/slurm/cgroup/release_common - -[sulu] (slurm) etc> cat /etc/slurm/cgroup/release_common -.br -#!/bin/bash -.br -base_path=/cgroup -.br -progname=$(basename $0) -.br -subsystem=${progname##*_} -.br -.br -rmcg=${base_path}/${subsystem}$@ -.br -uidcg=${rmcg%/job*} -.br -if [[ \-d ${base_path}/${subsystem} ]] -.br -then -.br - flock \-x ${uidcg} \-c "rmdir ${rmcg}" -.br -fi -.br -[sulu] (slurm) etc> - .SH "COPYING" -Copyright (C) 2010 Lawrence Livermore National Security. +Copyright (C) 2010-2012 Lawrence Livermore National Security. Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). CODE\-OCEC\-09\-009. All rights reserved. .LP diff --git a/doc/man/man5/gres.conf.5 b/doc/man/man5/gres.conf.5 index 455a03d1b467ad6f9c5ff53b98b8eed625089fc9..09413dc52c4ea81e7c942861690515ff32f17e96 100644 --- a/doc/man/man5/gres.conf.5 +++ b/doc/man/man5/gres.conf.5 @@ -1,4 +1,4 @@ -.TH "gres.conf" "5" "April 2012" "gres.conf 2.3" "Slurm configuration file" +.TH "gres.conf" "5" "July 2012" "gres.conf 2.3" "Slurm configuration file" .SH "NAME" gres.conf \- Slurm configuration file for generic resource management. @@ -28,6 +28,8 @@ Number of resources of this type available on this node. The default value is set to the number of \fBFile\fR values specified (if any), otherwise the default value is one. A suffix of "K", "M" or "G" may be used to mulitply the number by 1024, 1048576 or 1073741824 respectively. +Note that Count is a 32\-bit field and the maximum value is 4,294,967,295. + .TP \fBCPUs\fR diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5 index a4837e95155363fb2a783e76dae1a63b6ff4493c..76d755ea8d950401d61d1a9a74d2147e0d183c4c 100644 --- a/doc/man/man5/slurm.conf.5 +++ b/doc/man/man5/slurm.conf.5 @@ -1,4 +1,4 @@ -.TH "slurm.conf" "6" "April 2012" "slurm.conf 2.4" "Slurm configuration file" +.TH "slurm.conf" "5" "July 2012" "slurm.conf 2.5" "Slurm configuration file" .SH "NAME" slurm.conf \- Slurm configuration file @@ -324,6 +324,9 @@ Resource selection plugin \fBSteps\fR Slurmctld resource allocation for job steps .TP +\fBSwitch\fR +Siwtch plugin +.TP \fBTriggers\fR Slurmctld triggers .TP @@ -733,10 +736,10 @@ The value may not exceed 65533. \fBLicenses\fR Specification of licenses (or other resources available on all nodes of the cluster) which can be allocated to jobs. -License names can optionally be followed by an asterisk +License names can optionally be followed by a colon and count with a default count of one. Multiple license names should be comma separated (e.g. -"Licenses=foo*4,bar"). +"Licenses=foo:4,bar"). Note that SLURM prevents jobs from being scheduled if their required license specification is not available. SLURM does not prevent jobs from using licenses that are @@ -816,9 +819,11 @@ necessitate higher values. \fBMinJobAge\fR The minimum age of a completed job before its record is purged from SLURM's active database. Set the values of \fBMaxJobCount\fR and -\fBMinJobAge\fR to insure the slurmctld daemon does not exhaust + to insure the slurmctld daemon does not exhaust its memory or other resources. The default value is 300 seconds. A value of zero prevents any job record purging. +In order to eliminate some possible race conditions, the minimum non\-zero +value for \fBMinJobAge\fR recommended is 2. May not exceed 65533. .TP @@ -834,7 +839,7 @@ Currently supported versions include: \fBmvapich\fR, \fBnone\fR (default, which works for many other versions of MPI) and \fBopenmpi\fR. -\fpmi2\fR, +\fBpmi2\fR, More information about MPI use is available here . @@ -1169,6 +1174,12 @@ resources for use. While this program is running, the nodes associated with the job will be have a POWER_UP/CONFIGURING flag set in their state, which can be readily viewed. +The slurmctld daemon will wait indefinitely for this program to complete. +Once the program completes with an exit code of zero, the nodes will be +considered ready for use and the program will be started. +If some node can not be made available for use, the program should drain +the node (typically using the scontrol command) and terminate with a non\-zero +exit code. A non\-zero exit code will result in the job being requeued (where possible) or killed. See \fBProlog and Epilog Scripts\fR for more information. @@ -1545,6 +1556,12 @@ 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. .TP +\fBselect/serial\fR +for allocating resources to single CPU jobs only. +Highly optimized for maximum throughput. +NOTE: SPANK environment variables are NOT propagated to the job's \fBEpilog\fR +program. +.TP \fBselect/bluegene\fR for a three\-dimensional BlueGene system. The default value is "select/bluegene" for BlueGene systems. @@ -1607,7 +1624,10 @@ Without this option, by default one task will be allocated per thread on nodes with more than one \fBThreadsPerCore\fR configured. .TP \fBCR_CORE_DEFAULT_DIST_BLOCK\fR -Allocate cores using block distribution by default. +Allocate cores within a node using block distribution by default. +This is a pseudo\-best\-fit algorithm that minimizes the number of +boards and minimizes the number of sockets (within minimum boards) +used for the allocation. This default behavior can be overridden specifying a particular "\-m" parameter with srun/salloc/sbatch. Without this option, cores will be allocated cyclicly across the sockets. @@ -1946,6 +1966,8 @@ Acceptable values include "switch/none" for switches not requiring special processing for job launch or termination (Myrinet, Ethernet, and InfiniBand), "switch/elan" for Quadrics Elan 3 or Elan 4 interconnect. +"switch/federation" for IBM's Federation switch. +"switch/nrt" for IBM's Network Resource Table API. The default value is "switch/none". All SLURM daemons, commands and running jobs must be restarted for a change in \fBSwitchType\fR to take effect. @@ -2287,7 +2309,7 @@ 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 and switch/federation plugins at this time. +switch/elan, switch/federation and switch/nrt plugins 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 @@ -2309,7 +2331,7 @@ 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 and switch/federation plugins at this time. +switch/elan, switch/federation and switch/nrt plugins 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 @@ -2328,7 +2350,15 @@ they must exactly match the entries in the \fBNodeName\fR (e.g. "NodeName=lx[0\-7] NodeAddr="elx[0\-7]"). \fBNodeAddr\fR may also contain IP addresses. By default, the \fBNodeAddr\fR will be identical in value to -\fBNodeName\fR. +\fBNodeHostname\fR. + +.TP +\fBBoards\fR +Number of Baseboards in nodes with a baseboard controller. +Note that when Boards is specified, SocketsPerBoard, +CoresPerSocket, and ThreadsPerCore should be specified. +Boards and CPUs are mutully exclusive. +The default value is 1. .TP \fBCoresPerSocket\fR @@ -2344,6 +2374,7 @@ The default value is 1. Number of logical processors on the node (e.g. "2"). If \fBCPUs\fR is omitted, it will set equal to the product of \fBSockets\fR, \fBCoresPerSocket\fR, and \fBThreadsPerCore\fR. +CPUs and Boards are mutually exclusive. The default value is 1. .TP @@ -2365,7 +2396,8 @@ colon with a numeric value (default value is one) (e.g. "Gres=bandwidth:10000,gpu:2"). A suffix of "K", "M" or "G" may be used to mulitply the number by 1024, 1048576 or 1073741824 respectively (e.g. "Gres=bandwidth:4G,gpu:4").. -By default a node has no generic resources. +By default a node has no generic resources and its maximum count is +4,294,967,295. Also see \fBFeature\fR. .TP @@ -2374,7 +2406,8 @@ The port number that the SLURM compute node daemon, \fBslurmd\fR, listens to for work on this particular node. By default there is a single port number for all \fBslurmd\fR daemons on all compute nodes as defined by the \fBSlurmdPort\fR configuration parameter. Use of this option is not generally -recommended except for development or testing purposes. +recommended except for development or testing purposes. If multiple +\fBslurmd\fR daemons execute on a node this can specify a range of ports .TP \fBProcs\fR @@ -2398,6 +2431,15 @@ If Sockets is omitted, it will be inferred from \fBCPUs\fR, \fBCoresPerSocket\fR, and \fBThreadsPerCore\fR. \fBNOTE\fR: If you have multi\-core processors, you will likely need to specify these parameters. +Sockets and SocketsPerBoard are mutually exclusive. +If Sockets is specified when Boards is also used, +Sockets is interpreted as SocketsPerBoard rather than total sockets. +The default value is 1. + +.TP +\fBSocketsPerBoard\fR +Number of physical processor sockets/chips on a baseboard. +Sockets and SocketsPerBoard are mutually exclusive. The default value is 1. .TP @@ -3374,7 +3416,7 @@ See the \fBlogrotate\fR man page for more details. .SH "COPYING" Copyright (C) 2002\-2007 The Regents of the University of California. Copyright (C) 2008\-2010 Lawrence Livermore National Security. -Portions Copyright (C) 2010 SchedMD . +Portions Copyright (C) 2010-2012 SchedMD . Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). CODE\-OCEC\-09\-009. All rights reserved. .LP diff --git a/doc/man/man8/Makefile.in b/doc/man/man8/Makefile.in index 2c46deb5e8d374f0c2c29a89c3f8c1a7cd8dde8a..6936fd73c4f9698f224bd3f9dfe636994910626d 100644 --- a/doc/man/man8/Makefile.in +++ b/doc/man/man8/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -106,6 +105,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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; }; \ + } man8dir = $(mandir)/man8 am__installdirs = "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)" NROFF = nroff @@ -152,9 +157,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -162,9 +165,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -196,6 +198,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -223,6 +227,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -400,9 +405,7 @@ uninstall-man8: files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man8dir)" && rm -f $$files; } + dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) install-htmlDATA: $(html_DATA) @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" @@ -420,9 +423,7 @@ uninstall-htmlDATA: @$(NORMAL_UNINSTALL) @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(htmldir)" && rm -f $$files + dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: @@ -490,10 +491,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) diff --git a/etc/federation.conf.example b/etc/federation.conf.example deleted file mode 100644 index 5c376ae43f200dab3daa8757bbfe7ff12117e7b5..0000000000000000000000000000000000000000 --- a/etc/federation.conf.example +++ /dev/null @@ -1,10 +0,0 @@ -# -# Global specifications for Federation Switch Plugin -# -# AdapterName: Adapter names can be in these forms -# sni0 -# sni[0-1] -# sni[0,1] -# sni[0-1,2] - -AdapterName=sni[0-1] diff --git a/etc/init.d.slurm b/etc/init.d.slurm index 6f5b02543605dfe85f7a4a4baf3ae36c198d2e00..c3ace6009ecc6d4b90ab81eada01346771998745 100644 --- a/etc/init.d.slurm +++ b/etc/init.d.slurm @@ -55,11 +55,6 @@ else RETVAL=0 fi -if [ ! -x $BINDIR/scontrol ]; then - echo "Could not find $BINDIR/scontrol. Bad path?" - exit 1 -fi - # We can not use a starter program without losing environment # variables that are critical on Blue Gene systems if [ -d /bgl/BlueLight/ppcfloor ]; then @@ -80,6 +75,11 @@ else SLURMD_OPTIONS="" fi +if [ ! -x $BINDIR/scontrol ]; then + echo "Could not find $BINDIR/scontrol. Bad path?" + exit 1 +fi + if [ ! -f $CONFDIR/slurm.conf ]; then echo "Could not find $CONFDIR/slurm.conf. Bad path?" exit 1 diff --git a/slurm.spec b/slurm.spec index af6c25e9b14fabaea567b28eac049852a9628830..33270a93546fee83fdf1c0adb95282bf5cff154a 100644 --- a/slurm.spec +++ b/slurm.spec @@ -10,14 +10,14 @@ # --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_xt %_with_cray_xt 1 build for Cray XT system +# --with cray %_with_cray 1 build for a Cray system # --with debug %_with_debug 1 enable extra debugging within SLURM -# --with elan %_with_elan 1 build switch-elan RPM # --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 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 # --with postgres %_with_postgres 1 require postgresql support # --without readline %_without_readline 1 don't require readline-devel RPM to be installed # --with sgijob %_with_sgijob 1 build proctrack-sgi-job RPM @@ -42,7 +42,6 @@ %slurm_without_opt bluegene %slurm_without_opt cray %slurm_without_opt debug -%slurm_without_opt elan %slurm_without_opt sun_const %slurm_without_opt srun2aprun @@ -146,6 +145,11 @@ BuildRequires: mysql-devel >= 5.0.0 BuildRequires: postgresql-devel >= 8.0.0 %endif +%if %{slurm_with cray} +BuildRequires: cray-MySQL-devel-enterprise +Requires: cray-MySQL-devel-enterprise +%endif + %ifnos aix5.3 # FIXME: AIX can't seem to find this even though this is in existance there. # We should probably figure out a better way of doing this, but for now we @@ -254,16 +258,6 @@ Requires: slurm SLURM plugin interfaces to IBM Blue Gene system %endif -%if %{slurm_with elan} -%package switch-elan -Summary: SLURM switch plugin for Quadrics Elan3 or Elan4. -Group: System Environment/Base -Requires: slurm qsnetlibs -BuildRequires: qsnetlibs -%description switch-elan -SLURM switch plugin for Quadrics Elan3 or Elan4. -%endif - %package slurmdbd Summary: SLURM database daemon Group: System Environment/Base @@ -315,15 +309,26 @@ Wrappers to write directly to the slurmdb. %if %{slurm_with aix} %package aix -Summary: SLURM interfaces to IBM AIX and Federation switch. +Summary: SLURM interfaces to IBM AIX. Group: System Environment/Base Requires: slurm BuildRequires: proctrack >= 3 Obsoletes: slurm-aix-federation %description aix -SLURM plugins for IBM AIX and Federation switch. +SLURM plugins for IBM AIX. +%endif + +%if %{slurm_with percs} +%package percs +Summary: SLURM plugins to run on an IBM PERCS system. +Group: System Environment/Base +Requires: slurm nrt +BuildRequires: nrt +%description percs +SLURM plugins to run on an IBM PERCS system, POE interface and NRT switch plugin. %endif + %if %{slurm_with sgijob} %package proctrack-sgi-job Summary: SLURM process tracking plugin for SGI job containers. @@ -383,7 +388,6 @@ Gives the ability for SLURM to use Berkeley Lab Checkpoint/Restart %build %configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \ - %{?slurm_with_cray_xt:--enable-cray-xt} \ %{?slurm_with_debug:--enable-debug} \ %{?slurm_with_partial_attach:--enable-partial-attach} \ %{?slurm_with_sun_const:--enable-sun-const} \ @@ -485,10 +489,6 @@ test -f $RPM_BUILD_ROOT/etc/init.d/slurm && test -f $RPM_BUILD_ROOT/%{_bindir}/sview && echo %{_bindir}/sview >> $LIST -%if %{slurm_with aix} -install -D -m644 etc/federation.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/federation.conf.example -%endif - %if %{slurm_with bluegene} install -D -m644 etc/bluegene.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/bluegene.conf.example mkdir -p ${RPM_BUILD_ROOT}/etc/ld.so.conf.d @@ -510,8 +510,14 @@ LIST=./aix.files touch $LIST test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/proctrack_aix.so && echo %{_libdir}/slurm/proctrack_aix.so >> $LIST -test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/switch_federation.so && - echo %{_libdir}/slurm/switch_federation.so >> $LIST + +LIST=./percs.files +touch $LIST +test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/switch_nrt.so && + echo %{_libdir}/slurm/switch_nrt.so >> $LIST +test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/libpermapi.so && + echo %{_libdir}/slurm/libpermapi.so >> $LIST + LIST=./slurmdbd.files touch $LIST @@ -671,14 +677,6 @@ rm -rf $RPM_BUILD_ROOT ############################################################################# -%if %{slurm_with elan} -%files switch-elan -%defattr(-,root,root) -%{_libdir}/slurm/switch_elan.so -%{_libdir}/slurm/proctrack_rms.so -%endif -############################################################################# - %files -f slurmdbd.files slurmdbd %defattr(-,root,root) %{_sbindir}/slurmdbd @@ -736,6 +734,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/slurm/select_cray.so %{_libdir}/slurm/select_cons_res.so %{_libdir}/slurm/select_linear.so +%{_libdir}/slurm/select_serial.so %{_libdir}/slurm/switch_none.so %{_libdir}/slurm/task_none.so %{_libdir}/slurm/topology_3d_torus.so @@ -779,7 +778,12 @@ rm -rf $RPM_BUILD_ROOT %files -f aix.files aix %defattr(-,root,root) %{_libdir}/slurm/checkpoint_aix.so -%config %{_sysconfdir}/federation.conf.example +%endif +############################################################################# + +%if %{slurm_with percs} +%files -f percs.files percs +%defattr(-,root,root) %endif ############################################################################# diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in index a0e364dc3912f8b1f62030ab1a5a5374b0fba5bc..0392c48fd5fc853996cdb3dd44176fef8d0ff72d 100644 --- a/slurm/slurm.h.in +++ b/slurm/slurm.h.in @@ -422,7 +422,8 @@ enum jobacct_data_type { JOBACCT_DATA_TOT_PAGES, /* data-> uint32_t psize */ JOBACCT_DATA_MIN_CPU, /* data-> uint32_t psize */ JOBACCT_DATA_MIN_CPU_ID, /* data-> jobacct_id_t psize */ - JOBACCT_DATA_TOT_CPU /* data-> uint32_t psize */ + JOBACCT_DATA_TOT_CPU, /* data-> uint32_t psize */ + JOBACCT_DATA_CPU_CYCLES /* data-> uint32_t psize */ }; /* Possible task distributions across the nodes */ @@ -458,6 +459,7 @@ typedef enum cpu_bind_type { /* cpu binding type from --cpu_bind=... */ CPU_BIND_TO_CORES = 0x04, /* =cores */ CPU_BIND_TO_SOCKETS= 0x08, /* =sockets */ CPU_BIND_TO_LDOMS = 0x10, /* locality domains */ + CPU_BIND_TO_BOARDS = 0x1000, /* =boards */ /* the following manual binding flags are mutually exclusive */ /* CPU_BIND_NONE needs to be the lowest value among manual bindings */ CPU_BIND_NONE = 0x20, /* =no */ @@ -473,6 +475,13 @@ typedef enum cpu_bind_type { /* cpu binding type from --cpu_bind=... */ CPU_BIND_CPUSETS = 0x8000 } cpu_bind_type_t; +/* Flag to indicate that cpu_freq is a range: low,medium,high + * instead of an integer value in kilohertz */ +#define CPU_FREQ_RANGE_FLAG 0x80000000 +#define CPU_FREQ_LOW 0x80000001 +#define CPU_FREQ_MEDIUM 0x80000002 +#define CPU_FREQ_HIGH 0x80000003 + typedef enum mem_bind_type { /* memory binding type from --mem_bind=... */ /* verbose can be set with any other flag */ MEM_BIND_VERBOSE= 0x01, /* =v, */ @@ -526,6 +535,7 @@ enum node_states { * Values can be can be ORed */ #define SHOW_ALL 0x0001 /* Show info for "hidden" partitions */ #define SHOW_DETAIL 0x0002 /* Show detailed resource information */ +#define SHOW_DETAIL2 0x0004 /* Show batch script listing */ /* Define keys for ctx_key argument of slurm_step_ctx_get() */ enum ctx_keys { @@ -553,6 +563,9 @@ enum ctx_keys { #define CR_CORE 0x0004 /* Resources are shared down to the core level. * Jobs will not be co-allocated within a * core. */ +#define CR_BOARD 0x0008 /* Resources are shared down to the board + * level. Jobs will not be co-allocated + * within a board. */ #define CR_MEMORY 0x0010 /* Memory as consumable resources. Memory is * not over-commited when selected as a CR. */ @@ -996,6 +1009,8 @@ typedef struct job_descriptor { /* For submit, allocate, and update requests */ * default=0 */ uint32_t max_nodes; /* maximum number of nodes usable by job, * default=0 */ + uint16_t boards_per_node; /* boards per node required by job */ + uint16_t sockets_per_board;/* sockets per board required by job */ uint16_t sockets_per_node;/* sockets per node required by job */ uint16_t cores_per_socket;/* cores per socket required by job */ uint16_t threads_per_core;/* threads per core required by job */ @@ -1003,6 +1018,7 @@ typedef struct job_descriptor { /* For submit, allocate, and update requests */ uint16_t ntasks_per_socket;/* number of tasks to invoke on * each socket */ uint16_t ntasks_per_core;/* number of tasks to invoke on each core */ + uint16_t ntasks_per_board;/* number of tasks to invoke on each board */ uint16_t pn_min_cpus; /* minimum # CPUs per node, default=0 */ uint32_t pn_min_memory; /* minimum real memory per node OR * real memory per CPU | MEM_PER_CPU, @@ -1067,9 +1083,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 */ - uint16_t sockets_per_node;/* sockets per node required by job */ - uint16_t cores_per_socket;/* cores per socket required by job */ - uint16_t threads_per_core;/* threads per core required by job */ + uint16_t boards_per_node; /* boards per node required by job */ + uint16_t sockets_per_board;/* sockets per board required by job */ + uint16_t sockets_per_node; /* sockets per node required by job */ + uint16_t cores_per_socket; /* cores per socket required by job */ + uint16_t threads_per_core; /* threads per core required by job */ char *name; /* name of the job */ char *network; /* network specification */ char *nodes; /* list of nodes allocated to job */ @@ -1079,7 +1097,8 @@ typedef struct job_info { * start_range_2, .., -1 */ uint16_t ntasks_per_core;/* number of tasks to invoke on each core */ 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_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 */ @@ -1120,12 +1139,24 @@ typedef struct job_info { uint32_t wait4switch; /* Maximum time to wait for minimum switches */ char *wckey; /* wckey for job */ char *work_dir; /* pathname of working directory */ -} job_info_t; +} slurm_job_info_t; + +#ifndef __PERMAPI__H__ +/* If on an IBM PERCS machine the libpermapi.so file we generate in + * the switch/nrt plugin will need to link to this file and the + * permapi.h file which both have a job_info_t structure defined in + * it. So to avoid conflict only define job_info_t if we haven't + * included that file first. Then when in the libpermapi environment + * we can use slurm_job_info_t to access the job_info_t data. If not + * in that environment we should never know anything changed. + */ +typedef slurm_job_info_t job_info_t; +#endif typedef struct job_info_msg { time_t last_update; /* time of latest info */ uint32_t record_count; /* number of records */ - job_info_t *job_array; /* the job records */ + slurm_job_info_t *job_array; /* the job records */ } job_info_msg_t; typedef struct step_update_request_msg { @@ -1228,6 +1259,7 @@ typedef struct suspend_msg { typedef struct { uint16_t ckpt_interval; /* checkpoint interval in minutes */ uint32_t cpu_count; /* number of required processors */ + uint32_t cpu_freq; /* requested cpu frequency */ uint16_t exclusive; /* 1 if CPUs not shared with other steps */ char *features; /* required node features, default NONE */ uint16_t immediate; /* 1 if allocate to run or fail immediately, @@ -1289,6 +1321,7 @@ typedef struct { char *task_epilog; uint16_t cpu_bind_type; /* use cpu_bind_type_t */ char *cpu_bind; + uint32_t cpu_freq; /* requested cpu frequency */ uint16_t mem_bind_type; /* use mem_bind_type_t */ char *mem_bind; @@ -1344,6 +1377,7 @@ typedef struct { * start_range_1, end_range_1, * start_range_2, .., -1 */ uint32_t num_cpus; /* how many cpus are being used by step */ + uint32_t cpu_freq; /* requested cpu frequency */ uint32_t num_tasks; /* number of tasks */ char *partition; /* name of assigned partition */ char *resv_ports; /* ports allocated for MPI */ @@ -1391,8 +1425,9 @@ typedef struct { typedef struct node_info { char *arch; /* computer architecture */ + uint16_t boards; /* total number of boards per node */ time_t boot_time; /* time of node boot */ - uint16_t cores; /* number of cores per CPU */ + uint16_t cores; /* number of cores per socket */ uint16_t cpus; /* configured count of cpus running on * the node */ char *features; /* list of a node's features */ @@ -1409,7 +1444,7 @@ typedef struct node_info { uint32_t reason_uid; /* User that set the reason, ignore if * no reason is set. */ time_t slurmd_start_time;/* time of slurmd startup */ - uint16_t sockets; /* number of sockets per node */ + uint16_t sockets; /* total number of sockets per node */ uint16_t threads; /* number of threads per core */ uint32_t tmp_disk; /* configured MB of total disk in TMP_FS */ uint32_t weight; /* arbitrary priority of node for scheduling */ @@ -1679,6 +1714,8 @@ void slurm_init_update_block_msg PARAMS((update_block_msg_t *update_block_msg)); #define RESERVE_FLAG_NO_LIC_ONLY 0x0200 /* Clear reserve licenses only flag */ #define RESERVE_FLAG_STATIC 0x0400 /* Static node allocation */ #define RESERVE_FLAG_NO_STATIC 0x0800 /* Clear static node allocation */ +#define RESERVE_FLAG_PART_NODES 0x1000 /* Use Partition Nodes only */ +#define RESERVE_FLAG_NO_PART_NODES 0x2000 /* Clear Partition Nodes only */ #define RESERVE_FLAG_OVERLAP 0x4000 /* Permit to overlap others */ #define RESERVE_FLAG_SPEC_NODES 0x8000 /* Contains specific nodes */ @@ -1758,6 +1795,7 @@ typedef struct reservation_name_msg { #define DEBUG_FLAG_NO_REALTIME 0x00010000 /* get debug when the * realtime server * dies on a bluegene system */ +#define DEBUG_FLAG_SWITCH 0x00020000 /* SwitchType plugin */ #define GROUP_FORCE 0x8000 /* if set, update group membership * info even if no updates to @@ -1826,6 +1864,8 @@ typedef struct slurm_ctl_conf { * inactive resource allocation is released */ uint16_t job_acct_gather_freq; /* poll frequency for job accounting * gather plugins */ + uint16_t xres_access_freq; /* poll frequency for + * external-resource-access thread */ char *job_acct_gather_type; /* job accounting gather type */ char *job_ckpt_dir; /* directory saving job record checkpoint */ char *job_comp_host; /* job completion logging host */ @@ -1844,7 +1884,9 @@ typedef struct slurm_ctl_conf { * the processes is aborted or crashed */ uint16_t kill_wait; /* seconds between SIGXCPU to SIGKILL * on job termination */ + char *launch_type; /* type of step launcher to use */ char *licenses; /* licenses available on this cluster */ + char *licenses_used; /* licenses used on this cluster */ char *mail_prog; /* pathname of mail program */ uint32_t max_job_cnt; /* maximum number of active jobs */ uint32_t max_job_id; /* maximum job id before using first_job_id */ @@ -1975,8 +2017,9 @@ typedef struct slurmd_status_msg { time_t last_slurmctld_msg; /* time of last slurmctld message */ uint16_t slurmd_debug; /* logging level */ uint16_t actual_cpus; /* actual logical processor count */ - uint16_t actual_sockets; /* actual sockets count */ - uint16_t actual_cores; /* actual core count */ + uint16_t actual_boards; /* actual total boards count */ + uint16_t actual_sockets; /* actual total sockets count */ + uint16_t actual_cores; /* actual core per socket count */ uint16_t actual_threads; /* actual thread per core count */ uint32_t actual_real_mem; /* actual real memory in MB */ uint32_t actual_tmp_disk; /* actual temp disk space in MB */ @@ -2372,7 +2415,7 @@ extern int slurm_terminate_job_step PARAMS((uint32_t job_id, uint32_t step_id)); * in the structure that you will pass to slurm_step_ctx_create(). * This function will NOT allocate any new memory. * IN ptr - pointer to a structure allocated by the user. The structure will - * be intialized. + * be initialized. */ extern void slurm_step_ctx_params_t_init PARAMS((slurm_step_ctx_params_t *ptr)); @@ -2420,14 +2463,17 @@ extern int slurm_jobinfo_ctx_get PARAMS((switch_jobinfo_t *jobinfo, * to run a single process per node, regardless of the settings * selected at slurm_step_ctx_create time. * - * This is primarily used on AIX by the slurm_ll_api in support of - * poe. The slurm_ll_api will want to launch a single pmd daemon + * This is primarily used when launching 1 task per node as done + * with IBM's PE where we want to launch a single pmd daemon * on each node regardless of the number of tasks running on each * node. * IN ctx - job step context generated by slurm_step_ctx_create + * IN addr_array - address of nodes to run on + * IN node_cnt - number of nodes to run on * 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)); +extern int slurm_step_ctx_daemon_per_node_hack PARAMS( + (slurm_step_ctx_t *ctx, char **addr_array, uint32_t node_cnt)); /* * slurm_step_ctx_destroy - free allocated memory for a job step context. @@ -2441,7 +2487,7 @@ extern int slurm_step_ctx_destroy PARAMS((slurm_step_ctx_t *ctx)); * slurm_step_launch_params_t structure with default values. * default values. This function will NOT allocate any new memory. * IN ptr - pointer to a structure allocated by the use. The structure will - * be intialized. + * be initialized. */ extern void slurm_step_launch_params_t_init PARAMS((slurm_step_launch_params_t *ptr)); @@ -2704,7 +2750,7 @@ 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*, job_info_t * job_ptr, +extern void slurm_print_job_info PARAMS((FILE*, slurm_job_info_t * job_ptr, int one_liner)); /* @@ -2725,7 +2771,7 @@ 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((job_info_t * job_ptr, +extern char *slurm_sprint_job_info PARAMS((slurm_job_info_t * job_ptr, int one_liner)); /* diff --git a/slurm/slurm_errno.h b/slurm/slurm_errno.h index e26b5a933d9dacac9ce2bb23fbca9d497cc3b12b..6cc5042932c9a83602a8ba9d79743d318b0200e9 100644 --- a/slurm/slurm_errno.h +++ b/slurm/slurm_errno.h @@ -189,6 +189,7 @@ enum { ESLURM_PARTITION_IN_USE, ESLURM_STEP_LIMIT, ESLURM_JOB_SUSPENDED, + ESLURM_CAN_NOT_START_IMMEDIATELY, /* switch specific error codes, specific values defined in plugin module */ ESLURM_SWITCH_MIN = 3000, diff --git a/src/Makefile.in b/src/Makefile.in index ab36cc784358a9566eb2235155f8392211124c2b..29eead79bae3aeb18cef4dc8fc112214e50cca7c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -169,9 +168,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -179,9 +176,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -213,6 +209,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -240,6 +238,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -582,10 +581,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/api/Makefile.in b/src/api/Makefile.in index 56d44d91797e7fb4ebc53dcbdc03daee38d8cbe1..7b1d800d92a15cd0ab457604fa2241f0e61fc21a 100644 --- a/src/api/Makefile.in +++ b/src/api/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -60,9 +60,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -70,6 +68,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -108,6 +107,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libpmi_la_DEPENDENCIES = $(top_builddir)/src/api/libslurm.la @@ -201,10 +206,8 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ # This is needed if compiling on windows EXEEXT = -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -212,9 +215,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -246,6 +248,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -273,6 +277,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -589,11 +594,11 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libpmi.la: $(libpmi_la_OBJECTS) $(libpmi_la_DEPENDENCIES) +libpmi.la: $(libpmi_la_OBJECTS) $(libpmi_la_DEPENDENCIES) $(EXTRA_libpmi_la_DEPENDENCIES) $(libpmi_la_LINK) -rpath $(libdir) $(libpmi_la_OBJECTS) $(libpmi_la_LIBADD) $(LIBS) -libslurm.la: $(libslurm_la_OBJECTS) $(libslurm_la_DEPENDENCIES) +libslurm.la: $(libslurm_la_OBJECTS) $(libslurm_la_DEPENDENCIES) $(EXTRA_libslurm_la_DEPENDENCIES) $(libslurm_la_LINK) -rpath $(libdir) $(libslurm_la_OBJECTS) $(libslurm_la_LIBADD) $(LIBS) -libslurmhelper.la: $(libslurmhelper_la_OBJECTS) $(libslurmhelper_la_DEPENDENCIES) +libslurmhelper.la: $(libslurmhelper_la_OBJECTS) $(libslurmhelper_la_DEPENDENCIES) $(EXTRA_libslurmhelper_la_DEPENDENCIES) $(LINK) $(libslurmhelper_la_OBJECTS) $(libslurmhelper_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @@ -769,10 +774,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/api/allocate_msg.c b/src/api/allocate_msg.c index a4342b30797f5ef4b875681f39d9796f0271c7fd..f01b3bb38e64ca7ed910407aea14e7b556423c06 100644 --- a/src/api/allocate_msg.c +++ b/src/api/allocate_msg.c @@ -122,7 +122,7 @@ extern allocation_msg_thread_t *slurm_allocation_msg_thr_create( } if (net_stream_listen(&sock, (short *)port) < 0) { - error("unable to intialize step launch listening socket: %m"); + error("unable to initialize step launch listening socket: %m"); xfree(msg_thr); return NULL; } diff --git a/src/api/config_info.c b/src/api/config_info.c index 6ab4bc8f4866ae43227130f33bc673808c8e1f5b..1f93ca5357ac6dfe6f65b06854189193f92c4886 100644 --- a/src/api/config_info.c +++ b/src/api/config_info.c @@ -489,11 +489,21 @@ 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("LaunchType"); + key_pair->value = xstrdup(slurm_ctl_conf_ptr->launch_type); + list_append(ret_list, key_pair); + key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("Licenses"); key_pair->value = xstrdup(slurm_ctl_conf_ptr->licenses); list_append(ret_list, key_pair); + key_pair = xmalloc(sizeof(config_key_pair_t)); + key_pair->name = xstrdup("LicensesUsed"); + key_pair->value = xstrdup(slurm_ctl_conf_ptr->licenses_used); + list_append(ret_list, key_pair); + key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("MailProg"); key_pair->value = xstrdup(slurm_ctl_conf_ptr->mail_prog); @@ -1233,6 +1243,8 @@ void slurm_print_slurmd_status (FILE* out, fprintf(out, "Actual CPUs = %u\n", slurmd_status_ptr->actual_cpus); + fprintf(out, "Actual Boards = %u\n", + slurmd_status_ptr->actual_boards); fprintf(out, "Actual sockets = %u\n", slurmd_status_ptr->actual_sockets); fprintf(out, "Actual cores = %u\n", diff --git a/src/api/job_step_info.c b/src/api/job_step_info.c index b7483a67cbab012c39b4ba42e8272fa4d4dd9527..4cf5a4a2eef3a34298f8c7dab86a76678f233829 100644 --- a/src/api/job_step_info.c +++ b/src/api/job_step_info.c @@ -195,10 +195,43 @@ slurm_sprint_job_step_info ( job_step_info_t * job_step_ptr, /****** Line 4 ******/ snprintf(tmp_line, sizeof(tmp_line), - "ResvPorts=%s Checkpoint=%u CheckpointDir=%s\n\n", + "ResvPorts=%s Checkpoint=%u CheckpointDir=%s", job_step_ptr->resv_ports, job_step_ptr->ckpt_interval, job_step_ptr->ckpt_dir); xstrcat(out, tmp_line); + if (one_liner) + xstrcat(out, " "); + else + xstrcat(out, "\n "); + + /****** Line 5 ******/ + if (job_step_ptr->cpu_freq == NO_VAL) + snprintf(tmp_line, sizeof(tmp_line), + "CPUFreqReq=Default\n\n"); + else if (job_step_ptr->cpu_freq & CPU_FREQ_RANGE_FLAG) { + switch (job_step_ptr->cpu_freq) + { + case CPU_FREQ_LOW : + snprintf(tmp_line, sizeof(tmp_line), + "CPUFreqReq=Low\n\n"); + break; + case CPU_FREQ_MEDIUM : + snprintf(tmp_line, sizeof(tmp_line), + "CPUFreqReq=Medium\n\n"); + break; + case CPU_FREQ_HIGH : + snprintf(tmp_line, sizeof(tmp_line), + "CPUFreqReq=High\n\n"); + break; + default : + snprintf(tmp_line, sizeof(tmp_line), + "CPUFreqReq=Unknown\n\n"); + } + } + else + snprintf(tmp_line, sizeof(tmp_line), + "CPUFreqReq=%u\n\n", job_step_ptr->cpu_freq); + xstrcat(out, tmp_line); return out; } diff --git a/src/api/node_info.c b/src/api/node_info.c index bf25e8e04cb633dc3b30b93cde7f0394a7adb1fe..185cebf1c2a1f692f93ede7f0a671b4e974febbe 100644 --- a/src/api/node_info.c +++ b/src/api/node_info.c @@ -239,8 +239,9 @@ slurm_sprint_node_table (node_info_t * node_ptr, snprintf(tmp_line, sizeof(tmp_line), "OS=%s ", node_ptr->os); xstrcat(out, tmp_line); } - snprintf(tmp_line, sizeof(tmp_line), "RealMemory=%u Sockets=%u", - node_ptr->real_memory, node_ptr->sockets); + snprintf(tmp_line, sizeof(tmp_line), + "RealMemory=%u Sockets=%u Boards=%u", + node_ptr->real_memory, node_ptr->sockets, node_ptr->boards); xstrcat(out, tmp_line); if (one_liner) xstrcat(out, " "); diff --git a/src/api/pmi_server.h b/src/api/pmi_server.h index 2ab7fabf459425f93f002063c88fe43ae7c1ba78..ce4cca0645c245ba2d3afd8abe704cd3be3955a0 100644 --- a/src/api/pmi_server.h +++ b/src/api/pmi_server.h @@ -30,6 +30,7 @@ #define _PMI_SERVER_H #include "src/api/slurm_pmi.h" +#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); diff --git a/src/api/reservation_info.c b/src/api/reservation_info.c index ac922d9d2f70c2089726c1f1ae2904a1846be732..12df91caf1bd603a89d3045cfc5e0808fcdbf26b 100644 --- a/src/api/reservation_info.c +++ b/src/api/reservation_info.c @@ -129,7 +129,8 @@ char *slurm_sprint_reservation_info ( reserve_info_t * resv_ptr, flag_str = reservation_flags_string(resv_ptr->flags); snprintf(tmp_line, sizeof(tmp_line), - "Nodes=%s NodeCnt=%u CoreCnt= %u Features=%s PartitionName=%s Flags=%s", + "Nodes=%s NodeCnt=%u CoreCnt=%u Features=%s " + "PartitionName=%s Flags=%s", resv_ptr->node_list, resv_ptr->node_cnt, resv_ptr->core_cnt, resv_ptr->features, resv_ptr->partition, flag_str); xfree(flag_str); diff --git a/src/api/step_ctx.c b/src/api/step_ctx.c index 0775543190661095b9211f85858a42cfd83b875b..a26fafd8b2153f7d086031830d6e1fc00b9b9b94 100644 --- a/src/api/step_ctx.c +++ b/src/api/step_ctx.c @@ -58,6 +58,7 @@ #include "src/common/bitstring.h" #include "src/common/hostlist.h" #include "src/common/net.h" +#include "src/common/read_config.h" #include "src/common/slurm_cred.h" #include "src/common/slurm_protocol_api.h" #include "src/common/slurm_protocol_defs.h" @@ -108,6 +109,7 @@ static job_step_create_request_msg_t *_create_step_request( step_req->min_nodes = step_params->min_nodes; step_req->max_nodes = step_params->max_nodes; step_req->cpu_count = step_params->cpu_count; + step_req->cpu_freq = step_params->cpu_freq; step_req->num_tasks = step_params->task_count; step_req->relative = step_params->relative; step_req->resv_port_cnt = step_params->resv_port_cnt; @@ -156,7 +158,7 @@ slurm_step_ctx_create (const slurm_step_ctx_params_t *step_params) */ if (net_stream_listen(&sock, &port) < 0) { errnum = errno; - error("unable to intialize step context socket: %m"); + error("unable to initialize step context socket: %m"); slurm_free_job_step_create_request_msg(step_req); goto fail; } @@ -205,7 +207,6 @@ slurm_step_ctx_create_no_alloc (const slurm_step_ctx_params_t *step_params, int sock = -1; short port = 0; int errnum = 0; - int cyclic = (step_params->task_dist == SLURM_DIST_CYCLIC); /* First copy the user's step_params into a step request struct */ step_req = _create_step_request(step_params); @@ -216,7 +217,7 @@ slurm_step_ctx_create_no_alloc (const slurm_step_ctx_params_t *step_params, */ if (net_stream_listen(&sock, &port) < 0) { errnum = errno; - error("unable to intialize step context socket: %m"); + error("unable to initialize step context socket: %m"); slurm_free_job_step_create_request_msg(step_req); goto fail; } @@ -238,7 +239,8 @@ slurm_step_ctx_create_no_alloc (const slurm_step_ctx_params_t *step_params, if (switch_build_jobinfo(step_resp->switch_job, step_resp->step_layout->node_list, step_resp->step_layout->tasks, - cyclic, step_req->network) < 0) + step_resp->step_layout->tids, + step_req->network) < 0) fatal("switch_build_jobinfo: %m"); @@ -348,6 +350,7 @@ slurm_step_ctx_get (slurm_step_ctx_t *ctx, int ctx_key, ...) case SLURM_STEP_CTX_USER_MANAGED_SOCKETS: int_ptr = va_arg(ap, int *); int_array_pptr = va_arg(ap, int **); + if (ctx->launch_state == NULL || ctx->launch_state->user_managed_io == false || ctx->launch_state->io.user == NULL) { @@ -411,18 +414,23 @@ slurm_step_ctx_destroy (slurm_step_ctx_t *ctx) * to run a single process per node, regardless of the settings * selected at slurm_step_ctx_create time. * - * This is primarily used on AIX by the slurm_ll_api in support of - * poe. The slurm_ll_api will want to launch a single pmd daemon + * This is primarily used when launching 1 task per node as done + * with IBM's PE where we want to launch a single pmd daemon * on each node regardless of the number of tasks running on each * node. * IN ctx - job step context generated by slurm_step_ctx_create + * IN addr_array - address of nodes to run on + * IN node_cnt - number of nodes to run on * RET SLURM_SUCCESS or SLURM_ERROR (with slurm_errno set) */ extern int -slurm_step_ctx_daemon_per_node_hack(slurm_step_ctx_t *ctx) +slurm_step_ctx_daemon_per_node_hack( + slurm_step_ctx_t *ctx, char **addr_array, uint32_t node_cnt) { slurm_step_layout_t *new_layout, *old_layout; int i; + hostlist_t hl = NULL; + char *name = NULL; if ((ctx == NULL) || (ctx->magic != STEP_CTX_MAGIC)) { slurm_seterrno(EINVAL); @@ -430,15 +438,38 @@ slurm_step_ctx_daemon_per_node_hack(slurm_step_ctx_t *ctx) } /* hack the context node count */ - ctx->step_req->num_tasks = ctx->step_req->min_nodes; + ctx->step_req->num_tasks = node_cnt; /* hack the context step layout */ old_layout = ctx->step_resp->step_layout; new_layout = (slurm_step_layout_t *) xmalloc(sizeof(slurm_step_layout_t)); - new_layout->node_cnt = old_layout->node_cnt; - new_layout->task_cnt = old_layout->node_cnt; - new_layout->node_list = xstrdup(old_layout->node_list); + ctx->step_req->num_tasks = new_layout->task_cnt = new_layout->node_cnt + = node_cnt; + + for (i=0; inode_list = hostlist_ranged_string_xmalloc(hl); + hostlist_destroy(hl); + slurm_step_layout_destroy(old_layout); new_layout->tasks = (uint16_t *) xmalloc(sizeof(uint16_t) * new_layout->node_cnt); @@ -452,8 +483,14 @@ slurm_step_ctx_daemon_per_node_hack(slurm_step_ctx_t *ctx) ctx->step_resp->step_layout = new_layout; /* recreate the launch state structure now that the settings - have changed */ - step_launch_state_destroy(ctx->launch_state); + * have changed */ + + +/* FIXME: currently we have to make multiple calls for this so + destroying it does not work. This isn't a good solution either and + should only be viewed as temporary. +*/ + //step_launch_state_destroy(ctx->launch_state); ctx->launch_state = step_launch_state_create(ctx); return SLURM_SUCCESS; @@ -464,7 +501,7 @@ slurm_step_ctx_daemon_per_node_hack(slurm_step_ctx_t *ctx) * in the structure that you will pass to slurm_step_ctx_create(). * This function will NOT allocate any new memory. * IN ptr - pointer to a structure allocated by the user. The structure will - * be intialized. + * be initialized. */ extern void slurm_step_ctx_params_t_init (slurm_step_ctx_params_t *ptr) { diff --git a/src/api/step_launch.c b/src/api/step_launch.c index 0171d962ed592174426ec35d7e03f145c2c83fc5..b35c09330311231bd7d95c3b28244cbc64c02151 100644 --- a/src/api/step_launch.c +++ b/src/api/step_launch.c @@ -125,7 +125,7 @@ static struct io_operations message_socket_ops = { * slurm_step_launch_params_t structure with default values. * This function will NOT allocate any new memory. * IN ptr - pointer to a structure allocated by the user. - * The structure will be intialized. + * The structure will be initialized. */ void slurm_step_launch_params_t_init (slurm_step_launch_params_t *ptr) { @@ -138,6 +138,7 @@ void slurm_step_launch_params_t_init (slurm_step_launch_params_t *ptr) memcpy(&ptr->local_fds, &fds, sizeof(fds)); ptr->gid = getgid(); ptr->acctg_freq = (uint16_t) NO_VAL; + ptr->cpu_freq = NO_VAL; } /* @@ -250,6 +251,7 @@ int slurm_step_launch (slurm_step_ctx_t *ctx, launch.task_epilog = params->task_epilog; launch.cpu_bind_type = params->cpu_bind_type; launch.cpu_bind = params->cpu_bind; + launch.cpu_freq = params->cpu_freq; launch.mem_bind_type = params->mem_bind_type; launch.mem_bind = params->mem_bind; launch.multi_prog = params->multi_prog ? 1 : 0; @@ -834,7 +836,7 @@ static int _msg_thr_create(struct step_launch_state *sls, int num_nodes) for (i = 0; i < sls->num_resp_port; i++) { if (net_stream_listen(&sock, &port) < 0) { - error("unable to intialize step launch listening " + error("unable to initialize step launch listening " "socket: %m"); return SLURM_ERROR; } diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 8df61a75d14cf4417dd6d9966b430a4b1e37acef..6332b39a6dcbcf9abb449eeb967fc525335c8dc5 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -32,14 +32,16 @@ noinst_LTLIBRARIES = \ libspank.la libcommon_la_SOURCES = \ - xcgroup_read_config.c xcgroup_read_config.h \ - xcgroup.c xcgroup.h \ - xcpuinfo.c xcpuinfo.h \ + xcgroup_read_config.c xcgroup_read_config.h \ + xcgroup.c xcgroup.h \ + xcpuinfo.c xcpuinfo.h \ + cpu_frequency.c cpu_frequency.h \ assoc_mgr.c assoc_mgr.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 \ strlcpy.c strlcpy.h \ list.c list.h \ @@ -85,7 +87,6 @@ libcommon_la_SOURCES = \ uid.c uid.h \ util-net.c util-net.h \ slurm_auth.c slurm_auth.h \ - jobacct_common.c jobacct_common.h \ slurm_accounting_storage.c slurm_accounting_storage.h \ slurm_jobacct_gather.c slurm_jobacct_gather.h \ slurm_jobcomp.c slurm_jobcomp.h \ @@ -132,9 +133,9 @@ libspank_la_SOURCES = \ plugstack.c plugstack.h \ optz.c optz.h -libcommon_la_LIBADD = $(DL_LIBS) +libcommon_la_LIBADD = $(DL_LIBS) $(HWLOC_LIBS) -libcommon_la_LDFLAGS = $(LIB_LDFLAGS) -module --export-dynamic +libcommon_la_LDFLAGS = $(HWLOC_LDFLAGS) $(LIB_LDFLAGS) -module --export-dynamic # This was made so we could export all symbols from libcommon # on multiple platforms diff --git a/src/common/Makefile.in b/src/common/Makefile.in index f5c186616a793837b2a276f2f9cb0f2b7e2f6b7e..0abaf70dd15ae0676286140f99ef661c8f7dd350 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -68,9 +68,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -78,6 +76,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -97,11 +96,13 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = -libcommon_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +libcommon_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am__libcommon_la_SOURCES_DIST = xcgroup_read_config.c \ xcgroup_read_config.h xcgroup.c xcgroup.h xcpuinfo.c \ - xcpuinfo.h assoc_mgr.c assoc_mgr.h xmalloc.c xmalloc.h \ - xassert.c xassert.h xstring.c xstring.h xsignal.c xsignal.h \ + xcpuinfo.h cpu_frequency.c cpu_frequency.h assoc_mgr.c \ + assoc_mgr.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 strlcpy.c strlcpy.h list.c list.h net.c \ net.h log.c log.h cbuf.c cbuf.h safeopen.c safeopen.h \ bitstring.c bitstring.h mpi.c mpi.h pack.c pack.h \ @@ -120,35 +121,34 @@ am__libcommon_la_SOURCES_DIST = xcgroup_read_config.c \ slurm_rlimits_info.c slurmdb_defs.c slurmdb_defs.h \ slurmdb_pack.c slurmdb_pack.h slurmdbd_defs.c slurmdbd_defs.h \ working_cluster.c working_cluster.h uid.c uid.h util-net.c \ - util-net.h slurm_auth.c slurm_auth.h jobacct_common.c \ - jobacct_common.h slurm_accounting_storage.c \ - slurm_accounting_storage.h slurm_jobacct_gather.c \ - slurm_jobacct_gather.h slurm_jobcomp.c slurm_jobcomp.h \ - slurm_topology.c slurm_topology.h switch.c switch.h arg_desc.c \ - arg_desc.h macros.h malloc.c malloc.h getopt.h getopt.c \ - getopt1.c unsetenv.c unsetenv.h slurm_selecttype_info.c \ - slurm_selecttype_info.h slurm_resource_info.c \ - slurm_resource_info.h hostlist.c hostlist.h \ - slurm_step_layout.c slurm_step_layout.h checkpoint.c \ - checkpoint.h job_resources.c job_resources.h parse_time.c \ - parse_time.h job_options.c job_options.h global_defaults.c \ - timers.c timers.h slurm_xlator.h stepd_api.c stepd_api.h \ - write_labelled_message.c write_labelled_message.h proc_args.c \ - proc_args.h slurm_strcasestr.c slurm_strcasestr.h node_conf.h \ - node_conf.c gres.h gres.c + util-net.h slurm_auth.c slurm_auth.h \ + slurm_accounting_storage.c slurm_accounting_storage.h \ + slurm_jobacct_gather.c slurm_jobacct_gather.h slurm_jobcomp.c \ + slurm_jobcomp.h slurm_topology.c slurm_topology.h switch.c \ + switch.h arg_desc.c arg_desc.h macros.h malloc.c malloc.h \ + getopt.h getopt.c getopt1.c unsetenv.c unsetenv.h \ + slurm_selecttype_info.c slurm_selecttype_info.h \ + slurm_resource_info.c slurm_resource_info.h hostlist.c \ + hostlist.h slurm_step_layout.c slurm_step_layout.h \ + checkpoint.c checkpoint.h job_resources.c job_resources.h \ + parse_time.c parse_time.h job_options.c job_options.h \ + global_defaults.c timers.c timers.h slurm_xlator.h stepd_api.c \ + stepd_api.h write_labelled_message.c write_labelled_message.h \ + proc_args.c proc_args.h slurm_strcasestr.c slurm_strcasestr.h \ + node_conf.h node_conf.c gres.h gres.c @HAVE_UNSETENV_FALSE@am__objects_1 = unsetenv.lo am_libcommon_la_OBJECTS = xcgroup_read_config.lo xcgroup.lo \ - xcpuinfo.lo assoc_mgr.lo xmalloc.lo xassert.lo xstring.lo \ - xsignal.lo forward.lo strlcpy.lo list.lo net.lo log.lo cbuf.lo \ - safeopen.lo bitstring.lo mpi.lo pack.lo parse_config.lo \ - parse_spec.lo plugin.lo plugrack.lo print_fields.lo \ - read_config.lo node_select.lo env.lo fd.lo slurm_cred.lo \ - slurm_errno.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 jobacct_common.lo slurm_accounting_storage.lo \ + xcpuinfo.lo cpu_frequency.lo assoc_mgr.lo xmalloc.lo \ + xassert.lo xstring.lo xsignal.lo strnatcmp.lo forward.lo \ + strlcpy.lo list.lo net.lo log.lo cbuf.lo safeopen.lo \ + bitstring.lo mpi.lo pack.lo parse_config.lo parse_spec.lo \ + plugin.lo plugrack.lo print_fields.lo read_config.lo \ + node_select.lo env.lo fd.lo slurm_cred.lo slurm_errno.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_accounting_storage.lo \ slurm_jobacct_gather.lo slurm_jobcomp.lo slurm_topology.lo \ switch.lo arg_desc.lo malloc.lo getopt.lo getopt1.lo \ $(am__objects_1) slurm_selecttype_info.lo \ @@ -246,10 +246,8 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ # This is needed if compiling on windows EXEEXT = -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -257,9 +255,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -291,6 +288,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -318,6 +317,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -422,14 +422,16 @@ noinst_LTLIBRARIES = \ libspank.la libcommon_la_SOURCES = \ - xcgroup_read_config.c xcgroup_read_config.h \ - xcgroup.c xcgroup.h \ - xcpuinfo.c xcpuinfo.h \ + xcgroup_read_config.c xcgroup_read_config.h \ + xcgroup.c xcgroup.h \ + xcpuinfo.c xcpuinfo.h \ + cpu_frequency.c cpu_frequency.h \ assoc_mgr.c assoc_mgr.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 \ strlcpy.c strlcpy.h \ list.c list.h \ @@ -475,7 +477,6 @@ libcommon_la_SOURCES = \ uid.c uid.h \ util-net.c util-net.h \ slurm_auth.c slurm_auth.h \ - jobacct_common.c jobacct_common.h \ slurm_accounting_storage.c slurm_accounting_storage.h \ slurm_jobacct_gather.c slurm_jobacct_gather.h \ slurm_jobcomp.c slurm_jobcomp.h \ @@ -522,8 +523,8 @@ libspank_la_SOURCES = \ plugstack.c plugstack.h \ optz.c optz.h -libcommon_la_LIBADD = $(DL_LIBS) -libcommon_la_LDFLAGS = $(LIB_LDFLAGS) -module --export-dynamic +libcommon_la_LIBADD = $(DL_LIBS) $(HWLOC_LIBS) +libcommon_la_LDFLAGS = $(HWLOC_LDFLAGS) $(LIB_LDFLAGS) -module --export-dynamic # This was made so we could export all symbols from libcommon # on multiple platforms @@ -579,13 +580,13 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libcommon.la: $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) +libcommon.la: $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) $(EXTRA_libcommon_la_DEPENDENCIES) $(libcommon_la_LINK) $(libcommon_la_OBJECTS) $(libcommon_la_LIBADD) $(LIBS) -libdaemonize.la: $(libdaemonize_la_OBJECTS) $(libdaemonize_la_DEPENDENCIES) +libdaemonize.la: $(libdaemonize_la_OBJECTS) $(libdaemonize_la_DEPENDENCIES) $(EXTRA_libdaemonize_la_DEPENDENCIES) $(LINK) $(libdaemonize_la_OBJECTS) $(libdaemonize_la_LIBADD) $(LIBS) -libeio.la: $(libeio_la_OBJECTS) $(libeio_la_DEPENDENCIES) +libeio.la: $(libeio_la_OBJECTS) $(libeio_la_DEPENDENCIES) $(EXTRA_libeio_la_DEPENDENCIES) $(LINK) $(libeio_la_OBJECTS) $(libeio_la_LIBADD) $(LIBS) -libspank.la: $(libspank_la_OBJECTS) $(libspank_la_DEPENDENCIES) +libspank.la: $(libspank_la_OBJECTS) $(libspank_la_DEPENDENCIES) $(EXTRA_libspank_la_DEPENDENCIES) $(LINK) $(libspank_la_OBJECTS) $(libspank_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @@ -608,6 +609,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitstring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cbuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checkpoint.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu_frequency.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/daemonize.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/env.Plo@am__quote@ @@ -621,7 +623,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_hdr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_options.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_resources.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jobacct_common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Plo@am__quote@ @@ -664,6 +665,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurmdbd_defs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stepd_api.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strlcpy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnatcmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/switch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uid.Plo@am__quote@ @@ -802,10 +804,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/common/assoc_mgr.c b/src/common/assoc_mgr.c index eb610b4b89dc000667d813452b45f62782d9e2b8..4e2f7c68f296e5686a8e92a57522c71e5ec3dafd 100644 --- a/src/common/assoc_mgr.c +++ b/src/common/assoc_mgr.c @@ -1315,11 +1315,13 @@ extern int assoc_mgr_get_user_assocs(void *db_conn, xassert(assoc->uid != NO_VAL); xassert(assoc_list); - if (!assoc_mgr_association_list) { - if (_get_assoc_mgr_association_list(db_conn, enforce) - == SLURM_ERROR) + /* Call assoc_mgr_refresh_lists instead of just getting the + association list because we need qos and user lists before + the association list can be made. + */ + if (!assoc_mgr_association_list) + if (assoc_mgr_refresh_lists(db_conn, NULL) == SLURM_ERROR) return SLURM_ERROR; - } assoc_mgr_lock(&locks); @@ -1365,11 +1367,15 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn, if (assoc_pptr) *assoc_pptr = NULL; - if (!assoc_mgr_association_list) { - if (_get_assoc_mgr_association_list(db_conn, enforce) - == SLURM_ERROR) + + /* Call assoc_mgr_refresh_lists instead of just getting the + association list because we need qos and user lists before + the association list can be made. + */ + if (!assoc_mgr_association_list) + if (assoc_mgr_refresh_lists(db_conn, NULL) == SLURM_ERROR) return SLURM_ERROR; - } + if ((!assoc_mgr_association_list || !list_count(assoc_mgr_association_list)) && !(enforce & ACCOUNTING_ENFORCE_ASSOCS)) @@ -3195,9 +3201,12 @@ extern int assoc_mgr_validate_assoc_id(void *db_conn, assoc_mgr_lock_t locks = { READ_LOCK, NO_LOCK, NO_LOCK, NO_LOCK, NO_LOCK }; + /* Call assoc_mgr_refresh_lists instead of just getting the + association list because we need qos and user lists before + the association list can be made. + */ if (!assoc_mgr_association_list) - if (_get_assoc_mgr_association_list(db_conn, enforce) - == SLURM_ERROR) + if (assoc_mgr_refresh_lists(db_conn, NULL) == SLURM_ERROR) return SLURM_ERROR; assoc_mgr_lock(&locks); diff --git a/src/common/checkpoint.c b/src/common/checkpoint.c index ac7b3e2048e91fd5badc01538ed346374ee31c81..d9b99877c6800860a668305adc7df31991767644 100644 --- a/src/common/checkpoint.c +++ b/src/common/checkpoint.c @@ -78,182 +78,60 @@ typedef struct slurm_checkpoint_ops { uint16_t protocol_version); int (*ckpt_stepd_prefork) (void *slurmd_job); int (*ckpt_signal_tasks) (void *slurmd_job, char *image_dir); - int (*ckpt_restart_task) (void *slurmd_job, char *image_dir, int gtid); + int (*ckpt_restart_task) (void *slurmd_job, char *image_dir, + int gtid); } slurm_checkpoint_ops_t; /* - * A global job completion context. "Global" in the sense that there's - * only one, with static bindings. We don't export it. + * These strings must be kept in the same order as the fields + * declared for slurm_checkpoint_ops_t. */ - -struct slurm_checkpoint_context { - char * checkpoint_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int checkpoint_errno; - slurm_checkpoint_ops_t ops; +static const char *syms[] = { + "slurm_ckpt_op", + "slurm_ckpt_comp", + "slurm_ckpt_task_comp", + "slurm_ckpt_alloc_job", + "slurm_ckpt_free_job", + "slurm_ckpt_pack_job", + "slurm_ckpt_unpack_job", + "slurm_ckpt_stepd_prefork", + "slurm_ckpt_signal_tasks", + "slurm_ckpt_restart_task" }; -static slurm_checkpoint_context_t g_context = NULL; +static slurm_checkpoint_ops_t ops; +static plugin_context_t *g_context = NULL; static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER; - -static slurm_checkpoint_context_t -_slurm_checkpoint_context_create( const char *checkpoint_type ) -{ - slurm_checkpoint_context_t c; - - if ( checkpoint_type == NULL ) { - debug3( "_slurm_checkpoint_context_create: no checkpoint type"); - return NULL; - } - - c = xmalloc( sizeof( struct slurm_checkpoint_context ) ); - - c->checkpoint_errno = SLURM_SUCCESS; - - /* Copy the job completion job completion type. */ - c->checkpoint_type = xstrdup( checkpoint_type ); - if ( c->checkpoint_type == NULL ) { - debug3( "can't make local copy of checkpoint type" ); - xfree( c ); - return NULL; - } - - /* Plugin rack is demand-loaded on first reference. */ - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - - return c; -} - -static int -_slurm_checkpoint_context_destroy( slurm_checkpoint_context_t c ) -{ - int rc = SLURM_SUCCESS; - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree( c->checkpoint_type ); - xfree( c ); - - return rc; -} - -/* - * Resolve the operations from the plugin. - */ -static slurm_checkpoint_ops_t * -_slurm_checkpoint_get_ops( slurm_checkpoint_context_t c ) -{ - /* - * These strings must be kept in the same order as the fields - * declared for slurm_checkpoint_ops_t. - */ - static const char *syms[] = { - "slurm_ckpt_op", - "slurm_ckpt_comp", - "slurm_ckpt_task_comp", - "slurm_ckpt_alloc_job", - "slurm_ckpt_free_job", - "slurm_ckpt_pack_job", - "slurm_ckpt_unpack_job", - "slurm_ckpt_stepd_prefork", - "slurm_ckpt_signal_tasks", - "slurm_ckpt_restart_task" - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->checkpoint_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->checkpoint_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->checkpoint_type); - - /* Get the plugin list, if needed. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "Unable to create a plugin manager" ); - return NULL; - } - - plugrack_set_major_type( c->plugin_list, "checkpoint" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - /* Find the correct plugin. */ - c->cur_plugin = - plugrack_use_by_type( c->plugin_list, c->checkpoint_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "can't find a plugin for type %s", c->checkpoint_type ); - return NULL; - } - - /* Dereference the API. */ - if ( plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops ) < n_syms ) { - error( "incomplete checkpoint plugin detected" ); - return NULL; - } - - return &c->ops; -} +static bool init_run = false; /* initialize checkpoint plugin */ extern int -checkpoint_init(char *checkpoint_type) +checkpoint_init(char *type) { int retval = SLURM_SUCCESS; + char *plugin_type = "checkpoint"; - slurm_mutex_lock( &context_lock ); + if (init_run && g_context) + return retval; - if ( g_context ) - _slurm_checkpoint_context_destroy(g_context); - g_context = _slurm_checkpoint_context_create( checkpoint_type ); - if ( g_context == NULL ) { - error( "cannot create a context for %s", checkpoint_type ); - xfree(checkpoint_type); - retval = SLURM_ERROR; - goto done; - } + slurm_mutex_lock(&context_lock); + + if (g_context) + plugin_context_destroy(g_context); - if ( _slurm_checkpoint_get_ops( g_context ) == NULL ) { - error( "cannot resolve checkpoint plugin operations" ); - _slurm_checkpoint_context_destroy( g_context ); - g_context = NULL; + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); + + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; + goto done; } - verbose("Checkpoint plugin loaded: %s", checkpoint_type); + init_run = true; + verbose("Checkpoint plugin loaded: %s", type); done: - slurm_mutex_unlock( &context_lock ); + slurm_mutex_unlock(&context_lock); return retval; } @@ -263,12 +141,13 @@ checkpoint_fini(void) { int rc; - if ( !g_context ) + if (!g_context) return SLURM_SUCCESS; - slurm_mutex_lock( &context_lock ); - rc =_slurm_checkpoint_context_destroy(g_context); - slurm_mutex_unlock( &context_lock ); + slurm_mutex_lock(&context_lock); + init_run = false; + rc = plugin_context_destroy(g_context); + slurm_mutex_unlock(&context_lock); return rc; } @@ -284,7 +163,7 @@ checkpoint_op(uint32_t job_id, uint32_t step_id, slurm_mutex_lock( &context_lock ); if ( g_context ) { - retval = (*(g_context->ops.ckpt_op))( + retval = (*(ops.ckpt_op))( job_id, step_id, (struct step_record *) step_ptr, op, data, image_dir, @@ -305,7 +184,7 @@ checkpoint_comp(void * step_ptr, time_t event_time, uint32_t error_code, slurm_mutex_lock( &context_lock ); if ( g_context ) - retval = (*(g_context->ops.ckpt_comp))( + retval = (*(ops.ckpt_comp))( (struct step_record *) step_ptr, event_time, error_code, error_msg); else { @@ -324,7 +203,7 @@ checkpoint_task_comp(void * step_ptr, uint32_t task_id, time_t event_time, slurm_mutex_lock( &context_lock ); if ( g_context ) - retval = (*(g_context->ops.ckpt_task_comp))( + retval = (*(ops.ckpt_task_comp))( (struct step_record *) step_ptr, task_id, event_time, error_code, error_msg); else { @@ -342,8 +221,7 @@ extern int checkpoint_alloc_jobinfo(check_jobinfo_t *jobinfo) slurm_mutex_lock( &context_lock ); if ( g_context ) - retval = (*(g_context->ops.ckpt_alloc_jobinfo))( - jobinfo); + retval = (*(ops.ckpt_alloc_jobinfo))(jobinfo); else { error ("slurm_checkpoint plugin context not initialized"); retval = ENOENT; @@ -359,8 +237,7 @@ extern int checkpoint_free_jobinfo(check_jobinfo_t jobinfo) slurm_mutex_lock( &context_lock ); if ( g_context ) - retval = (*(g_context->ops.ckpt_free_jobinfo))( - jobinfo); + retval = (*(ops.ckpt_free_jobinfo))(jobinfo); else { error ("slurm_checkpoint plugin context not initialized"); retval = ENOENT; @@ -377,7 +254,7 @@ extern int checkpoint_pack_jobinfo (check_jobinfo_t jobinfo, Buf buffer, slurm_mutex_lock( &context_lock ); if ( g_context ) - retval = (*(g_context->ops.ckpt_pack_jobinfo))( + retval = (*(ops.ckpt_pack_jobinfo))( jobinfo, buffer, protocol_version); else { error ("slurm_checkpoint plugin context not initialized"); @@ -394,7 +271,7 @@ extern int checkpoint_unpack_jobinfo (check_jobinfo_t jobinfo, Buf buffer, slurm_mutex_lock( &context_lock ); if ( g_context ) - retval = (*(g_context->ops.ckpt_unpack_jobinfo))( + retval = (*(ops.ckpt_unpack_jobinfo))( jobinfo, buffer, protocol_version); else { error ("slurm_checkpoint plugin context not initialized"); @@ -410,7 +287,7 @@ extern int checkpoint_stepd_prefork (void *job) slurm_mutex_lock( &context_lock ); if ( g_context ) - retval = (*(g_context->ops.ckpt_stepd_prefork))(job); + retval = (*(ops.ckpt_stepd_prefork))(job); else { error ("slurm_checkpoint plugin context not initialized"); retval = ENOENT; @@ -425,7 +302,7 @@ extern int checkpoint_signal_tasks (void *job, char *image_dir) slurm_mutex_lock( &context_lock ); if ( g_context ) - retval = (*(g_context->ops.ckpt_signal_tasks))(job, image_dir); + retval = (*(ops.ckpt_signal_tasks))(job, image_dir); else { error ("slurm_checkpoint plugin context not initialized"); retval = ENOENT; @@ -441,8 +318,7 @@ extern int checkpoint_restart_task (void *job, char *image_dir, int gtid) slurm_mutex_lock( &context_lock ); if ( g_context ) { - retval = (*(g_context->ops.ckpt_restart_task))(job, image_dir, - gtid); + retval = (*(ops.ckpt_restart_task))(job, image_dir, gtid); } else { error ("slurm_checkpoint plugin context not initialized"); retval = ENOENT; diff --git a/src/common/cpu_frequency.c b/src/common/cpu_frequency.c new file mode 100644 index 0000000000000000000000000000000000000000..f0ebbd6f5f7627aa16845202a81e9644533a2ec2 --- /dev/null +++ b/src/common/cpu_frequency.c @@ -0,0 +1,641 @@ +/*****************************************************************************\ + * cpu_frequency.c - support for srun option --cpu-freq= + ***************************************************************************** + * Copyright (C) 2012 Bull + * Written by Don Albert, + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 +#include +#include +#include +#include + +#include "slurm/slurm.h" +#include "src/common/xcpuinfo.h" +#include "src/common/slurm_protocol_defs.h" +#include "src/common/xmalloc.h" +#include "src/common/xstring.h" +#include "src/common/cpu_frequency.h" + + + +#define PATH_TO_CPU "/sys/devices/system/cpu/" +#define LINE_LEN 100 +#define SYSFS_PATH_MAX 255 +#define FREQ_LIST_MAX 16 +#define GOV_NAME_LEN 24 + +static uint16_t cpu_freq_count = 0; +static struct cpu_freq_data { + uint32_t frequency_to_set; + uint32_t reset_frequency; + char reset_governor[GOV_NAME_LEN]; +} * cpufreq = NULL; + +static void _cpu_freq_find_valid(uint32_t cpu_freq, int cpuidx); +static uint16_t _cpu_freq_next_cpu(char **core_range, uint16_t *cpuidx, + uint16_t *start, uint16_t *end); + + + +/* + * called to check if the node supports setting cpu frequency + * if so, initialize fields in cpu_freq_data structure + */ +void +cpu_freq_init(slurmd_conf_t *conf) +{ + char path[SYSFS_PATH_MAX]; + struct stat statbuf; + FILE *fp; + char value[LINE_LEN]; + unsigned int i; + + /* check for cpufreq support */ + if ( stat(PATH_TO_CPU "cpu0/cpufreq", &statbuf) != 0 ) { + info("CPU frequency setting not configured for this node"); + return; + } + + if (!S_ISDIR(statbuf.st_mode)) { + error(PATH_TO_CPU "cpu0/cpufreq not a directory"); + return; + } + + /* get the cpu frequency info into the cpu_freq_data structure */ + cpu_freq_count = conf->block_map_size; + cpufreq = (struct cpu_freq_data *) xmalloc(cpu_freq_count * + sizeof(struct cpu_freq_data)); + + info("Gathering cpu frequency information for %u cpus", cpu_freq_count); + for (i = 0; i < cpu_freq_count; i++) { + + cpufreq[i].frequency_to_set = 0; + cpufreq[i].reset_frequency = 0; + + snprintf(path, sizeof(path), + PATH_TO_CPU + "cpu%u/cpufreq/scaling_available_governors", i); + if ( ( fp = fopen(path, "r") ) == NULL ) + continue; + if (fgets(value, LINE_LEN, fp) == NULL) { + fclose(fp); + continue; + } + if (strstr(value, "userspace") == NULL) { + fclose(fp); + continue; + } + fclose(fp); + + snprintf(path, sizeof(path), + PATH_TO_CPU "cpu%u/cpufreq/scaling_governor", i); + if ( ( fp = fopen(path, "r") ) == NULL ) + continue; + if (fgets(value, LINE_LEN, fp) == NULL) { + fclose(fp); + continue; + } + if (strlen(value) >= GOV_NAME_LEN) { + fclose(fp); + continue; + } + strcpy(cpufreq[i].reset_governor, value); + fclose(fp); + + snprintf(path, sizeof(path), + PATH_TO_CPU "cpu%u/cpufreq/scaling_min_freq", i); + if ( ( fp = fopen(path, "r") ) == NULL ) + continue; + if (fscanf (fp, "%u", &cpufreq[i].reset_frequency) < 0) { + error("cpu_freq_cgroup_valid: Could not read " + "scaling_min_freq"); + } + fclose(fp); + + debug("cpu_freq_init: cpu %u, reset freq: %u, " + "reset governor: %s", + i,cpufreq[i].reset_frequency,cpufreq[i].reset_governor); + } + return; +} + + +/* + * Send the cpu_frequency table info to slurmstepd + */ +void +cpu_freq_send_info(int fd) { + + if (cpu_freq_count) { + safe_write(fd, &cpu_freq_count, sizeof(uint16_t)); + safe_write(fd, cpufreq, + (cpu_freq_count * sizeof(struct cpu_freq_data))); + } else { + safe_write(fd, &cpu_freq_count, sizeof(uint16_t)); + } + return; +rwfail: + error("Unable to send cpu frequency information for %u cpus", + cpu_freq_count); + return; +} + + +/* + * Receive the cpu_frequency table info from slurmd + */ +void +cpu_freq_recv_info(int fd) { + + safe_read(fd, &cpu_freq_count, sizeof(uint16_t)); + + if (cpu_freq_count) { + cpufreq = (struct cpu_freq_data *) + xmalloc(cpu_freq_count * sizeof(struct cpu_freq_data)); + safe_read(fd, cpufreq, + (cpu_freq_count * sizeof(struct cpu_freq_data))); + info("Received cpu frequency information for %u cpus", + cpu_freq_count); + } + return; +rwfail: + error("Unable to recv cpu frequency information for %u cpus", + cpu_freq_count); + cpu_freq_count = 0; + return; +} + + +/* + * Validate the cpus and select the frequency to set + * Called from task cpuset code with task launch request containing + * a pointer to a hex map string of the cpus to be used by this step + */ +void +cpu_freq_cpuset_validate(slurmd_job_t *job) { + + int cpuidx; + bitstr_t *cpus_to_set; + bitstr_t *cpu_map; + char *cpu_bind; + char *cpu_str; + char *savestr = NULL; + + debug2("cpu_freq_cpuset_validate: request = %12d %8x", + job->cpu_freq, job->cpu_freq); + debug2(" jobid=%u, stepid=%u, tasks=%u cpu/task=%u, cpus=%u", + job->jobid,job->stepid,job->node_tasks, + job->cpus_per_task,job->cpus); + debug2(" cpu_bind_type=%4x, cpu_bind map=%s", + job->cpu_bind_type,job->cpu_bind); + + if (!cpu_freq_count) + return; + + if (job->cpu_bind == NULL) { + error("cpu_freq_cpuset_validate: cpu_bind string is null"); + return; + } + cpu_bind = xstrdup(job->cpu_bind); + + if ( (cpu_str = strtok_r(cpu_bind, ",", &savestr) ) == NULL) { + error("cpu_freq_cpuset_validate: cpu_bind string invalid"); + xfree(cpu_bind); + return; + } + + cpu_map = (bitstr_t *) bit_alloc(cpu_freq_count); + cpus_to_set = (bitstr_t *) bit_alloc(cpu_freq_count); + + do { + debug3(" cpu_str = %s", cpu_str); + + if (bit_unfmt_hexmask(cpu_map, cpu_str) == -1) { + error("cpu_freq_cpuset_validate: invalid cpu mask %s", + cpu_bind); + bit_free(cpu_map); + bit_free(cpus_to_set); + xfree(cpu_bind); + return; + } + bit_or(cpus_to_set, cpu_map); + } while ( (cpu_str = strtok_r(NULL, ",", &savestr) ) != NULL); + + for (cpuidx=0; cpuidx < cpu_freq_count; cpuidx++) { + + if (bit_test(cpus_to_set, cpuidx)) { + _cpu_freq_find_valid(job->cpu_freq, cpuidx); + } + } + cpu_freq_set(job); + + bit_free(cpu_map); + bit_free(cpus_to_set); + xfree(cpu_bind); + return; +} + + +/* + * Validate the cpus and select the frequency to set + * Called from task cgroup cpuset code with string containing + * the list of cpus to be used by this step + */ +void +cpu_freq_cgroup_validate(slurmd_job_t *job, char *step_alloc_cores) { + + uint16_t start = USHRT_MAX; + uint16_t end = USHRT_MAX; + uint16_t cpuidx = 0; + char *core_range; + + debug2("cpu_freq_cgroup_validate: request value = %12d %8x", + job->cpu_freq, job->cpu_freq); + debug2(" jobid=%u, stepid=%u, tasks=%u cpu/task=%u, cpus=%u", + job->jobid,job->stepid,job->node_tasks, + job->cpus_per_task,job->cpus); + debug2(" cpu_bind_type=%4x, cpu_bind map=%s", + job->cpu_bind_type, job->cpu_bind); + debug2(" step logical cores = %s, step physical cores = %s", + job->step_alloc_cores, step_alloc_cores); + + if (!cpu_freq_count) + return; + + /* set entries in cpu frequency table for this step's cpus */ + core_range = step_alloc_cores; + while ( (cpuidx = _cpu_freq_next_cpu(&core_range, &cpuidx, + &start, &end)) != USHRT_MAX) { + if (cpuidx >= cpu_freq_count) { + error("cpu_freq_validate: index %u exceeds cpu count %u", + cpuidx, cpu_freq_count); + return; + } + _cpu_freq_find_valid(job->cpu_freq, cpuidx); + } + cpu_freq_set(job); + return; +} + + +/* + * get the next number in a range + * assumes range is well-formed, i.e., monotonically increasing, + * no leading/trailing punctuation, either comma separated or dash + * separated: e.g., "4-6,8,10,13-15" + */ +uint16_t +_cpu_freq_next_cpu(char **core_range, uint16_t *cpuidx, + uint16_t *start, uint16_t *end) { + + int i; + char *p; + + p = *core_range; + + if (*start == USHRT_MAX) { + if (*p == '\0') + return USHRT_MAX; + if (*p == ',') + p++; + + i = 0; + while ( isdigit(*p) ) { + i = i*10 + (*p - '0'); + p++; + } + *core_range = p; + *start = i; + return i; + } + + if (*end == USHRT_MAX) { + switch (*p) + { + case '-' : + p++; + i = 0; + while ( isdigit(*p) ) { + i = i*10 + (*p - '0'); + p++; + } + *core_range = p; + *end = i; + break; + + case ',': + p++; + i = 0; + while ( isdigit(*p) ) { + i = i*10 + (*p - '0'); + p++; + } + *start = i; + *end = USHRT_MAX; + *core_range = p; + return i; + + case '\0' : + return USHRT_MAX; + } + } + + i = *cpuidx; + if ( i < *end ) { + i++; + if ( i == *end) { + *start = USHRT_MAX; + *end = USHRT_MAX; + } + } + return i; +} + +/* + * Compute the right frequency value to set, based on request + * + * input: job record containing cpu frequency parameter + * input: index to current cpu entry in cpu_freq_data table + * + * sets "frequency_to_set" table entry if valid value found + */ +void +_cpu_freq_find_valid(uint32_t cpu_freq, int cpuidx) { + + unsigned int j, freq_med = 0; + uint32_t freq_list[FREQ_LIST_MAX] = { 0 }; + char path[SYSFS_PATH_MAX]; + FILE *fp; + + /* see if user requested "high" "medium" or "low" */ + if (cpu_freq & CPU_FREQ_RANGE_FLAG) { + + switch(cpu_freq) + { + case CPU_FREQ_LOW : + /* get the value from scale min freq */ + snprintf(path, sizeof(path), + PATH_TO_CPU + "cpu%u/cpufreq/scaling_min_freq", cpuidx); + if ( ( fp = fopen(path, "r") ) == NULL ) { + error("cpu_freq_cgroup_valid: Could not open " + "scaling_min_freq"); + return; + } + if (fscanf (fp, "%u", + &cpufreq[cpuidx].frequency_to_set) < 1) { + error("cpu_freq_cgroup_valid: Could not read " + "scaling_min_freq"); + } + break; + + + case CPU_FREQ_MEDIUM : + snprintf(path, sizeof(path), + PATH_TO_CPU + "cpu%u/cpufreq/scaling_available_frequencies", + cpuidx); + if ( ( fp = fopen(path, "r") ) == NULL ) { + error("cpu_freq_cgroup_valid: Could not open " + "scaling_available_frequencies"); + return; + } + for (j = 0; j < FREQ_LIST_MAX; j++) { + if ( fscanf(fp, "%u", &freq_list[j]) == EOF) + break; + freq_med = (j + 1) / 2; + } + cpufreq[cpuidx].frequency_to_set = freq_list[freq_med]; + break; + + + case CPU_FREQ_HIGH : + /* get the value from scale max freq */ + snprintf(path, sizeof(path), + PATH_TO_CPU "cpu%u/cpufreq/scaling_max_freq", + cpuidx); + if ( ( fp = fopen(path, "r") ) == NULL ) { + error("cpu_freq_cgroup_valid: Could not open " + "scaling_max_freq"); + return; + } + if (fscanf (fp, "%u", + &cpufreq[cpuidx].frequency_to_set) < 1) { + error("cpu_freq_cgroup_valid: Could not read " + "scaling_max_freq"); + } + break; + + default : + error("cpu_freq_cgroup_valid: " + "invalid cpu_freq value %u", cpu_freq); + return; + } + fclose(fp); + + } else { + /* find legal value close to requested value */ + snprintf(path, sizeof(path), + PATH_TO_CPU + "cpu%u/cpufreq/scaling_available_frequencies", cpuidx); + if ( ( fp = fopen(path, "r") ) == NULL ) + return; + for (j = 0; j < FREQ_LIST_MAX; j++) { + + if ( fscanf(fp, "%u", &freq_list[j]) == EOF) + break; + if (cpu_freq == freq_list[j]) { + cpufreq[cpuidx].frequency_to_set = freq_list[j]; + break; + } + if (j > 0) { + if (freq_list[j] > freq_list[j-1] ) { + /* ascending order */ + if ((cpu_freq > freq_list[j-1]) && + (cpu_freq < freq_list[j])) { + cpufreq[cpuidx].frequency_to_set = + freq_list[j]; + break; + } + } else { + /* descending order */ + if ((cpu_freq > freq_list[j]) && + (cpu_freq < freq_list[j-1])) { + cpufreq[cpuidx].frequency_to_set = + freq_list[j]; + break; + } + } + } + } + fclose(fp); + } + + debug3("cpu_freq_cgroup_validate: cpu %u, frequency to set: %u", + cpuidx, cpufreq[cpuidx].frequency_to_set); + + return; +} + + +/* + * verify cpu_freq parameter + * + * in addition to a numeric frequency value, we allow the user + * to specify "low", "medium", or "high" frequency + * + * returns -1 on error, 0 otherwise + */ +int +cpu_freq_verify_param(const char *arg, uint32_t *cpu_freq) { + + char *end; + uint32_t frequency; + + if (arg == NULL) { + return 0; + } + + if ( (frequency = strtoul(arg, &end, 10) )) { + *cpu_freq = frequency; + return 0; + } + + if (strncasecmp(arg, "lo", 2) == 0) { + *cpu_freq = CPU_FREQ_LOW; + return 0; + } else if (strncasecmp(arg, "hi", 2) == 0) { + *cpu_freq = CPU_FREQ_HIGH; + return 0; + } else if (strncasecmp(arg, "med", 3) == 0) { + *cpu_freq = CPU_FREQ_MEDIUM; + return 0; + } + + error("unrecognized --cpu-freq argument \"%s\"", arg); + return -1; +} + + +/* + * set cpu frequency if possible for each cpu of the job step + */ +void +cpu_freq_set(slurmd_job_t *job) +{ + char path[SYSFS_PATH_MAX]; + FILE *fp; + char value[LINE_LEN]; + unsigned int i,j; + + if ((!cpu_freq_count) || (!cpufreq)) + return; + + j = 0; + for (i = 0; i < cpu_freq_count; i++) { + + if (cpufreq[i].frequency_to_set == 0) + continue; + + snprintf(path, sizeof(path), + PATH_TO_CPU "cpu%u/cpufreq/scaling_governor", i); + if ( ( fp = fopen(path, "w") ) == NULL ) + continue; + fputs("userspace\n", fp); + fclose(fp); + + snprintf(path, sizeof(path), + PATH_TO_CPU "cpu%u/cpufreq/scaling_setspeed", i); + snprintf(value, LINE_LEN, "%u", cpufreq[i].frequency_to_set); + + if ( ( fp = fopen(path, "w") ) == NULL ) + continue; + fputs(value, fp); + fclose(fp); + + j++; + debug2("cpu_freq_set: cpu %u, frequency: %u", + i,cpufreq[i].frequency_to_set); + } + debug("cpu_freq_set: #cpus set = %u", j); +} + +/* + * reset the cpus used by the process to their + * default frequency and governor type + */ +void +cpu_freq_reset(slurmd_job_t *job) +{ + char path[SYSFS_PATH_MAX]; + FILE *fp; + char value[LINE_LEN]; + unsigned int i,j; + + if ((!cpu_freq_count) || (!cpufreq)) + return; + + j = 0; + for (i = 0; i < cpu_freq_count; i++) { + + if (cpufreq[i].frequency_to_set == 0) + continue; + + snprintf(path, sizeof(path), + PATH_TO_CPU "cpu%u/cpufreq/scaling_setspeed", i); + snprintf(value, LINE_LEN, "%u", cpufreq[i].reset_frequency); + + if ( ( fp = fopen(path, "w") ) == NULL ) + continue; + fputs(value, fp); + fclose(fp); + + snprintf(path, sizeof(path), + PATH_TO_CPU "cpu%u/cpufreq/scaling_governor", i); + if ( ( fp = fopen(path, "w") ) == NULL ) + continue; + fputs(cpufreq[i].reset_governor, fp); + fclose(fp); + + j++; + debug3("cpu_freq_reset: " + "cpu %u, frequency reset: %u, governor reset: %s", + i,cpufreq[i].reset_frequency,cpufreq[i].reset_governor); + } + debug("cpu_freq_reset: #cpus reset = %u", j); +} diff --git a/src/common/cpu_frequency.h b/src/common/cpu_frequency.h new file mode 100644 index 0000000000000000000000000000000000000000..6b74777ea9ba5b01136630d7e349d3c94c9b7d26 --- /dev/null +++ b/src/common/cpu_frequency.h @@ -0,0 +1,101 @@ +/*****************************************************************************\ + * cpu_frequency.h - Define cpu frequency control functions + ***************************************************************************** + * Copyright (C) 2012 Bull + * Written by Don Albert, + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 _CPU_FREQUENCY_H_ +#define _CPU_FREQUENCY_H_ + +#include "src/slurmd/slurmd/slurmd.h" +#include "src/slurmd/slurmstepd/slurmstepd_job.h" + +/* + * check if cpu frequency setting is allowed on this node + * if so, create and initialize the cpu frequency table entry for each cpu + */ +void +cpu_freq_init(slurmd_conf_t *conf); + +/* + * Send the cpu_frequency table info to slurmstepd + */ +void +cpu_freq_send_info(int fd); + +/* + * Receive the cpu_frequency table info from slurmd + */ +void +cpu_freq_recv_info(int fd); + +/* + * Validate the cpus and select the frequency to set + * Called from task cpuset code with job record containing + * a pointer to a hex map of the cpus to be used by this step + */ +void +cpu_freq_cpuset_validate(slurmd_job_t *job); + +/* + * Validate the cpus and select the frequency to set + * Called from task cgroup cpuset code with string containing + * the list of cpus to be used by this step + */ +void +cpu_freq_cgroup_validate(slurmd_job_t *job, char *step_alloc_cores); + +/* + * verify cpu_freq parameter + * + * in addition to a numeric frequency value, we allow the user + * to specify "low", "medium", or "high" frequency + * + * returns -1 on error, 0 otherwise + */ +int +cpu_freq_verify_param(const char *arg, uint32_t *cpu_freq); + +/* + * set the userspace governor and the new frequency value + */ +void +cpu_freq_set(slurmd_job_t *job); + +/* + * reset the governor and cpu frequency to the configured values + */ +void +cpu_freq_reset(slurmd_job_t *job); + +#endif /* _CPU_FREQUENCY_H_ */ diff --git a/src/common/eio.c b/src/common/eio.c index 2c733a9b18829870ed03502bcf4aa17daf13865e..481e7a1c64ffdf9106d0f667db355d04337deca1 100644 --- a/src/common/eio.c +++ b/src/common/eio.c @@ -481,7 +481,7 @@ void eio_obj_destroy(void *arg) /* * Add an eio_obj_t "obj" to an eio_handle_t "eio"'s internal object list. * - * This function can only be used to intialize "eio"'s list before + * This function can only be used to initialize "eio"'s list before * calling eio_handle_mainloop. If it is used after the eio engine's * mainloop has started, segfaults are likely. */ diff --git a/src/common/eio.h b/src/common/eio.h index 12bdbe9616a863000602ddab62ae2091914f4f2f..afee1fdc525ef4cda1c8f80068c187afdbddc83b 100644 --- a/src/common/eio.h +++ b/src/common/eio.h @@ -75,7 +75,7 @@ void eio_handle_destroy(eio_handle_t *eio); /* * Add an eio_obj_t "obj" to an eio_handle_t "eio"'s internal object list. * - * This function can only be used to intialize "eio"'s list before + * This function can only be used to initialize "eio"'s list before * calling eio_handle_mainloop. If it is used after the eio engine's * mainloop has started, segfaults are likely. */ diff --git a/src/common/env.c b/src/common/env.c index eddf3dad2421c88ff7662134d2943615e9e918b4..ab97a9c4e44377bd74606481e4589a851df1d98f 100644 --- a/src/common/env.c +++ b/src/common/env.c @@ -655,6 +655,39 @@ int setup_env(env_t *env, bool preserve_env) } } + if ((env->cpu_freq != NO_VAL) && /* Default value from srun */ + (env->cpu_freq != 0)) { /* Default value from slurmstepd + * for batch jobs */ + int sts; + char *str; + + if (env->cpu_freq & CPU_FREQ_RANGE_FLAG) { + switch (env->cpu_freq) + { + case CPU_FREQ_LOW : + str="low"; + break; + case CPU_FREQ_MEDIUM : + str="medium"; + break; + case CPU_FREQ_HIGH : + str="high"; + break; + default : + str="unknown"; + break; + } + sts = setenvf(&env->env, "SLURM_CPU_FREQ_REQ", str); + } else { + sts = setenvf(&env->env, "SLURM_CPU_FREQ_REQ", "%d", + env->cpu_freq); + } + if (sts) { + error("Unable to set SLURM_CPU_FREQ_REQ"); + rc = SLURM_FAILURE; + } + } + if (env->overcommit && (setenvf(&env->env, "SLURM_OVERCOMMIT", "1"))) { error("Unable to set SLURM_OVERCOMMIT environment variable"); diff --git a/src/common/env.h b/src/common/env.h index 53531f7fbd7ac34c4cad96df1cb6abedbf0892c9..149cf62d412a76c177706208abb112ff9b272f52 100644 --- a/src/common/env.h +++ b/src/common/env.h @@ -45,6 +45,7 @@ typedef struct env_options { cpu_bind_type_t cpu_bind_type; /* --cpu_bind= */ char *cpu_bind; /* binding map for map/mask_cpu */ + uint32_t cpu_freq; /* cpu_frequency requested */ mem_bind_type_t mem_bind_type; /* --mem_bind= */ char *mem_bind; /* binding map for tasks to memory */ diff --git a/src/common/gres.c b/src/common/gres.c index 798ef8c91c6c267ab190a3cd9c65e71e13429ce0..8b74ef90f6db54a5c6826401a5cd4cb6d658cc04 100644 --- a/src/common/gres.c +++ b/src/common/gres.c @@ -124,6 +124,7 @@ static slurm_gres_context_t *gres_context = NULL; static char *gres_plugin_list = NULL; static pthread_mutex_t gres_context_lock = PTHREAD_MUTEX_INITIALIZER; static List gres_conf_list = NULL; +static bool init_run = false; /* Local functions */ static gres_node_state_t * @@ -338,6 +339,9 @@ extern int gres_plugin_init(void) int i, j, rc = SLURM_SUCCESS; char *last = NULL, *names, *one_name, *full_name; + if (init_run && (gres_context_cnt >= 0)) + return rc; + slurm_mutex_lock(&gres_context_lock); if (slurm_get_debug_flags() & DEBUG_FLAG_GRES) gres_debug = true; @@ -403,6 +407,7 @@ extern int gres_plugin_init(void) gres_context[i].gres_name_colon_len = strlen(gres_context[i].gres_name_colon); } + init_run = true; fini: slurm_mutex_unlock(&gres_context_lock); return rc; @@ -421,6 +426,7 @@ extern int gres_plugin_fini(void) if (gres_context_cnt < 0) goto fini; + init_run = false; for (i=0; iname); } + if ((tmp_long < 0) || (tmp_long >= NO_VAL)) { + fatal("Gres %s has invalid count value %ld", + p->name, tmp_long); + } p->count = tmp_long; xfree(tmp_str); } else if (p->count == 0) diff --git a/src/common/jobacct_common.c b/src/common/jobacct_common.c deleted file mode 100644 index dd31fb0ff44b594dc2e7df4fedaab2a9a33bdc78..0000000000000000000000000000000000000000 --- a/src/common/jobacct_common.c +++ /dev/null @@ -1,546 +0,0 @@ -/*****************************************************************************\ - * jobacct_common.c - common functions for almost all jobacct plugins. - ***************************************************************************** - * - * Copyright (C) 2005 Hewlett-Packard Development Company, L.P. - * Written by Danny Auble, - * CODE-OCEC-09-009. All rights reserved. - * - * This file is part of SLURM, a resource management program. - * For details, see . - * 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. - * - * This file is patterned after jobcomp_linux.c, written by Morris Jette and - * Copyright (C) 2002 The Regents of the University of California. -\*****************************************************************************/ - -#if defined(__NetBSD__) -#include -#endif - -#include "src/common/jobacct_common.h" - -/* -** Define slurm-specific aliases for use by plugins, see slurm_xlator.h -** for details. - */ -strong_alias(jobacct_common_pack, slurm_jobacct_common_pack); -strong_alias(jobacct_common_unpack, slurm_jobacct_common_unpack); -strong_alias(jobacct_common_alloc_jobacct, slurm_jobacct_common_alloc_jobacct); -strong_alias(jobacct_common_free_jobacct, slurm_jobacct_common_free_jobacct); - -pthread_mutex_t jobacct_lock = PTHREAD_MUTEX_INITIALIZER; -uint32_t jobacct_job_id = 0; -uint32_t jobacct_step_id = 0; -uint32_t jobacct_mem_limit = 0; -uint32_t jobacct_vmem_limit = 0; -uint32_t mult = 1000; - -static void _pack_jobacct_id(jobacct_id_t *jobacct_id, - uint16_t rpc_version, Buf buffer) -{ - if (jobacct_id) { - pack32((uint32_t) jobacct_id->nodeid, buffer); - pack16((uint16_t) jobacct_id->taskid, buffer); - } else { - pack32((uint32_t) 0, buffer); - pack16((uint16_t) 0, buffer); - } -} - -static int _unpack_jobacct_id(jobacct_id_t *jobacct_id, - uint16_t rpc_version, Buf buffer) -{ - safe_unpack32(&jobacct_id->nodeid, buffer); - safe_unpack16(&jobacct_id->taskid, buffer); - return SLURM_SUCCESS; -unpack_error: - return SLURM_ERROR; -} - -extern int jobacct_common_init_struct(struct jobacctinfo *jobacct, - jobacct_id_t *jobacct_id) -{ - if (!jobacct_id) { - jobacct_id_t temp_id; - temp_id.taskid = (uint16_t)NO_VAL; - temp_id.nodeid = (uint32_t)NO_VAL; - jobacct_id = &temp_id; - } - memset(jobacct, 0, sizeof(struct jobacctinfo)); - jobacct->sys_cpu_sec = 0; - jobacct->sys_cpu_usec = 0; - jobacct->user_cpu_sec = 0; - jobacct->user_cpu_usec = 0; - - jobacct->max_vsize = 0; - memcpy(&jobacct->max_vsize_id, jobacct_id, sizeof(jobacct_id_t)); - jobacct->tot_vsize = 0; - jobacct->max_rss = 0; - memcpy(&jobacct->max_rss_id, jobacct_id, sizeof(jobacct_id_t)); - jobacct->tot_rss = 0; - jobacct->max_pages = 0; - memcpy(&jobacct->max_pages_id, jobacct_id, sizeof(jobacct_id_t)); - jobacct->tot_pages = 0; - jobacct->min_cpu = (uint32_t)NO_VAL; - memcpy(&jobacct->min_cpu_id, jobacct_id, sizeof(jobacct_id_t)); - jobacct->tot_cpu = 0; - - return SLURM_SUCCESS; -} - -extern struct jobacctinfo *jobacct_common_alloc_jobacct( - jobacct_id_t *jobacct_id) -{ - struct jobacctinfo *jobacct = xmalloc(sizeof(struct jobacctinfo)); - jobacct_common_init_struct(jobacct, jobacct_id); - return jobacct; -} - -extern void jobacct_common_free_jobacct(void *object) -{ - struct jobacctinfo *jobacct = (struct jobacctinfo *)object; - xfree(jobacct); -} - -extern int jobacct_common_setinfo(struct jobacctinfo *jobacct, - enum jobacct_data_type type, void *data) -{ - int rc = SLURM_SUCCESS; - int *fd = (int *)data; - struct rusage *rusage = (struct rusage *)data; - uint32_t *uint32 = (uint32_t *) data; - jobacct_id_t *jobacct_id = (jobacct_id_t *) data; - struct jobacctinfo *send = (struct jobacctinfo *) data; - - slurm_mutex_lock(&jobacct_lock); - switch (type) { - case JOBACCT_DATA_TOTAL: - memcpy(jobacct, send, sizeof(struct jobacctinfo)); - break; - case JOBACCT_DATA_PIPE: - safe_write(*fd, jobacct, sizeof(struct jobacctinfo)); - break; - case JOBACCT_DATA_RUSAGE: - jobacct->user_cpu_sec = rusage->ru_utime.tv_sec; - jobacct->user_cpu_usec = rusage->ru_utime.tv_usec; - jobacct->sys_cpu_sec = rusage->ru_stime.tv_sec; - jobacct->sys_cpu_usec = rusage->ru_stime.tv_usec; - break; - case JOBACCT_DATA_MAX_RSS: - jobacct->max_rss = *uint32; - break; - case JOBACCT_DATA_MAX_RSS_ID: - jobacct->max_rss_id = *jobacct_id; - break; - case JOBACCT_DATA_TOT_RSS: - jobacct->tot_rss = *uint32; - break; - case JOBACCT_DATA_MAX_VSIZE: - jobacct->max_vsize = *uint32; - break; - case JOBACCT_DATA_MAX_VSIZE_ID: - jobacct->max_vsize_id = *jobacct_id; - break; - case JOBACCT_DATA_TOT_VSIZE: - jobacct->tot_vsize = *uint32; - break; - case JOBACCT_DATA_MAX_PAGES: - jobacct->max_pages = *uint32; - break; - case JOBACCT_DATA_MAX_PAGES_ID: - jobacct->max_pages_id = *jobacct_id; - break; - case JOBACCT_DATA_TOT_PAGES: - jobacct->tot_pages = *uint32; - break; - case JOBACCT_DATA_MIN_CPU: - jobacct->min_cpu = *uint32; - break; - case JOBACCT_DATA_MIN_CPU_ID: - jobacct->min_cpu_id = *jobacct_id; - break; - case JOBACCT_DATA_TOT_CPU: - jobacct->tot_cpu = *uint32; - break; - default: - debug("jobacct_g_set_setinfo data_type %d invalid", type); - } - slurm_mutex_unlock(&jobacct_lock); - return rc; -rwfail: - slurm_mutex_unlock(&jobacct_lock); - return SLURM_ERROR; - -} - -extern int jobacct_common_getinfo(struct jobacctinfo *jobacct, - enum jobacct_data_type type, void *data) -{ - int rc = SLURM_SUCCESS; - int *fd = (int *)data; - uint32_t *uint32 = (uint32_t *) data; - jobacct_id_t *jobacct_id = (jobacct_id_t *) data; - struct rusage *rusage = (struct rusage *)data; - struct jobacctinfo *send = (struct jobacctinfo *) data; - - slurm_mutex_lock(&jobacct_lock); - switch (type) { - case JOBACCT_DATA_TOTAL: - memcpy(send, jobacct, sizeof(struct jobacctinfo)); - break; - case JOBACCT_DATA_PIPE: - safe_read(*fd, jobacct, sizeof(struct jobacctinfo)); - break; - case JOBACCT_DATA_RUSAGE: - memset(rusage, 0, sizeof(struct rusage)); - rusage->ru_utime.tv_sec = jobacct->user_cpu_sec; - rusage->ru_utime.tv_usec = jobacct->user_cpu_usec; - rusage->ru_stime.tv_sec = jobacct->sys_cpu_sec; - rusage->ru_stime.tv_usec = jobacct->sys_cpu_usec; - break; - case JOBACCT_DATA_MAX_RSS: - *uint32 = jobacct->max_rss; - break; - case JOBACCT_DATA_MAX_RSS_ID: - *jobacct_id = jobacct->max_rss_id; - break; - case JOBACCT_DATA_TOT_RSS: - *uint32 = jobacct->tot_rss; - break; - case JOBACCT_DATA_MAX_VSIZE: - *uint32 = jobacct->max_vsize; - break; - case JOBACCT_DATA_MAX_VSIZE_ID: - *jobacct_id = jobacct->max_vsize_id; - break; - case JOBACCT_DATA_TOT_VSIZE: - *uint32 = jobacct->tot_vsize; - break; - case JOBACCT_DATA_MAX_PAGES: - *uint32 = jobacct->max_pages; - break; - case JOBACCT_DATA_MAX_PAGES_ID: - *jobacct_id = jobacct->max_pages_id; - break; - case JOBACCT_DATA_TOT_PAGES: - *uint32 = jobacct->tot_pages; - break; - case JOBACCT_DATA_MIN_CPU: - *uint32 = jobacct->min_cpu; - break; - case JOBACCT_DATA_MIN_CPU_ID: - *jobacct_id = jobacct->min_cpu_id; - break; - case JOBACCT_DATA_TOT_CPU: - *uint32 = jobacct->tot_cpu; - break; - default: - debug("jobacct_g_set_getinfo data_type %d invalid", type); - } - slurm_mutex_unlock(&jobacct_lock); - return rc; -rwfail: - slurm_mutex_unlock(&jobacct_lock); - return SLURM_ERROR; - -} - -extern void jobacct_common_aggregate(struct jobacctinfo *dest, - struct jobacctinfo *from) -{ - xassert(dest); - - if (!from) - return; - - slurm_mutex_lock(&jobacct_lock); - if (dest->max_vsize < from->max_vsize) { - dest->max_vsize = from->max_vsize; - dest->max_vsize_id = from->max_vsize_id; - } - dest->tot_vsize += from->tot_vsize; - - if (dest->max_rss < from->max_rss) { - dest->max_rss = from->max_rss; - dest->max_rss_id = from->max_rss_id; - } - dest->tot_rss += from->tot_rss; - - if (dest->max_pages < from->max_pages) { - dest->max_pages = from->max_pages; - dest->max_pages_id = from->max_pages_id; - } - dest->tot_pages += from->tot_pages; - - if ((dest->min_cpu > from->min_cpu) - || (dest->min_cpu == (uint32_t)NO_VAL)) { - if (from->min_cpu == (uint32_t)NO_VAL) - from->min_cpu = 0; - dest->min_cpu = from->min_cpu; - dest->min_cpu_id = from->min_cpu_id; - } - dest->tot_cpu += from->tot_cpu; - - if (dest->max_vsize_id.taskid == (uint16_t)NO_VAL) - dest->max_vsize_id = from->max_vsize_id; - - if (dest->max_rss_id.taskid == (uint16_t)NO_VAL) - dest->max_rss_id = from->max_rss_id; - - if (dest->max_pages_id.taskid == (uint16_t)NO_VAL) - dest->max_pages_id = from->max_pages_id; - - if (dest->min_cpu_id.taskid == (uint16_t)NO_VAL) - dest->min_cpu_id = from->min_cpu_id; - - dest->user_cpu_sec += from->user_cpu_sec; - dest->user_cpu_usec += from->user_cpu_usec; - while (dest->user_cpu_usec >= 1E6) { - dest->user_cpu_sec++; - dest->user_cpu_usec -= 1E6; - } - dest->sys_cpu_sec += from->sys_cpu_sec; - dest->sys_cpu_usec += from->sys_cpu_usec; - while (dest->sys_cpu_usec >= 1E6) { - dest->sys_cpu_sec++; - dest->sys_cpu_usec -= 1E6; - } - - slurm_mutex_unlock(&jobacct_lock); -} - -extern void jobacct_common_2_stats(slurmdb_stats_t *stats, - struct jobacctinfo *jobacct) -{ - xassert(jobacct); - xassert(stats); - slurm_mutex_lock(&jobacct_lock); - stats->vsize_max = jobacct->max_vsize; - stats->vsize_max_nodeid = jobacct->max_vsize_id.nodeid; - stats->vsize_max_taskid = jobacct->max_vsize_id.taskid; - stats->vsize_ave = (double)jobacct->tot_vsize; - stats->rss_max = jobacct->max_rss; - stats->rss_max_nodeid = jobacct->max_rss_id.nodeid; - stats->rss_max_taskid = jobacct->max_rss_id.taskid; - stats->rss_ave = (double)jobacct->tot_rss; - stats->pages_max = jobacct->max_pages; - stats->pages_max_nodeid = jobacct->max_pages_id.nodeid; - stats->pages_max_taskid = jobacct->max_pages_id.taskid; - stats->pages_ave = (double)jobacct->tot_pages; - stats->cpu_min = jobacct->min_cpu; - stats->cpu_min_nodeid = jobacct->min_cpu_id.nodeid; - stats->cpu_min_taskid = jobacct->min_cpu_id.taskid; - stats->cpu_ave = (double)jobacct->tot_cpu; - slurm_mutex_unlock(&jobacct_lock); -} - -extern void jobacct_common_pack(struct jobacctinfo *jobacct, - uint16_t rpc_version, Buf buffer) -{ - int i = 0; - - if (!jobacct) { - for (i = 0; i < 12; i++) - pack32((uint32_t) 0, buffer); - for (i = 0; i < 4; i++) - _pack_jobacct_id(NULL, rpc_version, buffer); - return; - } - - slurm_mutex_lock(&jobacct_lock); - pack32((uint32_t)jobacct->user_cpu_sec, buffer); - pack32((uint32_t)jobacct->user_cpu_usec, buffer); - pack32((uint32_t)jobacct->sys_cpu_sec, buffer); - pack32((uint32_t)jobacct->sys_cpu_usec, buffer); - pack32((uint32_t)jobacct->max_vsize, buffer); - pack32((uint32_t)jobacct->tot_vsize, buffer); - pack32((uint32_t)jobacct->max_rss, buffer); - pack32((uint32_t)jobacct->tot_rss, buffer); - pack32((uint32_t)jobacct->max_pages, buffer); - pack32((uint32_t)jobacct->tot_pages, buffer); - pack32((uint32_t)jobacct->min_cpu, buffer); - pack32((uint32_t)jobacct->tot_cpu, buffer); - - _pack_jobacct_id(&jobacct->max_vsize_id, rpc_version, buffer); - _pack_jobacct_id(&jobacct->max_rss_id, rpc_version, buffer); - _pack_jobacct_id(&jobacct->max_pages_id, rpc_version, buffer); - _pack_jobacct_id(&jobacct->min_cpu_id, rpc_version, buffer); - slurm_mutex_unlock(&jobacct_lock); -} - -/* you need to xfree this */ -extern int jobacct_common_unpack(struct jobacctinfo **jobacct, - uint16_t rpc_version, Buf buffer) -{ - uint32_t uint32_tmp; - - *jobacct = xmalloc(sizeof(struct jobacctinfo)); - safe_unpack32(&uint32_tmp, buffer); - (*jobacct)->user_cpu_sec = uint32_tmp; - safe_unpack32(&uint32_tmp, buffer); - (*jobacct)->user_cpu_usec = uint32_tmp; - safe_unpack32(&uint32_tmp, buffer); - (*jobacct)->sys_cpu_sec = uint32_tmp; - safe_unpack32(&uint32_tmp, buffer); - (*jobacct)->sys_cpu_usec = uint32_tmp; - safe_unpack32(&(*jobacct)->max_vsize, buffer); - safe_unpack32(&(*jobacct)->tot_vsize, buffer); - safe_unpack32(&(*jobacct)->max_rss, buffer); - safe_unpack32(&(*jobacct)->tot_rss, buffer); - safe_unpack32(&(*jobacct)->max_pages, buffer); - safe_unpack32(&(*jobacct)->tot_pages, buffer); - safe_unpack32(&(*jobacct)->min_cpu, buffer); - safe_unpack32(&(*jobacct)->tot_cpu, buffer); - - if (_unpack_jobacct_id(&(*jobacct)->max_vsize_id, rpc_version, buffer) - != SLURM_SUCCESS) - goto unpack_error; - if (_unpack_jobacct_id(&(*jobacct)->max_rss_id, rpc_version, buffer) - != SLURM_SUCCESS) - goto unpack_error; - if (_unpack_jobacct_id(&(*jobacct)->max_pages_id, rpc_version, buffer) - != SLURM_SUCCESS) - goto unpack_error; - if (_unpack_jobacct_id(&(*jobacct)->min_cpu_id, rpc_version, buffer) - != SLURM_SUCCESS) - goto unpack_error; - - return SLURM_SUCCESS; - -unpack_error: - debug2("jobacct_common_unpack:" - "unpack_error: size_buf(buffer) %u", - size_buf(buffer)); - xfree(*jobacct); - return SLURM_ERROR; -} - -extern int jobacct_common_set_mem_limit(uint32_t job_id, uint32_t step_id, - uint32_t mem_limit) -{ - if ((job_id == 0) || (mem_limit == 0)) { - error("jobacct_common_set_mem_limit: jobid:%u mem_limit:%u", - job_id, mem_limit); - return SLURM_ERROR; - } - - jobacct_job_id = job_id; - jobacct_step_id = step_id; - jobacct_mem_limit = mem_limit * 1024; /* MB to KB */ - jobacct_vmem_limit = jobacct_mem_limit; - jobacct_vmem_limit *= (slurm_get_vsize_factor() / 100.0); - return SLURM_SUCCESS; -} - -extern int jobacct_common_add_task(pid_t pid, jobacct_id_t *jobacct_id, - List task_list) -{ - struct jobacctinfo *jobacct = jobacct_common_alloc_jobacct(jobacct_id); - - slurm_mutex_lock(&jobacct_lock); - if(pid <= 0) { - error("invalid pid given (%d) for task acct", pid); - goto error; - } else if (!task_list) { - error("no task list created!"); - goto error; - } - - jobacct->pid = pid; - jobacct->min_cpu = 0; - debug2("adding task %u pid %d on node %u to jobacct", - jobacct_id->taskid, pid, jobacct_id->nodeid); - list_push(task_list, jobacct); - slurm_mutex_unlock(&jobacct_lock); - - return SLURM_SUCCESS; -error: - slurm_mutex_unlock(&jobacct_lock); - jobacct_common_free_jobacct(jobacct); - return SLURM_ERROR; -} - -extern struct jobacctinfo *jobacct_common_stat_task(pid_t pid, List task_list) -{ - struct jobacctinfo *jobacct = NULL; - struct jobacctinfo *ret_jobacct = NULL; - ListIterator itr = NULL; - - slurm_mutex_lock(&jobacct_lock); - if (!task_list) { - error("no task list created!"); - goto error; - } - - itr = list_iterator_create(task_list); - while((jobacct = list_next(itr))) { - if(jobacct->pid == pid) - break; - } - list_iterator_destroy(itr); - if (jobacct == NULL) - goto error; - ret_jobacct = xmalloc(sizeof(struct jobacctinfo)); - memcpy(ret_jobacct, jobacct, sizeof(struct jobacctinfo)); -error: - slurm_mutex_unlock(&jobacct_lock); - return ret_jobacct; -} - -extern struct jobacctinfo *jobacct_common_remove_task(pid_t pid, List task_list) -{ - struct jobacctinfo *jobacct = NULL; - - ListIterator itr = NULL; - - slurm_mutex_lock(&jobacct_lock); - if (!task_list) { - error("no task list created!"); - goto error; - } - - itr = list_iterator_create(task_list); - while((jobacct = list_next(itr))) { - if(jobacct->pid == pid) { - list_remove(itr); - break; - } - } - list_iterator_destroy(itr); - if(jobacct) { - debug2("removing task %u pid %d from jobacct", - jobacct->max_vsize_id.taskid, jobacct->pid); - } else { - debug2("pid(%d) not being watched in jobacct!", pid); - } -error: - slurm_mutex_unlock(&jobacct_lock); - return jobacct; -} - diff --git a/src/common/jobacct_common.h b/src/common/jobacct_common.h deleted file mode 100644 index 13a5f0c3d7e6cf6a47c1714a6111ed9ac9d39fa5..0000000000000000000000000000000000000000 --- a/src/common/jobacct_common.h +++ /dev/null @@ -1,144 +0,0 @@ -/*****************************************************************************\ - * jobacct_common.h - common functions for almost all jobacct plugins. - ***************************************************************************** - * - * Copyright (C) 2005 Hewlett-Packard Development Company, L.P. - * Written by Danny Auble, - * CODE-OCEC-09-009. All rights reserved. - * - * This file is part of SLURM, a resource management program. - * For details, see . - * 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. - * - * This file is patterned after jobcomp_linux.c, written by Morris Jette and - * Copyright (C) 2002 The Regents of the University of California. -\*****************************************************************************/ - -#ifndef _HAVE_JOBACCT_COMMON_H -#define _HAVE_JOBACCT_COMMON_H - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#if HAVE_STDINT_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#endif - -#include -#include - -#include "slurm/slurmdb.h" - -#include "src/common/xmalloc.h" -#include "src/common/list.h" -#include "src/common/xstring.h" -#include "src/common/node_select.h" -#include "src/slurmd/slurmstepd/slurmstepd_job.h" - - -#include - -#define BUFFER_SIZE 4096 -#define FDUMP_FLAG 0x04 - -typedef struct { - uint16_t taskid; /* contains which task number it was on */ - uint32_t nodeid; /* contains which node number it was on */ - slurmd_job_t *job; /* contains slurmd job pointer */ -} jobacct_id_t; - -struct jobacctinfo { - pid_t pid; - uint32_t sys_cpu_sec; - uint32_t sys_cpu_usec; - uint32_t user_cpu_sec; - uint32_t user_cpu_usec; - uint32_t max_vsize; /* max size of virtual memory */ - jobacct_id_t max_vsize_id; /* contains which task number it was on */ - uint32_t tot_vsize; /* total virtual memory - (used to figure out ave later) */ - uint32_t max_rss; /* max Resident Set Size */ - jobacct_id_t max_rss_id; /* contains which task it was on */ - uint32_t tot_rss; /* total rss - (used to figure out ave later) */ - uint32_t max_pages; /* max pages */ - jobacct_id_t max_pages_id; /* contains which task it was on */ - uint32_t tot_pages; /* total pages - (used to figure out ave later) */ - uint32_t min_cpu; /* min cpu time */ - jobacct_id_t min_cpu_id; /* contains which task it was on */ - uint32_t tot_cpu; /* total cpu time(used to figure out ave later) */ -}; - -/* Define jobacctinfo_t below to avoid including extraneous slurm headers */ -#ifndef __jobacctinfo_t_defined -# define __jobacctinfo_t_defined - typedef struct jobacctinfo jobacctinfo_t; /* opaque data type */ -#endif - -/* These should only be called from the jobacct-gather plugin */ -extern int jobacct_common_init_struct(struct jobacctinfo *jobacct, - jobacct_id_t *jobacct_id); -extern struct jobacctinfo *jobacct_common_alloc_jobacct( - jobacct_id_t *jobacct_id); -extern void jobacct_common_free_jobacct(void *object); -extern int jobacct_common_setinfo(struct jobacctinfo *jobacct, - enum jobacct_data_type type, void *data); -extern int jobacct_common_getinfo(struct jobacctinfo *jobacct, - enum jobacct_data_type type, void *data); -extern void jobacct_common_aggregate(struct jobacctinfo *dest, - struct jobacctinfo *from); -extern void jobacct_common_2_stats(slurmdb_stats_t *stats, - struct jobacctinfo *jobacct); -extern void jobacct_common_pack(struct jobacctinfo *jobacct, - uint16_t rpc_version, Buf buffer); -extern int jobacct_common_unpack(struct jobacctinfo **jobacct, - uint16_t rpc_version, Buf buffer); - -extern int jobacct_common_set_mem_limit(uint32_t job_id, uint32_t step_id, - uint32_t mem_limit); -extern int jobacct_common_add_task(pid_t pid, jobacct_id_t *jobacct_id, - List task_list); -extern struct jobacctinfo *jobacct_common_stat_task(pid_t pid, List task_list); -extern struct jobacctinfo *jobacct_common_remove_task(pid_t pid, - List task_list); -/***************************************************************/ - - -/* defined in common_jobacct.c */ -extern pthread_mutex_t jobacct_lock; -extern uint32_t jobacct_job_id; -extern uint32_t jobacct_step_id; -extern uint32_t jobacct_mem_limit; /* step's memory limit in KB */ -extern uint32_t jobacct_vmem_limit; /* step's virutal memory limit in KB */ - -#endif diff --git a/src/common/log.c b/src/common/log.c index 9fdc07702b77a12deedca71577bfc40708e67145..23e206693e358a18ff24621e84f07b8498deb781 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -571,12 +571,17 @@ static char *vxstrfmt(const char *fmt, va_list ap) case 'T': /* "%T" => "dd Mon yyyy hh:mm:ss off" */ xstrftimecat(buf, "%a %d %b %Y %H:%M:%S %z"); break; -#ifdef USE_ISO_8601 - case 'M': /* "%M" => "yyyy-mm-ddThh:mm:ss" */ +#if defined USE_USEC_CLOCK + case 'M': /* "%M" => "usec" */ + snprintf(tmp, sizeof(tmp), "%ld", clock()); + xstrcat(buf, tmp); + break; +#elif defined USE_ISO_8601 + case 'M': /* "%M" => "yyyy-mm-ddThh:mm:ss" */ xstrftimecat(buf, "%Y-%m-%dT%T"); break; #else - case 'M': /* "%M" => "Mon DD hh:mm:ss" */ + case 'M': /* "%M" => "Mon DD hh:mm:ss" */ xstrftimecat(buf, "%b %d %T"); break; #endif diff --git a/src/common/mpi.c b/src/common/mpi.c index 9ecdf1da837a8e9ef7ab4d88819e03d73964fc8a..9dc2cd187bd51de2f1a265f4f143376f5af0f4b0 100644 --- a/src/common/mpi.c +++ b/src/common/mpi.c @@ -69,148 +69,33 @@ typedef struct slurm_mpi_ops { int (*client_fini) (mpi_plugin_client_state_t *); } slurm_mpi_ops_t; -struct slurm_mpi_context { - char * mpi_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int mpi_errno; - slurm_mpi_ops_t ops; -}; - -static slurm_mpi_context_t g_context = NULL; -static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER; - -static slurm_mpi_context_t -_slurm_mpi_context_create(const char *mpi_type) -{ - slurm_mpi_context_t c; - - if ( mpi_type == NULL ) { - debug3( "_slurm_mpi_context_create: no mpi type" ); - return NULL; - } - - c = xmalloc(sizeof(struct slurm_mpi_context)); - - c->mpi_errno = SLURM_SUCCESS; - - /* Copy the job completion authentication type. */ - c->mpi_type = xstrdup(mpi_type); - if (c->mpi_type == NULL ) { - debug3( "can't make local copy of mpi type" ); - xfree(c); - return NULL; - } - - /* Plugin rack is demand-loaded on first reference. */ - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - - return c; -} - -static int -_slurm_mpi_context_destroy( slurm_mpi_context_t c ) -{ - int rc = SLURM_SUCCESS; - - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree(c->mpi_type); - xfree(c); - - return rc; -} - /* - * Resolve the operations from the plugin. + * These strings must be kept in the same order as the fields + * declared for slurm_mpi_ops_t. */ -static slurm_mpi_ops_t * -_slurm_mpi_get_ops( slurm_mpi_context_t c ) -{ - /* - * These strings must be kept in the same order as the fields - * declared for slurm_mpi_ops_t. - */ - static const char *syms[] = { - "p_mpi_hook_slurmstepd_prefork", - "p_mpi_hook_slurmstepd_task", - "p_mpi_hook_client_prelaunch", - "p_mpi_hook_client_single_task_per_node", - "p_mpi_hook_client_fini" - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - char *plugin_dir = NULL; - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->mpi_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->mpi_type); - - /* Get the plugin list, if needed. */ - if ( c->plugin_list == NULL ) { - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error("Unable to create a plugin manager"); - return NULL; - } - - plugrack_set_major_type(c->plugin_list, "mpi"); - plugrack_set_paranoia(c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir(c->plugin_list, plugin_dir); - xfree(plugin_dir); - } - - if (strcasecmp (c->mpi_type, "mpi/list") == 0) { - plugrack_print_all_plugin(c->plugin_list); - exit(0); - } else { - /* Find the correct plugin. */ - c->cur_plugin = plugrack_use_by_type(c->plugin_list, - c->mpi_type); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error("can't find a valid plugin for type %s", - c->mpi_type); - return NULL; - } - } - - /* Dereference the API. */ - if ( plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops ) < n_syms ) { - error( "incomplete mpi plugin detected" ); - return NULL; - } +static const char *syms[] = { + "p_mpi_hook_slurmstepd_prefork", + "p_mpi_hook_slurmstepd_task", + "p_mpi_hook_client_prelaunch", + "p_mpi_hook_client_single_task_per_node", + "p_mpi_hook_client_fini" +}; - return &c->ops; -} +static slurm_mpi_ops_t ops; +static plugin_context_t *g_context = NULL; +static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER; +static bool init_run = false; int _mpi_init (char *mpi_type) { int retval = SLURM_SUCCESS; - char *full_type = NULL; + char *plugin_type = "mpi"; + char *type = NULL; int got_default = 0; + if (init_run && g_context) + return retval; + slurm_mutex_lock( &context_lock ); if ( g_context ) @@ -225,29 +110,23 @@ int _mpi_init (char *mpi_type) retval = SLURM_ERROR; goto done; } - setenvf (NULL, "SLURM_MPI_TYPE", "%s", mpi_type); + setenvf(NULL, "SLURM_MPI_TYPE", "%s", mpi_type); - full_type = xmalloc(sizeof(char) * (strlen(mpi_type)+5)); - sprintf(full_type,"mpi/%s",mpi_type); + type = xstrdup_printf("mpi/%s", mpi_type); - g_context = _slurm_mpi_context_create(full_type); - xfree(full_type); - if ( g_context == NULL ) { - error( "cannot create a context for %s", mpi_type); - retval = SLURM_ERROR; - goto done; - } + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); - if ( _slurm_mpi_get_ops( g_context ) == NULL ) { - error( "cannot resolve plugin operations for %s", mpi_type); - _slurm_mpi_context_destroy( g_context ); - g_context = NULL; + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; + goto done; } - + init_run = true; done: - if(got_default) + xfree(type); + if (got_default) xfree(mpi_type); slurm_mutex_unlock( &context_lock ); return retval; @@ -259,7 +138,7 @@ int mpi_hook_slurmstepd_init (char ***env) debug("mpi type = %s", mpi_type); - if(_mpi_init(mpi_type) == SLURM_ERROR) + if (_mpi_init(mpi_type) == SLURM_ERROR) return SLURM_ERROR; unsetenvp (*env, "SLURM_MPI_TYPE"); @@ -272,7 +151,7 @@ int mpi_hook_slurmstepd_prefork (const slurmd_job_t *job, char ***env) if (mpi_hook_slurmstepd_init(env) == SLURM_ERROR) return SLURM_ERROR; - return (*(g_context->ops.slurmstepd_prefork))(job, env); + return (*(ops.slurmstepd_prefork))(job, env); } int mpi_hook_slurmstepd_task (const mpi_plugin_task_info_t *job, char ***env) @@ -280,14 +159,14 @@ int mpi_hook_slurmstepd_task (const mpi_plugin_task_info_t *job, char ***env) if (mpi_hook_slurmstepd_init(env) == SLURM_ERROR) return SLURM_ERROR; - return (*(g_context->ops.slurmstepd_init))(job, env); + return (*(ops.slurmstepd_init))(job, env); } int mpi_hook_client_init (char *mpi_type) { debug("mpi type = %s", mpi_type); - if(_mpi_init(mpi_type) == SLURM_ERROR) + if (_mpi_init(mpi_type) == SLURM_ERROR) return SLURM_ERROR; return SLURM_SUCCESS; @@ -299,7 +178,7 @@ mpi_hook_client_prelaunch(const mpi_plugin_client_info_t *job, char ***env) if (_mpi_init(NULL) < 0) return NULL; - return (*(g_context->ops.client_prelaunch))(job, env); + return (*(ops.client_prelaunch))(job, env); } bool mpi_hook_client_single_task_per_node (void) @@ -313,7 +192,7 @@ bool mpi_hook_client_single_task_per_node (void) */ return true; #else - return (*(g_context->ops.client_single_task))(); + return (*(ops.client_single_task))(); #endif } @@ -322,7 +201,7 @@ int mpi_hook_client_fini (mpi_plugin_client_state_t *state) if (_mpi_init(NULL) < 0) return SLURM_ERROR; - return (*(g_context->ops.client_fini))(state); + return (*(ops.client_fini))(state); } int mpi_fini (void) @@ -332,7 +211,8 @@ int mpi_fini (void) if (!g_context) return SLURM_SUCCESS; - rc = _slurm_mpi_context_destroy(g_context); + init_run = false; + rc = plugin_context_destroy(g_context); return rc; } diff --git a/src/common/node_conf.c b/src/common/node_conf.c index ca16593d1ebdaa90f8e46e9edf1e0c4a99e3621e..397598b4c878ea27fa6b34968d26f4dca0166f67 100644 --- a/src/common/node_conf.c +++ b/src/common/node_conf.c @@ -143,14 +143,17 @@ static int _build_single_nodeline_info(slurm_conf_node_t *node_ptr, { int error_code = SLURM_SUCCESS; struct node_record *node_rec = NULL; + hostlist_t address_list = NULL; hostlist_t alias_list = NULL; hostlist_t hostname_list = NULL; - hostlist_t address_list = NULL; + hostlist_t port_list = NULL; + char *address = NULL; char *alias = NULL; char *hostname = NULL; - char *address = NULL; + char *port_str = NULL; int state_val = NODE_STATE_UNKNOWN; - int address_count, alias_count, hostname_count; + int address_count, alias_count, hostname_count, port_count; + uint16_t port = 0; if (node_ptr->state != NULL) { state_val = state_str2int(node_ptr->state, node_ptr->nodenames); @@ -158,6 +161,12 @@ static int _build_single_nodeline_info(slurm_conf_node_t *node_ptr, goto cleanup; } + if ((address_list = hostlist_create(node_ptr->addresses)) == NULL) { + fatal("Unable to create NodeAddr list from %s", + node_ptr->addresses); + error_code = errno; + goto cleanup; + } if ((alias_list = hostlist_create(node_ptr->nodenames)) == NULL) { fatal("Unable to create NodeName list from %s", node_ptr->nodenames); @@ -170,9 +179,19 @@ static int _build_single_nodeline_info(slurm_conf_node_t *node_ptr, error_code = errno; goto cleanup; } - if ((address_list = hostlist_create(node_ptr->addresses)) == NULL) { - fatal("Unable to create NodeAddr list from %s", - node_ptr->addresses); + if (node_ptr->port_str && node_ptr->port_str[0] && + (node_ptr->port_str[0] != '[') && + (strchr(node_ptr->port_str, '-') || + strchr(node_ptr->port_str, ','))) { + xstrfmtcat(port_str, "[%s]", node_ptr->port_str); + port_list = hostlist_create(port_str); + xfree(port_str); + } else { + port_list = hostlist_create(node_ptr->port_str); + } + if (port_list == NULL) { + error("Unable to create Port list from %s", + node_ptr->port_str); error_code = errno; goto cleanup; } @@ -181,6 +200,7 @@ static int _build_single_nodeline_info(slurm_conf_node_t *node_ptr, address_count = hostlist_count(address_list); alias_count = hostlist_count(alias_list); hostname_count = hostlist_count(hostname_list); + port_count = hostlist_count(port_list); #ifdef HAVE_FRONT_END if ((hostname_count != alias_count) && (hostname_count != 1)) { error("NodeHostname count must equal that of NodeName " @@ -193,30 +213,54 @@ static int _build_single_nodeline_info(slurm_conf_node_t *node_ptr, goto cleanup; } #else - if (hostname_count < alias_count) { - error("At least as many NodeHostname are required " - "as NodeName"); +#ifdef MULTIPLE_SLURMD + if ((address_count != alias_count) && (address_count != 1)) { + error("NodeAddr count must equal that of NodeName " + "records of there must be no more than one"); goto cleanup; } +#else if (address_count < alias_count) { error("At least as many NodeAddr are required as NodeName"); goto cleanup; } +#endif /* MULTIPLE_SLURMD */ + if (hostname_count < alias_count) { + error("At least as many NodeHostname are required " + "as NodeName"); + goto cleanup; + } #endif + if ((port_count != alias_count) && (port_count > 1)) { + error("Port count must equal that of NodeName " + "records or there must be no more than one"); + goto cleanup; + } /* now build the individual node structures */ while ((alias = hostlist_shift(alias_list))) { + if (address_count > 0) { + address_count--; + if (address) + free(address); + address = hostlist_shift(address_list); + } if (hostname_count > 0) { hostname_count--; if (hostname) free(hostname); hostname = hostlist_shift(hostname_list); } - if (address_count > 0) { - address_count--; - if (address) - free(address); - address = hostlist_shift(address_list); + if (port_count > 0) { + int port_int; + port_count--; + if (port_str) + free(port_str); + port_str = hostlist_shift(port_list); + port_int = atoi(port_str); + if ((port_int <= 0) || (port_int > 0xffff)) + fatal("Invalid Port %s", node_ptr->port_str); + port = port_int; } /* find_node_record locks this to get the * alias so we need to unlock */ @@ -230,7 +274,7 @@ static int _build_single_nodeline_info(slurm_conf_node_t *node_ptr, node_rec->last_response = (time_t) 0; node_rec->comm_name = xstrdup(address); node_rec->node_hostname = xstrdup(hostname); - node_rec->port = node_ptr->port; + node_rec->port = port; node_rec->weight = node_ptr->weight; node_rec->features = xstrdup(node_ptr->feature); node_rec->reason = xstrdup(node_ptr->reason); @@ -247,12 +291,16 @@ cleanup: free(address); if (hostname) free(hostname); + if (port_str) + free(port_str); + if (address_list) + hostlist_destroy(address_list); if (alias_list) hostlist_destroy(alias_list); if (hostname_list) hostlist_destroy(hostname_list); - if (address_list) - hostlist_destroy(address_list); + if (port_list) + hostlist_destroy(port_list); return error_code; } @@ -596,6 +644,7 @@ extern int build_all_nodeline_info (bool set_bitmap) config_ptr = create_config_record(); config_ptr->nodes = xstrdup(node->nodenames); config_ptr->cpus = node->cpus; + config_ptr->boards = node->boards; config_ptr->sockets = node->sockets; config_ptr->cores = node->cores; config_ptr->threads = node->threads; @@ -730,6 +779,7 @@ extern struct node_record *create_node_record ( node_ptr->config_ptr = config_ptr; /* these values will be overwritten when the node actually registers */ node_ptr->cpus = config_ptr->cpus; + node_ptr->boards = config_ptr->boards; node_ptr->sockets = config_ptr->sockets; node_ptr->cores = config_ptr->cores; node_ptr->threads = config_ptr->threads; diff --git a/src/common/node_conf.h b/src/common/node_conf.h index 8eb96d5d3f0d8a778218cfc37198e3c0fcf91de9..49107f9cefd739710bb5805f79dd8f0e6f05cf25 100644 --- a/src/common/node_conf.h +++ b/src/common/node_conf.h @@ -66,6 +66,7 @@ struct config_record { uint32_t magic; /* magic cookie to test data integrity */ uint16_t cpus; /* count of processors running on the node */ + uint16_t boards; /* count of boards configured */ uint16_t sockets; /* number of sockets per node */ uint16_t cores; /* number of cores per CPU */ uint16_t threads; /* number of threads per core */ @@ -105,6 +106,7 @@ struct node_record { time_t last_response; /* last response from the node */ time_t last_idle; /* time node last become idle */ uint16_t cpus; /* count of processors on the node */ + uint16_t boards; /* count of boards configured */ uint16_t sockets; /* number of sockets per node */ uint16_t cores; /* number of cores per CPU */ uint16_t threads; /* number of threads per core */ diff --git a/src/common/node_select.c b/src/common/node_select.c index 00d189d5069d984c2d0d6f36edbe6bddefdffac2..b5e3be8e14645dd29b3e0672ba6f94cdd17bbc9d 100644 --- a/src/common/node_select.c +++ b/src/common/node_select.c @@ -58,158 +58,72 @@ #include "src/slurmctld/slurmctld.h" #include "src/common/node_select.h" -strong_alias(destroy_select_ba_request, slurm_destroy_select_ba_request); - -static int select_context_cnt = -1; -static int select_context_default = -1; -/* If there is a new select plugin, list it here */ -static slurm_select_context_t * select_context = NULL; -static pthread_mutex_t select_context_lock = - PTHREAD_MUTEX_INITIALIZER; - /* - * Locate and load the appropriate plugin + * Must be synchronized with slurm_select_ops_t in node_select.h. + * Also must be synchronized with the other_plugin.c in + * the select/cray plugin. (We tried to make it so we only had to + * define it once, but it didn't seem to work.) */ -static int _select_get_ops(char *select_type, - slurm_select_context_t *c) -{ - /* - * Must be synchronized with slurm_select_ops_t in node_select.h. - * Also must be synchronized with the other_plugin.[c|h] in - * the select/cray plugin. - */ - static const char *syms[] = { - "plugin_id", - "select_p_state_save", - "select_p_state_restore", - "select_p_job_init", - "select_p_node_ranking", - "select_p_node_init", - "select_p_block_init", - "select_p_job_test", - "select_p_job_begin", - "select_p_job_ready", - "select_p_job_expand_allow", - "select_p_job_expand", - "select_p_job_resized", - "select_p_job_signal", - "select_p_job_fini", - "select_p_job_suspend", - "select_p_job_resume", - "select_p_step_pick_nodes", - "select_p_step_finish", - "select_p_pack_select_info", - "select_p_select_nodeinfo_pack", - "select_p_select_nodeinfo_unpack", - "select_p_select_nodeinfo_alloc", - "select_p_select_nodeinfo_free", - "select_p_select_nodeinfo_set_all", - "select_p_select_nodeinfo_set", - "select_p_select_nodeinfo_get", - "select_p_select_jobinfo_alloc", - "select_p_select_jobinfo_free", - "select_p_select_jobinfo_set", - "select_p_select_jobinfo_get", - "select_p_select_jobinfo_copy", - "select_p_select_jobinfo_pack", - "select_p_select_jobinfo_unpack", - "select_p_select_jobinfo_sprint", - "select_p_select_jobinfo_xstrdup", - "select_p_update_block", - "select_p_update_sub_node", - "select_p_get_info_from_plugin", - "select_p_update_node_config", - "select_p_update_node_state", - "select_p_alter_node_cnt", - "select_p_reconfigure", - "select_p_resv_test", - "select_p_ba_init", - "select_p_ba_fini", - "select_p_ba_get_dims", - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - - c->select_type = xstrdup(select_type); - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - c->select_errno = SLURM_SUCCESS; - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->select_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return SLURM_SUCCESS; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->select_type, plugin_strerror(errno)); - return SLURM_ERROR; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->select_type); - - /* Get plugin list. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "cannot create plugin manager" ); - return SLURM_ERROR; - } - plugrack_set_major_type( c->plugin_list, "select" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - c->cur_plugin = plugrack_use_by_type( c->plugin_list, c->select_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "cannot find node selection plugin for %s", - c->select_type ); - - return SLURM_ERROR; - } - - /* Dereference the API. */ - if ( plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops ) < n_syms ) { - error( "incomplete node selection plugin detected" ); - return SLURM_ERROR; - } - - return SLURM_SUCCESS; -} - -/* - * Destroy a node selection context - */ -static int _select_context_destroy( slurm_select_context_t *c ) -{ - int rc = SLURM_SUCCESS; - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } +const char *node_select_syms[] = { + "plugin_id", + "select_p_state_save", + "select_p_state_restore", + "select_p_job_init", + "select_p_node_ranking", + "select_p_node_init", + "select_p_block_init", + "select_p_job_test", + "select_p_job_begin", + "select_p_job_ready", + "select_p_job_expand_allow", + "select_p_job_expand", + "select_p_job_resized", + "select_p_job_signal", + "select_p_job_fini", + "select_p_job_suspend", + "select_p_job_resume", + "select_p_step_pick_nodes", + "select_p_step_finish", + "select_p_pack_select_info", + "select_p_select_nodeinfo_pack", + "select_p_select_nodeinfo_unpack", + "select_p_select_nodeinfo_alloc", + "select_p_select_nodeinfo_free", + "select_p_select_nodeinfo_set_all", + "select_p_select_nodeinfo_set", + "select_p_select_nodeinfo_get", + "select_p_select_jobinfo_alloc", + "select_p_select_jobinfo_free", + "select_p_select_jobinfo_set", + "select_p_select_jobinfo_get", + "select_p_select_jobinfo_copy", + "select_p_select_jobinfo_pack", + "select_p_select_jobinfo_unpack", + "select_p_select_jobinfo_sprint", + "select_p_select_jobinfo_xstrdup", + "select_p_update_block", + "select_p_update_sub_node", + "select_p_fail_cnode", + "select_p_get_info_from_plugin", + "select_p_update_node_config", + "select_p_update_node_state", + "select_p_alter_node_cnt", + "select_p_reconfigure", + "select_p_resv_test", + "select_p_ba_init", + "select_p_ba_fini", + "select_p_ba_get_dims", +}; - xfree(c->select_type); +strong_alias(destroy_select_ba_request, slurm_destroy_select_ba_request); - return rc; -} +static int select_context_cnt = -1; +static int select_context_default = -1; +static slurm_select_ops_t *ops = NULL; +static plugin_context_t **select_context = NULL; +static pthread_mutex_t select_context_lock = PTHREAD_MUTEX_INITIALIZER; +static bool init_run = false; /** * delete a block request */ @@ -275,28 +189,32 @@ extern int select_char2coord(char coord) extern int slurm_select_init(bool only_default) { int retval = SLURM_SUCCESS; - char *select_type = NULL; - int i, j, rc, len; + char *type = NULL; + int i, j, len; DIR *dirp; struct dirent *e; char *dir_array = NULL, *head = NULL; + char *plugin_type = "select"; + + if ( init_run && select_context ) + return retval; slurm_mutex_lock( &select_context_lock ); if ( select_context ) goto done; - select_type = slurm_get_select_type(); + type = slurm_get_select_type(); if (working_cluster_rec) { /* just ignore warnings here */ } else { #ifdef HAVE_XCPU - if (strcasecmp(select_type, "select/linear")) { - error("%s is incompatible with XCPU use", select_type); + if (strcasecmp(type, "select/linear")) { + error("%s is incompatible with XCPU use", type); fatal("Use SelectType=select/linear"); } #endif - if (!strcasecmp(select_type, "select/linear")) { + if (!strcasecmp(type, "select/linear")) { uint16_t cr_type = slurm_get_select_type_param(); if ((cr_type & CR_SOCKET) || (cr_type & CR_CORE) || (cr_type & CR_CPU)) @@ -305,12 +223,12 @@ extern int slurm_select_init(bool only_default) } #ifdef HAVE_BG - if (strcasecmp(select_type, "select/bluegene")) { - error("%s is incompatible with BlueGene", select_type); + if (strcasecmp(type, "select/bluegene")) { + error("%s is incompatible with BlueGene", type); fatal("Use SelectType=select/bluegene"); } #else - if (!strcasecmp(select_type, "select/bluegene")) { + if (!strcasecmp(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] " @@ -320,12 +238,12 @@ extern int slurm_select_init(bool only_default) #endif #ifdef HAVE_CRAY - if (strcasecmp(select_type, "select/cray")) { - error("%s is incompatible with Cray", select_type); + if (strcasecmp(type, "select/cray")) { + error("%s is incompatible with Cray", type); fatal("Use SelectType=select/cray"); } #else - if (!strcasecmp(select_type, "select/cray")) { + if (!strcasecmp(type, "select/cray")) { fatal("Requested SelectType=select/cray " "in slurm.conf, but not running on a Cray " "system. If looking to emulate a Cray " @@ -335,17 +253,19 @@ extern int slurm_select_init(bool only_default) } select_context_cnt = 0; - if(only_default) { - select_context = xmalloc(sizeof(slurm_select_context_t)); - rc = _select_get_ops(select_type, select_context); - if (rc == SLURM_SUCCESS) { + if (only_default) { + ops = xmalloc(sizeof(slurm_select_ops_t)); + select_context = xmalloc(sizeof(plugin_context_t)); + if ((select_context[0] = plugin_context_create( + plugin_type, type, (void **)&ops[0], + node_select_syms, sizeof(node_select_syms)))) { select_context_default = 0; select_context_cnt++; } goto skip_load_all; } - if(!(dir_array = slurm_get_plugin_dir())) { + if (!(dir_array = slurm_get_plugin_dir())) { error("plugin_load_and_link: No plugin dir given"); goto done; } @@ -395,22 +315,27 @@ extern int slurm_select_init(bool only_default) snprintf(full_name, len, "select/%s", e->d_name+7); for (j=0; jtype)) break; } if (j >= select_context_cnt) { + xrealloc(ops, + (sizeof(slurm_select_ops_t) * + (select_context_cnt + 1))); xrealloc(select_context, - (sizeof(slurm_select_context_t) * + (sizeof(plugin_context_t) * (select_context_cnt + 1))); - rc = _select_get_ops( - full_name, - select_context + select_context_cnt); - - /* only add the ones this system has */ - if (rc == SLURM_SUCCESS) { + select_context[select_context_cnt] = + plugin_context_create( + plugin_type, full_name, + (void **)&ops[ + select_context_cnt], + node_select_syms, + sizeof(node_select_syms)); + if (select_context[select_context_cnt]) { /* set the default */ - if (!strcmp(full_name, select_type)) + if (!strcmp(full_name, type)) select_context_default = select_context_cnt; select_context_cnt++; @@ -427,32 +352,33 @@ extern int slurm_select_init(bool only_default) } skip_load_all: - if(select_context_default == -1) - fatal("Can't find plugin for %s", select_type); + if (select_context_default == -1) + fatal("Can't find plugin for %s", type); /* Insure that plugin_id is valid and unique */ for (i=0; itype, + select_context[j]->type); } - if (*(select_context[i].ops.plugin_id) < 100) { + if (*(ops[i].plugin_id) < 100) { fatal("SelectPlugins: Invalid plugin_id %u (<100) %s", - *(select_context[i].ops.plugin_id), - select_context[i].select_type); + *(ops[i].plugin_id), + select_context[i]->type); } } + init_run = true; done: slurm_mutex_unlock( &select_context_lock ); - xfree(select_type); + xfree(type); xfree(dir_array); return retval; } @@ -465,11 +391,13 @@ extern int slurm_select_fini(void) if (!select_context) goto fini; + init_run = false; for (i=0; i= select_context_cnt) @@ -500,7 +428,7 @@ extern int select_get_plugin_id(void) if (slurm_select_init(0) < 0) return 0; - return *(select_context[select_context_default].ops.plugin_id); + return *(ops[select_context_default].plugin_id); } /* @@ -512,7 +440,7 @@ extern int select_g_state_save(char *dir_name) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.state_save)) + return (*(ops[select_context_default].state_save)) (dir_name); } @@ -526,7 +454,7 @@ extern int select_g_state_restore(char *dir_name) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.state_restore)) + return (*(ops[select_context_default].state_restore)) (dir_name); } @@ -539,7 +467,7 @@ extern int select_g_job_init(List job_list) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.job_init)) + return (*(ops[select_context_default].job_init)) (job_list); } @@ -554,7 +482,7 @@ extern bool select_g_node_ranking(struct node_record *node_ptr, int node_cnt) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.node_ranking)) + return (*(ops[select_context_default].node_ranking)) (node_ptr, node_cnt); } @@ -568,7 +496,7 @@ extern int select_g_node_init(struct node_record *node_ptr, int node_cnt) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.node_init)) + return (*(ops[select_context_default].node_init)) (node_ptr, node_cnt); } @@ -582,7 +510,7 @@ extern int select_g_block_init(List block_list) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.block_init)) + return (*(ops[select_context_default].block_init)) (block_list); } @@ -610,12 +538,13 @@ extern int select_g_job_test(struct job_record *job_ptr, bitstr_t *bitmap, uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, uint16_t mode, List preemptee_candidates, - List *preemptee_job_list, bitstr_t *exc_core_bitmap) + List *preemptee_job_list, + bitstr_t *exc_core_bitmap) { if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.job_test)) + return (*(ops[select_context_default].job_test)) (job_ptr, bitmap, min_nodes, max_nodes, req_nodes, mode, @@ -633,7 +562,7 @@ extern int select_g_job_begin(struct job_record *job_ptr) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.job_begin)) + return (*(ops[select_context_default].job_begin)) (job_ptr); } @@ -648,7 +577,7 @@ extern int select_g_job_ready(struct job_record *job_ptr) if (slurm_select_init(0) < 0) return -1; - return (*(select_context[select_context_default].ops.job_ready)) + return (*(ops[select_context_default].job_ready)) (job_ptr); } @@ -660,7 +589,7 @@ extern bool select_g_job_expand_allow(void) if (slurm_select_init(0) < 0) return false; - return (*(select_context[select_context_default].ops.job_expand_allow)) + return (*(ops[select_context_default].job_expand_allow)) (); } @@ -676,7 +605,7 @@ extern int select_g_job_expand(struct job_record *from_job_ptr, if (slurm_select_init(0) < 0) return -1; - return (*(select_context[select_context_default].ops.job_expand)) + return (*(ops[select_context_default].job_expand)) (from_job_ptr, to_job_ptr); } @@ -691,7 +620,7 @@ extern int select_g_job_resized(struct job_record *job_ptr, if (slurm_select_init(0) < 0) return -1; - return (*(select_context[select_context_default].ops.job_resized)) + return (*(ops[select_context_default].job_resized)) (job_ptr, node_ptr); } @@ -706,7 +635,7 @@ extern int select_g_job_signal(struct job_record *job_ptr, int signal) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.job_signal)) + return (*(ops[select_context_default].job_signal)) (job_ptr, signal); } @@ -719,7 +648,7 @@ extern int select_g_job_fini(struct job_record *job_ptr) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.job_fini)) + return (*(ops[select_context_default].job_fini)) (job_ptr); } @@ -735,7 +664,7 @@ extern int select_g_job_suspend(struct job_record *job_ptr, bool indf_susp) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.job_suspend)) + return (*(ops[select_context_default].job_suspend)) (job_ptr, indf_susp); } @@ -751,7 +680,7 @@ extern int select_g_job_resume(struct job_record *job_ptr, bool indf_susp) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.job_resume)) + return (*(ops[select_context_default].job_resume)) (job_ptr, indf_susp); } @@ -776,7 +705,7 @@ extern bitstr_t *select_g_step_pick_nodes(struct job_record *job_ptr, xassert(step_jobinfo); - return (*(select_context[select_context_default].ops.step_pick_nodes)) + return (*(ops[select_context_default].step_pick_nodes)) (job_ptr, step_jobinfo->data, node_count); } @@ -789,7 +718,7 @@ extern int select_g_step_finish(struct step_record *step_ptr) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.step_finish)) + return (*(ops[select_context_default].step_finish)) (step_ptr); } @@ -800,7 +729,7 @@ extern int select_g_pack_select_info(time_t last_query_time, if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.pack_select_info)) + return (*(ops[select_context_default].pack_select_info)) (last_query_time, show_flags, buffer, protocol_version); } @@ -821,10 +750,10 @@ extern int select_g_select_nodeinfo_pack(dynamic_plugin_data_t *nodeinfo, plugin_id = select_context_default; if(protocol_version >= SLURM_2_2_PROTOCOL_VERSION) - pack32(*(select_context[plugin_id].ops.plugin_id), + pack32(*(ops[plugin_id].plugin_id), buffer); - return (*(select_context[plugin_id].ops. + return (*(ops[plugin_id]. nodeinfo_pack))(data, buffer, protocol_version); } @@ -845,7 +774,7 @@ extern int select_g_select_nodeinfo_unpack(dynamic_plugin_data_t **nodeinfo, uint32_t plugin_id; safe_unpack32(&plugin_id, buffer); for (i=0; iplugin_id = i; break; } @@ -855,7 +784,7 @@ extern int select_g_select_nodeinfo_unpack(dynamic_plugin_data_t **nodeinfo, } } else nodeinfo_ptr->plugin_id = select_context_default; - if ((*(select_context[nodeinfo_ptr->plugin_id].ops.nodeinfo_unpack)) + if ((*(ops[nodeinfo_ptr->plugin_id].nodeinfo_unpack)) ((select_nodeinfo_t **)&nodeinfo_ptr->data, buffer, protocol_version) != SLURM_SUCCESS) goto unpack_error; @@ -882,7 +811,7 @@ extern dynamic_plugin_data_t *select_g_select_nodeinfo_alloc(void) nodeinfo_ptr = xmalloc(sizeof(dynamic_plugin_data_t)); nodeinfo_ptr->plugin_id = plugin_id; - nodeinfo_ptr->data = (*(select_context[plugin_id].ops. + nodeinfo_ptr->data = (*(ops[plugin_id]. nodeinfo_alloc))(); return nodeinfo_ptr; } @@ -896,20 +825,20 @@ extern int select_g_select_nodeinfo_free(dynamic_plugin_data_t *nodeinfo) if(nodeinfo) { if(nodeinfo->data) - rc = (*(select_context[nodeinfo->plugin_id].ops. + rc = (*(ops[nodeinfo->plugin_id]. nodeinfo_free))(nodeinfo->data); xfree(nodeinfo); } return rc; } -extern int select_g_select_nodeinfo_set_all(time_t last_query_time) +extern int select_g_select_nodeinfo_set_all(void) { if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.nodeinfo_set_all)) - (last_query_time); + return (*(ops[select_context_default].nodeinfo_set_all)) + (); } extern int select_g_select_nodeinfo_set(struct job_record *job_ptr) @@ -917,7 +846,7 @@ extern int select_g_select_nodeinfo_set(struct job_record *job_ptr) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.nodeinfo_set)) + return (*(ops[select_context_default].nodeinfo_set)) (job_ptr); } @@ -938,7 +867,7 @@ extern int select_g_select_nodeinfo_get(dynamic_plugin_data_t *nodeinfo, } else plugin_id = select_context_default; - return (*(select_context[plugin_id].ops.nodeinfo_get)) + return (*(ops[plugin_id].nodeinfo_get)) (nodedata, dinfo, state, data); } @@ -955,7 +884,7 @@ extern dynamic_plugin_data_t *select_g_select_jobinfo_alloc(void) jobinfo_ptr = xmalloc(sizeof(dynamic_plugin_data_t)); jobinfo_ptr->plugin_id = plugin_id; - jobinfo_ptr->data = (*(select_context[plugin_id].ops. + jobinfo_ptr->data = (*(ops[plugin_id]. jobinfo_alloc))(); return jobinfo_ptr; } @@ -971,7 +900,7 @@ extern int select_g_select_jobinfo_free(dynamic_plugin_data_t *jobinfo) return SLURM_ERROR; if (jobinfo) { if (jobinfo->data) { - rc = (*(select_context[jobinfo->plugin_id].ops. + rc = (*(ops[jobinfo->plugin_id]. jobinfo_free))(jobinfo->data); } xfree(jobinfo); @@ -995,7 +924,7 @@ extern int select_g_select_jobinfo_set(dynamic_plugin_data_t *jobinfo, } else plugin_id = select_context_default; - return (*(select_context[plugin_id].ops.jobinfo_set)) + return (*(ops[plugin_id].jobinfo_set)) (jobdata, data_type, data); } @@ -1020,7 +949,7 @@ extern int select_g_select_jobinfo_get(dynamic_plugin_data_t *jobinfo, } else plugin_id = select_context_default; - return (*(select_context[plugin_id].ops.jobinfo_get)) + return (*(ops[plugin_id].jobinfo_get)) (jobdata, data_type, data); } @@ -1039,7 +968,7 @@ extern dynamic_plugin_data_t *select_g_select_jobinfo_copy( jobinfo_ptr = xmalloc(sizeof(dynamic_plugin_data_t)); if(jobinfo) { jobinfo_ptr->plugin_id = jobinfo->plugin_id; - jobinfo_ptr->data = (*(select_context[jobinfo->plugin_id].ops. + jobinfo_ptr->data = (*(ops[jobinfo->plugin_id]. jobinfo_copy))(jobinfo->data); } else jobinfo_ptr->plugin_id = select_context_default; @@ -1062,17 +991,15 @@ extern int select_g_select_jobinfo_pack(dynamic_plugin_data_t *jobinfo, if (slurm_select_init(0) < 0) return SLURM_ERROR; - if(jobinfo) { + if (jobinfo) { data = jobinfo->data; plugin_id = jobinfo->plugin_id; } else plugin_id = select_context_default; - if(protocol_version >= SLURM_2_2_PROTOCOL_VERSION) - pack32(*(select_context[plugin_id].ops.plugin_id), - buffer); - return (*(select_context[plugin_id].ops. - jobinfo_pack))(data, buffer, protocol_version); + if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) + pack32(*(ops[plugin_id].plugin_id), buffer); + return (*(ops[plugin_id].jobinfo_pack))(data, buffer, protocol_version); } /* unpack a select job credential from a buffer @@ -1098,7 +1025,7 @@ extern int select_g_select_jobinfo_unpack(dynamic_plugin_data_t **jobinfo, uint32_t plugin_id; safe_unpack32(&plugin_id, buffer); for (i=0; iplugin_id = i; break; } @@ -1109,7 +1036,7 @@ extern int select_g_select_jobinfo_unpack(dynamic_plugin_data_t **jobinfo, } else jobinfo_ptr->plugin_id = select_context_default; - if ((*(select_context[jobinfo_ptr->plugin_id].ops.jobinfo_unpack)) + if ((*(ops[jobinfo_ptr->plugin_id].jobinfo_unpack)) ((select_jobinfo_t **)&jobinfo_ptr->data, buffer, protocol_version) != SLURM_SUCCESS) goto unpack_error; @@ -1144,7 +1071,7 @@ extern char *select_g_select_jobinfo_sprint(dynamic_plugin_data_t *jobinfo, } else plugin_id = select_context_default; - return (*(select_context[plugin_id].ops. + return (*(ops[plugin_id]. jobinfo_sprint)) (data, buf, size, mode); } @@ -1168,7 +1095,7 @@ extern char *select_g_select_jobinfo_xstrdup( } else plugin_id = select_context_default; - return (*(select_context[plugin_id].ops. + return (*(ops[plugin_id]. jobinfo_xstrdup))(data, mode); } @@ -1181,7 +1108,7 @@ extern int select_g_update_block (update_block_msg_t *block_desc_ptr) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops. + return (*(ops[select_context_default]. update_block))(block_desc_ptr); } @@ -1194,10 +1121,23 @@ extern int select_g_update_sub_node (update_block_msg_t *block_desc_ptr) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops. + return (*(ops[select_context_default]. update_sub_node))(block_desc_ptr); } +/* + * Fail certain cnodes in a blocks midplane (usually comes from the + * IBM runjob mux) + * IN step_ptr - step that has failed cnodes + */ +extern int select_g_fail_cnode (struct step_record *step_ptr) +{ + if (slurm_select_init(0) < 0) + return SLURM_ERROR; + + return (*(ops[select_context_default].fail_cnode))(step_ptr); +} + /* * Get select data from a plugin * IN dinfo - type of data to get from the node record @@ -1211,7 +1151,7 @@ extern int select_g_get_info_from_plugin (enum select_plugindata_info dinfo, if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops. + return (*(ops[select_context_default]. get_info_from_plugin))(dinfo, job_ptr, data); } @@ -1226,7 +1166,7 @@ extern int select_g_update_node_config (int index) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops. + return (*(ops[select_context_default]. update_node_config))(index); } @@ -1242,7 +1182,7 @@ extern int select_g_update_node_state (struct node_record *node_ptr) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.update_node_state)) + return (*(ops[select_context_default].update_node_state)) (node_ptr); } @@ -1260,8 +1200,7 @@ extern int select_g_alter_node_cnt (enum select_node_cnt type, void *data) uint32_t *nodes = (uint32_t *)data; *nodes = 1; } - return (*(select_context[select_context_default].ops.alter_node_cnt)) - (type, data); + return (*(ops[select_context_default].alter_node_cnt))(type, data); } /* @@ -1272,7 +1211,7 @@ extern int select_g_reconfigure (void) if (slurm_select_init(0) < 0) return SLURM_ERROR; - return (*(select_context[select_context_default].ops.reconfigure))(); + return (*(ops[select_context_default].reconfigure))(); } /* @@ -1286,12 +1225,13 @@ extern int select_g_reconfigure (void) * IN core_bitmap - cores to be excluded for this reservation * RET - nodes selected for use by the reservation */ -extern bitstr_t * select_g_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, uint32_t core_cnt, bitstr_t **core_bitmap) +extern bitstr_t * select_g_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, + uint32_t core_cnt, bitstr_t **core_bitmap) { if (slurm_select_init(0) < 0) return NULL; - return (*(select_context[select_context_default].ops.resv_test)) + return (*(ops[select_context_default].resv_test)) (avail_bitmap, node_cnt, core_cnt, core_bitmap); } @@ -1307,7 +1247,7 @@ extern void select_g_ba_init(node_info_msg_t *node_info_ptr, bool sanity_check) else plugin_id = select_context_default; - (*(select_context[plugin_id].ops.ba_init))(node_info_ptr, sanity_check); + (*(ops[plugin_id].ba_init))(node_info_ptr, sanity_check); } extern void select_g_ba_fini(void) @@ -1322,7 +1262,7 @@ extern void select_g_ba_fini(void) else plugin_id = select_context_default; - (*(select_context[plugin_id].ops.ba_fini))(); + (*(ops[plugin_id].ba_fini))(); } extern int *select_g_ba_get_dims(void) @@ -1337,5 +1277,5 @@ extern int *select_g_ba_get_dims(void) else plugin_id = select_context_default; - return (*(select_context[plugin_id].ops.ba_get_dims))(); + return (*(ops[plugin_id].ba_get_dims))(); } diff --git a/src/common/node_select.h b/src/common/node_select.h index d8bd1d01c8e67d7e4216e9e33451eba91607b1f6..04c9ec1a6e70be489eea77452a2b405840c0c686 100644 --- a/src/common/node_select.h +++ b/src/common/node_select.h @@ -170,7 +170,7 @@ typedef struct slurm_select_ops { uint16_t protocol_version); select_nodeinfo_t *(*nodeinfo_alloc) (void); int (*nodeinfo_free) (select_nodeinfo_t *nodeinfo); - int (*nodeinfo_set_all) (time_t last_query_time); + int (*nodeinfo_set_all) (void); int (*nodeinfo_set) (struct job_record *job_ptr); int (*nodeinfo_get) (select_nodeinfo_t *nodeinfo, enum @@ -203,6 +203,7 @@ typedef struct slurm_select_ops { *block_desc_ptr); int (*update_sub_node) (update_block_msg_t *block_desc_ptr); + int (*fail_cnode) (struct step_record *step_ptr); int (*get_info_from_plugin) (enum select_plugindata_info dinfo, struct job_record *job_ptr, @@ -213,7 +214,9 @@ typedef struct slurm_select_ops { void *data); int (*reconfigure) (void); bitstr_t * (*resv_test) (bitstr_t *avail_bitmap, - uint32_t node_cnt, uint32_t core_cnt, bitstr_t **core_bitmap); + uint32_t node_cnt, + uint32_t core_cnt, + bitstr_t **core_bitmap); void (*ba_init) (node_info_msg_t *node_info_ptr, bool sanity_check); void (*ba_fini) (void); @@ -221,13 +224,12 @@ typedef struct slurm_select_ops { } slurm_select_ops_t; -typedef struct slurm_select_context { - char *select_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int select_errno; - slurm_select_ops_t ops; -} slurm_select_context_t; +/* + * Defined in node_select.c Must be synchronized with slurm_select_ops_t above. + * Also must be synchronized with the other_plugin.c in + * the select/cray plugin. + */ +extern const char *node_select_syms[]; /* Convert a node coordinate character into its equivalent number: * '0' = 0; '9' = 9; 'A' = 10; etc. */ @@ -336,9 +338,8 @@ extern int select_g_select_nodeinfo_free(dynamic_plugin_data_t *nodeinfo); extern int select_g_select_nodeinfo_set(struct job_record *job_ptr); /* Update slect plugin information about every node as needed (if changed since - * previous query) - * IN query_time - Time of previous update */ -extern int select_g_select_nodeinfo_set_all(time_t last_query_time); + * previous query) */ +extern int select_g_select_nodeinfo_set_all(void); /* * Get information from a slect plugin node record @@ -401,6 +402,13 @@ extern int select_g_update_sub_node (update_block_msg_t *block_desc_ptr); */ extern int select_g_update_block (update_block_msg_t *block_desc_ptr); +/* + * Fail certain cnodes in a blocks midplane (usually comes from the + * IBM runjob mux) + * IN step_ptr - step with failed cnodes + */ +extern int select_g_fail_cnode (struct step_record *step_ptr); + /******************************************************\ * JOB SPECIFIC SELECT CREDENTIAL MANAGEMENT FUNCIONS * \******************************************************/ @@ -544,7 +552,8 @@ extern int select_g_job_test(struct job_record *job_ptr, bitstr_t *bitmap, uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, uint16_t mode, List preemptee_candidates, - List *preemptee_job_list, bitstr_t *exc_core_bitmap); + List *preemptee_job_list, + bitstr_t *exc_core_bitmap); /* * Note initiation of job is about to begin. Called immediately @@ -657,7 +666,9 @@ extern int select_g_step_finish(struct step_record *step_ptr); * IN core_bitmap - cores to exclude for this reservation * RET - nodes selected for use by the reservation */ -extern bitstr_t * select_g_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, uint32_t core_cnt, bitstr_t **core_bitmap); +extern bitstr_t * select_g_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, + uint32_t core_cnt, + bitstr_t **core_bitmap); /*****************************\ * GET INFORMATION FUNCTIONS * diff --git a/src/common/plugin.c b/src/common/plugin.c index bb88fa6dc08dba7aefdf3a0ff2d1754715199e6c..6bb5faf0d050e98cebc6fef490140395d430b499 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -6,6 +6,8 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jay Windley . * CODE-OCEC-09-009. All rights reserved. + * Portions Copyright (C) 2012 SchedMD LLC. + * Written by Danny Auble * * This file is part of SLURM, a resource management program. * For details, see . @@ -49,7 +51,7 @@ #include "src/common/xmalloc.h" #include "src/common/log.h" -#include "src/common/plugin.h" +#include "src/common/plugrack.h" #include "src/common/xstring.h" #include "src/common/slurm_protocol_api.h" #include "slurm/slurm_errno.h" @@ -98,8 +100,11 @@ const char * plugin_strerror(plugin_err_t e) return ("Dlopen of plugin file failed"); case EPLUGIN_INIT_FAILED: return ("Plugin init() callback failed"); - case EPLUGIN_MISSING_SYMBOL: + case EPLUGIN_MISSING_NAME: return ("Plugin name/type/version symbol missing"); + case EPLUGIN_MISSING_SYMBOL: + return ("Plugin missing a required symbol use " + "debug3 to see"); } return ("Unknown error"); } @@ -186,7 +191,7 @@ plugin_load_from_file(plugin_handle_t *p, const char *fq_path) (dlsym(plug, PLUGIN_TYPE) == NULL) || (dlsym(plug, PLUGIN_VERSION) == NULL)) { dlclose (plug); - return EPLUGIN_MISSING_SYMBOL; + return EPLUGIN_MISSING_NAME; } /* @@ -356,3 +361,105 @@ plugin_get_syms( plugin_handle_t plug, return count; } +/* + * Create a priority context + */ +extern plugin_context_t *plugin_context_create( + const char *plugin_type, const char *uler_type, + void *ptrs[], const char *names[], size_t names_size) +{ + plugin_context_t *c; + int n_names; + + if (!uler_type) { + debug3("plugin_context_create: no uler type"); + return NULL; + } else if (!plugin_type) { + debug3("plugin_context_create: no plugin type"); + return NULL; + } else if (!names) { + error("plugin_context_create: no symbols given for plugin %s", + plugin_type); + return NULL; + } else if (!ptrs) { + error("plugin_context_create: no ptrs given for plugin %s", + plugin_type); + return NULL; + } + + c = xmalloc(sizeof(plugin_context_t)); + c->type = xstrdup(uler_type); + c->cur_plugin = PLUGIN_INVALID_HANDLE; + + n_names = names_size / sizeof(char *); + + /* Find the correct plugin. */ + c->cur_plugin = plugin_load_and_link(c->type, n_names, names, ptrs); + if (c->cur_plugin != PLUGIN_INVALID_HANDLE) + return c; + + if (errno != EPLUGIN_NOTFOUND) { + error("Couldn't load specified plugin name for %s: %s", + c->type, plugin_strerror(errno)); + goto fail; + } + + error("Couldn't find the specified plugin name for %s " + "looking at all files", + c->type); + + /* Get plugin list. */ + if (!c->plugin_list) { + char *plugin_dir; + c->plugin_list = plugrack_create(); + if (!c->plugin_list) { + error("cannot create plugin manager"); + goto fail; + } + plugrack_set_major_type(c->plugin_list, plugin_type); + plugrack_set_paranoia( + c->plugin_list, PLUGRACK_PARANOIA_NONE, 0); + plugin_dir = slurm_get_plugin_dir(); + plugrack_read_dir(c->plugin_list, plugin_dir); + xfree(plugin_dir); + } + + c->cur_plugin = plugrack_use_by_type(c->plugin_list, c->type); + if (c->cur_plugin == PLUGIN_INVALID_HANDLE) { + error("cannot find %s plugin for %s", plugin_type, c->type); + goto fail; + } + + /* Dereference the API. */ + if (plugin_get_syms(c->cur_plugin, n_names, names, ptrs) < n_names) { + error("incomplete %s plugin detected", plugin_type); + goto fail; + } + + return c; +fail: + plugin_context_destroy(c); + return NULL; +} + +/* + * Destroy a context + */ +extern int plugin_context_destroy(plugin_context_t *c) +{ + int rc = SLURM_SUCCESS; + /* + * Must check return code here because plugins might still + * be loaded and active. + */ + if (c->plugin_list) { + if (plugrack_destroy(c->plugin_list) != SLURM_SUCCESS) + rc = SLURM_ERROR; + } else + plugin_unload(c->cur_plugin); + + xfree(c->type); + xfree(c); + + return rc; +} diff --git a/src/common/plugin.h b/src/common/plugin.h index 85c1615487ef5ff4608e0feaf6d9e5a19c0b92be..2773863310381894f18f5e0e67e42d74417d4297 100644 --- a/src/common/plugin.h +++ b/src/common/plugin.h @@ -79,6 +79,13 @@ */ typedef void *plugin_handle_t; +typedef struct { + plugin_handle_t cur_plugin; + void *plugin_list; + char *type; +} plugin_context_t; + + #define PLUGIN_INVALID_HANDLE ((void*)0) typedef enum { @@ -87,7 +94,8 @@ typedef enum { EPLUGIN_ACCESS_ERROR, /* Access denied */ EPLUGIN_DLOPEN_FAILED, /* Dlopen not successful */ EPLUGIN_INIT_FAILED, /* Plugin's init() callback failed */ - EPLUGIN_MISSING_SYMBOL /* plugin_name/type/version missing */ + EPLUGIN_MISSING_NAME, /* plugin_name/type/version missing */ + EPLUGIN_MISSING_SYMBOL, /* some symbol needed isn't found */ } plugin_err_t; const char *plugin_strerror(plugin_err_t err); @@ -187,4 +195,29 @@ int plugin_get_syms( plugin_handle_t plug, const char *names[], void *ptrs[] ); + +/* + * Create a priority context + * plugin_type - IN - name of plugin major type (select) + * uler_type - IN - name of plugin minor type (linear) + * ptrs[] - IN/OUT - an array of pointers into which the addresses of the + * respective symbols should be placed. ptrs[i] will receive + * the address of names[i]. + * names[] - IN - an argv-like array of symbol names to resolve. + * names_size - IN - size of names[] (sizeof(names)) + * + * Returns plugin_context_t on success of NULL if failed. On success + * ptrs[] is filled in with the symbols from names[]. + * + * Free memory with plugin_context_destroy + */ +extern plugin_context_t *plugin_context_create( + const char *plugin_type, const char *uler_type, + void *ptrs[], const char *names[], size_t names_size); + +/* + * Destroy a context created from plugin_context_create. + */ +extern int plugin_context_destroy(plugin_context_t *c); + #endif /*__GENERIC_PLUGIN_H__*/ diff --git a/src/common/proc_args.c b/src/common/proc_args.c index ff4b1b6b5842a0b9e7d61af4d9928c4158275e8c..9213fffd362afd669a3d3c18e70c10b0e3575431 100644 --- a/src/common/proc_args.c +++ b/src/common/proc_args.c @@ -903,12 +903,13 @@ extern int parse_uint32(char *aval, uint32_t *ival) */ uint32_t max32uint = (uint32_t) NO_VAL; long long tval; + char *p; /* * Return error for invalid value. */ - tval = strtoll(aval, (char **) NULL, 10); - if ((tval == LLONG_MIN) || (tval == LLONG_MAX) || + tval = strtoll(aval, &p, 10); + if (p[0] || (tval == LLONG_MIN) || (tval == LLONG_MAX) || (tval < 0) || (tval >= max32uint)) return 1; @@ -934,12 +935,13 @@ extern int parse_uint16(char *aval, uint16_t *ival) */ uint16_t max16uint = (uint16_t) NO_VAL; long long tval; + char *p; /* * Return error for invalid value. */ - tval = strtoll(aval, (char **) NULL, 10); - if ((tval == LLONG_MIN) || (tval == LLONG_MAX) || + tval = strtoll(aval, &p, 10); + if (p[0] || (tval == LLONG_MIN) || (tval == LLONG_MAX) || (tval < 0) || (tval >= max16uint)) return 1; diff --git a/src/common/read_config.c b/src/common/read_config.c index cf2618aa7c33d222de17202eae55e993070acfc3..5dfe5202d057f694553a5638d7e068283b78213d 100644 --- a/src/common/read_config.c +++ b/src/common/read_config.c @@ -5,6 +5,7 @@ * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Portions Copyright (C) 2008 Vijay Ramasubramanian. * Portions Copyright (C) 2010 SchedMD . + * Portions (boards) copyright (C) 2012 Bull, * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. @@ -43,16 +44,19 @@ # include "config.h" #endif +#include #include #include #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -110,6 +114,7 @@ typedef struct names_ll_s { char *address; /* NodeAddr */ uint16_t port; uint16_t cpus; + uint16_t boards; uint16_t sockets; uint16_t cores; uint16_t threads; @@ -204,6 +209,7 @@ s_p_options_t slurm_conf_options[] = { {"JobSubmitPlugins", S_P_STRING}, {"KillOnBadExit", S_P_UINT16}, {"KillWait", S_P_UINT16}, + {"LaunchType", S_P_STRING}, {"Licenses", S_P_STRING}, {"MailProg", S_P_STRING}, {"MaxJobCount", S_P_UINT32}, @@ -496,17 +502,19 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, slurm_conf_node_t *n; int computed_procs; static s_p_options_t _nodename_options[] = { + {"Boards", S_P_UINT16}, {"CoresPerSocket", S_P_UINT16}, {"CPUs", S_P_UINT16}, {"Feature", S_P_STRING}, {"Gres", S_P_STRING}, {"NodeAddr", S_P_STRING}, {"NodeHostname", S_P_STRING}, - {"Port", S_P_UINT16}, + {"Port", S_P_STRING}, {"Procs", S_P_UINT16}, {"RealMemory", S_P_UINT32}, {"Reason", S_P_STRING}, {"Sockets", S_P_UINT16}, + {"SocketsPerBoard", S_P_UINT16}, {"State", S_P_STRING}, {"ThreadsPerCore", S_P_UINT16}, {"TmpDisk", S_P_UINT32}, @@ -543,9 +551,12 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, return 0; } else { bool no_cpus = false; + bool no_boards = false; bool no_sockets = false; bool no_cores = false; bool no_threads = false; + bool no_sockets_per_board = false; + uint16_t sockets_per_board = 0; n = xmalloc(sizeof(slurm_conf_node_t)); dflt = default_nodename_tbl; @@ -561,6 +572,12 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, if (!s_p_get_string(&n->addresses, "NodeAddr", tbl)) n->addresses = xstrdup(n->hostnames); + if (!s_p_get_uint16(&n->boards, "Boards", tbl) + && !s_p_get_uint16(&n->boards, "Boards", dflt)) { + n->boards = 1; + no_boards = true; + } + if (!s_p_get_uint16(&n->cores, "CoresPerSocket", tbl) && !s_p_get_uint16(&n->cores, "CoresPerSocket", dflt)) { n->cores = 1; @@ -573,12 +590,11 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, if (!s_p_get_string(&n->gres, "Gres", tbl)) s_p_get_string(&n->gres, "Gres", dflt); - if (!s_p_get_uint16(&n->port, "Port", tbl) - && !s_p_get_uint16(&n->port, "Port", dflt)) { + if (!s_p_get_string(&n->port_str, "Port", tbl) && + !s_p_get_string(&n->port_str, "Port", dflt)) { /* This gets resolved in slurm_conf_get_port() * and slurm_conf_get_addr(). For now just - * leave with a value of zero */ - n->port = 0; + * leave with a value of NULL */ } if (!s_p_get_uint16(&n->cpus, "CPUs", tbl) && @@ -602,6 +618,13 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, no_sockets = true; } + if (!s_p_get_uint16(&sockets_per_board, "SocketsPerBoard", tbl) + && !s_p_get_uint16(&sockets_per_board, "SocketsPerBoard", + dflt)) { + sockets_per_board = 1; + no_sockets_per_board = true; + } + if (!s_p_get_string(&n->state, "State", tbl) && !s_p_get_string(&n->state, "State", dflt)) n->state = NULL; @@ -633,43 +656,101 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, n->threads = 1; } - if (!no_cpus && /* infer missing Sockets= */ - no_sockets) { - n->sockets = n->cpus / (n->cores * n->threads); - } - - if (n->sockets == 0) { /* make sure sockets is non-zero */ - error("NodeNames=%s Sockets=0 is invalid, " + if (!no_sockets_per_board && sockets_per_board==0) { + /* make sure sockets_per_boards is non-zero */ + error("NodeNames=%s SocketsPerBoards=0 is invalid, " "reset to 1", n->nodenames); - n->sockets = 1; - } - - if (no_cpus) { /* infer missing CPUs= */ - n->cpus = n->sockets * n->cores * n->threads; - } - - /* if only CPUs= and Sockets= specified check for match */ - if (!no_cpus && - !no_sockets && - no_cores && - no_threads) { - if (n->cpus != n->sockets) { + sockets_per_board = 1; + } + + if (no_boards) { + /* This case is exactly like if was without boards, + * Except SocketsPerBoard=# can be used, + * But it can't be used with Sockets=# */ + n->boards = 1; + if (!no_sockets && !no_sockets_per_board) { + error("NodeNames=%s Sockets=# and " + "SocketsPerBoard=# is invalid" + ", using SocketsPerBoard", + n->nodenames); + n->sockets = sockets_per_board; + } + if (!no_sockets_per_board) { + n->sockets = sockets_per_board; + } + if (!no_cpus && /* infer missing Sockets= */ + no_sockets) { + n->sockets = n->cpus / (n->cores * n->threads); + } + if (n->sockets == 0) { /* make sure sockets != 0 */ + error("NodeNames=%s Sockets=0 is invalid, " + "reset to 1", n->nodenames); + n->sockets = 1; + } + if (no_cpus) { /* infer missing CPUs= */ + n->cpus = n->sockets * n->cores * n->threads; + } + /* if only CPUs= and Sockets= + * specified check for match */ + if (!no_cpus && !no_sockets && + no_cores && no_threads && + (n->cpus != n->sockets)) { n->sockets = n->cpus; error("NodeNames=%s CPUs doesn't match " "Sockets, setting Sockets to %d", n->nodenames, n->sockets); } - } - - computed_procs = n->sockets * n->cores * n->threads; - if ((n->cpus != n->sockets) && - (n->cpus != n->sockets * n->cores) && - (n->cpus != computed_procs)) { - error("NodeNames=%s CPUs=%d doesn't match " - "Sockets*CoresPerSocket*ThreadsPerCore (%d), " - "resetting CPUs", - n->nodenames, n->cpus, computed_procs); - n->cpus = computed_procs; + computed_procs = n->sockets * n->cores * n->threads; + if ((n->cpus != n->sockets) && + (n->cpus != n->sockets * n->cores) && + (n->cpus != computed_procs)) { + error("NodeNames=%s CPUs=%d doesn't match " + "Sockets*CoresPerSocket*ThreadsPerCore " + "(%d), resetting CPUs", + n->nodenames, n->cpus, computed_procs); + n->cpus = computed_procs; + } + } else { + /* In this case Boards=# is used. + * CPUs=# or Procs=# are ignored. + */ + if (!no_cpus) { + error("NodeNames=%s CPUs=# or Procs=# " + "with Boards=# is invalid and " + "is ignored.", n->nodenames); + } + if (n->boards == 0) { + /* make sure boards is non-zero */ + error("NodeNames=%s Boards=0 is " + "invalid, reset to 1", + n->nodenames); + n->boards = 1; + } + if (!no_sockets && !no_sockets_per_board) { + error("NodeNames=%s Sockets=# and " + "SocketsPerBoard=# is invalid, " + "using SocketsPerBoard", n->nodenames); + n->sockets = n->boards * sockets_per_board; + } else if (!no_sockets_per_board) { + n->sockets = n->boards * sockets_per_board; + } else if (!no_sockets) { + error("NodeNames=%s Sockets=# with Boards=# is" + " not recommended, assume " + "SocketsPerBoard was meant", + n->nodenames); + if (n->sockets == 0) { + /* make sure sockets is non-zero */ + error("NodeNames=%s Sockets=0 is " + "invalid, reset to 1", + n->nodenames); + n->sockets = 1; + } + n->sockets = n->boards * n->sockets; + } else { + n->sockets = n->boards; + } + /* Node boards factored into sockets */ + n->cpus = n->sockets * n->cores * n->threads; } *dest = (void *)n; @@ -712,11 +793,13 @@ extern int list_find_frontend (void *front_end_entry, void *key) static void _destroy_nodename(void *ptr) { slurm_conf_node_t *n = (slurm_conf_node_t *)ptr; - xfree(n->nodenames); - xfree(n->hostnames); + xfree(n->addresses); xfree(n->feature); + xfree(n->hostnames); xfree(n->gres); + xfree(n->nodenames); + xfree(n->port_str); xfree(n->reason); xfree(n->state); xfree(ptr); @@ -756,7 +839,10 @@ int slurm_conf_frontend_array(slurm_conf_frontend_t **ptr_array[]) sizeof(hostnames)); local_front_end.addresses = addresses; local_front_end.frontends = hostnames; - local_front_end.port = node_ptr[0]->port; + if (node_ptr[0]->port_str) { + local_front_end.port = atoi(node_ptr[0]-> + port_str); + } local_front_end.reason = NULL; local_front_end.node_state = NODE_STATE_UNKNOWN; local_front_end_array[0] = &local_front_end; @@ -870,7 +956,7 @@ static int _parse_partitionname(void **dest, slurm_parser_enum_t type, s_p_get_uint32(&p->def_mem_per_cpu, "DefMemPerCPU", dflt)) { p->def_mem_per_cpu |= MEM_PER_CPU; - } { + } else { p->def_mem_per_cpu = 0; } } @@ -1178,8 +1264,9 @@ static int _get_hash_idx(const char *name) static void _push_to_hashtbls(char *alias, char *hostname, char *address, uint16_t port, - uint16_t cpus, uint16_t sockets, - uint16_t cores, uint16_t threads) + uint16_t cpus, uint16_t boards, + uint16_t sockets, uint16_t cores, + uint16_t threads) { int hostname_idx, alias_idx; names_ll_t *p, *new; @@ -1217,6 +1304,7 @@ static void _push_to_hashtbls(char *alias, char *hostname, new->address = xstrdup(address); new->port = port; new->cpus = cpus; + new->boards = boards; new->sockets = sockets; new->cores = cores; new->threads = threads; @@ -1251,18 +1339,27 @@ static void _push_to_hashtbls(char *alias, char *hostname, */ static int _register_conf_node_aliases(slurm_conf_node_t *node_ptr) { + hostlist_t address_list = NULL; hostlist_t alias_list = NULL; hostlist_t hostname_list = NULL; - hostlist_t address_list = NULL; + hostlist_t port_list = NULL; + char *address = NULL; char *alias = NULL; char *hostname = NULL; - char *address = NULL; + char *port_str = NULL; int error_code = SLURM_SUCCESS; - int address_count, alias_count, hostname_count; + int address_count, alias_count, hostname_count, port_count; + uint16_t port = 0; if ((node_ptr->nodenames == NULL) || (node_ptr->nodenames[0] == '\0')) return -1; + if ((address_list = hostlist_create(node_ptr->addresses)) == NULL) { + error("Unable to create NodeAddr list from %s", + node_ptr->addresses); + error_code = errno; + goto cleanup; + } if ((alias_list = hostlist_create(node_ptr->nodenames)) == NULL) { error("Unable to create NodeName list from %s", node_ptr->nodenames); @@ -1275,9 +1372,20 @@ static int _register_conf_node_aliases(slurm_conf_node_t *node_ptr) error_code = errno; goto cleanup; } - if ((address_list = hostlist_create(node_ptr->addresses)) == NULL) { - error("Unable to create NodeAddr list from %s", - node_ptr->addresses); + + if (node_ptr->port_str && node_ptr->port_str[0] && + (node_ptr->port_str[0] != '[') && + (strchr(node_ptr->port_str, '-') || + strchr(node_ptr->port_str, ','))) { + xstrfmtcat(port_str, "[%s]", node_ptr->port_str); + port_list = hostlist_create(port_str); + xfree(port_str); + } else { + port_list = hostlist_create(node_ptr->port_str); + } + if (port_list == NULL) { + error("Unable to create Port list from %s", + node_ptr->port_str); error_code = errno; goto cleanup; } @@ -1291,28 +1399,42 @@ static int _register_conf_node_aliases(slurm_conf_node_t *node_ptr) address_count = hostlist_count(address_list); alias_count = hostlist_count(alias_list); hostname_count = hostlist_count(hostname_list); + port_count = hostlist_count(port_list); #ifdef HAVE_FRONT_END + if ((address_count != alias_count) && (address_count != 1)) { + error("NodeAddr count must equal that of NodeName " + "records of there must be no more than one"); + goto cleanup; + } if ((hostname_count != alias_count) && (hostname_count != 1)) { error("NodeHostname count must equal that of NodeName " "records of there must be no more than one"); goto cleanup; } +#else +#ifdef MULTIPLE_SLURMD if ((address_count != alias_count) && (address_count != 1)) { error("NodeAddr count must equal that of NodeName " "records of there must be no more than one"); goto cleanup; } #else + if (address_count < alias_count) { + error("At least as many NodeAddr are required as NodeName"); + goto cleanup; + } +#endif /* MULTIPLE_SLURMD */ if (hostname_count < alias_count) { error("At least as many NodeHostname are required " "as NodeName"); goto cleanup; } - if (address_count < alias_count) { - error("At least as many NodeAddr are required as NodeName"); +#endif /* HAVE_FRONT_END */ + if ((port_count != alias_count) && (port_count > 1)) { + error("Port count must equal that of NodeName " + "records or there must be no more than one"); goto cleanup; } -#endif /* now build the individual node structures */ while ((alias = hostlist_shift(alias_list))) { @@ -1320,9 +1442,18 @@ static int _register_conf_node_aliases(slurm_conf_node_t *node_ptr) address = hostlist_shift(address_list); if ((hostname_count > 1) || (hostname == NULL)) hostname = hostlist_shift(hostname_list); - _push_to_hashtbls(alias, hostname, address, node_ptr->port, - node_ptr->cpus, node_ptr->sockets, - node_ptr->cores, node_ptr->threads); + if ((port_count > 1) && (port_str == NULL)) { + int port_int; + port_str = hostlist_shift(port_list); + port_int = atoi(port_str); + if ((port_int <= 0) || (port_int > 0xffff)) + fatal("Invalid Port %s", node_ptr->port_str); + port = port_int; + } + _push_to_hashtbls(alias, hostname, address, port, + node_ptr->cpus, node_ptr->boards, + node_ptr->sockets, node_ptr->cores, + node_ptr->threads); free(alias); if (address_count > 1) { address_count--; @@ -1334,20 +1465,29 @@ static int _register_conf_node_aliases(slurm_conf_node_t *node_ptr) free(hostname); hostname = NULL; } + if (port_count > 1) { + port_count--; + free(port_str); + port_str = NULL; + } } if (address) free(address); if (hostname) free(hostname); + if (port_str) + free(port_str); /* free allocated storage */ cleanup: + if (address_list) + hostlist_destroy(address_list); if (alias_list) hostlist_destroy(alias_list); if (hostname_list) hostlist_destroy(hostname_list); - if (address_list) - hostlist_destroy(address_list); + if (port_list) + hostlist_destroy(port_list); return error_code; } @@ -1387,7 +1527,7 @@ static int _register_front_ends(slurm_conf_frontend_t *front_end_ptr) address = hostlist_shift(address_list); _push_to_hashtbls(hostname, hostname, address, - front_end_ptr->port, 1, 1, 1, 1); + front_end_ptr->port, 1, 1, 1, 1, 1); free(hostname); free(address); } @@ -1495,7 +1635,6 @@ extern char *slurm_conf_get_nodename(const char *node_hostname) _init_slurmd_nodehash(); idx = _get_hash_idx(node_hostname); - p = host_to_node_hashtbl[idx]; while (p) { if (strcmp(p->hostname, node_hostname) == 0) { @@ -1579,6 +1718,42 @@ extern char *slurm_conf_get_nodeaddr(const char *node_hostname) return NULL; } +/* + * slurm_conf_get_nodename_from_addr - Return the NodeName for given NodeAddr + * + * NOTE: Call xfree() to release returned value's memory. + * NOTE: Caller must NOT be holding slurm_conf_lock(). + */ +extern char *slurm_conf_get_nodename_from_addr(const char *node_addr) +{ + unsigned char buf[HOSTENT_SIZE]; + struct hostent *hptr; + 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); + return NULL; + } + + if (!strcmp(hptr->h_name, "localhost")) { + start_name = xshort_hostname(); + } else { + start_name = xstrdup(hptr->h_name); + dot_ptr = strchr(start_name, '.'); + if (dot_ptr == NULL) + dot_ptr = start_name + strlen(start_name); + else + dot_ptr[0] = '\0'; + } + + ret_name = slurm_conf_get_aliases(start_name); + xfree(start_name); + + return ret_name; +} + /* * slurm_conf_get_aliased_nodename - Return the NodeName for the * complete hostname string returned by gethostname if there is @@ -1733,13 +1908,15 @@ extern int slurm_conf_get_addr(const char *node_name, slurm_addr_t *address) } /* - * slurm_conf_get_cpus_sct - - * Return the cpus, sockets, cores, and threads for a given NodeName + * slurm_conf_get_cpus_bsct - + * Return the cpus, boards, sockets, cores, and threads configured for a + * given NodeName * Returns SLURM_SUCCESS on success, SLURM_FAILURE on failure. */ -extern int slurm_conf_get_cpus_sct(const char *node_name, - uint16_t *cpus, uint16_t *sockets, - uint16_t *cores, uint16_t *threads) +extern int slurm_conf_get_cpus_bsct(const char *node_name, + uint16_t *cpus, uint16_t *boards, + uint16_t *sockets, uint16_t *cores, + uint16_t *threads) { int idx; names_ll_t *p; @@ -1753,6 +1930,8 @@ extern int slurm_conf_get_cpus_sct(const char *node_name, if (strcmp(p->alias, node_name) == 0) { if (cpus) *cpus = p->cpus; + if (boards) + *boards = p->boards; if (sockets) *sockets = p->sockets; if (cores) @@ -1836,7 +2015,9 @@ free_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr, bool purge_node_hash) xfree (ctl_conf_ptr->job_credential_private_key); xfree (ctl_conf_ptr->job_credential_public_certificate); xfree (ctl_conf_ptr->job_submit_plugins); + xfree (ctl_conf_ptr->launch_type); xfree (ctl_conf_ptr->licenses); + xfree (ctl_conf_ptr->licenses_used); xfree (ctl_conf_ptr->mail_prog); xfree (ctl_conf_ptr->mpi_default); xfree (ctl_conf_ptr->mpi_params); @@ -1857,7 +2038,7 @@ free_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr, bool purge_node_hash) xfree (ctl_conf_ptr->sched_params); xfree (ctl_conf_ptr->schedtype); xfree (ctl_conf_ptr->select_type); - if(ctl_conf_ptr->select_conf_key_pairs) + if (ctl_conf_ptr->select_conf_key_pairs) list_destroy((List)ctl_conf_ptr->select_conf_key_pairs); xfree (ctl_conf_ptr->slurm_conf); xfree (ctl_conf_ptr->slurm_user_name); @@ -1944,6 +2125,7 @@ init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr) ctl_conf_ptr->job_requeue = (uint16_t) NO_VAL; xfree(ctl_conf_ptr->job_submit_plugins); ctl_conf_ptr->kill_wait = (uint16_t) NO_VAL; + xfree (ctl_conf_ptr->launch_type); xfree (ctl_conf_ptr->licenses); xfree (ctl_conf_ptr->mail_prog); ctl_conf_ptr->max_job_cnt = (uint32_t) NO_VAL; @@ -2570,6 +2752,9 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl) if (!s_p_get_uint16(&conf->kill_wait, "KillWait", hashtbl)) conf->kill_wait = DEFAULT_KILL_WAIT; + if (!s_p_get_string(&conf->launch_type, "LaunchType", hashtbl)) + conf->launch_type = xstrdup(DEFAULT_LAUNCH_TYPE); + s_p_get_string(&conf->licenses, "Licenses", hashtbl); if (!s_p_get_string(&conf->mail_prog, "MailProg", hashtbl)) @@ -2606,6 +2791,10 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl) if (!s_p_get_uint16(&conf->min_job_age, "MinJobAge", hashtbl)) conf->min_job_age = DEFAULT_MIN_JOB_AGE; + else if (conf->min_job_age < 2) { + info("WARNING: MinJobAge must be at least 2"); + conf->min_job_age = 2; + } if (!s_p_get_string(&conf->mpi_default, "MpiDefault", hashtbl)) conf->mpi_default = xstrdup(DEFAULT_MPI_DEFAULT); @@ -3197,6 +3386,11 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl) fatal("Bad TaskPluginParam: %s", tok); set_unit = true; conf->task_plugin_param |= CPU_BIND_NONE; + } else if (strcasecmp(tok, "boards") == 0) { + if (set_unit) + fatal("Bad TaskPluginParam: %s", tok); + set_unit = true; + conf->task_plugin_param |= CPU_BIND_TO_BOARDS; } else if (strcasecmp(tok, "sockets") == 0) { if (set_unit) fatal("Bad TaskPluginParam: %s", tok); @@ -3385,6 +3579,11 @@ extern char * debug_flags2str(uint32_t debug_flags) xstrcat(rc, ","); xstrcat(rc, "Steps"); } + if (debug_flags & DEBUG_FLAG_SWITCH) { + if (rc) + xstrcat(rc, ","); + xstrcat(rc, "Switch"); + } if (debug_flags & DEBUG_FLAG_TRIGGERS) { if (rc) xstrcat(rc, ","); @@ -3441,12 +3640,12 @@ extern uint32_t debug_str2flags(char *debug_flags) rc |= DEBUG_FLAG_PRIO; else if (strcasecmp(tok, "Reservation") == 0) rc |= DEBUG_FLAG_RESERVATION; - else if (strcasecmp(tok, "Reservations") == 0) - rc |= DEBUG_FLAG_RESERVATION; else if (strcasecmp(tok, "SelectType") == 0) rc |= DEBUG_FLAG_SELECT_TYPE; else if (strcasecmp(tok, "Steps") == 0) rc |= DEBUG_FLAG_STEPS; + else if (strcasecmp(tok, "Switch") == 0) + rc |= DEBUG_FLAG_SWITCH; else if (strcasecmp(tok, "Trigger") == 0) rc |= DEBUG_FLAG_TRIGGERS; else if (strcasecmp(tok, "Triggers") == 0) diff --git a/src/common/read_config.h b/src/common/read_config.h index ad404bbd75a05c46bce447a89526e19bc2c702cd..38367ffb901869bce94f774f9a72e03915c4d149 100644 --- a/src/common/read_config.h +++ b/src/common/read_config.h @@ -85,6 +85,13 @@ extern char *default_plugstack; #define DEFAULT_KILL_ON_BAD_EXIT 0 #define DEFAULT_KILL_TREE 0 #define DEFAULT_KILL_WAIT 30 + +#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P +# define DEFAULT_LAUNCH_TYPE "launch/runjob" +#else +# define DEFAULT_LAUNCH_TYPE "launch/slurm" +#endif + #define DEFAULT_MAIL_PROG "/bin/mail" #define DEFAULT_MAX_JOB_COUNT 10000 #define DEFAULT_MAX_JOB_ID 0xffff0000 @@ -169,8 +176,9 @@ typedef struct slurm_conf_node { char *addresses; char *gres; /* arbitrary list of node's generic resources */ char *feature; /* arbitrary list of node's features */ - uint16_t port; + char *port_str; uint16_t cpus; /* count of cpus running on the node */ + uint16_t boards; /* number of boards per node */ uint16_t sockets; /* number of sockets per node */ uint16_t cores; /* number of cores per CPU */ uint16_t threads; /* number of threads per core */ @@ -359,6 +367,14 @@ extern char *slurm_conf_get_aliases(const char *node_hostname); */ extern char *slurm_conf_get_nodeaddr(const char *node_hostname); +/* + * slurm_conf_get_nodename_from_addr - Return the NodeName for given NodeAddr + * + * NOTE: Call xfree() to release returned value's memory. + * NOTE: Caller must NOT be holding slurm_conf_lock(). + */ +extern char *slurm_conf_get_nodename_from_addr(const char *node_addr); + /* * slurm_conf_get_aliased_nodename - Return the NodeName matching an alias * of the local hostname @@ -387,15 +403,17 @@ extern uint16_t slurm_conf_get_port(const char *node_name); extern int slurm_conf_get_addr(const char *node_name, slurm_addr_t *address); /* - * slurm_conf_get_cpus_sct - - * Return the cpus, sockets, cores, and threads configured for a given NodeName + * slurm_conf_get_cpus_bsct - + * Return the cpus, boards, sockets, cores, and threads configured for a + * given NodeName * Returns SLURM_SUCCESS on success, SLURM_FAILURE on failure. * * NOTE: Caller must NOT be holding slurm_conf_lock(). */ -extern int slurm_conf_get_cpus_sct(const char *node_name, - uint16_t *procs, uint16_t *sockets, - uint16_t *cores, uint16_t *threads); +extern int slurm_conf_get_cpus_bsct(const char *node_name, + uint16_t *cpus, uint16_t *boards, + uint16_t *sockets, uint16_t *cores, + uint16_t *threads); /* * init_slurm_conf - initialize or re-initialize the slurm configuration diff --git a/src/common/slurm_accounting_storage.c b/src/common/slurm_accounting_storage.c index eff7577f784621feb06206077bfa4d55d40fe95f..be905428e8300c2f5564727e3362fd84c2ae3be7 100644 --- a/src/common/slurm_accounting_storage.c +++ b/src/common/slurm_accounting_storage.c @@ -1,3 +1,4 @@ + /*****************************************************************************\ * slurm_accounting_storage.c - account storage plugin wrapper. * @@ -53,6 +54,7 @@ #include "src/common/list.h" #include "src/common/plugin.h" #include "src/common/plugrack.h" +#include "src/common/node_select.h" #include "src/common/slurm_accounting_storage.h" #include "src/common/slurm_protocol_api.h" #include "src/common/slurm_protocol_defs.h" @@ -189,196 +191,72 @@ typedef struct slurm_acct_storage_ops { int (*flush_jobs) (void *db_conn, time_t event_time); } slurm_acct_storage_ops_t; - -typedef struct slurm_acct_storage_context { - char *acct_storage_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int acct_storage_errno; - slurm_acct_storage_ops_t ops; -} slurm_acct_storage_context_t; - -static slurm_acct_storage_context_t * g_acct_storage_context = NULL; -static pthread_mutex_t g_acct_storage_context_lock = - PTHREAD_MUTEX_INITIALIZER; - -/* - * Local functions - */ -static slurm_acct_storage_ops_t *_acct_storage_get_ops( - slurm_acct_storage_context_t *c); -static slurm_acct_storage_context_t *_acct_storage_context_create( - const char *acct_storage_type); -static int _acct_storage_context_destroy( - slurm_acct_storage_context_t *c); - -/* - * Locate and load the appropriate plugin - */ -static slurm_acct_storage_ops_t * _acct_storage_get_ops( - slurm_acct_storage_context_t *c) -{ - /* - * Must be synchronized with slurm_acct_storage_ops_t above. - */ - static const char *syms[] = { - "acct_storage_p_get_connection", - "acct_storage_p_close_connection", - "acct_storage_p_commit", - "acct_storage_p_add_users", - "acct_storage_p_add_coord", - "acct_storage_p_add_accts", - "acct_storage_p_add_clusters", - "acct_storage_p_add_associations", - "acct_storage_p_add_qos", - "acct_storage_p_add_wckeys", - "acct_storage_p_add_reservation", - "acct_storage_p_modify_users", - "acct_storage_p_modify_accts", - "acct_storage_p_modify_clusters", - "acct_storage_p_modify_associations", - "acct_storage_p_modify_job", - "acct_storage_p_modify_qos", - "acct_storage_p_modify_wckeys", - "acct_storage_p_modify_reservation", - "acct_storage_p_remove_users", - "acct_storage_p_remove_coord", - "acct_storage_p_remove_accts", - "acct_storage_p_remove_clusters", - "acct_storage_p_remove_associations", - "acct_storage_p_remove_qos", - "acct_storage_p_remove_wckeys", - "acct_storage_p_remove_reservation", - "acct_storage_p_get_users", - "acct_storage_p_get_accts", - "acct_storage_p_get_clusters", - "acct_storage_p_get_config", - "acct_storage_p_get_associations", - "acct_storage_p_get_events", - "acct_storage_p_get_problems", - "acct_storage_p_get_qos", - "acct_storage_p_get_wckeys", - "acct_storage_p_get_reservations", - "acct_storage_p_get_txn", - "acct_storage_p_get_usage", - "acct_storage_p_roll_usage", - "clusteracct_storage_p_node_down", - "clusteracct_storage_p_node_up", - "clusteracct_storage_p_cluster_cpus", - "clusteracct_storage_p_register_ctld", - "clusteracct_storage_p_register_disconn_ctld", - "clusteracct_storage_p_fini_ctld", - "jobacct_storage_p_job_start", - "jobacct_storage_p_job_complete", - "jobacct_storage_p_step_start", - "jobacct_storage_p_step_complete", - "jobacct_storage_p_suspend", - "jobacct_storage_p_get_jobs_cond", - "jobacct_storage_p_archive", - "jobacct_storage_p_archive_load", - "acct_storage_p_update_shares_used", - "acct_storage_p_flush_jobs_on_cluster" - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->acct_storage_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->acct_storage_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->acct_storage_type); - - /* Get plugin list. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "cannot create plugin manager" ); - return NULL; - } - plugrack_set_major_type( c->plugin_list, "accounting_storage" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - c->cur_plugin = plugrack_use_by_type( c->plugin_list, - c->acct_storage_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "cannot find accounting_storage plugin for %s", - c->acct_storage_type ); - return NULL; - } - - /* Dereference the API. */ - if ( plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops ) < n_syms ) { - error( "incomplete acct_storage plugin detected" ); - return NULL; - } - - return &c->ops; -} - /* - * Create a acct_storage context + * Must be synchronized with slurm_acct_storage_ops_t above. */ -static slurm_acct_storage_context_t *_acct_storage_context_create( - const char *acct_storage_type) -{ - slurm_acct_storage_context_t *c; - - if ( acct_storage_type == NULL ) { - debug3( "_acct_storage_context_create: no uler type" ); - return NULL; - } - - c = xmalloc( sizeof( slurm_acct_storage_context_t ) ); - c->acct_storage_type = xstrdup( acct_storage_type ); - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - c->acct_storage_errno = SLURM_SUCCESS; - - return c; -} - -/* - * Destroy a acct_storage context - */ -static int _acct_storage_context_destroy(slurm_acct_storage_context_t *c) -{ - int rc = SLURM_SUCCESS; - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree( c->acct_storage_type ); - xfree( c ); - - return rc; -} +static const char *syms[] = { + "acct_storage_p_get_connection", + "acct_storage_p_close_connection", + "acct_storage_p_commit", + "acct_storage_p_add_users", + "acct_storage_p_add_coord", + "acct_storage_p_add_accts", + "acct_storage_p_add_clusters", + "acct_storage_p_add_associations", + "acct_storage_p_add_qos", + "acct_storage_p_add_wckeys", + "acct_storage_p_add_reservation", + "acct_storage_p_modify_users", + "acct_storage_p_modify_accts", + "acct_storage_p_modify_clusters", + "acct_storage_p_modify_associations", + "acct_storage_p_modify_job", + "acct_storage_p_modify_qos", + "acct_storage_p_modify_wckeys", + "acct_storage_p_modify_reservation", + "acct_storage_p_remove_users", + "acct_storage_p_remove_coord", + "acct_storage_p_remove_accts", + "acct_storage_p_remove_clusters", + "acct_storage_p_remove_associations", + "acct_storage_p_remove_qos", + "acct_storage_p_remove_wckeys", + "acct_storage_p_remove_reservation", + "acct_storage_p_get_users", + "acct_storage_p_get_accts", + "acct_storage_p_get_clusters", + "acct_storage_p_get_config", + "acct_storage_p_get_associations", + "acct_storage_p_get_events", + "acct_storage_p_get_problems", + "acct_storage_p_get_qos", + "acct_storage_p_get_wckeys", + "acct_storage_p_get_reservations", + "acct_storage_p_get_txn", + "acct_storage_p_get_usage", + "acct_storage_p_roll_usage", + "clusteracct_storage_p_node_down", + "clusteracct_storage_p_node_up", + "clusteracct_storage_p_cluster_cpus", + "clusteracct_storage_p_register_ctld", + "clusteracct_storage_p_register_disconn_ctld", + "clusteracct_storage_p_fini_ctld", + "jobacct_storage_p_job_start", + "jobacct_storage_p_job_complete", + "jobacct_storage_p_step_start", + "jobacct_storage_p_step_complete", + "jobacct_storage_p_suspend", + "jobacct_storage_p_get_jobs_cond", + "jobacct_storage_p_archive", + "jobacct_storage_p_archive_load", + "acct_storage_p_update_shares_used", + "acct_storage_p_flush_jobs_on_cluster" +}; + +static slurm_acct_storage_ops_t ops; +static plugin_context_t *plugin_context = NULL; +static pthread_mutex_t plugin_context_lock = PTHREAD_MUTEX_INITIALIZER; +static bool init_run = false; /* * Initialize context for acct_storage plugin @@ -386,36 +264,35 @@ static int _acct_storage_context_destroy(slurm_acct_storage_context_t *c) extern int slurm_acct_storage_init(char *loc) { int retval = SLURM_SUCCESS; - char *acct_storage_type = NULL; + char *plugin_type = "accounting_storage"; + char *type = NULL; - slurm_mutex_lock( &g_acct_storage_context_lock ); + if (init_run && plugin_context) + return retval; - if ( g_acct_storage_context ) + slurm_mutex_lock(&plugin_context_lock); + + if (plugin_context) goto done; + if (loc) slurm_set_accounting_storage_loc(loc); - acct_storage_type = slurm_get_accounting_storage_type(); + type = slurm_get_accounting_storage_type(); - g_acct_storage_context = _acct_storage_context_create( - acct_storage_type); - if ( g_acct_storage_context == NULL ) { - error( "cannot create acct_storage context for %s", - acct_storage_type ); - retval = SLURM_ERROR; - goto done; - } + plugin_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); - if ( _acct_storage_get_ops( g_acct_storage_context ) == NULL ) { - error( "cannot resolve acct_storage plugin operations" ); - _acct_storage_context_destroy( g_acct_storage_context ); - g_acct_storage_context = NULL; + if (!plugin_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; + goto done; } + init_run = true; done: - slurm_mutex_unlock( &g_acct_storage_context_lock ); - xfree(acct_storage_type); + slurm_mutex_unlock(&plugin_context_lock); + xfree(type); return retval; } @@ -423,31 +300,30 @@ extern int slurm_acct_storage_fini(void) { int rc; - if (!g_acct_storage_context) + if (!plugin_context) return SLURM_SUCCESS; -// (*(g_acct_storage_context->ops.acct_storage_fini))(); - rc = _acct_storage_context_destroy( g_acct_storage_context ); - g_acct_storage_context = NULL; + init_run = false; +// (*(ops.acct_storage_fini))(); + rc = plugin_context_destroy(plugin_context); + plugin_context = NULL; return rc; } extern void *acct_storage_g_get_connection( - const slurm_trigger_callbacks_t *callbacks, - int conn_num, bool rollback,char *cluster_name) + const slurm_trigger_callbacks_t *callbacks, + int conn_num, bool rollback,char *cluster_name) { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_conn))(callbacks, conn_num, - rollback, - cluster_name); + return (*(ops.get_conn))(callbacks, conn_num, rollback, cluster_name); } extern int acct_storage_g_close_connection(void **db_conn) { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.close_conn))(db_conn); + return (*(ops.close_conn))(db_conn); } @@ -455,7 +331,7 @@ extern int acct_storage_g_commit(void *db_conn, bool commit) { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.commit))(db_conn, commit); + return (*(ops.commit))(db_conn, commit); } @@ -464,8 +340,7 @@ extern int acct_storage_g_add_users(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.add_users)) - (db_conn, uid, user_list); + return (*(ops.add_users))(db_conn, uid, user_list); } extern int acct_storage_g_add_coord(void *db_conn, uint32_t uid, @@ -474,8 +349,7 @@ extern int acct_storage_g_add_coord(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.add_coord)) - (db_conn, uid, acct_list, user_cond); + return (*(ops.add_coord))(db_conn, uid, acct_list, user_cond); } extern int acct_storage_g_add_accounts(void *db_conn, uint32_t uid, @@ -483,8 +357,7 @@ extern int acct_storage_g_add_accounts(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.add_accts)) - (db_conn, uid, acct_list); + return (*(ops.add_accts))(db_conn, uid, acct_list); } extern int acct_storage_g_add_clusters(void *db_conn, uint32_t uid, @@ -492,8 +365,7 @@ extern int acct_storage_g_add_clusters(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.add_clusters)) - (db_conn, uid, cluster_list); + return (*(ops.add_clusters))(db_conn, uid, cluster_list); } extern int acct_storage_g_add_associations(void *db_conn, uint32_t uid, @@ -501,8 +373,7 @@ extern int acct_storage_g_add_associations(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.add_associations)) - (db_conn, uid, association_list); + return (*(ops.add_associations))(db_conn, uid, association_list); } extern int acct_storage_g_add_qos(void *db_conn, uint32_t uid, @@ -510,8 +381,7 @@ extern int acct_storage_g_add_qos(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.add_qos)) - (db_conn, uid, qos_list); + return (*(ops.add_qos))(db_conn, uid, qos_list); } extern int acct_storage_g_add_wckeys(void *db_conn, uint32_t uid, @@ -519,8 +389,7 @@ extern int acct_storage_g_add_wckeys(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.add_wckeys)) - (db_conn, uid, wckey_list); + return (*(ops.add_wckeys))(db_conn, uid, wckey_list); } extern int acct_storage_g_add_reservation(void *db_conn, @@ -528,8 +397,7 @@ extern int acct_storage_g_add_reservation(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return NO_VAL; - return (*(g_acct_storage_context->ops.add_reservation)) - (db_conn, resv); + return (*(ops.add_reservation))(db_conn, resv); } extern List acct_storage_g_modify_users(void *db_conn, uint32_t uid, @@ -538,8 +406,7 @@ extern List acct_storage_g_modify_users(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.modify_users)) - (db_conn, uid, user_cond, user); + return (*(ops.modify_users))(db_conn, uid, user_cond, user); } extern List acct_storage_g_modify_accounts(void *db_conn, uint32_t uid, @@ -548,8 +415,7 @@ extern List acct_storage_g_modify_accounts(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.modify_accts)) - (db_conn, uid, acct_cond, acct); + return (*(ops.modify_accts))(db_conn, uid, acct_cond, acct); } extern List acct_storage_g_modify_clusters(void *db_conn, uint32_t uid, @@ -558,8 +424,7 @@ extern List acct_storage_g_modify_clusters(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.modify_clusters)) - (db_conn, uid, cluster_cond, cluster); + return (*(ops.modify_clusters))(db_conn, uid, cluster_cond, cluster); } extern List acct_storage_g_modify_associations( @@ -569,8 +434,7 @@ extern List acct_storage_g_modify_associations( { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.modify_associations)) - (db_conn, uid, assoc_cond, assoc); + return (*(ops.modify_associations))(db_conn, uid, assoc_cond, assoc); } extern List acct_storage_g_modify_job(void *db_conn, uint32_t uid, @@ -579,8 +443,7 @@ extern List acct_storage_g_modify_job(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.modify_job)) - (db_conn, uid, job_cond, job); + return (*(ops.modify_job))(db_conn, uid, job_cond, job); } extern List acct_storage_g_modify_qos(void *db_conn, uint32_t uid, @@ -589,8 +452,7 @@ extern List acct_storage_g_modify_qos(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.modify_qos)) - (db_conn, uid, qos_cond, qos); + return (*(ops.modify_qos))(db_conn, uid, qos_cond, qos); } extern List acct_storage_g_modify_wckeys(void *db_conn, uint32_t uid, @@ -599,8 +461,7 @@ extern List acct_storage_g_modify_wckeys(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.modify_wckeys)) - (db_conn, uid, wckey_cond, wckey); + return (*(ops.modify_wckeys))(db_conn, uid, wckey_cond, wckey); } extern int acct_storage_g_modify_reservation(void *db_conn, @@ -608,8 +469,7 @@ extern int acct_storage_g_modify_reservation(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return NO_VAL; - return (*(g_acct_storage_context->ops.modify_reservation)) - (db_conn, resv); + return (*(ops.modify_reservation))(db_conn, resv); } extern List acct_storage_g_remove_users(void *db_conn, uint32_t uid, @@ -617,8 +477,7 @@ extern List acct_storage_g_remove_users(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.remove_users)) - (db_conn, uid, user_cond); + return (*(ops.remove_users))(db_conn, uid, user_cond); } extern List acct_storage_g_remove_coord(void *db_conn, uint32_t uid, @@ -627,8 +486,7 @@ extern List acct_storage_g_remove_coord(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.remove_coord)) - (db_conn, uid, acct_list, user_cond); + return (*(ops.remove_coord))(db_conn, uid, acct_list, user_cond); } extern List acct_storage_g_remove_accounts(void *db_conn, uint32_t uid, @@ -636,8 +494,7 @@ extern List acct_storage_g_remove_accounts(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.remove_accts)) - (db_conn, uid, acct_cond); + return (*(ops.remove_accts))(db_conn, uid, acct_cond); } extern List acct_storage_g_remove_clusters(void *db_conn, uint32_t uid, @@ -645,8 +502,7 @@ extern List acct_storage_g_remove_clusters(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.remove_clusters)) - (db_conn, uid, cluster_cond); + return (*(ops.remove_clusters))(db_conn, uid, cluster_cond); } extern List acct_storage_g_remove_associations( @@ -655,8 +511,7 @@ extern List acct_storage_g_remove_associations( { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.remove_associations)) - (db_conn, uid, assoc_cond); + return (*(ops.remove_associations))(db_conn, uid, assoc_cond); } extern List acct_storage_g_remove_qos(void *db_conn, uint32_t uid, @@ -664,8 +519,7 @@ extern List acct_storage_g_remove_qos(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.remove_qos)) - (db_conn, uid, qos_cond); + return (*(ops.remove_qos))(db_conn, uid, qos_cond); } extern List acct_storage_g_remove_wckeys(void *db_conn, uint32_t uid, @@ -673,8 +527,7 @@ extern List acct_storage_g_remove_wckeys(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.remove_wckeys)) - (db_conn, uid, wckey_cond); + return (*(ops.remove_wckeys))(db_conn, uid, wckey_cond); } extern int acct_storage_g_remove_reservation(void *db_conn, @@ -682,8 +535,7 @@ extern int acct_storage_g_remove_reservation(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return NO_VAL; - return (*(g_acct_storage_context->ops.remove_reservation)) - (db_conn, resv); + return (*(ops.remove_reservation))(db_conn, resv); } extern List acct_storage_g_get_users(void *db_conn, uint32_t uid, @@ -691,8 +543,7 @@ extern List acct_storage_g_get_users(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_users)) - (db_conn, uid, user_cond); + return (*(ops.get_users))(db_conn, uid, user_cond); } extern List acct_storage_g_get_accounts(void *db_conn, uint32_t uid, @@ -700,8 +551,7 @@ extern List acct_storage_g_get_accounts(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_accts)) - (db_conn, uid, acct_cond); + return (*(ops.get_accts))(db_conn, uid, acct_cond); } extern List acct_storage_g_get_clusters(void *db_conn, uint32_t uid, @@ -709,15 +559,14 @@ extern List acct_storage_g_get_clusters(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_clusters)) - (db_conn, uid, cluster_cond); + return (*(ops.get_clusters))(db_conn, uid, cluster_cond); } extern List acct_storage_g_get_config(void *db_conn, char *config_name) { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_config))(db_conn, config_name); + return (*(ops.get_config))(db_conn, config_name); } extern List acct_storage_g_get_associations( @@ -726,8 +575,7 @@ extern List acct_storage_g_get_associations( { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_associations)) - (db_conn, uid, assoc_cond); + return (*(ops.get_associations))(db_conn, uid, assoc_cond); } extern List acct_storage_g_get_events(void *db_conn, uint32_t uid, @@ -735,8 +583,7 @@ extern List acct_storage_g_get_events(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_events)) - (db_conn, uid, event_cond); + return (*(ops.get_events))(db_conn, uid, event_cond); } extern List acct_storage_g_get_problems(void *db_conn, uint32_t uid, @@ -744,8 +591,7 @@ extern List acct_storage_g_get_problems(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_problems)) - (db_conn, uid, assoc_cond); + return (*(ops.get_problems))(db_conn, uid, assoc_cond); } extern List acct_storage_g_get_qos(void *db_conn, uint32_t uid, @@ -753,7 +599,7 @@ extern List acct_storage_g_get_qos(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_qos))(db_conn, uid, qos_cond); + return (*(ops.get_qos))(db_conn, uid, qos_cond); } extern List acct_storage_g_get_wckeys(void *db_conn, uint32_t uid, @@ -761,17 +607,15 @@ extern List acct_storage_g_get_wckeys(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_wckeys))(db_conn, uid, - wckey_cond); + return (*(ops.get_wckeys))(db_conn, uid, wckey_cond); } -extern List acct_storage_g_get_reservations(void *db_conn, uint32_t uid, - slurmdb_reservation_cond_t *resv_cond) +extern List acct_storage_g_get_reservations( + void *db_conn, uint32_t uid, slurmdb_reservation_cond_t *resv_cond) { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_resvs))(db_conn, uid, - resv_cond); + return (*(ops.get_resvs))(db_conn, uid, resv_cond); } extern List acct_storage_g_get_txn(void *db_conn, uint32_t uid, @@ -779,7 +623,7 @@ extern List acct_storage_g_get_txn(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_txn))(db_conn, uid, txn_cond); + return (*(ops.get_txn))(db_conn, uid, txn_cond); } extern int acct_storage_g_get_usage(void *db_conn, uint32_t uid, @@ -788,8 +632,7 @@ extern int acct_storage_g_get_usage(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.get_usage)) - (db_conn, uid, in, type, start, end); + return (*(ops.get_usage))(db_conn, uid, in, type, start, end); } extern int acct_storage_g_roll_usage(void *db_conn, @@ -798,8 +641,7 @@ extern int acct_storage_g_roll_usage(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.roll_usage)) - (db_conn, sent_start, sent_end, archive_data); + return (*(ops.roll_usage))(db_conn, sent_start, sent_end, archive_data); } extern int clusteracct_storage_g_node_down(void *db_conn, @@ -809,8 +651,8 @@ extern int clusteracct_storage_g_node_down(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.node_down)) - (db_conn, node_ptr, event_time, reason, reason_uid); + return (*(ops.node_down))(db_conn, node_ptr, event_time, + reason, reason_uid); } extern int clusteracct_storage_g_node_up(void *db_conn, @@ -865,7 +707,7 @@ extern int clusteracct_storage_g_node_up(void *db_conn, send_node.node_state = NODE_STATE_ERROR; - return (*(g_acct_storage_context->ops.node_down)) + return (*(ops.node_down)) (db_conn, &send_node, event_time, reason, slurm_get_slurm_user_id()); } else { @@ -879,8 +721,7 @@ extern int clusteracct_storage_g_node_up(void *db_conn, node_ptr->reason_uid = NO_VAL; } - return (*(g_acct_storage_context->ops.node_up)) - (db_conn, node_ptr, event_time); + return (*(ops.node_up))(db_conn, node_ptr, event_time); } @@ -891,8 +732,7 @@ extern int clusteracct_storage_g_cluster_cpus(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.cluster_cpus)) - (db_conn, cluster_nodes, cpus, event_time); + return (*(ops.cluster_cpus))(db_conn, cluster_nodes, cpus, event_time); } @@ -900,7 +740,7 @@ extern int clusteracct_storage_g_register_ctld(void *db_conn, uint16_t port) { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.register_ctld))(db_conn, port); + return (*(ops.register_ctld))(db_conn, port); } extern int clusteracct_storage_g_register_disconn_ctld( @@ -908,8 +748,7 @@ extern int clusteracct_storage_g_register_disconn_ctld( { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.register_disconn_ctld)) - (db_conn, control_host); + return (*(ops.register_disconn_ctld))(db_conn, control_host); } extern int clusteracct_storage_g_fini_ctld(void *db_conn, @@ -917,7 +756,7 @@ extern int clusteracct_storage_g_fini_ctld(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.fini_ctld))(db_conn, cluster_rec); + return (*(ops.fini_ctld))(db_conn, cluster_rec); } /* @@ -938,13 +777,12 @@ extern int jobacct_storage_g_job_start(void *db_conn, int rc; time_t orig_start_time = job_ptr->start_time; job_ptr->start_time = (time_t) 0; - rc = (*(g_acct_storage_context->ops.job_start))( - db_conn, job_ptr); + rc = (*(ops.job_start))(db_conn, job_ptr); job_ptr->start_time = orig_start_time; return rc; } - return (*(g_acct_storage_context->ops.job_start))(db_conn, job_ptr); + return (*(ops.job_start))(db_conn, job_ptr); } /* @@ -955,7 +793,7 @@ extern int jobacct_storage_g_job_complete(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.job_complete))(db_conn, job_ptr); + return (*(ops.job_complete))(db_conn, job_ptr); } /* @@ -966,7 +804,7 @@ extern int jobacct_storage_g_step_start(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.step_start))(db_conn, step_ptr); + return (*(ops.step_start))(db_conn, step_ptr); } /* @@ -977,8 +815,7 @@ extern int jobacct_storage_g_step_complete(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.step_complete))(db_conn, - step_ptr); + return (*(ops.step_complete))(db_conn, step_ptr); } /* @@ -989,7 +826,7 @@ extern int jobacct_storage_g_job_suspend(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.job_suspend))(db_conn, job_ptr); + return (*(ops.job_suspend))(db_conn, job_ptr); } /* @@ -1002,8 +839,7 @@ extern List jobacct_storage_g_get_jobs_cond(void *db_conn, uint32_t uid, { if (slurm_acct_storage_init(NULL) < 0) return NULL; - return (*(g_acct_storage_context->ops.get_jobs_cond)) - (db_conn, uid, job_cond); + return (*(ops.get_jobs_cond))(db_conn, uid, job_cond); } /* @@ -1014,8 +850,7 @@ extern int jobacct_storage_g_archive(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.archive_dump)) - (db_conn, arch_cond); + return (*(ops.archive_dump))(db_conn, arch_cond); } /* @@ -1026,7 +861,7 @@ extern int jobacct_storage_g_archive_load(void *db_conn, { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.archive_load))(db_conn, arch_rec); + return (*(ops.archive_load))(db_conn, arch_rec); } @@ -1039,8 +874,7 @@ extern int acct_storage_g_update_shares_used(void *db_conn, List acct_list) { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.update_shares_used))(db_conn, - acct_list); + return (*(ops.update_shares_used))(db_conn, acct_list); } /* @@ -1056,7 +890,6 @@ extern int acct_storage_g_flush_jobs_on_cluster( { if (slurm_acct_storage_init(NULL) < 0) return SLURM_ERROR; - return (*(g_acct_storage_context->ops.flush_jobs)) - (db_conn, event_time); + return (*(ops.flush_jobs))(db_conn, event_time); } diff --git a/src/common/slurm_auth.c b/src/common/slurm_auth.c index 264c605a712e41b7c4a805ab875dae5e63b91be6..3867b59ad5329e44aa099a34b696f5c15de222cd 100644 --- a/src/common/slurm_auth.c +++ b/src/common/slurm_auth.c @@ -53,6 +53,7 @@ #include "src/common/arg_desc.h" static bool auth_dummy = false; /* for security testing */ +static bool init_run = false; /* * WARNING: Do not change the order of these fields or add additional @@ -72,39 +73,29 @@ typedef struct slurm_auth_ops { int (*sa_errno) ( void *cred ); const char * (*sa_errstr) ( int slurm_errno ); } slurm_auth_ops_t; - /* - * Implementation of the authentication context. Hopefully everything - * having to do with plugins will be abstracted under here so that the - * callers can just deal with creating a context and asking for the - * operations implemented pertinent to that context. - * - * auth_type - the string (presumably from configuration files) - * describing the desired form of authentication, such as "auth/munge" - * or "auth/kerberos" or "auth/none". - * - * plugin_list - the plugin rack managing the loading and unloading of - * plugins for authencation. - * - * cur_plugin - the plugin currently supplying operations to the caller. - * - * ops - a table of pointers to functions in the plugin which correspond - * to the standardized plugin API. We create this table by text references - * into the plugin's symbol table. + * These strings must be kept in the same order as the fields + * declared for slurm_auth_ops_t. */ -struct slurm_auth_context { - char * auth_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int auth_errno; - slurm_auth_ops_t ops; +static const char *syms[] = { + "slurm_auth_create", + "slurm_auth_destroy", + "slurm_auth_verify", + "slurm_auth_get_uid", + "slurm_auth_get_gid", + "slurm_auth_pack", + "slurm_auth_unpack", + "slurm_auth_print", + "slurm_auth_errno", + "slurm_auth_errstr" }; /* * A global authentication context. "Global" in the sense that there's * only one, with static bindings. We don't export it. */ -static slurm_auth_context_t g_context = NULL; +static slurm_auth_ops_t ops; +static plugin_context_t *g_context = NULL; static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER; /* @@ -116,82 +107,6 @@ static arg_desc_t auth_args[] = { { NULL } }; -/* - * Resolve the operations from the plugin. - */ -static slurm_auth_ops_t * -slurm_auth_get_ops( slurm_auth_context_t c ) -{ - /* - * These strings must be kept in the same order as the fields - * declared for slurm_auth_ops_t. - */ - static const char *syms[] = { - "slurm_auth_create", - "slurm_auth_destroy", - "slurm_auth_verify", - "slurm_auth_get_uid", - "slurm_auth_get_gid", - "slurm_auth_pack", - "slurm_auth_unpack", - "slurm_auth_print", - "slurm_auth_errno", - "slurm_auth_errstr" - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->auth_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->auth_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->auth_type); - - /* Get the plugin list, if needed. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "Unable to create auth plugin manager" ); - return NULL; - } - - plugrack_set_major_type( c->plugin_list, "auth" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - /* Find the correct plugin. */ - c->cur_plugin = plugrack_use_by_type( c->plugin_list, c->auth_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "can't find a plugin for type %s", c->auth_type ); - return NULL; - } - - /* Dereference the API. */ - if ( plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops ) < n_syms ) { - error( "incomplete auth plugin detected" ); - return NULL; - } - - return &c->ops; -} const arg_desc_t * slurm_auth_get_arg_desc( void ) @@ -226,37 +141,6 @@ slurm_auth_marshal_args( void *hosts, int timeout ) return argv; } - -slurm_auth_context_t -slurm_auth_context_create( const char *auth_type ) -{ - slurm_auth_context_t c; - - if ( auth_type == NULL ) { - debug3( "slurm_auth_context_create: no authentication type" ); - return NULL; - } - - c = xmalloc( sizeof( struct slurm_auth_context ) ); - - c->auth_errno = SLURM_SUCCESS; - - /* Copy the authentication type. */ - c->auth_type = xstrdup( auth_type ); - if ( c->auth_type == NULL ) { - debug3( "can't make local copy of authentication type" ); - xfree( c ); - return NULL; - } - - /* Plugin rack is demand-loaded on first reference. */ - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - - return c; -} - - static const char * slurm_auth_generic_errstr( int slurm_errno ) { @@ -286,68 +170,44 @@ slurm_auth_generic_errstr( int slurm_errno ) } } - -static int -_slurm_auth_context_destroy( slurm_auth_context_t c ) -{ - int rc = SLURM_SUCCESS; - - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree( c->auth_type ); - xfree( c ); - - return rc; -} - extern int slurm_auth_init( char *auth_type ) { int retval = SLURM_SUCCESS; - char *auth_type_local = NULL; + char *type = NULL; + char *plugin_type = "auth"; - slurm_mutex_lock( &context_lock ); + if (init_run && g_context) + return retval; - if ( g_context ) + slurm_mutex_lock(&context_lock); + + if (g_context) goto done; - if (auth_type == NULL) { - auth_type_local = slurm_get_auth_type(); - auth_type = auth_type_local; - } - if (strcmp(auth_type, "auth/dummy") == 0) { - info( "warning: %s plugin selected", auth_type); + if (auth_type) + slurm_set_auth_type(auth_type); + + type = slurm_get_auth_type(); + + if (strcmp(type, "auth/dummy") == 0) { + info( "warning: %s plugin selected", type); auth_dummy = true; goto done; } - g_context = slurm_auth_context_create( auth_type ); - if ( g_context == NULL ) { - error( "cannot create a context for %s", auth_type ); - retval = SLURM_ERROR; - goto done; - } + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); - if ( slurm_auth_get_ops( g_context ) == NULL ) { - error( "cannot resolve %s plugin operations", - auth_type ); - _slurm_auth_context_destroy( g_context ); - g_context = NULL; - retval = SLURM_ERROR; - } + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); + retval = SLURM_ERROR; + goto done; + } + init_run = true; done: - xfree(auth_type_local); - slurm_mutex_unlock( &context_lock ); + xfree(type); + slurm_mutex_unlock(&context_lock); return retval; } @@ -357,10 +217,11 @@ slurm_auth_fini( void ) { int rc; - if ( !g_context ) + if (!g_context) return SLURM_SUCCESS; - rc = _slurm_auth_context_destroy( g_context ); + init_run = false; + rc = plugin_context_destroy(g_context); g_context = NULL; return rc; } @@ -388,7 +249,7 @@ g_slurm_auth_create( void *hosts, int timeout, char *auth_info ) return NULL; } - ret = (*(g_context->ops.create))( argv, auth_info ); + ret = (*(ops.create))( argv, auth_info ); xfree( argv ); return ret; } @@ -402,7 +263,7 @@ g_slurm_auth_destroy( void *cred ) if ( auth_dummy ) /* don't worry about leak in testing */ return SLURM_SUCCESS; - return (*(g_context->ops.destroy))( cred ); + return (*(ops.destroy))( cred ); } int @@ -421,7 +282,7 @@ g_slurm_auth_verify( void *cred, void *hosts, int timeout, char *auth_info ) return SLURM_ERROR; } - ret = (*(g_context->ops.verify))( cred, auth_info ); + ret = (*(ops.verify))( cred, auth_info ); xfree( argv ); return ret; } @@ -432,7 +293,7 @@ g_slurm_auth_get_uid( void *cred, char *auth_info ) if (( slurm_auth_init(NULL) < 0 ) || auth_dummy ) return SLURM_AUTH_NOBODY; - return (*(g_context->ops.get_uid))( cred, auth_info ); + return (*(ops.get_uid))( cred, auth_info ); } gid_t @@ -441,7 +302,7 @@ g_slurm_auth_get_gid( void *cred, char *auth_info ) if (( slurm_auth_init(NULL) < 0 ) || auth_dummy ) return SLURM_AUTH_NOBODY; - return (*(g_context->ops.get_gid))( cred, auth_info ); + return (*(ops.get_gid))( cred, auth_info ); } int @@ -453,7 +314,7 @@ g_slurm_auth_pack( void *cred, Buf buf ) if ( auth_dummy ) return SLURM_SUCCESS; - return (*(g_context->ops.pack))( cred, buf ); + return (*(ops.pack))( cred, buf ); } void * @@ -462,7 +323,7 @@ g_slurm_auth_unpack( Buf buf ) if (( slurm_auth_init(NULL) < 0 ) || auth_dummy ) return NULL; - return (*(g_context->ops.unpack))( buf ); + return (*(ops.unpack))( buf ); } int @@ -474,7 +335,7 @@ g_slurm_auth_print( void *cred, FILE *fp ) if ( auth_dummy ) return SLURM_SUCCESS; - return (*(g_context->ops.print))( cred, fp ); + return (*(ops.print))( cred, fp ); } int @@ -483,7 +344,7 @@ g_slurm_auth_errno( void *cred ) if (( slurm_auth_init(NULL) < 0 ) || auth_dummy ) return SLURM_ERROR; - return (*(g_context->ops.sa_errno))( cred ); + return (*(ops.sa_errno))( cred ); } const char * @@ -498,5 +359,5 @@ g_slurm_auth_errstr( int slurm_errno ) if (( generic = (char *) slurm_auth_generic_errstr( slurm_errno ) )) return generic; - return (*(g_context->ops.sa_errstr))( slurm_errno ); + return (*(ops.sa_errstr))( slurm_errno ); } diff --git a/src/common/slurm_cred.c b/src/common/slurm_cred.c index 0b278915b48388d9e73b071b571d463b4ecbb598..fc0a3288003d8723ea95f5ed5ff4edef66549ca1 100644 --- a/src/common/slurm_cred.c +++ b/src/common/slurm_cred.c @@ -210,21 +210,22 @@ typedef struct slurm_crypto_ops { } slurm_crypto_ops_t; /* - * A global cryptographic context. "Global" in the sense that there's - * only one, with static bindings. We don't export it. + * These strings must be in the same order as the fields declared + * for slurm_crypto_ops_t. */ +static const char *syms[] = { + "crypto_read_private_key", + "crypto_read_public_key", + "crypto_destroy_key", + "crypto_sign", + "crypto_verify_sign", + "crypto_str_error" +}; -typedef struct slurm_crypto_context { - char *crypto_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int crypto_errno; - slurm_crypto_ops_t ops; -} slurm_crypto_context_t; - -static slurm_crypto_context_t *g_crypto_context = NULL; -static pthread_mutex_t g_crypto_context_lock = PTHREAD_MUTEX_INITIALIZER; - +static slurm_crypto_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 prototypes: @@ -275,166 +276,33 @@ static void _cred_state_pack_one(cred_state_t *s, Buf buffer); static char * timestr (const time_t *tp, char *buf, size_t n); #endif - -static slurm_crypto_context_t * -_slurm_crypto_context_create( const char *crypto_type) -{ - slurm_crypto_context_t *c; - - if ( crypto_type == NULL ) { - error( "_slurm_crypto_context_create: no crypto type" ); - return NULL; - } - - c = xmalloc( sizeof( struct slurm_crypto_context ) ); - - c->crypto_errno = SLURM_SUCCESS; - - /* Copy the job completion job completion type. */ - c->crypto_type = xstrdup( crypto_type ); - if ( c->crypto_type == NULL ) { - error( "can't make local copy of crypto type" ); - xfree( c ); - return NULL; - } - - /* Plugin rack is demand-loaded on first reference. */ - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - c->crypto_errno = SLURM_SUCCESS; - - return c; -} - -static int -_slurm_crypto_context_destroy( slurm_crypto_context_t *c ) -{ - int rc = SLURM_SUCCESS; - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree( c->crypto_type ); - xfree( c ); - - return rc; -} - -/* - * Resolve the operations from the plugin. - */ -static slurm_crypto_ops_t * -_slurm_crypto_get_ops( slurm_crypto_context_t *c ) -{ - /* - * These strings must be in the same order as the fields declared - * for slurm_crypto_ops_t. - */ - static const char *syms[] = { - "crypto_read_private_key", - "crypto_read_public_key", - "crypto_destroy_key", - "crypto_sign", - "crypto_verify_sign", - "crypto_str_error" - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - int rc = 0; - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->crypto_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->crypto_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->crypto_type); - - /* Get the plugin list, if needed. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "Unable to create a plugin manager" ); - return NULL; - } - - plugrack_set_major_type( c->plugin_list, "crypto" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - /* Find the correct plugin. */ - c->cur_plugin = - plugrack_use_by_type( c->plugin_list, c->crypto_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "can't find a plugin for type %s", c->crypto_type ); - return NULL; - } - - /* Dereference the API. */ - if ( (rc = plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops )) < n_syms ) { - error( "incomplete crypto plugin detected only " - "got %d out of %d", - rc, n_syms); - return NULL; - } - - return &c->ops; -} - static int _slurm_crypto_init(void) { - char *crypto_type = NULL; + char *plugin_type = "crypto"; + char *type = NULL; int retval = SLURM_SUCCESS; - if ( g_crypto_context ) /* mostly avoid locks for better speed */ - return SLURM_SUCCESS; + if ( init_run && g_context ) /* mostly avoid locks for better speed */ + return retval; - slurm_mutex_lock( &g_crypto_context_lock ); - if ( g_crypto_context ) + slurm_mutex_lock( &g_context_lock ); + if ( g_context ) goto done; - crypto_type = slurm_get_crypto_type(); - g_crypto_context = _slurm_crypto_context_create( crypto_type ); - if ( g_crypto_context == NULL ) { - error( "cannot create a context for %s", crypto_type ); - retval = SLURM_ERROR; - goto done; - } + type = slurm_get_crypto_type(); + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); - if ( _slurm_crypto_get_ops( g_crypto_context ) == NULL ) { - error( "cannot resolve crypto plugin operations" ); - _slurm_crypto_context_destroy( g_crypto_context ); - g_crypto_context = NULL; + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; + goto done; } + init_run = true; done: - slurm_mutex_unlock( &g_crypto_context_lock ); - xfree(crypto_type); + slurm_mutex_unlock( &g_context_lock ); + xfree(type); return(retval); } @@ -443,11 +311,12 @@ static int _slurm_crypto_fini(void) { int rc; - if (!g_crypto_context) + if (!g_context) return SLURM_SUCCESS; - rc = _slurm_crypto_context_destroy(g_crypto_context); - g_crypto_context = NULL; + init_run = false; + rc = plugin_context_destroy(g_context); + g_context = NULL; return rc; } @@ -473,7 +342,7 @@ slurm_cred_creator_ctx_create(const char *path) ctx->type = SLURM_CRED_CREATOR; - ctx->key = (*(g_crypto_context->ops.crypto_read_private_key))(path); + ctx->key = (*(ops.crypto_read_private_key))(path); if (!ctx->key) goto fail; @@ -501,7 +370,7 @@ slurm_cred_verifier_ctx_create(const char *path) ctx->type = SLURM_CRED_VERIFIER; - ctx->key = (*(g_crypto_context->ops.crypto_read_public_key))(path); + ctx->key = (*(ops.crypto_read_public_key))(path); if (!ctx->key) goto fail; @@ -530,9 +399,9 @@ slurm_cred_ctx_destroy(slurm_cred_ctx_t ctx) xassert(ctx->magic == CRED_CTX_MAGIC); if (ctx->exkey) - (*(g_crypto_context->ops.crypto_destroy_key))(ctx->exkey); + (*(ops.crypto_destroy_key))(ctx->exkey); if (ctx->key) - (*(g_crypto_context->ops.crypto_destroy_key))(ctx->key); + (*(ops.crypto_destroy_key))(ctx->key); if (ctx->job_list) list_destroy(ctx->job_list); if (ctx->state_list) @@ -1108,7 +977,6 @@ error: int slurm_cred_begin_expiration(slurm_cred_ctx_t ctx, uint32_t jobid) { - char buf[64]; job_state_t *j = NULL; xassert(ctx != NULL); @@ -1131,10 +999,16 @@ slurm_cred_begin_expiration(slurm_cred_ctx_t ctx, uint32_t jobid) } j->expiration = time(NULL) + ctx->expiry_window; - - debug2 ("set revoke expiration for jobid %u to %s", - j->jobid, timestr (&j->expiration, buf, 64) ); - +#if DEBUG_TIME + { + char buf[64]; + debug2("set revoke expiration for jobid %u to %s", + j->jobid, timestr(&j->expiration, buf, 64)); + } +#else + debug2("set revoke expiration for jobid %u to %"PRIu64" UTS", + j->jobid, (uint64_t) j->expiration); +#endif slurm_mutex_unlock(&ctx->mutex); return SLURM_SUCCESS; @@ -1186,8 +1060,8 @@ static char *_core_format(bitstr_t *core_bitmap) * NOTE: caller must xfree the returned strings. */ void format_core_allocs(slurm_cred_t *cred, char *node_name, - char **job_alloc_cores, char **step_alloc_cores, - uint32_t *job_mem_limit, uint32_t *step_mem_limit) + char **job_alloc_cores, char **step_alloc_cores, + uint32_t *job_mem_limit, uint32_t *step_mem_limit) { #ifdef HAVE_BG xassert(cred); @@ -1272,12 +1146,12 @@ void format_core_allocs(slurm_cred_t *cred, char *node_name, if (cred->job_mem_limit & MEM_PER_CPU) { *job_mem_limit = (cred->job_mem_limit & (~MEM_PER_CPU)) * - job_core_cnt; + job_core_cnt; } else *job_mem_limit = cred->job_mem_limit; if (cred->step_mem_limit & MEM_PER_CPU) { *step_mem_limit = (cred->step_mem_limit & (~MEM_PER_CPU)) * - step_core_cnt; + step_core_cnt; } else if (cred->step_mem_limit) *step_mem_limit = cred->step_mem_limit; else @@ -1537,7 +1411,7 @@ _ctx_update_private_key(slurm_cred_ctx_t ctx, const char *path) xassert(ctx != NULL); - pk = (*(g_crypto_context->ops.crypto_read_private_key))(path); + pk = (*(ops.crypto_read_private_key))(path); if (!pk) return SLURM_ERROR; @@ -1551,7 +1425,7 @@ _ctx_update_private_key(slurm_cred_ctx_t ctx, const char *path) slurm_mutex_unlock(&ctx->mutex); - (*(g_crypto_context->ops.crypto_destroy_key))(tmpk); + (*(ops.crypto_destroy_key))(tmpk); return SLURM_SUCCESS; } @@ -1563,7 +1437,7 @@ _ctx_update_public_key(slurm_cred_ctx_t ctx, const char *path) void *pk = NULL; xassert(ctx != NULL); - pk = (*(g_crypto_context->ops.crypto_read_public_key))(path); + pk = (*(ops.crypto_read_public_key))(path); if (!pk) return SLURM_ERROR; @@ -1573,7 +1447,7 @@ _ctx_update_public_key(slurm_cred_ctx_t ctx, const char *path) xassert(ctx->type == SLURM_CRED_VERIFIER); if (ctx->exkey) - (*(g_crypto_context->ops.crypto_destroy_key))(ctx->exkey); + (*(ops.crypto_destroy_key))(ctx->exkey); ctx->exkey = ctx->key; ctx->key = pk; @@ -1597,7 +1471,7 @@ _exkey_is_valid(slurm_cred_ctx_t ctx) if (time(NULL) > ctx->exkey_exp) { debug2("old job credential key slurmd expired"); - (*(g_crypto_context->ops.crypto_destroy_key))(ctx->exkey); + (*(ops.crypto_destroy_key))(ctx->exkey); ctx->exkey = NULL; return false; } @@ -1660,16 +1534,16 @@ _slurm_cred_sign(slurm_cred_ctx_t ctx, slurm_cred_t *cred) buffer = init_buf(4096); _pack_cred(cred, buffer); - rc = (*(g_crypto_context->ops.crypto_sign))(ctx->key, - get_buf_data(buffer), - get_buf_offset(buffer), - &cred->signature, - &cred->siglen); + rc = (*(ops.crypto_sign))(ctx->key, + get_buf_data(buffer), + get_buf_offset(buffer), + &cred->signature, + &cred->siglen); free_buf(buffer); if (rc) { error("Credential sign: %s", - (*(g_crypto_context->ops.crypto_str_error))(rc)); + (*(ops.crypto_str_error))(rc)); return SLURM_ERROR; } return SLURM_SUCCESS; @@ -1685,23 +1559,23 @@ _slurm_cred_verify_signature(slurm_cred_ctx_t ctx, slurm_cred_t *cred) buffer = init_buf(4096); _pack_cred(cred, buffer); - rc = (*(g_crypto_context->ops.crypto_verify_sign))(ctx->key, - get_buf_data(buffer), - get_buf_offset(buffer), - cred->signature, - cred->siglen); + rc = (*(ops.crypto_verify_sign))(ctx->key, + get_buf_data(buffer), + get_buf_offset(buffer), + cred->signature, + cred->siglen); if (rc && _exkey_is_valid(ctx)) { - rc = (*(g_crypto_context->ops.crypto_verify_sign))(ctx->exkey, - get_buf_data(buffer), - get_buf_offset(buffer), - cred->signature, - cred->siglen); + rc = (*(ops.crypto_verify_sign))(ctx->exkey, + get_buf_data(buffer), + get_buf_offset(buffer), + cred->signature, + cred->siglen); } free_buf(buffer); if (rc) { error("Credential signature check: %s", - (*(g_crypto_context->ops.crypto_str_error))(rc)); + (*(ops.crypto_str_error))(rc)); return SLURM_ERROR; } return SLURM_SUCCESS; @@ -1796,7 +1670,7 @@ extern char * timestr (const time_t *tp, char *buf, size_t n) #ifdef DISABLE_LOCALTIME static int disabled = 0; if (buf == NULL) - disabled=1; + disabled = 1; if (disabled) return NULL; #endif @@ -1852,9 +1726,14 @@ _credential_revoked(slurm_cred_ctx_t ctx, slurm_cred_t *cred) } if (cred->ctime <= j->revoked) { +#if DEBUG_TIME char buf[64]; - debug ("cred for %u revoked. expires at %s", - j->jobid, timestr (&j->expiration, buf, 64)); + debug3("cred for %u revoked. expires at %s", + j->jobid, timestr(&j->expiration, buf, 64)); +#else + debug3("cred for %u revoked. expires at %"PRIu64" UTS", + j->jobid, (uint64_t) j->expiration); +#endif return true; } @@ -1917,15 +1796,20 @@ _job_state_destroy(job_state_t *j) static void _clear_expired_job_states(slurm_cred_ctx_t ctx) { + static time_t last_scan = 0; time_t now = time(NULL); ListIterator i = NULL; job_state_t *j = NULL; + if ((now - last_scan) < 2) /* Reduces slurmd overhead */ + return; + last_scan = now; + i = list_iterator_create(ctx->job_list); if (!i) fatal("list_iterator_create: malloc failure"); while ((j = list_next(i))) { -#if EXTREME_DEBUG +#if DEBUG_TIME char t1[64], t2[64], t3[64]; if (j->revoked) { strcpy(t2, " revoked:"); @@ -1941,6 +1825,11 @@ _clear_expired_job_states(slurm_cred_ctx_t ctx) } debug3("state for jobid %u: ctime:%s%s%s", j->jobid, timestr(&j->ctime, t1, 64), t2, t3); +#else + debug3("state for jobid %u: ctime:%"PRIu64" revoked:%"PRIu64" " + "expires:%"PRIu64"", + j->jobid, (uint64_t)j->ctime, (uint64_t)j->revoked, + (uint64_t)j->revoked); #endif if (j->revoked && (now > j->expiration)) { list_delete_item(i); @@ -1954,17 +1843,20 @@ _clear_expired_job_states(slurm_cred_ctx_t ctx) static void _clear_expired_credential_states(slurm_cred_ctx_t ctx) { + static time_t last_scan = 0; time_t now = time(NULL); ListIterator i = NULL; cred_state_t *s = NULL; - i = list_iterator_create(ctx->state_list); + if ((now - last_scan) < 2) /* Reduces slurmd overhead */ + return; + last_scan = now; + i = list_iterator_create(ctx->state_list); while ((s = list_next(i))) { if (now > s->expiration) list_delete_item(i); } - list_iterator_destroy(i); } @@ -2196,14 +2088,14 @@ sbcast_cred_t *create_sbcast_cred(slurm_cred_ctx_t ctx, buffer = init_buf(4096); _pack_sbcast_cred(sbcast_cred, buffer); - rc = (*(g_crypto_context->ops.crypto_sign))(ctx->key, - get_buf_data(buffer), get_buf_offset(buffer), - &sbcast_cred->signature, &sbcast_cred->siglen); + rc = (*(ops.crypto_sign))( + ctx->key, get_buf_data(buffer), get_buf_offset(buffer), + &sbcast_cred->signature, &sbcast_cred->siglen); free_buf(buffer); if (rc) { error("sbcast_cred sign: %s", - (*(g_crypto_context->ops.crypto_str_error))(rc)); + (*(ops.crypto_str_error))(rc)); delete_sbcast_cred(sbcast_cred); return NULL; } @@ -2271,14 +2163,14 @@ int extract_sbcast_cred(slurm_cred_ctx_t ctx, _pack_sbcast_cred(sbcast_cred, buffer); /* NOTE: the verification checks that the credential was * created by SlurmUser or root */ - rc = (*(g_crypto_context->ops.crypto_verify_sign))(ctx->key, - get_buf_data(buffer), get_buf_offset(buffer), - sbcast_cred->signature, sbcast_cred->siglen); + rc = (*(ops.crypto_verify_sign))( + ctx->key, get_buf_data(buffer), get_buf_offset(buffer), + sbcast_cred->signature, sbcast_cred->siglen); free_buf(buffer); if (rc) { error("sbcast_cred verify: %s", - (*(g_crypto_context->ops.crypto_str_error))(rc)); + (*(ops.crypto_str_error))(rc)); return -1; } diff --git a/src/common/slurm_cred.h b/src/common/slurm_cred.h index e3469d923db16030ca3608b02013ccfdd25fdc51..f77caaa46b4f664fb841c8a5d91b27319d19bec7 100644 --- a/src/common/slurm_cred.h +++ b/src/common/slurm_cred.h @@ -129,7 +129,7 @@ void slurm_cred_ctx_destroy(slurm_cred_ctx_t ctx); * * On pack() ctx is packed in machine-independent format into the * buffer, on unpack() the contents of the buffer are used to - * intialize the state of the context ctx. + * initialize the state of the context ctx. */ int slurm_cred_ctx_pack(slurm_cred_ctx_t ctx, Buf buffer); int slurm_cred_ctx_unpack(slurm_cred_ctx_t ctx, Buf buffer); diff --git a/src/common/slurm_errno.c b/src/common/slurm_errno.c index 2e71607ced268b12b3136643474f5081d6ddd5ff..e6cd4d84a42587cd5f4a7b6e85b1c50cac7c7f91 100644 --- a/src/common/slurm_errno.c +++ b/src/common/slurm_errno.c @@ -280,6 +280,8 @@ static slurm_errtab_t slurm_errtab[] = { "Step limit reached for this job" }, { ESLURM_JOB_SUSPENDED, "Job is current suspended, requested operation disabled" }, + { ESLURM_CAN_NOT_START_IMMEDIATELY, + "Job can not start immediately" }, /* slurmd error codes */ diff --git a/src/common/slurm_jobacct_gather.c b/src/common/slurm_jobacct_gather.c index 66a1cef9ac5ae452409f3ab4f7dcc4cdb29a0556..944619e31495b5b44ff2fd9a5175259fe61ae929 100644 --- a/src/common/slurm_jobacct_gather.c +++ b/src/common/slurm_jobacct_gather.c @@ -54,11 +54,21 @@ #include "src/common/macros.h" #include "src/common/plugin.h" #include "src/common/plugrack.h" +#include "src/common/read_config.h" #include "src/common/slurm_jobacct_gather.h" #include "src/common/xmalloc.h" #include "src/common/xstring.h" #include "src/slurmd/slurmstepd/slurmstepd_job.h" +/* +** Define slurm-specific aliases for use by plugins, see slurm_xlator.h +** for details. + */ +strong_alias(jobacctinfo_pack, slurm_jobacctinfo_pack); +strong_alias(jobacctinfo_unpack, slurm_jobacctinfo_unpack); +strong_alias(jobacctinfo_create, slurm_jobacctinfo_create); +strong_alias(jobacctinfo_destroy, slurm_jobacctinfo_destroy); + /* * WARNING: Do not change the order of these fields or add additional @@ -67,486 +77,825 @@ * at the end of the structure. */ typedef struct slurm_jobacct_gather_ops { - jobacctinfo_t *(*jobacct_gather_create)(jobacct_id_t *jobacct_id); - void (*jobacct_gather_destroy) (jobacctinfo_t *jobacct); - int (*jobacct_gather_setinfo) (jobacctinfo_t *jobacct, - enum jobacct_data_type type, - void *data); - int (*jobacct_gather_getinfo) (jobacctinfo_t *jobacct, - enum jobacct_data_type type, - void *data); - void (*jobacct_gather_pack) (jobacctinfo_t *jobacct, uint16_t rpc_version, Buf buffer); - int (*jobacct_gather_unpack) (jobacctinfo_t **jobacct, uint16_t rpc_version, Buf buffer); - void (*jobacct_gather_aggregate) (jobacctinfo_t *dest, - jobacctinfo_t *from); - int (*jobacct_gather_startpoll) (uint16_t frequency); - int (*jobacct_gather_endpoll) (); - void (*jobacct_gather_change_poll) (uint16_t frequency); - void (*jobacct_gather_suspend_poll) (); - void (*jobacct_gather_resume_poll) (); - int (*jobacct_gather_set_proctrack_container_id)(uint64_t id); - int (*jobacct_gather_add_task) (pid_t pid, jobacct_id_t *jobacct_id); - jobacctinfo_t *(*jobacct_gather_stat_task)(pid_t pid); - jobacctinfo_t *(*jobacct_gather_remove_task)(pid_t pid); - void (*jobacct_gather_2_stats) (slurmdb_stats_t *stats, - jobacctinfo_t *jobacct); + void (*poll_data) (List task_list, bool pgid_plugin, uint64_t cont_id); + int (*endpoll) (); + int (*add_task) (pid_t pid, jobacct_id_t *jobacct_id); } slurm_jobacct_gather_ops_t; /* - * A global job accounting context. "Global" in the sense that there's - * only one, with static bindings. We don't export it. + * These strings must be in the same order as the fields declared + * for slurm_jobacct_gather_ops_t. */ - -typedef struct slurm_jobacct_gather_context { - char *jobacct_gather_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int jobacct_gather_errno; - slurm_jobacct_gather_ops_t ops; -} slurm_jobacct_gather_context_t; - -static slurm_jobacct_gather_context_t *g_jobacct_gather_context = NULL; -static pthread_mutex_t g_jobacct_gather_context_lock = PTHREAD_MUTEX_INITIALIZER; - -static int _slurm_jobacct_gather_init(void); - -static slurm_jobacct_gather_context_t * -_slurm_jobacct_gather_context_create( const char *jobacct_gather_type) +static const char *syms[] = { + "jobacct_gather_p_poll_data", + "jobacct_gather_p_endpoll", + "jobacct_gather_p_add_task", +}; + +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 int freq = 0; +static bool pgid_plugin = false; +static List task_list = NULL; +static uint64_t cont_id = (uint64_t)NO_VAL; +static pthread_mutex_t task_list_lock = PTHREAD_MUTEX_INITIALIZER; + +static bool jobacct_shutdown = true; +static bool jobacct_suspended = 0; + +static uint32_t jobacct_job_id = 0; +static uint32_t jobacct_step_id = 0; +static uint32_t jobacct_mem_limit = 0; +static uint32_t jobacct_vmem_limit = 0; + +/* _acct_kill_step() issue RPC to kill a slurm job step */ +static void _acct_kill_step(void) { - slurm_jobacct_gather_context_t *c; - - if ( jobacct_gather_type == NULL ) { - error("_slurm_jobacct_gather_context_create: no jobacct type"); - return NULL; - } - - c = xmalloc( sizeof( struct slurm_jobacct_gather_context ) ); + slurm_msg_t msg; + job_step_kill_msg_t req; + job_notify_msg_t notify_req; + + slurm_msg_t_init(&msg); + notify_req.job_id = jobacct_job_id; + notify_req.job_step_id = jobacct_step_id; + notify_req.message = "Exceeded job memory limit"; + msg.msg_type = REQUEST_JOB_NOTIFY; + msg.data = ¬ify_req; + slurm_send_only_controller_msg(&msg); - c->jobacct_gather_errno = SLURM_SUCCESS; + /* + * Request message: + */ + req.job_id = jobacct_job_id; + req.job_step_id = jobacct_step_id; + req.signal = SIGKILL; + req.batch_flag = 0; + msg.msg_type = REQUEST_CANCEL_JOB_STEP; + msg.data = &req; + + slurm_send_only_controller_msg(&msg); +} - /* Copy the job completion job completion type. */ - c->jobacct_gather_type = xstrdup( jobacct_gather_type ); - if ( c->jobacct_gather_type == NULL ) { - error( "can't make local copy of jobacct type" ); - xfree( c ); - return NULL; +static void _pack_jobacct_id(jobacct_id_t *jobacct_id, + uint16_t rpc_version, Buf buffer) +{ + if (jobacct_id) { + pack32((uint32_t) jobacct_id->nodeid, buffer); + pack16((uint16_t) jobacct_id->taskid, buffer); + } else { + pack32((uint32_t) 0, buffer); + pack16((uint16_t) 0, buffer); } +} - /* Plugin rack is demand-loaded on first reference. */ - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - c->jobacct_gather_errno = SLURM_SUCCESS; +static int _unpack_jobacct_id(jobacct_id_t *jobacct_id, + uint16_t rpc_version, Buf buffer) +{ + safe_unpack32(&jobacct_id->nodeid, buffer); + safe_unpack16(&jobacct_id->taskid, buffer); - return c; + return SLURM_SUCCESS; +unpack_error: + return SLURM_ERROR; } -static int -_slurm_jobacct_gather_context_destroy( slurm_jobacct_gather_context_t *c ) +static void _poll_data(void) { - int rc = SLURM_SUCCESS; - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } + if (jobacct_suspended) + return; - xfree( c->jobacct_gather_type ); - xfree( c ); + /* Update the data */ + slurm_mutex_lock(&task_list_lock); + (*(ops.poll_data))(task_list, pgid_plugin, cont_id); + slurm_mutex_unlock(&task_list_lock); +} - return rc; +static void _task_sleep(int rem) +{ + while (rem) + rem = sleep(rem); /* subject to interupt */ } -/* - * Resolve the operations from the plugin. + +/* _watch_tasks() -- monitor slurm jobs and track their memory usage + * + * IN, OUT: Irrelevant; this is invoked by pthread_create() */ -static slurm_jobacct_gather_ops_t * -_slurm_jobacct_gather_get_ops( slurm_jobacct_gather_context_t *c ) + +static void *_watch_tasks(void *arg) { - /* - * These strings must be in the same order as the fields declared - * for slurm_jobacct_gather_ops_t. - */ - static const char *syms[] = { - "jobacct_gather_p_create", - "jobacct_gather_p_destroy", - "jobacct_gather_p_setinfo", - "jobacct_gather_p_getinfo", - "jobacct_gather_p_pack", - "jobacct_gather_p_unpack", - "jobacct_gather_p_aggregate", - "jobacct_gather_p_startpoll", - "jobacct_gather_p_endpoll", - "jobacct_gather_p_change_poll", - "jobacct_gather_p_suspend_poll", - "jobacct_gather_p_resume_poll", - "jobacct_gather_p_set_proctrack_container_id", - "jobacct_gather_p_add_task", - "jobacct_gather_p_stat_task", - "jobacct_gather_p_remove_task", - "jobacct_gather_p_2_stats" - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - int rc = 0; - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->jobacct_gather_type, - n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->jobacct_gather_type, plugin_strerror(errno)); - return 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) { /* Do this until shutdown is requested */ + _poll_data(); + _task_sleep(freq); } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->jobacct_gather_type); - - /* Get the plugin list, if needed. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "Unable to create a plugin manager" ); - return NULL; - } - - plugrack_set_major_type( c->plugin_list, "jobacct_gather" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - /* Find the correct plugin. */ - c->cur_plugin = - plugrack_use_by_type( c->plugin_list, c->jobacct_gather_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "can't find a plugin for type %s", - c->jobacct_gather_type ); - return NULL; - } - - /* Dereference the API. */ - if ( (rc = plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops )) < n_syms ) { - error( "incomplete jobacct_gather plugin detected only " - "got %d out of %d", - rc, n_syms); - return NULL; - } - - return &c->ops; - + return NULL; } -static int _slurm_jobacct_gather_init(void) +extern int jobacct_gather_init(void) { - char *jobacct_gather_type = NULL; + char *plugin_type = "jobacct_gather"; + char *type = NULL; int retval=SLURM_SUCCESS; - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) + if (init_run && g_context) + return retval; + + slurm_mutex_lock(&g_context_lock); + if (g_context) goto done; - jobacct_gather_type = slurm_get_jobacct_gather_type(); - g_jobacct_gather_context = _slurm_jobacct_gather_context_create( - jobacct_gather_type); - if ( g_jobacct_gather_context == NULL ) { - error( "cannot create a context for %s", jobacct_gather_type ); + type = slurm_get_jobacct_gather_type(); + + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); + + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; goto done; } - if ( _slurm_jobacct_gather_get_ops( g_jobacct_gather_context ) - == NULL ) { - error( "cannot resolve job accounting plugin operations" ); - _slurm_jobacct_gather_context_destroy( - g_jobacct_gather_context); - g_jobacct_gather_context = NULL; - retval = SLURM_ERROR; + if (!strcasecmp(type, "jobacct_gather/none")) + goto done; + + plugin_type = type; + type = slurm_get_proctrack_type(); + if (!strcasecmp(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", + plugin_type); + pgid_plugin = true; + } + xfree(type); + xfree(plugin_type); + + type = slurm_get_accounting_storage_type(); + if (!strcasecmp(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 " + "need to change it.", ACCOUNTING_STORAGE_TYPE_NONE); } + init_run = true; done: - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - xfree(jobacct_gather_type); + slurm_mutex_unlock(&g_context_lock); + xfree(type); return(retval); } -extern int slurm_jobacct_gather_init(void) -{ - if (_slurm_jobacct_gather_init() < 0) - return SLURM_ERROR; - - return SLURM_SUCCESS; -} - -extern int slurm_jobacct_gather_fini(void) +extern int jobacct_gather_fini(void) { int rc = SLURM_SUCCESS; - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if (g_jobacct_gather_context) { - rc = _slurm_jobacct_gather_context_destroy( - g_jobacct_gather_context); - g_jobacct_gather_context = NULL; + slurm_mutex_lock(&g_context_lock); + if (g_context) { + init_run = false; + rc = plugin_context_destroy(g_context); + g_context = NULL; } - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); + slurm_mutex_unlock(&g_context_lock); return rc; } -extern jobacctinfo_t *jobacct_gather_g_create(jobacct_id_t *jobacct_id) +extern int jobacct_gather_startpoll(uint16_t frequency) { - jobacctinfo_t *jobacct = NULL; + int retval = SLURM_SUCCESS; + pthread_attr_t attr; + pthread_t _watch_tasks_thread_id; - if (_slurm_jobacct_gather_init() < 0) - return jobacct; + if (jobacct_gather_init() < 0) + return SLURM_ERROR; - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - jobacct = (*(g_jobacct_gather_context-> - ops.jobacct_gather_create))(jobacct_id); + if (!jobacct_shutdown) { + error("jobacct_gather_startpoll: poll already started!"); + return retval; + } - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return jobacct; -} + jobacct_shutdown = false; -extern void jobacct_gather_g_destroy(jobacctinfo_t *jobacct) -{ - if (_slurm_jobacct_gather_init() < 0) - return; + freq = frequency; - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - (*(g_jobacct_gather_context->ops.jobacct_gather_destroy)) - (jobacct); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return; -} + task_list = list_create(jobacctinfo_destroy); + if (frequency == 0) { /* don't want dynamic monitoring? */ + debug2("jobacct AIX dynamic logging disabled"); + return retval; + } -extern int jobacct_gather_g_setinfo(jobacctinfo_t *jobacct, - enum jobacct_data_type type, void *data) -{ - int retval = SLURM_SUCCESS; + /* create polling thread */ + slurm_attr_init(&attr); + if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)) + error("pthread_attr_setdetachstate error %m"); - if (_slurm_jobacct_gather_init() < 0) - return SLURM_ERROR; + if (pthread_create(&_watch_tasks_thread_id, &attr, + &_watch_tasks, NULL)) { + debug("jobacct-gather failed to create _watch_tasks " + "thread: %m"); + frequency = 0; + } else + debug3("jobacct-gather AIX dynamic logging enabled"); + slurm_attr_destroy(&attr); - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - retval = (*(g_jobacct_gather_context-> - ops.jobacct_gather_setinfo))(jobacct, type, data); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); return retval; } -extern int jobacct_gather_g_getinfo(jobacctinfo_t *jobacct, - enum jobacct_data_type type, void *data) +extern int jobacct_gather_endpoll() { int retval = SLURM_SUCCESS; - if (_slurm_jobacct_gather_init() < 0) + if (jobacct_gather_init() < 0) return SLURM_ERROR; - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - retval = (*(g_jobacct_gather_context-> - ops.jobacct_gather_getinfo))(jobacct, type, data); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); + jobacct_shutdown = true; + slurm_mutex_lock(&task_list_lock); + if(task_list) + list_destroy(task_list); + task_list = NULL; + slurm_mutex_unlock(&task_list_lock); + + retval = (*(ops.endpoll))(); + return retval; } -extern void jobacct_gather_g_pack(jobacctinfo_t *jobacct, - uint16_t rpc_version, Buf buffer) +extern void jobacct_gather_change_poll(uint16_t frequency) { - if (_slurm_jobacct_gather_init() < 0) + if (jobacct_gather_init() < 0) return; - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - (*(g_jobacct_gather_context->ops.jobacct_gather_pack)) - (jobacct, rpc_version, buffer); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); + if (freq == 0 && frequency != 0) { + pthread_attr_t attr; + pthread_t _watch_tasks_thread_id; + /* 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, + &_watch_tasks, NULL)) { + debug("jobacct-gather failed to create _watch_tasks " + "thread: %m"); + frequency = 0; + } + else + debug3("jobacct-gather LINUX dynamic logging enabled"); + slurm_attr_destroy(&attr); + jobacct_shutdown = false; + } + + freq = frequency; + debug("jobacct-gather: frequency changed = %d", frequency); + if (freq == 0) + jobacct_shutdown = true; return; } -extern int jobacct_gather_g_unpack(jobacctinfo_t **jobacct, - uint16_t rpc_version, Buf buffer) +extern void jobacct_gather_suspend_poll() { - int retval = SLURM_SUCCESS; + jobacct_suspended = true; +} - if (_slurm_jobacct_gather_init() < 0) +extern void jobacct_gather_resume_poll() +{ + jobacct_suspended = false; +} + +extern int jobacct_gather_add_task(pid_t pid, jobacct_id_t *jobacct_id) +{ + struct jobacctinfo *jobacct; + + if (jobacct_gather_init() < 0) return SLURM_ERROR; - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - retval = (*(g_jobacct_gather_context-> - ops.jobacct_gather_unpack)) - (jobacct, rpc_version, buffer); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return retval; + if (jobacct_shutdown) + return SLURM_ERROR; + + jobacct = jobacctinfo_create(jobacct_id); + + slurm_mutex_lock(&task_list_lock); + if (pid <= 0) { + error("invalid pid given (%d) for task acct", pid); + goto error; + } else if (!task_list) { + error("no task list created!"); + goto error; + } + + jobacct->pid = pid; + jobacct->min_cpu = 0; + debug2("adding task %u pid %d on node %u to jobacct", + jobacct_id->taskid, pid, jobacct_id->nodeid); + list_push(task_list, jobacct); + slurm_mutex_unlock(&task_list_lock); + + (*(ops.add_task))(pid, jobacct_id); + + return SLURM_SUCCESS; +error: + slurm_mutex_unlock(&task_list_lock); + jobacctinfo_destroy(jobacct); + return SLURM_ERROR; } -extern void jobacct_gather_g_aggregate(jobacctinfo_t *dest, - jobacctinfo_t *from) +extern jobacctinfo_t *jobacct_gather_stat_task(pid_t pid) { - if (_slurm_jobacct_gather_init() < 0) - return; + if (jobacct_shutdown) + return NULL; + else if (pid) { + struct jobacctinfo *jobacct = NULL; + struct jobacctinfo *ret_jobacct = NULL; + ListIterator itr = NULL; - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - (*(g_jobacct_gather_context->ops.jobacct_gather_aggregate)) - (dest, from); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return; + _poll_data(); + + slurm_mutex_lock(&task_list_lock); + if (!task_list) { + error("no task list created!"); + goto error; + } + + itr = list_iterator_create(task_list); + while((jobacct = list_next(itr))) { + if(jobacct->pid == pid) + break; + } + list_iterator_destroy(itr); + if (jobacct == NULL) + goto error; + ret_jobacct = xmalloc(sizeof(struct jobacctinfo)); + memcpy(ret_jobacct, jobacct, sizeof(struct jobacctinfo)); + error: + slurm_mutex_unlock(&task_list_lock); + return ret_jobacct; + } else { + /* In this situation, we are just trying to get a + * basis of information since we are not pollng. So + * we will give a chance for processes to spawn before we + * gather information. 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); + _poll_data(); + return NULL; + } } -extern int jobacct_gather_g_startpoll(uint16_t frequency) +extern jobacctinfo_t *jobacct_gather_remove_task(pid_t pid) { - int retval = SLURM_SUCCESS; - if (_slurm_jobacct_gather_init() < 0) - return SLURM_ERROR; + struct jobacctinfo *jobacct = NULL; + ListIterator itr = NULL; - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - retval = (*(g_jobacct_gather_context->ops.jobacct_gather_startpoll)) - (frequency); + if (jobacct_shutdown) + return NULL; - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return retval; + slurm_mutex_lock(&task_list_lock); + if (!task_list) { + error("no task list created!"); + goto error; + } + + itr = list_iterator_create(task_list); + while((jobacct = list_next(itr))) { + if(jobacct->pid == pid) { + list_remove(itr); + break; + } + } + list_iterator_destroy(itr); + if(jobacct) { + debug2("removing task %u pid %d from jobacct", + jobacct->max_vsize_id.taskid, jobacct->pid); + } else { + debug2("pid(%d) not being watched in jobacct!", pid); + } +error: + slurm_mutex_unlock(&task_list_lock); + return jobacct; } -extern int jobacct_gather_g_endpoll() +extern int jobacct_gather_set_proctrack_container_id(uint64_t id) { - int retval = SLURM_SUCCESS; - if (_slurm_jobacct_gather_init() < 0) + if (pgid_plugin) + return SLURM_SUCCESS; + + if (cont_id != (uint64_t)NO_VAL) + info("Warning: jobacct: set_proctrack_container_id: cont_id " + "is already set to %"PRIu64" you are setting it to " + "%"PRIu64"", cont_id, id); + if (id <= 0) { + error("jobacct: set_proctrack_container_id: " + "I was given most likely an unset cont_id %"PRIu64"", + id); return SLURM_ERROR; + } + cont_id = id; - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - retval = (*(g_jobacct_gather_context->ops.jobacct_gather_endpoll))(); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return retval; + return SLURM_SUCCESS; } -extern void jobacct_gather_g_change_poll(uint16_t frequency) +extern int jobacct_gather_set_mem_limit(uint32_t job_id, uint32_t step_id, + uint32_t mem_limit) { - if (_slurm_jobacct_gather_init() < 0) - return; - - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - (*(g_jobacct_gather_context->ops.jobacct_gather_change_poll)) - (frequency); + if ((job_id == 0) || (mem_limit == 0)) { + error("jobacct_gather_set_mem_limit: jobid:%u mem_limit:%u", + job_id, mem_limit); + return SLURM_ERROR; + } - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); + jobacct_job_id = job_id; + jobacct_step_id = step_id; + jobacct_mem_limit = mem_limit * 1024; /* MB to KB */ + jobacct_vmem_limit = jobacct_mem_limit; + jobacct_vmem_limit *= (slurm_get_vsize_factor() / 100.0); + return SLURM_SUCCESS; } -extern void jobacct_gather_g_suspend_poll() +extern void jobacct_gather_handle_mem_limit( + uint32_t total_job_mem, uint32_t total_job_vsize) { - if (_slurm_jobacct_gather_init() < 0) - return; - - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - (*(g_jobacct_gather_context->ops.jobacct_gather_suspend_poll))(); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return; + if (jobacct_mem_limit) { + if (jobacct_step_id == NO_VAL) { + debug("Job %u memory used:%u limit:%u KB", + jobacct_job_id, total_job_mem, jobacct_mem_limit); + } else { + debug("Step %u.%u memory used:%u limit:%u KB", + jobacct_job_id, jobacct_step_id, + total_job_mem, jobacct_mem_limit); + } + } + if (jobacct_job_id && jobacct_mem_limit && + (total_job_mem > jobacct_mem_limit)) { + if (jobacct_step_id == NO_VAL) { + error("Job %u exceeded %u KB memory limit, being " + "killed", jobacct_job_id, jobacct_mem_limit); + } else { + error("Step %u.%u exceeded %u KB memory limit, being " + "killed", jobacct_job_id, jobacct_step_id, + jobacct_mem_limit); + } + _acct_kill_step(); + } else if (jobacct_job_id && jobacct_vmem_limit && + (total_job_vsize > jobacct_vmem_limit)) { + if (jobacct_step_id == NO_VAL) { + error("Job %u exceeded %u KB virtual memory limit, " + "being killed", jobacct_job_id, + jobacct_vmem_limit); + } else { + error("Step %u.%u exceeded %u KB virtual memory " + "limit, being killed", jobacct_job_id, + jobacct_step_id, jobacct_vmem_limit); + } + _acct_kill_step(); + } } -extern void jobacct_gather_g_resume_poll() +/********************* jobacctinfo functions ******************************/ + +extern jobacctinfo_t *jobacctinfo_create(jobacct_id_t *jobacct_id) { - if (_slurm_jobacct_gather_init() < 0) - return; + struct jobacctinfo *jobacct = xmalloc(sizeof(struct jobacctinfo)); - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - (*(g_jobacct_gather_context->ops.jobacct_gather_resume_poll))(); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return; + if (!jobacct_id) { + jobacct_id_t temp_id; + temp_id.taskid = (uint16_t)NO_VAL; + temp_id.nodeid = (uint32_t)NO_VAL; + jobacct_id = &temp_id; + } + memset(jobacct, 0, sizeof(struct jobacctinfo)); + jobacct->sys_cpu_sec = 0; + jobacct->sys_cpu_usec = 0; + jobacct->user_cpu_sec = 0; + jobacct->user_cpu_usec = 0; + + jobacct->max_vsize = 0; + memcpy(&jobacct->max_vsize_id, jobacct_id, sizeof(jobacct_id_t)); + jobacct->tot_vsize = 0; + jobacct->max_rss = 0; + memcpy(&jobacct->max_rss_id, jobacct_id, sizeof(jobacct_id_t)); + jobacct->tot_rss = 0; + jobacct->max_pages = 0; + memcpy(&jobacct->max_pages_id, jobacct_id, sizeof(jobacct_id_t)); + jobacct->tot_pages = 0; + jobacct->min_cpu = (uint32_t)NO_VAL; + memcpy(&jobacct->min_cpu_id, jobacct_id, sizeof(jobacct_id_t)); + jobacct->tot_cpu = 0; + + return jobacct; } -extern int jobacct_gather_g_set_proctrack_container_id(uint64_t id) +extern void jobacctinfo_destroy(void *object) { - int retval = SLURM_SUCCESS; - if (_slurm_jobacct_gather_init() < 0) - return SLURM_ERROR; + struct jobacctinfo *jobacct = (struct jobacctinfo *)object; + xfree(jobacct); +} - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - retval = (*(g_jobacct_gather_context->ops. - jobacct_gather_set_proctrack_container_id))(id); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return retval; +extern int jobacctinfo_setinfo(jobacctinfo_t *jobacct, + enum jobacct_data_type type, void *data) +{ + int rc = SLURM_SUCCESS; + int *fd = (int *)data; + struct rusage *rusage = (struct rusage *)data; + uint32_t *uint32 = (uint32_t *) data; + jobacct_id_t *jobacct_id = (jobacct_id_t *) data; + struct jobacctinfo *send = (struct jobacctinfo *) data; + + switch (type) { + case JOBACCT_DATA_TOTAL: + memcpy(jobacct, send, sizeof(struct jobacctinfo)); + break; + case JOBACCT_DATA_PIPE: + safe_write(*fd, jobacct, sizeof(struct jobacctinfo)); + break; + case JOBACCT_DATA_RUSAGE: + jobacct->user_cpu_sec = rusage->ru_utime.tv_sec; + jobacct->user_cpu_usec = rusage->ru_utime.tv_usec; + jobacct->sys_cpu_sec = rusage->ru_stime.tv_sec; + jobacct->sys_cpu_usec = rusage->ru_stime.tv_usec; + break; + case JOBACCT_DATA_MAX_RSS: + jobacct->max_rss = *uint32; + break; + case JOBACCT_DATA_MAX_RSS_ID: + jobacct->max_rss_id = *jobacct_id; + break; + case JOBACCT_DATA_TOT_RSS: + jobacct->tot_rss = *uint32; + break; + case JOBACCT_DATA_MAX_VSIZE: + jobacct->max_vsize = *uint32; + break; + case JOBACCT_DATA_MAX_VSIZE_ID: + jobacct->max_vsize_id = *jobacct_id; + break; + case JOBACCT_DATA_TOT_VSIZE: + jobacct->tot_vsize = *uint32; + break; + case JOBACCT_DATA_MAX_PAGES: + jobacct->max_pages = *uint32; + break; + case JOBACCT_DATA_MAX_PAGES_ID: + jobacct->max_pages_id = *jobacct_id; + break; + case JOBACCT_DATA_TOT_PAGES: + jobacct->tot_pages = *uint32; + break; + case JOBACCT_DATA_MIN_CPU: + jobacct->min_cpu = *uint32; + break; + case JOBACCT_DATA_MIN_CPU_ID: + jobacct->min_cpu_id = *jobacct_id; + break; + case JOBACCT_DATA_TOT_CPU: + jobacct->tot_cpu = *uint32; + break; + default: + debug("jobacct_g_set_setinfo data_type %d invalid", type); + } + return rc; +rwfail: + return SLURM_ERROR; } -extern int jobacct_gather_g_add_task(pid_t pid, jobacct_id_t *jobacct_id) +extern int jobacctinfo_getinfo( + jobacctinfo_t *jobacct, enum jobacct_data_type type, void *data) { - int retval = SLURM_SUCCESS; - if (_slurm_jobacct_gather_init() < 0) - return SLURM_ERROR; - - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - retval = (*(g_jobacct_gather_context-> - ops.jobacct_gather_add_task))(pid, jobacct_id); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return retval; + int rc = SLURM_SUCCESS; + int *fd = (int *)data; + uint32_t *uint32 = (uint32_t *) data; + jobacct_id_t *jobacct_id = (jobacct_id_t *) data; + struct rusage *rusage = (struct rusage *)data; + struct jobacctinfo *send = (struct jobacctinfo *) data; + + switch (type) { + case JOBACCT_DATA_TOTAL: + memcpy(send, jobacct, sizeof(struct jobacctinfo)); + break; + case JOBACCT_DATA_PIPE: + safe_read(*fd, jobacct, sizeof(struct jobacctinfo)); + break; + case JOBACCT_DATA_RUSAGE: + memset(rusage, 0, sizeof(struct rusage)); + rusage->ru_utime.tv_sec = jobacct->user_cpu_sec; + rusage->ru_utime.tv_usec = jobacct->user_cpu_usec; + rusage->ru_stime.tv_sec = jobacct->sys_cpu_sec; + rusage->ru_stime.tv_usec = jobacct->sys_cpu_usec; + break; + case JOBACCT_DATA_MAX_RSS: + *uint32 = jobacct->max_rss; + break; + case JOBACCT_DATA_MAX_RSS_ID: + *jobacct_id = jobacct->max_rss_id; + break; + case JOBACCT_DATA_TOT_RSS: + *uint32 = jobacct->tot_rss; + break; + case JOBACCT_DATA_MAX_VSIZE: + *uint32 = jobacct->max_vsize; + break; + case JOBACCT_DATA_MAX_VSIZE_ID: + *jobacct_id = jobacct->max_vsize_id; + break; + case JOBACCT_DATA_TOT_VSIZE: + *uint32 = jobacct->tot_vsize; + break; + case JOBACCT_DATA_MAX_PAGES: + *uint32 = jobacct->max_pages; + break; + case JOBACCT_DATA_MAX_PAGES_ID: + *jobacct_id = jobacct->max_pages_id; + break; + case JOBACCT_DATA_TOT_PAGES: + *uint32 = jobacct->tot_pages; + break; + case JOBACCT_DATA_MIN_CPU: + *uint32 = jobacct->min_cpu; + break; + case JOBACCT_DATA_MIN_CPU_ID: + *jobacct_id = jobacct->min_cpu_id; + break; + case JOBACCT_DATA_TOT_CPU: + *uint32 = jobacct->tot_cpu; + break; + default: + debug("jobacct_g_set_getinfo data_type %d invalid", type); + } + return rc; +rwfail: + return SLURM_ERROR; } -extern jobacctinfo_t *jobacct_gather_g_stat_task(pid_t pid) +extern void jobacctinfo_pack( + jobacctinfo_t *jobacct, uint16_t rpc_version, Buf buffer) { - jobacctinfo_t *jobacct = NULL; - if (_slurm_jobacct_gather_init() < 0) - return jobacct; - - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - jobacct = (*(g_jobacct_gather_context-> - ops.jobacct_gather_stat_task))(pid); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return jobacct; + int i = 0; + + if (!jobacct) { + for (i = 0; i < 12; i++) + pack32((uint32_t) 0, buffer); + for (i = 0; i < 4; i++) + _pack_jobacct_id(NULL, rpc_version, buffer); + return; + } + + pack32((uint32_t)jobacct->user_cpu_sec, buffer); + pack32((uint32_t)jobacct->user_cpu_usec, buffer); + pack32((uint32_t)jobacct->sys_cpu_sec, buffer); + pack32((uint32_t)jobacct->sys_cpu_usec, buffer); + pack32((uint32_t)jobacct->max_vsize, buffer); + pack32((uint32_t)jobacct->tot_vsize, buffer); + pack32((uint32_t)jobacct->max_rss, buffer); + pack32((uint32_t)jobacct->tot_rss, buffer); + pack32((uint32_t)jobacct->max_pages, buffer); + pack32((uint32_t)jobacct->tot_pages, buffer); + pack32((uint32_t)jobacct->min_cpu, buffer); + pack32((uint32_t)jobacct->tot_cpu, buffer); + + _pack_jobacct_id(&jobacct->max_vsize_id, rpc_version, buffer); + _pack_jobacct_id(&jobacct->max_rss_id, rpc_version, buffer); + _pack_jobacct_id(&jobacct->max_pages_id, rpc_version, buffer); + _pack_jobacct_id(&jobacct->min_cpu_id, rpc_version, buffer); } -extern jobacctinfo_t *jobacct_gather_g_remove_task(pid_t pid) +extern int jobacctinfo_unpack( + jobacctinfo_t **jobacct, uint16_t rpc_version, Buf buffer) { - jobacctinfo_t *jobacct = NULL; - if (_slurm_jobacct_gather_init() < 0) - return jobacct; - - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - jobacct = (*(g_jobacct_gather_context-> - ops.jobacct_gather_remove_task))(pid); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return jobacct; + uint32_t uint32_tmp; + + *jobacct = xmalloc(sizeof(struct jobacctinfo)); + safe_unpack32(&uint32_tmp, buffer); + (*jobacct)->user_cpu_sec = uint32_tmp; + safe_unpack32(&uint32_tmp, buffer); + (*jobacct)->user_cpu_usec = uint32_tmp; + safe_unpack32(&uint32_tmp, buffer); + (*jobacct)->sys_cpu_sec = uint32_tmp; + safe_unpack32(&uint32_tmp, buffer); + (*jobacct)->sys_cpu_usec = uint32_tmp; + safe_unpack32(&(*jobacct)->max_vsize, buffer); + safe_unpack32(&(*jobacct)->tot_vsize, buffer); + safe_unpack32(&(*jobacct)->max_rss, buffer); + safe_unpack32(&(*jobacct)->tot_rss, buffer); + safe_unpack32(&(*jobacct)->max_pages, buffer); + safe_unpack32(&(*jobacct)->tot_pages, buffer); + safe_unpack32(&(*jobacct)->min_cpu, buffer); + safe_unpack32(&(*jobacct)->tot_cpu, buffer); + + if (_unpack_jobacct_id(&(*jobacct)->max_vsize_id, rpc_version, buffer) + != SLURM_SUCCESS) + goto unpack_error; + if (_unpack_jobacct_id(&(*jobacct)->max_rss_id, rpc_version, buffer) + != SLURM_SUCCESS) + goto unpack_error; + if (_unpack_jobacct_id(&(*jobacct)->max_pages_id, rpc_version, buffer) + != SLURM_SUCCESS) + goto unpack_error; + if (_unpack_jobacct_id(&(*jobacct)->min_cpu_id, rpc_version, buffer) + != SLURM_SUCCESS) + goto unpack_error; + + return SLURM_SUCCESS; + +unpack_error: + debug2("jobacctinfo_unpack:" + "unpack_error: size_buf(buffer) %u", + size_buf(buffer)); + xfree(*jobacct); + return SLURM_ERROR; } -extern void jobacct_gather_g_2_stats(slurmdb_stats_t *stats, - jobacctinfo_t *jobacct) +extern void jobacctinfo_aggregate(jobacctinfo_t *dest, jobacctinfo_t *from) { - if (_slurm_jobacct_gather_init() < 0) + xassert(dest); + + if (!from) return; - slurm_mutex_lock( &g_jobacct_gather_context_lock ); - if ( g_jobacct_gather_context ) - (*(g_jobacct_gather_context->ops.jobacct_gather_2_stats)) - (stats, jobacct); - slurm_mutex_unlock( &g_jobacct_gather_context_lock ); - return; + if (dest->max_vsize < from->max_vsize) { + dest->max_vsize = from->max_vsize; + dest->max_vsize_id = from->max_vsize_id; + } + dest->tot_vsize += from->tot_vsize; + + if (dest->max_rss < from->max_rss) { + dest->max_rss = from->max_rss; + dest->max_rss_id = from->max_rss_id; + } + dest->tot_rss += from->tot_rss; + + if (dest->max_pages < from->max_pages) { + dest->max_pages = from->max_pages; + dest->max_pages_id = from->max_pages_id; + } + dest->tot_pages += from->tot_pages; + + if ((dest->min_cpu > from->min_cpu) + || (dest->min_cpu == (uint32_t)NO_VAL)) { + if (from->min_cpu == (uint32_t)NO_VAL) + from->min_cpu = 0; + dest->min_cpu = from->min_cpu; + dest->min_cpu_id = from->min_cpu_id; + } + dest->tot_cpu += from->tot_cpu; + + if (dest->max_vsize_id.taskid == (uint16_t)NO_VAL) + dest->max_vsize_id = from->max_vsize_id; + + if (dest->max_rss_id.taskid == (uint16_t)NO_VAL) + dest->max_rss_id = from->max_rss_id; + + if (dest->max_pages_id.taskid == (uint16_t)NO_VAL) + dest->max_pages_id = from->max_pages_id; + + if (dest->min_cpu_id.taskid == (uint16_t)NO_VAL) + dest->min_cpu_id = from->min_cpu_id; + + dest->user_cpu_sec += from->user_cpu_sec; + dest->user_cpu_usec += from->user_cpu_usec; + while (dest->user_cpu_usec >= 1E6) { + dest->user_cpu_sec++; + dest->user_cpu_usec -= 1E6; + } + dest->sys_cpu_sec += from->sys_cpu_sec; + dest->sys_cpu_usec += from->sys_cpu_usec; + while (dest->sys_cpu_usec >= 1E6) { + dest->sys_cpu_sec++; + dest->sys_cpu_usec -= 1E6; + } +} + +extern void jobacctinfo_2_stats(slurmdb_stats_t *stats, jobacctinfo_t *jobacct) +{ + xassert(jobacct); + xassert(stats); + + stats->vsize_max = jobacct->max_vsize; + stats->vsize_max_nodeid = jobacct->max_vsize_id.nodeid; + stats->vsize_max_taskid = jobacct->max_vsize_id.taskid; + stats->vsize_ave = (double)jobacct->tot_vsize; + stats->rss_max = jobacct->max_rss; + stats->rss_max_nodeid = jobacct->max_rss_id.nodeid; + stats->rss_max_taskid = jobacct->max_rss_id.taskid; + stats->rss_ave = (double)jobacct->tot_rss; + stats->pages_max = jobacct->max_pages; + stats->pages_max_nodeid = jobacct->max_pages_id.nodeid; + stats->pages_max_taskid = jobacct->max_pages_id.taskid; + stats->pages_ave = (double)jobacct->tot_pages; + stats->cpu_min = jobacct->min_cpu; + stats->cpu_min_nodeid = jobacct->min_cpu_id.nodeid; + stats->cpu_min_taskid = jobacct->min_cpu_id.taskid; + stats->cpu_ave = (double)jobacct->tot_cpu; } diff --git a/src/common/slurm_jobacct_gather.h b/src/common/slurm_jobacct_gather.h index 62a3ed578d08f8900c0fee93ab3414dffc3ca211..d798c647b8842c963559e3eb67d3fc84a6710afa 100644 --- a/src/common/slurm_jobacct_gather.h +++ b/src/common/slurm_jobacct_gather.h @@ -76,40 +76,81 @@ #include "src/common/pack.h" #include "src/common/list.h" #include "src/common/xmalloc.h" -#include "src/common/jobacct_common.h" - -extern int slurm_jobacct_gather_init(void); /* load the plugin */ -extern int slurm_jobacct_gather_fini(void); /* unload the plugin */ - -extern jobacctinfo_t *jobacct_gather_g_create(jobacct_id_t *jobacct_id); -extern void jobacct_gather_g_destroy(jobacctinfo_t *jobacct); -extern int jobacct_gather_g_setinfo(jobacctinfo_t *jobacct, - enum jobacct_data_type type, void *data); -extern int jobacct_gather_g_getinfo(jobacctinfo_t *jobacct, - enum jobacct_data_type type, void *data); -extern void jobacct_gather_g_pack(jobacctinfo_t *jobacct, - uint16_t rpc_version, Buf buffer); -extern int jobacct_gather_g_unpack(jobacctinfo_t **jobacct, - uint16_t rpc_version, Buf buffer); - -extern void jobacct_gather_g_aggregate(jobacctinfo_t *dest, - jobacctinfo_t *from); - -extern void jobacct_gather_g_change_poll(uint16_t frequency); -extern int jobacct_gather_g_startpoll(uint16_t frequency); -extern int jobacct_gather_g_endpoll(); -extern void jobacct_gather_g_suspend_poll(); -extern void jobacct_gather_g_resume_poll(); - -extern int jobacct_gather_g_set_proctrack_container_id(uint64_t id); -extern int jobacct_gather_g_add_task(pid_t pid, jobacct_id_t *jobacct_id); + +#include "src/slurmd/slurmstepd/slurmstepd_job.h" + +#define FDUMP_FLAG 0x04 + +typedef struct { + uint16_t taskid; /* contains which task number it was on */ + uint32_t nodeid; /* contains which node number it was on */ + slurmd_job_t *job; /* contains slurmd job pointer */ +} jobacct_id_t; + +struct jobacctinfo { + pid_t pid; + uint32_t sys_cpu_sec; + uint32_t sys_cpu_usec; + uint32_t user_cpu_sec; + uint32_t user_cpu_usec; + uint32_t max_vsize; /* max size of virtual memory */ + jobacct_id_t max_vsize_id; /* contains which task number it was on */ + uint32_t tot_vsize; /* total virtual memory + (used to figure out ave later) */ + uint32_t max_rss; /* max Resident Set Size */ + jobacct_id_t max_rss_id; /* contains which task it was on */ + uint32_t tot_rss; /* total rss + (used to figure out ave later) */ + uint32_t max_pages; /* max pages */ + jobacct_id_t max_pages_id; /* contains which task it was on */ + uint32_t tot_pages; /* total pages + (used to figure out ave later) */ + uint32_t min_cpu; /* min cpu time */ + jobacct_id_t min_cpu_id; /* contains which task it was on */ + uint32_t tot_cpu; /* total cpu time(used to figure out ave later) */ +}; + +/* Define jobacctinfo_t below to avoid including extraneous slurm headers */ +#ifndef __jobacctinfo_t_defined +# define __jobacctinfo_t_defined + typedef struct jobacctinfo jobacctinfo_t; /* opaque data type */ +#endif + +extern int jobacct_gather_init(void); /* load the plugin */ +extern int jobacct_gather_fini(void); /* unload the plugin */ + +extern int jobacct_gather_startpoll(uint16_t frequency); +extern int jobacct_gather_endpoll(); +extern void jobacct_gather_change_poll(uint16_t frequency); +extern void jobacct_gather_suspend_poll(); +extern void jobacct_gather_resume_poll(); + +extern int jobacct_gather_add_task(pid_t pid, jobacct_id_t *jobacct_id); /* must free jobacctinfo_t if not NULL */ -extern jobacctinfo_t *jobacct_gather_g_stat_task(pid_t pid); +extern jobacctinfo_t *jobacct_gather_stat_task(pid_t pid); /* must free jobacctinfo_t if not NULL */ -extern jobacctinfo_t *jobacct_gather_g_remove_task(pid_t pid); - -extern void jobacct_gather_g_2_stats(slurmdb_stats_t *stats, - jobacctinfo_t *jobacct); +extern jobacctinfo_t *jobacct_gather_remove_task(pid_t pid); + +extern int jobacct_gather_set_proctrack_container_id(uint64_t id); +extern int jobacct_gather_set_mem_limit(uint32_t job_id, uint32_t step_id, + uint32_t mem_limit); +extern void jobacct_gather_handle_mem_limit( + uint32_t total_job_mem, uint32_t total_job_vsize); + +extern jobacctinfo_t *jobacctinfo_create(jobacct_id_t *jobacct_id); +extern void jobacctinfo_destroy(void *object); +extern int jobacctinfo_setinfo(jobacctinfo_t *jobacct, + enum jobacct_data_type type, void *data); +extern int jobacctinfo_getinfo(jobacctinfo_t *jobacct, + enum jobacct_data_type type, void *data); +extern void jobacctinfo_pack(jobacctinfo_t *jobacct, + uint16_t rpc_version, Buf buffer); +extern int jobacctinfo_unpack(jobacctinfo_t **jobacct, + uint16_t rpc_version, Buf buffer); + +extern void jobacctinfo_aggregate(jobacctinfo_t *dest, jobacctinfo_t *from); + +extern void jobacctinfo_2_stats(slurmdb_stats_t *stats, jobacctinfo_t *jobacct); #endif /*__SLURM_JOBACCT_GATHER_H__*/ diff --git a/src/common/slurm_jobcomp.c b/src/common/slurm_jobcomp.c index 4abd0a447035d522e5f3c1fe7c38260e20690231..bacac57f701dc6766574c3f02741dcb9a7b31c0c 100644 --- a/src/common/slurm_jobcomp.c +++ b/src/common/slurm_jobcomp.c @@ -1,3 +1,4 @@ + /*****************************************************************************\ * slurm_jobcomp.c - implementation-independent job completion logging * functions @@ -70,147 +71,23 @@ typedef struct slurm_jobcomp_ops { int (*archive) ( slurmdb_archive_cond_t *params ); } slurm_jobcomp_ops_t; - /* - * A global job completion context. "Global" in the sense that there's - * only one, with static bindings. We don't export it. + * These strings must be kept in the same order as the fields + * declared for slurm_jobcomp_ops_t. */ - -struct slurm_jobcomp_context { - char * jobcomp_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int jobcomp_errno; - slurm_jobcomp_ops_t ops; +static const char *syms[] = { + "slurm_jobcomp_set_location", + "slurm_jobcomp_log_record", + "slurm_jobcomp_get_errno", + "slurm_jobcomp_strerror", + "slurm_jobcomp_get_jobs", + "slurm_jobcomp_archive" }; -static slurm_jobcomp_context_t g_context = NULL; -static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER; - -static slurm_jobcomp_context_t -_slurm_jobcomp_context_create( const char *jobcomp_type) -{ - slurm_jobcomp_context_t c; - - if ( jobcomp_type == NULL ) { - debug3( "_slurm_jobcomp_context_create: no jobcomp type" ); - return NULL; - } - - c = xmalloc( sizeof( struct slurm_jobcomp_context ) ); - - c->jobcomp_errno = SLURM_SUCCESS; - - /* Copy the job completion job completion type. */ - c->jobcomp_type = xstrdup( jobcomp_type ); - if ( c->jobcomp_type == NULL ) { - debug3( "can't make local copy of jobcomp type" ); - xfree( c ); - return NULL; - } - - /* Plugin rack is demand-loaded on first reference. */ - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - - return c; -} - -static int -_slurm_jobcomp_context_destroy( slurm_jobcomp_context_t c ) -{ - int rc = SLURM_SUCCESS; - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree( c->jobcomp_type ); - xfree( c ); - - return rc; -} - -/* - * Resolve the operations from the plugin. - */ -static slurm_jobcomp_ops_t * -_slurm_jobcomp_get_ops( slurm_jobcomp_context_t c ) -{ - /* - * These strings must be kept in the same order as the fields - * declared for slurm_jobcomp_ops_t. - */ - static const char *syms[] = { - "slurm_jobcomp_set_location", - "slurm_jobcomp_log_record", - "slurm_jobcomp_get_errno", - "slurm_jobcomp_strerror", - "slurm_jobcomp_get_jobs", - "slurm_jobcomp_archive" - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->jobcomp_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->jobcomp_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->jobcomp_type); - - /* Get the plugin list, if needed. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "Unable to create a plugin manager" ); - return NULL; - } - - plugrack_set_major_type( c->plugin_list, "jobcomp" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - /* Find the correct plugin. */ - c->cur_plugin = - plugrack_use_by_type( c->plugin_list, c->jobcomp_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "can't find a plugin for type %s", c->jobcomp_type ); - return NULL; - } - - /* Dereference the API. */ - if ( plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops ) < n_syms ) { - error( "incomplete jobcomp plugin detected" ); - return NULL; - } - - return &c->ops; -} +static slurm_jobcomp_ops_t ops; +static plugin_context_t *g_context = NULL; +static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER; +static bool init_run = false; extern void jobcomp_destroy_job(void *object) @@ -241,33 +118,32 @@ extern int g_slurm_jobcomp_init( char *jobcomp_loc ) { int retval = SLURM_SUCCESS; - char *jobcomp_type; + char *plugin_type = "jobcomp"; + char *type; + + if (init_run && g_context) + return retval; slurm_mutex_lock( &context_lock ); - if ( g_context ) - _slurm_jobcomp_context_destroy(g_context); + if (g_context) + plugin_context_destroy(g_context); - jobcomp_type = slurm_get_jobcomp_type(); - g_context = _slurm_jobcomp_context_create( jobcomp_type ); - if ( g_context == NULL ) { - error( "cannot create a context for %s", jobcomp_type ); - xfree(jobcomp_type); - retval = SLURM_ERROR; - goto done; - } - xfree(jobcomp_type); + type = slurm_get_jobcomp_type(); + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); - if ( _slurm_jobcomp_get_ops( g_context ) == NULL ) { - error( "cannot resolve job completion plugin operations" ); - _slurm_jobcomp_context_destroy( g_context ); - g_context = NULL; + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; + goto done; } + init_run = true; done: - if ( g_context ) - retval = (*(g_context->ops.set_loc))(jobcomp_loc); + xfree(type); + if (g_context) + retval = (*(ops.set_loc))(jobcomp_loc); slurm_mutex_unlock( &context_lock ); return retval; } @@ -280,7 +156,8 @@ g_slurm_jobcomp_fini(void) if ( !g_context) goto done; - _slurm_jobcomp_context_destroy ( g_context ); + init_run = false; + plugin_context_destroy ( g_context ); g_context = NULL; done: @@ -295,7 +172,7 @@ g_slurm_jobcomp_write(struct job_record *job_ptr) slurm_mutex_lock( &context_lock ); if ( g_context ) - retval = (*(g_context->ops.job_write))(job_ptr); + retval = (*(ops.job_write))(job_ptr); else { error ("slurm_jobcomp plugin context not initialized"); retval = ENOENT; @@ -311,7 +188,7 @@ g_slurm_jobcomp_errno(void) slurm_mutex_lock( &context_lock ); if ( g_context ) - retval = (*(g_context->ops.sa_errno))(); + retval = (*(ops.sa_errno))(); else { error ("slurm_jobcomp plugin context not initialized"); retval = ENOENT; @@ -327,7 +204,7 @@ g_slurm_jobcomp_strerror(int errnum) slurm_mutex_lock( &context_lock ); if ( g_context ) - retval = (*(g_context->ops.job_strerror))(errnum); + retval = (*(ops.job_strerror))(errnum); else error ("slurm_jobcomp plugin context not initialized"); slurm_mutex_unlock( &context_lock ); @@ -341,7 +218,7 @@ g_slurm_jobcomp_get_jobs(slurmdb_job_cond_t *job_cond) slurm_mutex_lock( &context_lock ); if ( g_context ) - job_list = (*(g_context->ops.get_jobs))(job_cond); + job_list = (*(ops.get_jobs))(job_cond); else error ("slurm_jobcomp plugin context not initialized"); slurm_mutex_unlock( &context_lock ); @@ -355,7 +232,7 @@ g_slurm_jobcomp_archive(slurmdb_archive_cond_t *arch_cond) slurm_mutex_lock( &context_lock ); if ( g_context ) - rc = (*(g_context->ops.archive))(arch_cond); + rc = (*(ops.archive))(arch_cond); else error ("slurm_jobcomp plugin context not initialized"); slurm_mutex_unlock( &context_lock ); diff --git a/src/common/slurm_priority.c b/src/common/slurm_priority.c index ecb56b3b1acc93fecdc68b6d5a5172940fac29f6..9f8b52c522ebc6bb37391d87efb8c0e71793c30a 100644 --- a/src/common/slurm_priority.c +++ b/src/common/slurm_priority.c @@ -52,143 +52,21 @@ typedef struct slurm_priority_ops { (priority_factors_request_msg_t *req_msg, uid_t uid); } slurm_priority_ops_t; -typedef struct slurm_priority_context { - char *priority_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int priority_errno; - slurm_priority_ops_t ops; -} slurm_priority_context_t; - -static slurm_priority_context_t * g_priority_context = NULL; -static pthread_mutex_t g_priority_context_lock = - PTHREAD_MUTEX_INITIALIZER; - /* - * Local functions + * Must be synchronized with slurm_priority_ops_t above. */ -static slurm_priority_ops_t *_priority_get_ops( - slurm_priority_context_t *c); -static slurm_priority_context_t *_priority_context_create( - const char *priority_type); -static int _priority_context_destroy( - slurm_priority_context_t *c); - -/* - * Locate and load the appropriate plugin - */ -static slurm_priority_ops_t * _priority_get_ops( - slurm_priority_context_t *c) -{ - /* - * Must be synchronized with slurm_priority_ops_t above. - */ - static const char *syms[] = { - "priority_p_set", - "priority_p_reconfig", - "priority_p_set_assoc_usage", - "priority_p_calc_fs_factor", - "priority_p_get_priority_factors_list", - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->priority_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->priority_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->priority_type); - - /* Get plugin list. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "cannot create plugin manager" ); - return NULL; - } - plugrack_set_major_type( c->plugin_list, "priority" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - c->cur_plugin = plugrack_use_by_type( c->plugin_list, - c->priority_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "cannot find accounting_storage plugin for %s", - c->priority_type ); - return NULL; - } - - /* Dereference the API. */ - if ( plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops ) < n_syms ) { - error( "incomplete priority plugin detected" ); - return NULL; - } - - return &c->ops; -} - -/* - * Create a priority context - */ -static slurm_priority_context_t *_priority_context_create( - const char *priority_type) -{ - slurm_priority_context_t *c; - - if ( priority_type == NULL ) { - debug3( "_priority_context_create: no uler type" ); - return NULL; - } - - c = xmalloc( sizeof( slurm_priority_context_t ) ); - c->priority_type = xstrdup( priority_type ); - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - c->priority_errno = SLURM_SUCCESS; - - return c; -} - -/* - * Destroy a priority context - */ -static int _priority_context_destroy(slurm_priority_context_t *c) -{ - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - return SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree( c->priority_type ); - xfree( c ); - - return SLURM_SUCCESS; -} +static const char *syms[] = { + "priority_p_set", + "priority_p_reconfig", + "priority_p_set_assoc_usage", + "priority_p_calc_fs_factor", + "priority_p_get_priority_factors_list", +}; + +static slurm_priority_ops_t ops; +static plugin_context_t *g_priority_context = NULL; +static pthread_mutex_t g_priority_context_lock = PTHREAD_MUTEX_INITIALIZER; +static bool init_run = false; /* * Initialize context for priority plugin @@ -196,33 +74,32 @@ static int _priority_context_destroy(slurm_priority_context_t *c) extern int slurm_priority_init(void) { int retval = SLURM_SUCCESS; - char *priority_type = NULL; + char *plugin_type = "priority"; + char *type = NULL; + + if (init_run && g_priority_context) + return retval; - slurm_mutex_lock( &g_priority_context_lock ); + slurm_mutex_lock(&g_priority_context_lock); - if ( g_priority_context ) + if (g_priority_context) goto done; - priority_type = slurm_get_priority_type(); + type = slurm_get_priority_type(); - g_priority_context = _priority_context_create(priority_type); - if ( g_priority_context == NULL ) { - error( "cannot create priority context for %s", - priority_type ); - retval = SLURM_ERROR; - goto done; - } + g_priority_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); - if ( _priority_get_ops( g_priority_context ) == NULL ) { - error( "cannot resolve priority plugin operations" ); - _priority_context_destroy( g_priority_context ); - g_priority_context = NULL; + if (!g_priority_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; + goto done; } + init_run = true; done: - slurm_mutex_unlock( &g_priority_context_lock ); - xfree(priority_type); + slurm_mutex_unlock(&g_priority_context_lock); + xfree(type); return retval; } @@ -233,7 +110,8 @@ extern int slurm_priority_fini(void) if (!g_priority_context) return SLURM_SUCCESS; - rc = _priority_context_destroy( g_priority_context ); + init_run = false; + rc = plugin_context_destroy(g_priority_context); g_priority_context = NULL; return rc; } @@ -243,7 +121,7 @@ extern uint32_t priority_g_set(uint32_t last_prio, struct job_record *job_ptr) if (slurm_priority_init() < 0) return 0; - return (*(g_priority_context->ops.set))(last_prio, job_ptr); + return (*(ops.set))(last_prio, job_ptr); } extern void priority_g_reconfig(void) @@ -251,7 +129,7 @@ extern void priority_g_reconfig(void) if (slurm_priority_init() < 0) return; - (*(g_priority_context->ops.reconfig))(); + (*(ops.reconfig))(); return; } @@ -261,7 +139,7 @@ extern void priority_g_set_assoc_usage(slurmdb_association_rec_t *assoc) if (slurm_priority_init() < 0) return; - (*(g_priority_context->ops.set_assoc_usage))(assoc); + (*(ops.set_assoc_usage))(assoc); return; } @@ -271,7 +149,7 @@ extern double priority_g_calc_fs_factor(long double usage_efctv, if (slurm_priority_init() < 0) return 0.0; - return (*(g_priority_context->ops.calc_fs_factor)) + return (*(ops.calc_fs_factor)) (usage_efctv, shares_norm); } @@ -281,5 +159,6 @@ extern List priority_g_get_priority_factors_list( if (slurm_priority_init() < 0) return NULL; - return (*(g_priority_context->ops.get_priority_factors))(req_msg, uid); + return (*(ops.get_priority_factors))(req_msg, uid); } + diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c index a3fdd58ee1b7771cf2acd32272c92e6f350d8b7a..3665002a3884370a0b30f0fdcf5c37fa7420671e 100644 --- a/src/common/slurm_protocol_api.c +++ b/src/common/slurm_protocol_api.c @@ -1504,6 +1504,43 @@ int slurm_set_jobcomp_port(uint32_t port) return 0; } +/* slurm_get_launch_type + * get launch_type from slurmctld_conf object + * RET char * - launch_type, MUST be xfreed by caller + */ +char *slurm_get_launch_type(void) +{ + char *launch_type = NULL; + slurm_ctl_conf_t *conf; + + if (slurmdbd_conf) { + } else { + conf = slurm_conf_lock(); + launch_type = xstrdup(conf->launch_type); + slurm_conf_unlock(); + } + return launch_type; +} + +/* slurm_set_launch_type + * set launch_type in slurmctld_conf object + * RET 0 or error code + */ +int slurm_set_launch_type(char *launch_type) +{ + slurm_ctl_conf_t *conf; + + if (slurmdbd_conf) { + } else { + conf = slurm_conf_lock(); + xfree(conf->launch_type); + conf->launch_type = xstrdup(launch_type); + slurm_conf_unlock(); + } + return 0; +} + + /* slurm_get_preempt_type * get PreemptType from slurmctld_conf object * RET char * - preempt type, MUST be xfreed by caller @@ -2374,6 +2411,7 @@ List slurm_receive_msgs(slurm_fd_t fd, int steps, int timeout) /* * Unpack message body */ + msg.protocol_version = header.version; msg.msg_type = header.msg_type; msg.flags = header.flags; @@ -2604,6 +2642,7 @@ int slurm_receive_msg_and_forward(slurm_fd_t fd, slurm_addr_t *orig_addr, /* * Unpack message body */ + msg->protocol_version = header.version; msg->msg_type = header.msg_type; msg->flags = header.flags; diff --git a/src/common/slurm_protocol_api.h b/src/common/slurm_protocol_api.h index 18ab2cd6baa8910be170ec37073529410319d3da..509cf3f45d6c2e8dc5a36f5bc2c950af371ba84c 100644 --- a/src/common/slurm_protocol_api.h +++ b/src/common/slurm_protocol_api.h @@ -443,6 +443,18 @@ uint32_t slurm_get_accounting_storage_port(void); */ int slurm_set_accounting_storage_port(uint32_t storage_port); +/* slurm_get_launch_type + * get launch_type from slurmctld_conf object + * RET char * - launch_type, MUST be xfreed by caller + */ +char *slurm_get_launch_type(void); + +/* slurm_set_launch_type + * set launch_type in slurmctld_conf object + * RET 0 or error code + */ +int slurm_set_launch_type(char *launch_type); + /* slurm_get_preempt_mode * returns the PreemptMode value from slurmctld_conf object * RET uint16_t - PreemptMode value (See PREEMPT_MODE_* in slurm.h) diff --git a/src/common/slurm_protocol_common.h b/src/common/slurm_protocol_common.h index 187fd388c2308e1b00d3f38a3eb034c2a0cf1462..b68886a1fa4d4360641d0f2792fc93736359b7da 100644 --- a/src/common/slurm_protocol_common.h +++ b/src/common/slurm_protocol_common.h @@ -70,7 +70,8 @@ * In slurm_protocol_util.c check_header_version(), and init_header() * need to be updated also when changes are added */ #define SLURM_PROTOCOL_VERSION ((SLURM_API_MAJOR << 8) | SLURM_API_AGE) -#define SLURM_2_4_PROTOCOL_VERSION SLURM_PROTOCOL_VERSION +#define SLURM_2_5_PROTOCOL_VERSION SLURM_PROTOCOL_VERSION +#define SLURM_2_4_PROTOCOL_VERSION ((24 << 8) | 0) #define SLURM_2_3_PROTOCOL_VERSION ((23 << 8) | 0) #define SLURM_2_2_PROTOCOL_VERSION ((22 << 8) | 0) #define SLURM_2_1_PROTOCOL_VERSION ((21 << 8) | 0) diff --git a/src/common/slurm_protocol_defs.c b/src/common/slurm_protocol_defs.c index 27854530969fd9f12a55fb6d8c9f22b5c047fd31..083070976f11c571300ddd170cd16933fb311038 100644 --- a/src/common/slurm_protocol_defs.c +++ b/src/common/slurm_protocol_defs.c @@ -57,6 +57,7 @@ #include "src/common/slurm_protocol_defs.h" #include "src/common/switch.h" #include "src/common/xmalloc.h" +#include "src/common/xstring.h" #include "src/common/job_options.h" #include "src/common/forward.h" #include "src/common/slurm_jobacct_gather.h" @@ -117,7 +118,7 @@ extern void slurm_msg_t_init(slurm_msg_t *msg) * values from the "src" slurm_msg_t structure. * IN src - Pointer to the initialized message from which "dest" will * be initialized. - * OUT dest - Pointer to the slurm_msg_t which will be intialized. + * OUT dest - Pointer to the slurm_msg_t which will be initialized. * NOTE: the "dest" structure will contain pointers into the contents of "src". */ extern void slurm_msg_t_copy(slurm_msg_t *dest, slurm_msg_t *src) @@ -503,7 +504,7 @@ extern void slurm_free_node_registration_status_msg( xfree(msg->node_name); xfree(msg->os); xfree(msg->step_id); - if (msg->startup) + if (msg->switch_nodeinfo) switch_g_free_node_info(&msg->switch_nodeinfo); xfree(msg); } @@ -600,7 +601,7 @@ extern void slurm_free_complete_batch_script_msg( complete_batch_script_msg_t * msg) { if (msg) { - jobacct_gather_g_destroy(msg->jobacct); + jobacctinfo_destroy(msg->jobacct); xfree(msg->node_name); xfree(msg); } @@ -1391,6 +1392,16 @@ extern char *reservation_flags_string(uint16_t flags) xstrcat(flag_str, ","); xstrcat(flag_str, "NO_STATIC"); } + if (flags & RESERVE_FLAG_PART_NODES) { + if (flag_str[0]) + xstrcat(flag_str, ","); + xstrcat(flag_str, "PART_NODES"); + } + if (flags & RESERVE_FLAG_NO_PART_NODES) { + if (flag_str[0]) + xstrcat(flag_str, ","); + xstrcat(flag_str, "NO_PART_NODES"); + } return flag_str; } @@ -2218,7 +2229,7 @@ extern void slurm_free_file_bcast_msg(file_bcast_msg_t *msg) extern void slurm_free_step_complete_msg(step_complete_msg_t *msg) { if (msg) { - jobacct_gather_g_destroy(msg->jobacct); + jobacctinfo_destroy(msg->jobacct); xfree(msg); } } @@ -2227,7 +2238,7 @@ extern void slurm_free_job_step_stat(void *object) { job_step_stat_t *msg = (job_step_stat_t *)object; if (msg) { - jobacct_gather_g_destroy(msg->jobacct); + jobacctinfo_destroy(msg->jobacct); slurm_free_job_step_pids(msg->step_pids); xfree(msg); } @@ -2424,6 +2435,7 @@ extern int slurm_free_msg_data(slurm_msg_type_t type, void *data) case REQUEST_COMPLETE_JOB_ALLOCATION: slurm_free_complete_job_allocation_msg(data); break; + case REQUEST_COMPLETE_BATCH_JOB: case REQUEST_COMPLETE_BATCH_SCRIPT: slurm_free_complete_batch_script_msg(data); break; diff --git a/src/common/slurm_protocol_defs.h b/src/common/slurm_protocol_defs.h index 15a7a9273425f35aca6da75718e12969e3415c1a..27134488d9e91e01bf9332080010fa1819b1b6c4 100644 --- a/src/common/slurm_protocol_defs.h +++ b/src/common/slurm_protocol_defs.h @@ -286,6 +286,7 @@ typedef enum { REQUEST_JOB_STEP_PIDS, RESPONSE_JOB_STEP_PIDS, REQUEST_FORWARD_DATA, + REQUEST_COMPLETE_BATCH_JOB, REQUEST_LAUNCH_TASKS = 6001, RESPONSE_LAUNCH_TASKS, @@ -539,6 +540,7 @@ typedef struct complete_batch_script { uint32_t job_rc; uint32_t slurm_rc; char *node_name; + uint32_t user_id; /* user the job runs as */ } complete_batch_script_msg_t; typedef struct step_complete_msg { @@ -595,6 +597,7 @@ typedef struct job_step_specs { uint16_t ckpt_interval; /* checkpoint creation interval (minutes) */ char *ckpt_dir; /* path to store checkpoint image files */ uint32_t cpu_count; /* count of required processors */ + uint32_t cpu_freq; /* requested cpu frequency */ uint16_t exclusive; /* 1 if CPUs not shared with other steps */ char *features; /* required node features, default NONE */ char *gres; /* generic resources required */ @@ -674,6 +677,7 @@ typedef struct launch_tasks_request_msg { uint8_t open_mode; /* stdout/err append or truncate */ uint8_t pty; /* use pseudo tty */ uint16_t acctg_freq; /* accounting polling interval */ + uint32_t cpu_freq; /* requested cpu frequency */ /********** START "normal" IO only options **********/ /* These options are ignored if user_managed_io is 1 */ @@ -806,6 +810,7 @@ typedef struct batch_job_launch_msg { * real memory per CPU | MEM_PER_CPU, * default=0 (no limit) */ uint16_t acctg_freq; /* accounting polling interval */ + uint32_t cpu_freq; /* requested cpu frequency */ uint32_t job_mem; /* memory limit for job */ uint16_t restart_cnt; /* batch job restart count */ char **spank_job_env; /* SPANK job environment variables */ @@ -883,10 +888,13 @@ typedef struct file_bcast_msg { } file_bcast_msg_t; typedef struct multi_core_data { + uint16_t boards_per_node; /* boards per node required by job */ + uint16_t sockets_per_board; /* sockets per board required by job */ uint16_t sockets_per_node; /* sockets per node required by job */ uint16_t cores_per_socket; /* cores per cpu required by job */ uint16_t threads_per_core; /* threads per core required by job */ + uint16_t ntasks_per_board; /* number of tasks to invoke on each board*/ uint16_t ntasks_per_socket; /* number of tasks to invoke on each socket */ uint16_t ntasks_per_core; /* number of tasks to invoke on each core */ uint16_t plane_size; /* plane size when task_dist = SLURM_DIST_PLANE */ @@ -924,6 +932,7 @@ typedef struct slurm_node_registration_status_msg { uint32_t job_count; /* number of associate job_id's */ uint32_t *job_id; /* IDs of running job (if any) */ char *node_name; + uint16_t boards; char *os; uint32_t real_memory; time_t slurmd_start_time; @@ -973,7 +982,7 @@ extern void slurm_msg_t_init (slurm_msg_t *msg); * values from the "src" slurm_msg_t structure. * IN src - Pointer to the initialized message from which "dest" will * be initialized. - * OUT dest - Pointer to the slurm_msg_t which will be intialized. + * OUT dest - Pointer to the slurm_msg_t which will be initialized. * NOTE: the "dest" structure will contain pointers into the contents of "src". */ extern void slurm_msg_t_copy(slurm_msg_t *dest, slurm_msg_t *src); diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c index 1e421992b7288cd935134ee2a7547a133b0e9295..7653b5f08c1aa96ed511e2d8f285405cc48f37bb 100644 --- a/src/common/slurm_protocol_pack.c +++ b/src/common/slurm_protocol_pack.c @@ -62,6 +62,7 @@ #include "src/common/slurm_protocol_pack.h" #include "src/common/switch.h" #include "src/common/xmalloc.h" +#include "src/common/xstring.h" #include "src/common/xassert.h" #include "src/common/forward.h" #include "src/common/job_options.h" @@ -164,11 +165,11 @@ static int _unpack_node_info_members(node_info_t * node, Buf buffer, uint16_t protocol_version); static void _pack_front_end_info_request_msg( - front_end_info_request_msg_t * msg, - Buf buffer, uint16_t protocol_version); + front_end_info_request_msg_t * msg, + Buf buffer, uint16_t protocol_version); static int _unpack_front_end_info_request_msg( - front_end_info_request_msg_t ** msg, - Buf buffer, uint16_t protocol_version); + front_end_info_request_msg_t ** msg, + Buf buffer, uint16_t protocol_version); static int _unpack_front_end_info_msg(front_end_info_msg_t ** msg, Buf buffer, uint16_t protocol_version); static int _unpack_front_end_info_members(front_end_info_t *front_end, @@ -904,6 +905,7 @@ pack_msg(slurm_msg_t const *msg, Buf buffer) (complete_job_allocation_msg_t *)msg->data, buffer, msg->protocol_version); break; + case REQUEST_COMPLETE_BATCH_JOB: case REQUEST_COMPLETE_BATCH_SCRIPT: _pack_complete_batch_script_msg( (complete_batch_script_msg_t *)msg->data, buffer, @@ -1220,6 +1222,17 @@ unpack_msg(slurm_msg_t * msg, Buf buffer) int rc = SLURM_SUCCESS; msg->data = NULL; /* Initialize to no data for now */ + /* In older versions of SLURM some RPC's were not initialized + correctly and NO_VAL was sent along as the + protocol_version. This was fixed in 2.4.2 and was noticed + when upgrading from 2.3 -> 2.5 when REQUEST_STEP_COMPLETE + was called. It hadn't changed for a while so + SLURM_2_4_PROTOCOL_VERSION should fix the issue when this + happens. + */ + if (msg->protocol_version == (uint16_t)NO_VAL) + msg->protocol_version = SLURM_2_4_PROTOCOL_VERSION; + switch (msg->msg_type) { case REQUEST_NODE_INFO: rc = _unpack_node_info_request_msg((node_info_request_msg_t **) @@ -1441,6 +1454,7 @@ unpack_msg(slurm_msg_t * msg, Buf buffer) (complete_job_allocation_msg_t **)&msg->data, buffer, msg->protocol_version); break; + case REQUEST_COMPLETE_BATCH_JOB: case REQUEST_COMPLETE_BATCH_SCRIPT: rc = _unpack_complete_batch_script_msg( (complete_batch_script_msg_t **)&msg->data, buffer, @@ -2380,7 +2394,41 @@ _pack_node_registration_status_msg(slurm_node_registration_status_msg_t * uint32_t gres_info_size = 0; xassert(msg != NULL); - if(protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_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->os, buffer); + pack16(msg->cpus, buffer); + pack16(msg->boards, buffer); + pack16(msg->sockets, buffer); + pack16(msg->cores, buffer); + pack16(msg->threads, buffer); + pack32(msg->real_memory, buffer); + pack32(msg->tmp_disk, buffer); + pack32(msg->up_time, buffer); + pack32(msg->hash_val, buffer); + + pack32(msg->job_count, buffer); + for (i = 0; i < msg->job_count; i++) { + pack32(msg->job_id[i], buffer); + } + for (i = 0; i < msg->job_count; i++) { + pack32(msg->step_id[i], buffer); + } + pack16(msg->startup, buffer); + if (msg->startup) + switch_g_pack_node_info(msg->switch_nodeinfo, buffer); + if (msg->gres_info) + gres_info_size = get_buf_offset(msg->gres_info); + pack32(gres_info_size, buffer); + if (gres_info_size) { + packmem(get_buf_data(msg->gres_info), gres_info_size, + buffer); + } + } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { pack_time(msg->timestamp, buffer); pack_time(msg->slurmd_start_time, buffer); pack32(msg->status, buffer); @@ -2455,7 +2503,56 @@ _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_2_2_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_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->node_name, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node_reg_ptr->arch, + &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); + safe_unpack16(&node_reg_ptr->sockets, buffer); + safe_unpack16(&node_reg_ptr->cores, buffer); + safe_unpack16(&node_reg_ptr->threads, buffer); + safe_unpack32(&node_reg_ptr->real_memory, buffer); + safe_unpack32(&node_reg_ptr->tmp_disk, buffer); + safe_unpack32(&node_reg_ptr->up_time, buffer); + safe_unpack32(&node_reg_ptr->hash_val, buffer); + + safe_unpack32(&node_reg_ptr->job_count, buffer); + node_reg_ptr->job_id = + xmalloc(sizeof(uint32_t) * node_reg_ptr->job_count); + for (i = 0; i < node_reg_ptr->job_count; i++) { + safe_unpack32(&node_reg_ptr->job_id[i], buffer); + } + node_reg_ptr->step_id = + xmalloc(sizeof(uint32_t) * node_reg_ptr->job_count); + for (i = 0; i < node_reg_ptr->job_count; i++) { + safe_unpack32(&node_reg_ptr->step_id[i], buffer); + } + + safe_unpack16(&node_reg_ptr->startup, buffer); + if (node_reg_ptr->startup + && (switch_g_alloc_node_info( + &node_reg_ptr->switch_nodeinfo) + || switch_g_unpack_node_info( + node_reg_ptr->switch_nodeinfo, buffer))) + goto unpack_error; + + safe_unpack32(&gres_info_size, buffer); + if (gres_info_size) { + safe_unpackmem_xmalloc(&gres_info, &uint32_tmp, buffer); + if (gres_info_size != uint32_tmp) + goto unpack_error; + node_reg_ptr->gres_info = create_buf(gres_info, + gres_info_size); + } + } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { /* unpack timestamp of snapshot */ safe_unpack_time(&node_reg_ptr->timestamp, buffer); safe_unpack_time(&node_reg_ptr->slurmd_start_time, buffer); @@ -2875,7 +2972,36 @@ _unpack_node_info_members(node_info_t * node, Buf buffer, xassert(node != NULL); - if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_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(&node->node_state, buffer); + safe_unpack16(&node->cpus, buffer); + safe_unpack16(&node->boards, buffer); + safe_unpack16(&node->sockets, buffer); + safe_unpack16(&node->cores, buffer); + safe_unpack16(&node->threads, buffer); + + safe_unpack32(&node->real_memory, buffer); + safe_unpack32(&node->tmp_disk, buffer); + safe_unpack32(&node->weight, buffer); + safe_unpack32(&node->reason_uid, buffer); + + safe_unpack_time(&node->boot_time, buffer); + safe_unpack_time(&node->reason_time, buffer); + safe_unpack_time(&node->slurmd_start_time, buffer); + + select_g_select_nodeinfo_unpack(&node->select_nodeinfo, buffer, + protocol_version); + + safe_unpackstr_xmalloc(&node->arch, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node->features, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node->gres, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node->os, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node->reason, &uint32_tmp, buffer); + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { safe_unpackstr_xmalloc(&node->name, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&node->node_hostname, &uint32_tmp, buffer); @@ -3155,7 +3281,30 @@ _pack_update_resv_msg(resv_desc_msg_t * msg, Buf buffer, uint32_t array_len; xassert(msg != NULL); - if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + packstr(msg->name, buffer); + pack_time(msg->start_time, buffer); + pack_time(msg->end_time, buffer); + pack32(msg->duration, buffer); + pack16(msg->flags, buffer); + if (msg->node_cnt) { + for (array_len = 0; msg->node_cnt[array_len]; + array_len++) { + /* determine array length */ + } + array_len++; /* Include trailing zero */ + } else + array_len = 0; + pack32_array(msg->node_cnt, array_len, buffer); + pack32(msg->core_cnt, buffer); + packstr(msg->node_list, buffer); + packstr(msg->features, buffer); + packstr(msg->licenses, buffer); + packstr(msg->partition, buffer); + + packstr(msg->users, buffer); + packstr(msg->accounts, buffer); + } else if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { packstr(msg->name, buffer); pack_time(msg->start_time, buffer); pack_time(msg->end_time, buffer); @@ -3211,7 +3360,36 @@ _unpack_update_resv_msg(resv_desc_msg_t ** msg, Buf buffer, tmp_ptr = xmalloc(sizeof(resv_desc_msg_t)); *msg = tmp_ptr; - if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_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); + safe_unpack32(&tmp_ptr->duration, buffer); + safe_unpack16(&tmp_ptr->flags, buffer); + safe_unpack32_array(&tmp_ptr->node_cnt, &uint32_tmp, buffer); + if (uint32_tmp > 0) { + /* Must be zero terminated */ + if (tmp_ptr->node_cnt[uint32_tmp-1] != 0) + goto unpack_error; + } else { + /* This avoids a pointer to a zero length buffer */ + xfree(tmp_ptr->node_cnt); + } + safe_unpack32(&tmp_ptr->core_cnt, buffer); + safe_unpackstr_xmalloc(&tmp_ptr->node_list, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&tmp_ptr->features, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&tmp_ptr->licenses, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&tmp_ptr->partition, + &uint32_tmp, buffer); + + safe_unpackstr_xmalloc(&tmp_ptr->users, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&tmp_ptr->accounts, + &uint32_tmp, buffer); + } else if (protocol_version >= SLURM_2_4_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); @@ -3352,7 +3530,37 @@ _pack_job_step_create_request_msg(job_step_create_request_msg_t { xassert(msg != NULL); - if(protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + pack32(msg->job_id, buffer); + pack32(msg->user_id, buffer); + pack32(msg->min_nodes, buffer); + pack32(msg->max_nodes, buffer); + pack32(msg->cpu_count, buffer); + pack32(msg->cpu_freq, buffer); + pack32(msg->num_tasks, buffer); + pack32(msg->mem_per_cpu, buffer); + pack32(msg->time_limit, buffer); + + pack16(msg->relative, buffer); + pack16(msg->task_dist, buffer); + pack16(msg->plane_size, buffer); + pack16(msg->port, buffer); + pack16(msg->ckpt_interval, buffer); + pack16(msg->exclusive, buffer); + pack16(msg->immediate, buffer); + pack16(msg->resv_port_cnt, buffer); + + packstr(msg->host, buffer); + packstr(msg->name, buffer); + packstr(msg->network, buffer); + packstr(msg->node_list, buffer); + packstr(msg->ckpt_dir, buffer); + packstr(msg->features, buffer); + packstr(msg->gres, buffer); + + pack8(msg->no_kill, buffer); + pack8(msg->overcommit, buffer); + } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { pack32(msg->job_id, buffer); pack32(msg->user_id, buffer); pack32(msg->min_nodes, buffer); @@ -3424,7 +3632,41 @@ _unpack_job_step_create_request_msg(job_step_create_request_msg_t ** msg, tmp_ptr = xmalloc(sizeof(job_step_create_request_msg_t)); *msg = tmp_ptr; - if(protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpack32(&(tmp_ptr->job_id), buffer); + safe_unpack32(&(tmp_ptr->user_id), buffer); + safe_unpack32(&(tmp_ptr->min_nodes), buffer); + safe_unpack32(&(tmp_ptr->max_nodes), buffer); + safe_unpack32(&(tmp_ptr->cpu_count), buffer); + safe_unpack32(&(tmp_ptr->cpu_freq), buffer); + safe_unpack32(&(tmp_ptr->num_tasks), buffer); + safe_unpack32(&(tmp_ptr->mem_per_cpu), buffer); + safe_unpack32(&(tmp_ptr->time_limit), buffer); + + safe_unpack16(&(tmp_ptr->relative), buffer); + safe_unpack16(&(tmp_ptr->task_dist), buffer); + safe_unpack16(&(tmp_ptr->plane_size), buffer); + safe_unpack16(&(tmp_ptr->port), buffer); + safe_unpack16(&(tmp_ptr->ckpt_interval), buffer); + safe_unpack16(&(tmp_ptr->exclusive), buffer); + safe_unpack16(&(tmp_ptr->immediate), buffer); + safe_unpack16(&(tmp_ptr->resv_port_cnt), buffer); + + safe_unpackstr_xmalloc(&(tmp_ptr->host), &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&(tmp_ptr->name), &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&(tmp_ptr->network), &uint32_tmp, + buffer); + safe_unpackstr_xmalloc(&(tmp_ptr->node_list), &uint32_tmp, + buffer); + safe_unpackstr_xmalloc(&(tmp_ptr->ckpt_dir), &uint32_tmp, + buffer); + safe_unpackstr_xmalloc(&(tmp_ptr->features), &uint32_tmp, + buffer); + safe_unpackstr_xmalloc(&(tmp_ptr->gres), &uint32_tmp, buffer); + + safe_unpack8(&(tmp_ptr->no_kill), buffer); + safe_unpack8(&(tmp_ptr->overcommit), buffer); + } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { safe_unpack32(&(tmp_ptr->job_id), buffer); safe_unpack32(&(tmp_ptr->user_id), buffer); safe_unpack32(&(tmp_ptr->min_nodes), buffer); @@ -3972,7 +4214,28 @@ _unpack_reserve_info_members(reserve_info_t * resv, Buf buffer, char *node_inx_str = NULL; uint32_t uint32_tmp; - if(protocol_version >= SLURM_2_1_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpackstr_xmalloc(&resv->accounts, &uint32_tmp, buffer); + safe_unpack_time(&resv->end_time, buffer); + safe_unpackstr_xmalloc(&resv->features, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&resv->licenses, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&resv->name, &uint32_tmp, buffer); + safe_unpack32(&resv->node_cnt, buffer); + safe_unpack32(&resv->core_cnt, buffer); + safe_unpackstr_xmalloc(&resv->node_list,&uint32_tmp, buffer); + safe_unpackstr_xmalloc(&resv->partition,&uint32_tmp, buffer); + safe_unpack_time(&resv->start_time, buffer); + safe_unpack16(&resv->flags, buffer); + safe_unpackstr_xmalloc(&resv->users, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node_inx_str, &uint32_tmp, buffer); + if (node_inx_str == NULL) + resv->node_inx = bitfmt2int(""); + else { + resv->node_inx = bitfmt2int(node_inx_str); + xfree(node_inx_str); + node_inx_str = NULL; + } + } else if (protocol_version >= SLURM_2_1_PROTOCOL_VERSION) { safe_unpackstr_xmalloc(&resv->accounts, &uint32_tmp, buffer); safe_unpack_time(&resv->end_time, buffer); safe_unpackstr_xmalloc(&resv->features, &uint32_tmp, buffer); @@ -4015,12 +4278,13 @@ _unpack_job_step_info_members(job_step_info_t * step, Buf buffer, uint32_t uint32_tmp = 0; char *node_inx_str; - if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { 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, buffer); safe_unpack32(&step->num_tasks, buffer); safe_unpack32(&step->time_limit, buffer); @@ -4044,7 +4308,7 @@ _unpack_job_step_info_members(job_step_info_t * step, Buf buffer, if (select_g_select_jobinfo_unpack(&step->select_jobinfo, buffer, protocol_version)) goto unpack_error; - } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { safe_unpack32(&step->job_id, buffer); safe_unpack32(&step->step_id, buffer); safe_unpack16(&step->ckpt_interval, buffer); @@ -4070,7 +4334,36 @@ _unpack_job_step_info_members(job_step_info_t * step, Buf buffer, step->node_inx = bitfmt2int(node_inx_str); xfree(node_inx_str); } - } else { + if (select_g_select_jobinfo_unpack(&step->select_jobinfo, + buffer, protocol_version)) + goto unpack_error; + } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + 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->num_tasks, buffer); + safe_unpack32(&step->time_limit, 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); + } + } else { safe_unpack32(&step->job_id, buffer); safe_unpack32(&step->step_id, buffer); safe_unpack16(&step->ckpt_interval, buffer); @@ -4191,7 +4484,122 @@ _unpack_job_info_members(job_info_t * job, Buf buffer, char *node_inx_str; multi_core_data_t *mc_ptr; - if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpack32(&job->assoc_id, buffer); + safe_unpack32(&job->job_id, buffer); + safe_unpack32(&job->user_id, buffer); + safe_unpack32(&job->group_id, buffer); + + safe_unpack16(&job->job_state, buffer); + 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_unpack32(&job->alloc_sid, buffer); + safe_unpack32(&job->time_limit, buffer); + safe_unpack32(&job->time_min, buffer); + + safe_unpack16(&job->nice, buffer); + + safe_unpack_time(&job->submit_time, buffer); + safe_unpack_time(&job->eligible_time, buffer); + safe_unpack_time(&job->start_time, buffer); + safe_unpack_time(&job->end_time, buffer); + safe_unpack_time(&job->suspend_time, buffer); + safe_unpack_time(&job->pre_sus_time, buffer); + safe_unpack_time(&job->resize_time, 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->partition, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->account, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->network, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->comment, &uint32_tmp, 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->qos, &uint32_tmp, 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_unpack32(&job->exit_code, buffer); + safe_unpack32(&job->derived_ec, buffer); + unpack_job_resources(&job->job_resrcs, buffer, + protocol_version); + + safe_unpackstr_xmalloc(&job->name, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->wckey, &uint32_tmp, buffer); + safe_unpack32(&job->req_switch, buffer); + safe_unpack32(&job->wait4switch, buffer); + + safe_unpackstr_xmalloc(&job->alloc_node, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node_inx_str, &uint32_tmp, buffer); + if (node_inx_str == NULL) + job->node_inx = bitfmt2int(""); + else { + job->node_inx = bitfmt2int(node_inx_str); + xfree(node_inx_str); + } + + if (select_g_select_jobinfo_unpack(&job->select_jobinfo, + buffer, protocol_version)) + goto unpack_error; + + /*** unpack default job details ***/ + safe_unpackstr_xmalloc(&job->features, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->work_dir, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->dependency, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->command, &uint32_tmp, buffer); + + safe_unpack32(&job->num_cpus, buffer); + safe_unpack32(&job->max_cpus, buffer); + safe_unpack32(&job->num_nodes, buffer); + safe_unpack32(&job->max_nodes, buffer); + safe_unpack16(&job->requeue, buffer); + + /*** unpack pending job details ***/ + safe_unpack16(&job->shared, buffer); + safe_unpack16(&job->contiguous, buffer); + safe_unpack16(&job->cpus_per_task, buffer); + safe_unpack16(&job->pn_min_cpus, buffer); + + safe_unpack32(&job->pn_min_memory, buffer); + safe_unpack32(&job->pn_min_tmp_disk, buffer); + + safe_unpackstr_xmalloc(&job->req_nodes, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node_inx_str, &uint32_tmp, buffer); + if (node_inx_str == NULL) + job->req_node_inx = bitfmt2int(""); + else { + job->req_node_inx = bitfmt2int(node_inx_str); + xfree(node_inx_str); + } + safe_unpackstr_xmalloc(&job->exc_nodes, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node_inx_str, &uint32_tmp, buffer); + if (node_inx_str == NULL) + job->exc_node_inx = bitfmt2int(""); + else { + job->exc_node_inx = bitfmt2int(node_inx_str); + xfree(node_inx_str); + } + + if (unpack_multi_core_data(&mc_ptr, buffer, protocol_version)) + goto unpack_error; + if (mc_ptr) { + job->boards_per_node = mc_ptr->boards_per_node; + job->sockets_per_board = mc_ptr->sockets_per_board; + job->sockets_per_node = mc_ptr->sockets_per_node; + job->cores_per_socket = mc_ptr->cores_per_socket; + job->threads_per_core = mc_ptr->threads_per_core; + job->ntasks_per_board = mc_ptr->ntasks_per_board; + job->ntasks_per_socket = mc_ptr->ntasks_per_socket; + job->ntasks_per_core = mc_ptr->ntasks_per_core; + xfree(mc_ptr); + } + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { safe_unpack32(&job->assoc_id, buffer); safe_unpack32(&job->job_id, buffer); safe_unpack32(&job->user_id, buffer); @@ -4531,7 +4939,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, uint16_t uint16_tmp; uint32_t cluster_flags = slurmdb_setup_cluster_flags(); - if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { pack_time(build_ptr->last_update, buffer); pack16(build_ptr->accounting_storage_enforce, buffer); @@ -4600,7 +5008,9 @@ _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_type, buffer); packstr(build_ptr->licenses, buffer); + packstr(build_ptr->licenses_used, buffer); packstr(build_ptr->mail_prog, buffer); pack32(build_ptr->max_job_cnt, buffer); @@ -4731,7 +5141,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_2_3_PROTOCOL_VERSION) { + } else if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { pack_time(build_ptr->last_update, buffer); pack16(build_ptr->accounting_storage_enforce, buffer); @@ -4826,6 +5236,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, pack32(build_ptr->priority_decay_hl, buffer); pack32(build_ptr->priority_calc_period, buffer); pack16(build_ptr->priority_favor_small, buffer); + pack16(build_ptr->priority_flags, buffer); pack32(build_ptr->priority_max_age, buffer); pack16(build_ptr->priority_reset_period, buffer); packstr(build_ptr->priority_type, buffer); @@ -4843,6 +5254,8 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, packstr(build_ptr->propagate_rlimits, buffer); packstr(build_ptr->propagate_rlimits_except, buffer); + packstr(build_ptr->reboot_program, buffer); + pack16(build_ptr->reconfig_flags, buffer); packstr(build_ptr->resume_program, buffer); pack16(build_ptr->resume_rate, buffer); pack16(build_ptr->resume_timeout, buffer); @@ -4862,11 +5275,11 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, count = list_count(build_ptr->select_conf_key_pairs); pack32(count, buffer); - if(count && count != NO_VAL) { + if (count && count != NO_VAL) { ListIterator itr = list_iterator_create( (List)build_ptr->select_conf_key_pairs); config_key_pair_t *key_pair = NULL; - while((key_pair = list_next(itr))) { + while ((key_pair = list_next(itr))) { pack_config_key_pair(key_pair, protocol_version, buffer); } @@ -4892,7 +5305,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, pack16(build_ptr->slurmd_debug, buffer); packstr(build_ptr->slurmd_logfile, buffer); packstr(build_ptr->slurmd_pidfile, buffer); - if(!(cluster_flags & CLUSTER_FLAG_MULTSD)) + if (!(cluster_flags & CLUSTER_FLAG_MULTSD)) pack32(build_ptr->slurmd_port, buffer); packstr(build_ptr->slurmd_spooldir, buffer); @@ -4928,7 +5341,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_2_2_PROTOCOL_VERSION) { + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { pack_time(build_ptr->last_update, buffer); pack16(build_ptr->accounting_storage_enforce, buffer); @@ -4938,6 +5351,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, pack32(build_ptr->accounting_storage_port, buffer); packstr(build_ptr->accounting_storage_type, buffer); packstr(build_ptr->accounting_storage_user, buffer); + pack16(build_ptr->acctng_store_job_comment, buffer); packstr(build_ptr->authtype, buffer); @@ -5000,7 +5414,9 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, packstr(build_ptr->mail_prog, buffer); pack32(build_ptr->max_job_cnt, buffer); + pack32(build_ptr->max_job_id, 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->min_job_age, buffer); packstr(build_ptr->mpi_default, buffer); @@ -5122,14 +5538,13 @@ _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_2_1_PROTOCOL_VERSION) { + } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { pack_time(build_ptr->last_update, buffer); pack16(build_ptr->accounting_storage_enforce, buffer); packstr(build_ptr->accounting_storage_backup_host, buffer); packstr(build_ptr->accounting_storage_host, buffer); packstr(build_ptr->accounting_storage_loc, buffer); - packstr("", buffer); pack32(build_ptr->accounting_storage_port, buffer); packstr(build_ptr->accounting_storage_type, buffer); packstr(build_ptr->accounting_storage_user, buffer); @@ -5141,11 +5556,6 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, pack16(build_ptr->batch_start_timeout, buffer); pack_time(build_ptr->boot_time, buffer); - if (build_ptr->group_info & GROUP_CACHE) - uint16_tmp = 1; - else - uint16_tmp = 0; - pack16(uint16_tmp, buffer); /* cache_groups equivalent */ packstr(build_ptr->checkpoint_type, buffer); packstr(build_ptr->cluster_name, buffer); pack16(build_ptr->complete_wait, buffer); @@ -5157,6 +5567,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, pack32(build_ptr->debug_flags, buffer); pack16(build_ptr->disable_root_jobs, buffer); + pack16(build_ptr->enforce_part_limits, buffer); packstr(build_ptr->epilog, buffer); pack32(build_ptr->epilog_msg_time, buffer); packstr(build_ptr->epilog_slurmctld, buffer); @@ -5165,6 +5576,10 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, pack32(build_ptr->first_job_id, buffer); pack16(build_ptr->get_env_timeout, buffer); + packstr(build_ptr->gres_plugins, buffer); + pack16(build_ptr->group_info, buffer); + + pack32(build_ptr->hash_val, buffer); pack16(build_ptr->health_check_interval, buffer); packstr(build_ptr->health_check_program, buffer); @@ -5178,7 +5593,6 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, packstr(build_ptr->job_comp_host, buffer); packstr(build_ptr->job_comp_loc, buffer); - packstr("", buffer); pack32((uint32_t)build_ptr->job_comp_port, buffer); packstr(build_ptr->job_comp_type, buffer); packstr(build_ptr->job_comp_user, buffer); @@ -5187,6 +5601,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, packstr(build_ptr->job_credential_public_certificate, buffer); pack16(build_ptr->job_file_append, buffer); pack16(build_ptr->job_requeue, buffer); + packstr(build_ptr->job_submit_plugins, buffer); pack16(build_ptr->kill_on_bad_exit, buffer); pack16(build_ptr->kill_wait, buffer); @@ -5194,7 +5609,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, packstr(build_ptr->licenses, buffer); packstr(build_ptr->mail_prog, buffer); - pack16(build_ptr->max_job_cnt, buffer); + pack32(build_ptr->max_job_cnt, buffer); pack32(build_ptr->max_mem_per_cpu, buffer); pack16(build_ptr->max_tasks_per_node, buffer); pack16(build_ptr->min_job_age, buffer); @@ -5242,6 +5657,8 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, packstr(build_ptr->sched_params, buffer); pack16(build_ptr->schedport, buffer); pack16(build_ptr->schedrootfltr, buffer); + packstr(build_ptr->sched_logfile, buffer); + pack16(build_ptr->sched_log_level, buffer); pack16(build_ptr->sched_time_slice, buffer); packstr(build_ptr->schedtype, buffer); packstr(build_ptr->select_type, buffer); @@ -5273,17 +5690,17 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, packstr(build_ptr->slurmctld_logfile, buffer); packstr(build_ptr->slurmctld_pidfile, buffer); pack32(build_ptr->slurmctld_port, buffer); + pack16(build_ptr->slurmctld_port_count, buffer); pack16(build_ptr->slurmctld_timeout, buffer); pack16(build_ptr->slurmd_debug, buffer); packstr(build_ptr->slurmd_logfile, buffer); packstr(build_ptr->slurmd_pidfile, buffer); -#ifndef MULTIPLE_SLURMD - pack32(build_ptr->slurmd_port, buffer); -#endif + if(!(cluster_flags & CLUSTER_FLAG_MULTSD)) + pack32(build_ptr->slurmd_port, buffer); + packstr(build_ptr->slurmd_spooldir, buffer); pack16(build_ptr->slurmd_timeout, buffer); - packstr(build_ptr->srun_epilog, buffer); packstr(build_ptr->srun_prolog, buffer); packstr(build_ptr->state_save_location, buffer); @@ -5308,34 +5725,505 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, packstr(build_ptr->unkillable_program, buffer); pack16(build_ptr->unkillable_timeout, buffer); packstr(build_ptr->version, buffer); + pack16(build_ptr->vsize_factor, buffer); pack16(build_ptr->wait_time, buffer); pack16(build_ptr->z_16, buffer); pack32(build_ptr->z_32, buffer); packstr(build_ptr->z_char, buffer); - } -} + } else if (protocol_version >= SLURM_2_1_PROTOCOL_VERSION) { + pack_time(build_ptr->last_update, buffer); -static int -_unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr, - Buf buffer, uint16_t protocol_version) -{ - uint32_t count = NO_VAL; - uint32_t uint32_tmp; - uint16_t uint16_tmp; - slurm_ctl_conf_info_msg_t *build_ptr; - uint32_t cluster_flags = slurmdb_setup_cluster_flags(); + pack16(build_ptr->accounting_storage_enforce, buffer); + packstr(build_ptr->accounting_storage_backup_host, buffer); + packstr(build_ptr->accounting_storage_host, buffer); + packstr(build_ptr->accounting_storage_loc, buffer); + packstr("", buffer); + pack32(build_ptr->accounting_storage_port, buffer); + packstr(build_ptr->accounting_storage_type, buffer); + packstr(build_ptr->accounting_storage_user, buffer); - /* alloc memory for structure */ - build_ptr = xmalloc(sizeof(slurm_ctl_conf_t)); - *build_buffer_ptr = build_ptr; + packstr(build_ptr->authtype, buffer); + + packstr(build_ptr->backup_addr, buffer); + packstr(build_ptr->backup_controller, buffer); + pack16(build_ptr->batch_start_timeout, buffer); + pack_time(build_ptr->boot_time, buffer); + + if (build_ptr->group_info & GROUP_CACHE) + uint16_tmp = 1; + else + uint16_tmp = 0; + pack16(uint16_tmp, buffer); /* cache_groups equivalent */ + packstr(build_ptr->checkpoint_type, 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->crypto_type, buffer); + + pack32(build_ptr->def_mem_per_cpu, buffer); + pack32(build_ptr->debug_flags, buffer); + pack16(build_ptr->disable_root_jobs, buffer); + + packstr(build_ptr->epilog, buffer); + pack32(build_ptr->epilog_msg_time, buffer); + packstr(build_ptr->epilog_slurmctld, buffer); + + pack16(build_ptr->fast_schedule, buffer); + pack32(build_ptr->first_job_id, buffer); + + pack16(build_ptr->get_env_timeout, buffer); + + pack16(build_ptr->health_check_interval, buffer); + packstr(build_ptr->health_check_program, buffer); + + pack16(build_ptr->inactive_limit, buffer); + + pack16(build_ptr->job_acct_gather_freq, buffer); + packstr(build_ptr->job_acct_gather_type, buffer); + + packstr(build_ptr->job_ckpt_dir, buffer); + + packstr(build_ptr->job_comp_host, buffer); + packstr(build_ptr->job_comp_loc, buffer); + packstr("", buffer); + pack32((uint32_t)build_ptr->job_comp_port, buffer); + packstr(build_ptr->job_comp_type, buffer); + packstr(build_ptr->job_comp_user, buffer); + + packstr(build_ptr->job_credential_private_key, buffer); + packstr(build_ptr->job_credential_public_certificate, buffer); + pack16(build_ptr->job_file_append, buffer); + pack16(build_ptr->job_requeue, buffer); + + pack16(build_ptr->kill_on_bad_exit, buffer); + pack16(build_ptr->kill_wait, buffer); + + packstr(build_ptr->licenses, buffer); + + packstr(build_ptr->mail_prog, buffer); + pack16(build_ptr->max_job_cnt, buffer); + pack32(build_ptr->max_mem_per_cpu, buffer); + pack16(build_ptr->max_tasks_per_node, buffer); + pack16(build_ptr->min_job_age, buffer); + packstr(build_ptr->mpi_default, buffer); + packstr(build_ptr->mpi_params, buffer); + pack16(build_ptr->msg_timeout, buffer); + + pack32(build_ptr->next_job_id, buffer); + packstr(build_ptr->node_prefix, buffer); + + pack16(build_ptr->over_time_limit, buffer); + + packstr(build_ptr->plugindir, buffer); + packstr(build_ptr->plugstack, buffer); + pack16(build_ptr->preempt_mode, buffer); + packstr(build_ptr->preempt_type, buffer); + + pack32(build_ptr->priority_decay_hl, buffer); + pack32(build_ptr->priority_calc_period, buffer); + pack16(build_ptr->priority_favor_small, buffer); + pack32(build_ptr->priority_max_age, buffer); + pack16(build_ptr->priority_reset_period, buffer); + packstr(build_ptr->priority_type, buffer); + pack32(build_ptr->priority_weight_age, buffer); + pack32(build_ptr->priority_weight_fs, buffer); + pack32(build_ptr->priority_weight_js, buffer); + pack32(build_ptr->priority_weight_part, buffer); + pack32(build_ptr->priority_weight_qos, buffer); + + pack16(build_ptr->private_data, buffer); + packstr(build_ptr->proctrack_type, buffer); + packstr(build_ptr->prolog, buffer); + packstr(build_ptr->prolog_slurmctld, buffer); + pack16(build_ptr->propagate_prio_process, buffer); + packstr(build_ptr->propagate_rlimits, buffer); + packstr(build_ptr->propagate_rlimits_except, buffer); + + packstr(build_ptr->resume_program, buffer); + pack16(build_ptr->resume_rate, buffer); + pack16(build_ptr->resume_timeout, buffer); + pack16(build_ptr->resv_over_run, buffer); + pack16(build_ptr->ret2service, buffer); + + packstr(build_ptr->salloc_default_command, buffer); + packstr(build_ptr->sched_params, buffer); + pack16(build_ptr->schedport, buffer); + pack16(build_ptr->schedrootfltr, buffer); + pack16(build_ptr->sched_time_slice, buffer); + packstr(build_ptr->schedtype, buffer); + packstr(build_ptr->select_type, buffer); + if(build_ptr->select_conf_key_pairs) + count = list_count(build_ptr->select_conf_key_pairs); + + pack32(count, buffer); + if(count && count != NO_VAL) { + ListIterator itr = list_iterator_create( + (List)build_ptr->select_conf_key_pairs); + config_key_pair_t *key_pair = NULL; + while((key_pair = list_next(itr))) { + pack_config_key_pair(key_pair, + protocol_version, buffer); + } + list_iterator_destroy(itr); + } + count = NO_VAL; + + pack16(build_ptr->select_type_param, buffer); + + packstr(build_ptr->slurm_conf, buffer); + pack32(build_ptr->slurm_user_id, buffer); + packstr(build_ptr->slurm_user_name, buffer); + pack32(build_ptr->slurmd_user_id, buffer); + packstr(build_ptr->slurmd_user_name, buffer); + + pack16(build_ptr->slurmctld_debug, buffer); + packstr(build_ptr->slurmctld_logfile, buffer); + packstr(build_ptr->slurmctld_pidfile, buffer); + pack32(build_ptr->slurmctld_port, buffer); + pack16(build_ptr->slurmctld_timeout, buffer); + + pack16(build_ptr->slurmd_debug, buffer); + packstr(build_ptr->slurmd_logfile, buffer); + packstr(build_ptr->slurmd_pidfile, buffer); +#ifndef MULTIPLE_SLURMD + pack32(build_ptr->slurmd_port, buffer); +#endif + packstr(build_ptr->slurmd_spooldir, buffer); + pack16(build_ptr->slurmd_timeout, buffer); + + packstr(build_ptr->srun_epilog, buffer); + packstr(build_ptr->srun_prolog, buffer); + packstr(build_ptr->state_save_location, buffer); + packstr(build_ptr->suspend_exc_nodes, buffer); + packstr(build_ptr->suspend_exc_parts, buffer); + packstr(build_ptr->suspend_program, buffer); + pack16(build_ptr->suspend_rate, buffer); + pack32(build_ptr->suspend_time, buffer); + pack16(build_ptr->suspend_timeout, buffer); + packstr(build_ptr->switch_type, 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); + packstr(build_ptr->tmp_fs, buffer); + packstr(build_ptr->topology_plugin, buffer); + pack16(build_ptr->track_wckey, buffer); + pack16(build_ptr->tree_width, buffer); + + pack16(build_ptr->use_pam, buffer); + packstr(build_ptr->unkillable_program, buffer); + pack16(build_ptr->unkillable_timeout, buffer); + packstr(build_ptr->version, buffer); + + pack16(build_ptr->wait_time, buffer); + + pack16(build_ptr->z_16, buffer); + pack32(build_ptr->z_32, buffer); + packstr(build_ptr->z_char, buffer); + } +} + +static int +_unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr, + Buf buffer, uint16_t protocol_version) +{ + uint32_t count = NO_VAL; + uint32_t uint32_tmp; + uint16_t uint16_tmp; + slurm_ctl_conf_info_msg_t *build_ptr; + uint32_t cluster_flags = slurmdb_setup_cluster_flags(); + + /* alloc memory for structure */ + build_ptr = xmalloc(sizeof(slurm_ctl_conf_t)); + *build_buffer_ptr = build_ptr; + + /* initialize this so we don't check for those not sending it */ + build_ptr->hash_val = NO_VAL; + + /* load the data values */ + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + /* unpack timestamp of snapshot */ + safe_unpack_time(&build_ptr->last_update, buffer); + + safe_unpack16(&build_ptr->accounting_storage_enforce, buffer); + safe_unpackstr_xmalloc( + &build_ptr->accounting_storage_backup_host, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->accounting_storage_host, + &uint32_tmp, buffer); + 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_type, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->accounting_storage_user, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->acctng_store_job_comment, buffer); + + safe_unpackstr_xmalloc(&build_ptr->authtype, + &uint32_tmp, buffer); + + safe_unpackstr_xmalloc(&build_ptr->backup_addr, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->backup_controller, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->batch_start_timeout, buffer); + safe_unpack_time(&build_ptr->boot_time, buffer); + + safe_unpackstr_xmalloc(&build_ptr->checkpoint_type, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->cluster_name, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->complete_wait, buffer); + safe_unpackstr_xmalloc(&build_ptr->control_addr, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->control_machine, + &uint32_tmp,buffer); + safe_unpackstr_xmalloc(&build_ptr->crypto_type, &uint32_tmp, + buffer); + + safe_unpack32(&build_ptr->def_mem_per_cpu, buffer); + safe_unpack32(&build_ptr->debug_flags, buffer); + safe_unpack16(&build_ptr->disable_root_jobs, buffer); + + safe_unpack16(&build_ptr->enforce_part_limits, buffer); + safe_unpackstr_xmalloc(&build_ptr->epilog, &uint32_tmp, + buffer); + safe_unpack32(&build_ptr->epilog_msg_time, buffer); + safe_unpackstr_xmalloc(&build_ptr->epilog_slurmctld, + &uint32_tmp, buffer); + + safe_unpack16(&build_ptr->fast_schedule, buffer); + safe_unpack32(&build_ptr->first_job_id, buffer); + + safe_unpack16(&build_ptr->get_env_timeout, buffer); + safe_unpackstr_xmalloc(&build_ptr->gres_plugins, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->group_info, buffer); + + safe_unpack32(&build_ptr->hash_val, buffer); + + safe_unpack16(&build_ptr->health_check_interval, buffer); + safe_unpackstr_xmalloc(&build_ptr->health_check_program, + &uint32_tmp, buffer); + + safe_unpack16(&build_ptr->inactive_limit, buffer); + + safe_unpack16(&build_ptr->job_acct_gather_freq, buffer); + safe_unpackstr_xmalloc(&build_ptr->job_acct_gather_type, + &uint32_tmp, buffer); + + safe_unpackstr_xmalloc(&build_ptr->job_ckpt_dir, + &uint32_tmp, buffer); + + safe_unpackstr_xmalloc(&build_ptr->job_comp_host, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->job_comp_loc, + &uint32_tmp, buffer); + safe_unpack32(&build_ptr->job_comp_port, buffer); + safe_unpackstr_xmalloc(&build_ptr->job_comp_type, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->job_comp_user, + &uint32_tmp, buffer); + + safe_unpackstr_xmalloc(&build_ptr->job_credential_private_key, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr-> + job_credential_public_certificate, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->job_file_append, buffer); + safe_unpack16(&build_ptr->job_requeue, buffer); + safe_unpackstr_xmalloc(&build_ptr->job_submit_plugins, + &uint32_tmp, buffer); + + safe_unpack16(&build_ptr->kill_on_bad_exit, buffer); + safe_unpack16(&build_ptr->kill_wait, buffer); + + safe_unpackstr_xmalloc(&build_ptr->launch_type, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->licenses, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->licenses_used, + &uint32_tmp, buffer); + + safe_unpackstr_xmalloc(&build_ptr->mail_prog, + &uint32_tmp, buffer); + safe_unpack32(&build_ptr->max_job_cnt, buffer); + safe_unpack32(&build_ptr->max_job_id, buffer); + 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->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_unpack16(&build_ptr->msg_timeout, buffer); + + safe_unpack32(&build_ptr->next_job_id, buffer); + safe_unpackstr_xmalloc(&build_ptr->node_prefix, + &uint32_tmp, buffer); + + safe_unpack16(&build_ptr->over_time_limit, buffer); + + safe_unpackstr_xmalloc(&build_ptr->plugindir, + &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_unpack16(&build_ptr->priority_reset_period, buffer); + safe_unpackstr_xmalloc(&build_ptr->priority_type, &uint32_tmp, + buffer); + safe_unpack32(&build_ptr->priority_weight_age, buffer); + safe_unpack32(&build_ptr->priority_weight_fs, buffer); + 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_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_unpackstr_xmalloc(&build_ptr->prolog_slurmctld, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->propagate_prio_process, buffer); + safe_unpackstr_xmalloc(&build_ptr->propagate_rlimits, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->propagate_rlimits_except, + &uint32_tmp, buffer); + + safe_unpackstr_xmalloc(&build_ptr->reboot_program, &uint32_tmp, + buffer); + safe_unpack16(&build_ptr->reconfig_flags, buffer); + safe_unpackstr_xmalloc(&build_ptr->resume_program, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->resume_rate, buffer); + safe_unpack16(&build_ptr->resume_timeout, buffer); + safe_unpack16(&build_ptr->resv_over_run, buffer); + safe_unpack16(&build_ptr->ret2service, buffer); + + safe_unpackstr_xmalloc(&build_ptr->salloc_default_command, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->sched_params, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->schedport, buffer); + safe_unpack16(&build_ptr->schedrootfltr, buffer); + safe_unpackstr_xmalloc(&build_ptr->sched_logfile, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->sched_log_level, buffer); + safe_unpack16(&build_ptr->sched_time_slice, buffer); + safe_unpackstr_xmalloc(&build_ptr->schedtype, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->select_type, + &uint32_tmp, buffer); + safe_unpack32(&count, buffer); + if (count != NO_VAL) { + List tmp_list = list_create(destroy_config_key_pair); + config_key_pair_t *object = NULL; + int i; + for (i=0; iselect_conf_key_pairs = (void *)tmp_list; + } + + safe_unpack16(&build_ptr->select_type_param, buffer); + + safe_unpackstr_xmalloc(&build_ptr->slurm_conf, + &uint32_tmp, buffer); + safe_unpack32(&build_ptr->slurm_user_id, buffer); + safe_unpackstr_xmalloc(&build_ptr->slurm_user_name, + &uint32_tmp, buffer); + safe_unpack32(&build_ptr->slurmd_user_id, buffer); + safe_unpackstr_xmalloc(&build_ptr->slurmd_user_name, + &uint32_tmp, buffer); + + safe_unpack16(&build_ptr->slurmctld_debug, buffer); + safe_unpackstr_xmalloc(&build_ptr->slurmctld_logfile, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->slurmctld_pidfile, + &uint32_tmp, buffer); + safe_unpack32(&build_ptr->slurmctld_port, buffer); + safe_unpack16(&build_ptr->slurmctld_port_count, buffer); + safe_unpack16(&build_ptr->slurmctld_timeout, buffer); + + safe_unpack16(&build_ptr->slurmd_debug, buffer); + safe_unpackstr_xmalloc(&build_ptr->slurmd_logfile, &uint32_tmp, + buffer); + safe_unpackstr_xmalloc(&build_ptr->slurmd_pidfile, &uint32_tmp, + buffer); + if (!(cluster_flags & CLUSTER_FLAG_MULTSD)) + safe_unpack32(&build_ptr->slurmd_port, buffer); + + safe_unpackstr_xmalloc(&build_ptr->slurmd_spooldir, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->slurmd_timeout, buffer); + + safe_unpackstr_xmalloc(&build_ptr->srun_epilog, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->srun_prolog, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->state_save_location, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->suspend_exc_nodes, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->suspend_exc_parts, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->suspend_program, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->suspend_rate, buffer); + safe_unpack32(&build_ptr->suspend_time, buffer); + safe_unpack16(&build_ptr->suspend_timeout, buffer); + safe_unpackstr_xmalloc(&build_ptr->switch_type, + &uint32_tmp, buffer); + + safe_unpackstr_xmalloc(&build_ptr->task_epilog, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->task_prolog, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&build_ptr->task_plugin, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->task_plugin_param, buffer); + safe_unpackstr_xmalloc(&build_ptr->tmp_fs, &uint32_tmp, + buffer); + safe_unpackstr_xmalloc(&build_ptr->topology_plugin, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->track_wckey, buffer); + safe_unpack16(&build_ptr->tree_width, buffer); + + safe_unpack16(&build_ptr->use_pam, buffer); + safe_unpackstr_xmalloc(&build_ptr->unkillable_program, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->unkillable_timeout, buffer); + safe_unpackstr_xmalloc(&build_ptr->version, + &uint32_tmp, buffer); + safe_unpack16(&build_ptr->vsize_factor, buffer); - /* initialize this so we don't check for those not sending it */ - build_ptr->hash_val = NO_VAL; + safe_unpack16(&build_ptr->wait_time, buffer); - /* load the data values */ - if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { + safe_unpack16(&build_ptr->z_16, buffer); + safe_unpack32(&build_ptr->z_32, buffer); + safe_unpackstr_xmalloc(&build_ptr->z_char, &uint32_tmp, + buffer); + } else if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { /* unpack timestamp of snapshot */ safe_unpack_time(&build_ptr->last_update, buffer); @@ -5522,8 +6410,8 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr, int i; for (i=0; i= SLURM_2_3_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + pack16(job_desc_ptr->contiguous, buffer); + pack16(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); + pack32(job_desc_ptr->job_id, buffer); + packstr(job_desc_ptr->name, buffer); + + packstr(job_desc_ptr->alloc_node, buffer); + pack32(job_desc_ptr->alloc_sid, 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); + + 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); + packstr(job_desc_ptr->qos, buffer); + + pack8(job_desc_ptr->open_mode, buffer); + pack8(job_desc_ptr->overcommit, buffer); + pack16(job_desc_ptr->acctg_freq, buffer); + pack32(job_desc_ptr->num_tasks, buffer); + pack16(job_desc_ptr->ckpt_interval, buffer); + + packstr(job_desc_ptr->req_nodes, buffer); + packstr(job_desc_ptr->exc_nodes, buffer); + packstr_array(job_desc_ptr->environment, + job_desc_ptr->env_size, buffer); + packstr_array(job_desc_ptr->spank_job_env, + job_desc_ptr->spank_job_env_size, buffer); + packstr(job_desc_ptr->script, buffer); + packstr_array(job_desc_ptr->argv, job_desc_ptr->argc, buffer); + + packstr(job_desc_ptr->std_err, buffer); + packstr(job_desc_ptr->std_in, buffer); + packstr(job_desc_ptr->std_out, buffer); + packstr(job_desc_ptr->work_dir, buffer); + packstr(job_desc_ptr->ckpt_dir, buffer); + + pack16(job_desc_ptr->immediate, buffer); + pack16(job_desc_ptr->requeue, buffer); + pack16(job_desc_ptr->shared, buffer); + pack16(job_desc_ptr->cpus_per_task, buffer); + pack16(job_desc_ptr->ntasks_per_node, buffer); + pack16(job_desc_ptr->ntasks_per_board, buffer); + pack16(job_desc_ptr->ntasks_per_socket, buffer); + pack16(job_desc_ptr->ntasks_per_core, buffer); + + pack16(job_desc_ptr->plane_size, buffer); + pack16(job_desc_ptr->cpu_bind_type, buffer); + pack16(job_desc_ptr->mem_bind_type, buffer); + packstr(job_desc_ptr->cpu_bind, buffer); + packstr(job_desc_ptr->mem_bind, buffer); + + pack32(job_desc_ptr->time_limit, buffer); + pack32(job_desc_ptr->time_min, buffer); + pack32(job_desc_ptr->min_cpus, buffer); + pack32(job_desc_ptr->max_cpus, buffer); + pack32(job_desc_ptr->min_nodes, buffer); + pack32(job_desc_ptr->max_nodes, buffer); + pack16(job_desc_ptr->boards_per_node, buffer); + pack16(job_desc_ptr->sockets_per_board, buffer); + pack16(job_desc_ptr->sockets_per_node, buffer); + pack16(job_desc_ptr->cores_per_socket, buffer); + pack16(job_desc_ptr->threads_per_core, buffer); + pack32(job_desc_ptr->user_id, buffer); + pack32(job_desc_ptr->group_id, buffer); + + pack16(job_desc_ptr->alloc_resp_port, buffer); + pack16(job_desc_ptr->other_port, buffer); + packstr(job_desc_ptr->network, buffer); + pack_time(job_desc_ptr->begin_time, buffer); + pack_time(job_desc_ptr->end_time, buffer); + + packstr(job_desc_ptr->licenses, buffer); + pack16(job_desc_ptr->mail_type, buffer); + packstr(job_desc_ptr->mail_user, buffer); + packstr(job_desc_ptr->reservation, buffer); + pack16(job_desc_ptr->warn_signal, buffer); + pack16(job_desc_ptr->warn_time, buffer); + packstr(job_desc_ptr->wckey, buffer); + pack32(job_desc_ptr->req_switch, buffer); + pack32(job_desc_ptr->wait4switch, buffer); + + if (job_desc_ptr->select_jobinfo) { + select_g_select_jobinfo_pack( + job_desc_ptr->select_jobinfo, + buffer, protocol_version); + } else { + job_desc_ptr->select_jobinfo = + select_g_select_jobinfo_alloc(); + if(job_desc_ptr->geometry[0] != (uint16_t) NO_VAL) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_GEOMETRY, + job_desc_ptr->geometry); + + if (job_desc_ptr->conn_type[0] != (uint16_t) NO_VAL) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_CONN_TYPE, + &(job_desc_ptr->conn_type)); + if (job_desc_ptr->reboot != (uint16_t) NO_VAL) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_REBOOT, + &(job_desc_ptr->reboot)); + if (job_desc_ptr->rotate != (uint16_t) NO_VAL) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_ROTATE, + &(job_desc_ptr->rotate)); + if (job_desc_ptr->blrtsimage) { + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_BLRTS_IMAGE, + job_desc_ptr->blrtsimage); + } + if (job_desc_ptr->linuximage) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_LINUX_IMAGE, + job_desc_ptr->linuximage); + if (job_desc_ptr->mloaderimage) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_MLOADER_IMAGE, + job_desc_ptr->mloaderimage); + if (job_desc_ptr->ramdiskimage) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_RAMDISK_IMAGE, + job_desc_ptr->ramdiskimage); + select_g_select_jobinfo_pack( + job_desc_ptr->select_jobinfo, + buffer, protocol_version); + select_g_select_jobinfo_free( + job_desc_ptr->select_jobinfo); + job_desc_ptr->select_jobinfo = NULL; + } + pack16(job_desc_ptr->wait_all_nodes, buffer); + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { pack16(job_desc_ptr->contiguous, buffer); pack16(job_desc_ptr->task_dist, buffer); pack16(job_desc_ptr->kill_on_node_fail, buffer); @@ -6862,21 +7896,156 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer, } } -/* _unpack_job_desc_msg - * unpacks a job_desc struct - * OUT job_desc_buffer_ptr - place to put pointer to allocated job desc struct - * IN/OUT buffer - source of the unpack, contains pointers that are - * automatically updated - */ -static int -_unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer, - uint16_t protocol_version) -{ - uint32_t uint32_tmp; - job_desc_msg_t *job_desc_ptr; +/* _unpack_job_desc_msg + * unpacks a job_desc struct + * OUT job_desc_buffer_ptr - place to put pointer to allocated job desc struct + * IN/OUT buffer - source of the unpack, contains pointers that are + * automatically updated + */ +static int +_unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer, + uint16_t protocol_version) +{ + uint32_t uint32_tmp; + job_desc_msg_t *job_desc_ptr; + + /* alloc memory for structure */ + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + job_desc_ptr = xmalloc(sizeof(job_desc_msg_t)); + *job_desc_buffer_ptr = job_desc_ptr; + + /* load the data values */ + safe_unpack16(&job_desc_ptr->contiguous, buffer); + safe_unpack16(&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); + safe_unpackstr_xmalloc(&job_desc_ptr->gres, &uint32_tmp,buffer); + safe_unpack32(&job_desc_ptr->job_id, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->name, + &uint32_tmp, buffer); + + safe_unpackstr_xmalloc(&job_desc_ptr->alloc_node, + &uint32_tmp, buffer); + safe_unpack32(&job_desc_ptr->alloc_sid, 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_unpackstr_xmalloc(&job_desc_ptr->partition, + &uint32_tmp, buffer); + safe_unpack32(&job_desc_ptr->priority, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->dependency, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->account, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->comment, + &uint32_tmp, buffer); + safe_unpack16(&job_desc_ptr->nice, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->qos, &uint32_tmp, + buffer); + + safe_unpack8(&job_desc_ptr->open_mode, buffer); + safe_unpack8(&job_desc_ptr->overcommit, buffer); + safe_unpack16(&job_desc_ptr->acctg_freq, buffer); + safe_unpack32(&job_desc_ptr->num_tasks, buffer); + safe_unpack16(&job_desc_ptr->ckpt_interval, buffer); + + safe_unpackstr_xmalloc(&job_desc_ptr->req_nodes, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->exc_nodes, + &uint32_tmp, buffer); + safe_unpackstr_array(&job_desc_ptr->environment, + &job_desc_ptr->env_size, buffer); + safe_unpackstr_array(&job_desc_ptr->spank_job_env, + &job_desc_ptr->spank_job_env_size, + buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->script, + &uint32_tmp, buffer); + safe_unpackstr_array(&job_desc_ptr->argv, + &job_desc_ptr->argc, buffer); + + safe_unpackstr_xmalloc(&job_desc_ptr->std_err, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->std_in, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->std_out, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->work_dir, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->ckpt_dir, + &uint32_tmp, buffer); + + safe_unpack16(&job_desc_ptr->immediate, buffer); + safe_unpack16(&job_desc_ptr->requeue, buffer); + safe_unpack16(&job_desc_ptr->shared, buffer); + safe_unpack16(&job_desc_ptr->cpus_per_task, buffer); + safe_unpack16(&job_desc_ptr->ntasks_per_node, buffer); + safe_unpack16(&job_desc_ptr->ntasks_per_board, buffer); + safe_unpack16(&job_desc_ptr->ntasks_per_socket, buffer); + safe_unpack16(&job_desc_ptr->ntasks_per_core, buffer); + + safe_unpack16(&job_desc_ptr->plane_size, buffer); + safe_unpack16(&job_desc_ptr->cpu_bind_type, buffer); + safe_unpack16(&job_desc_ptr->mem_bind_type, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->cpu_bind, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->mem_bind, + &uint32_tmp, buffer); + + safe_unpack32(&job_desc_ptr->time_limit, buffer); + safe_unpack32(&job_desc_ptr->time_min, buffer); + safe_unpack32(&job_desc_ptr->min_cpus, buffer); + safe_unpack32(&job_desc_ptr->max_cpus, buffer); + safe_unpack32(&job_desc_ptr->min_nodes, buffer); + safe_unpack32(&job_desc_ptr->max_nodes, buffer); + safe_unpack16(&job_desc_ptr->boards_per_node, buffer); + safe_unpack16(&job_desc_ptr->sockets_per_board, buffer); + safe_unpack16(&job_desc_ptr->sockets_per_node, buffer); + safe_unpack16(&job_desc_ptr->cores_per_socket, buffer); + safe_unpack16(&job_desc_ptr->threads_per_core, buffer); + safe_unpack32(&job_desc_ptr->user_id, buffer); + safe_unpack32(&job_desc_ptr->group_id, buffer); + + safe_unpack16(&job_desc_ptr->alloc_resp_port, buffer); + safe_unpack16(&job_desc_ptr->other_port, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->network, + &uint32_tmp, buffer); + safe_unpack_time(&job_desc_ptr->begin_time, buffer); + safe_unpack_time(&job_desc_ptr->end_time, buffer); - /* alloc memory for structure */ - if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { + safe_unpackstr_xmalloc(&job_desc_ptr->licenses, + &uint32_tmp, buffer); + safe_unpack16(&job_desc_ptr->mail_type, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->mail_user, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->reservation, + &uint32_tmp, buffer); + safe_unpack16(&job_desc_ptr->warn_signal, buffer); + safe_unpack16(&job_desc_ptr->warn_time, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->wckey, + &uint32_tmp, buffer); + safe_unpack32(&job_desc_ptr->req_switch, buffer); + safe_unpack32(&job_desc_ptr->wait4switch, buffer); + + if (select_g_select_jobinfo_unpack( + &job_desc_ptr->select_jobinfo, + buffer, protocol_version)) + goto unpack_error; + + /* These are set so we don't confuse them later for what is + * set in the select_jobinfo structure. + */ + 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; + job_desc_ptr->mloaderimage = NULL; + job_desc_ptr->ramdiskimage = NULL; + safe_unpack16(&job_desc_ptr->wait_all_nodes, buffer); + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { job_desc_ptr = xmalloc(sizeof(job_desc_msg_t)); *job_desc_buffer_ptr = job_desc_ptr; @@ -7562,7 +8731,79 @@ _pack_launch_tasks_request_msg(launch_tasks_request_msg_t * msg, Buf buffer, int i = 0; xassert(msg != NULL); - if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + pack32(msg->job_id, buffer); + pack32(msg->job_step_id, buffer); + pack32(msg->ntasks, buffer); + pack32(msg->uid, 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); + pack16(msg->task_dist, buffer); + + slurm_cred_pack(msg->cred, buffer); + for (i = 0; i < msg->nnodes; i++) { + pack16(msg->tasks_to_launch[i], buffer); + pack16(msg->cpus_allocated[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); + } + packstr(msg->task_prolog, buffer); + packstr(msg->task_epilog, buffer); + pack16(msg->slurmd_debug, buffer); + switch_pack_jobinfo(msg->switch_job, buffer); + 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); + pack16(msg->acctg_freq, buffer); + pack32(msg->cpu_freq, 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_2_4_PROTOCOL_VERSION) { pack32(msg->job_id, buffer); pack32(msg->job_step_id, buffer); pack32(msg->ntasks, buffer); @@ -7838,7 +9079,103 @@ _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_2_4_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpack32(&msg->job_id, buffer); + safe_unpack32(&msg->job_step_id, buffer); + safe_unpack32(&msg->ntasks, buffer); + safe_unpack32(&msg->uid, buffer); + safe_unpack32(&msg->gid, buffer); + safe_unpack32(&msg->job_mem_lim, buffer); + safe_unpack32(&msg->step_mem_lim, buffer); + + safe_unpack32(&msg->nnodes, buffer); + safe_unpack16(&msg->cpus_per_task, buffer); + safe_unpack16(&msg->task_dist, buffer); + + if (!(msg->cred = slurm_cred_unpack(buffer, protocol_version))) + goto unpack_error; + msg->tasks_to_launch = xmalloc(sizeof(uint16_t) * msg->nnodes); + msg->cpus_allocated = 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_unpack16(&msg->cpus_allocated[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_unpackstr_xmalloc(&msg->task_prolog, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->task_epilog, &uint32_tmp, buffer); + safe_unpack16(&msg->slurmd_debug, buffer); + + switch_alloc_jobinfo(&msg->switch_job); + if (switch_unpack_jobinfo(msg->switch_job, buffer) < 0) { + error("switch_unpack_jobinfo: %m"); + switch_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_unpack16(&msg->acctg_freq, buffer); + safe_unpack32(&msg->cpu_freq, 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 if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { safe_unpack32(&msg->job_id, buffer); safe_unpack32(&msg->job_step_id, buffer); safe_unpack32(&msg->ntasks, buffer); @@ -8325,7 +9662,7 @@ _pack_reboot_msg(reboot_msg_t * msg, Buf buffer, static int _unpack_reboot_msg(reboot_msg_t ** msg_ptr, Buf buffer, uint16_t protocol_version) - { +{ reboot_msg_t *msg; uint32_t uint32_tmp; @@ -8472,8 +9809,15 @@ _pack_complete_batch_script_msg( complete_batch_script_msg_t * msg, Buf buffer, uint16_t protocol_version) { - if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { - jobacct_gather_g_pack(msg->jobacct, protocol_version, buffer); + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + jobacctinfo_pack(msg->jobacct, protocol_version, buffer); + pack32(msg->job_id, buffer); + pack32(msg->job_rc, buffer); + pack32(msg->slurm_rc, buffer); + pack32(msg->user_id, buffer); + packstr(msg->node_name, buffer); + } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + jobacctinfo_pack(msg->jobacct, protocol_version, buffer); pack32((uint32_t)msg->job_id, buffer); pack32((uint32_t)msg->job_rc, buffer); pack32((uint32_t)msg->slurm_rc, buffer); @@ -8497,9 +9841,19 @@ _unpack_complete_batch_script_msg( msg = xmalloc(sizeof(complete_batch_script_msg_t)); *msg_ptr = msg; - if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { - if (jobacct_gather_g_unpack(&msg->jobacct, - protocol_version, buffer) + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + if (jobacctinfo_unpack(&msg->jobacct, + protocol_version, buffer) + != SLURM_SUCCESS) + goto unpack_error; + safe_unpack32(&msg->job_id, buffer); + safe_unpack32(&msg->job_rc, buffer); + safe_unpack32(&msg->slurm_rc, buffer); + safe_unpack32(&msg->user_id, buffer); + safe_unpackstr_xmalloc(&msg->node_name, &uint32_tmp, buffer); + } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + if (jobacctinfo_unpack(&msg->jobacct, + protocol_version, buffer) != SLURM_SUCCESS) goto unpack_error; safe_unpack32(&msg->job_id, buffer); @@ -8526,7 +9880,7 @@ _pack_job_step_stat(job_step_stat_t * msg, Buf buffer, { pack32((uint32_t)msg->return_code, buffer); pack32((uint32_t)msg->num_tasks, buffer); - jobacct_gather_g_pack(msg->jobacct, protocol_version, buffer); + jobacctinfo_pack(msg->jobacct, protocol_version, buffer); _pack_job_step_pids(msg->step_pids, buffer, protocol_version); } @@ -8543,7 +9897,7 @@ _unpack_job_step_stat(job_step_stat_t ** msg_ptr, Buf buffer, safe_unpack32(&msg->return_code, buffer); safe_unpack32(&msg->num_tasks, buffer); - if (jobacct_gather_g_unpack(&msg->jobacct, protocol_version, buffer) + if (jobacctinfo_unpack(&msg->jobacct, protocol_version, buffer) != SLURM_SUCCESS) goto unpack_error; rc = _unpack_job_step_pids(&msg->step_pids, buffer, protocol_version); @@ -8628,7 +9982,7 @@ _pack_step_complete_msg(step_complete_msg_t * msg, Buf buffer, pack32((uint32_t)msg->range_first, buffer); pack32((uint32_t)msg->range_last, buffer); pack32((uint32_t)msg->step_rc, buffer); - jobacct_gather_g_pack(msg->jobacct, protocol_version, buffer); + jobacctinfo_pack(msg->jobacct, protocol_version, buffer); } static int @@ -8645,7 +9999,7 @@ _unpack_step_complete_msg(step_complete_msg_t ** msg_ptr, Buf buffer, safe_unpack32(&msg->range_first, buffer); safe_unpack32(&msg->range_last, buffer); safe_unpack32(&msg->step_rc, buffer); - if (jobacct_gather_g_unpack(&msg->jobacct, protocol_version, buffer) + if (jobacctinfo_unpack(&msg->jobacct, protocol_version, buffer) != SLURM_SUCCESS) goto unpack_error; @@ -9044,7 +10398,7 @@ static void _pack_block_info_msg(block_info_t *block_info, Buf buffer, } extern void slurm_pack_block_job_info(block_job_info_t *block_job_info, - Buf buffer, uint16_t protocol_version) + Buf buffer, uint16_t protocol_version) { if (!block_job_info) { packnull(buffer); @@ -10755,13 +12109,26 @@ pack_multi_core_data (multi_core_data_t *multi_core, Buf buffer, pack8((uint8_t) 0xff, buffer); /* flag as Full */ - pack16(multi_core->sockets_per_node, buffer); - pack16(multi_core->cores_per_socket, buffer); - pack16(multi_core->threads_per_core, buffer); + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + pack16(multi_core->boards_per_node, buffer); + pack16(multi_core->sockets_per_board, buffer); + pack16(multi_core->sockets_per_node, buffer); + pack16(multi_core->cores_per_socket, buffer); + pack16(multi_core->threads_per_core, buffer); + + pack16(multi_core->ntasks_per_board, buffer); + pack16(multi_core->ntasks_per_socket, buffer); + pack16(multi_core->ntasks_per_core, buffer); + pack16(multi_core->plane_size, buffer); + } else { + pack16(multi_core->sockets_per_node, buffer); + pack16(multi_core->cores_per_socket, buffer); + pack16(multi_core->threads_per_core, buffer); - pack16(multi_core->ntasks_per_socket, buffer); - pack16(multi_core->ntasks_per_core, buffer); - pack16(multi_core->plane_size, buffer); + pack16(multi_core->ntasks_per_socket, buffer); + pack16(multi_core->ntasks_per_core, buffer); + pack16(multi_core->plane_size, buffer); + } } extern int @@ -10780,14 +12147,24 @@ unpack_multi_core_data (multi_core_data_t **mc_ptr, Buf buffer, multi_core = xmalloc(sizeof(multi_core_data_t)); - safe_unpack16(&multi_core->sockets_per_node, buffer); - safe_unpack16(&multi_core->cores_per_socket, buffer); - safe_unpack16(&multi_core->threads_per_core, buffer); - - safe_unpack16(&multi_core->ntasks_per_socket, buffer); - safe_unpack16(&multi_core->ntasks_per_core, buffer); - safe_unpack16(&multi_core->plane_size, buffer); - + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpack16(&multi_core->boards_per_node, buffer); + safe_unpack16(&multi_core->sockets_per_board, buffer); + safe_unpack16(&multi_core->sockets_per_node, buffer); + safe_unpack16(&multi_core->cores_per_socket, buffer); + safe_unpack16(&multi_core->threads_per_core, buffer); + safe_unpack16(&multi_core->ntasks_per_board, buffer); + safe_unpack16(&multi_core->ntasks_per_socket, buffer); + safe_unpack16(&multi_core->ntasks_per_core, buffer); + safe_unpack16(&multi_core->plane_size, buffer); + } else { + safe_unpack16(&multi_core->sockets_per_node, buffer); + safe_unpack16(&multi_core->cores_per_socket, buffer); + safe_unpack16(&multi_core->threads_per_core, buffer); + safe_unpack16(&multi_core->ntasks_per_socket, buffer); + safe_unpack16(&multi_core->ntasks_per_core, buffer); + safe_unpack16(&multi_core->plane_size, buffer); + } *mc_ptr = multi_core; return SLURM_SUCCESS; @@ -10801,23 +12178,44 @@ static void _pack_slurmd_status(slurmd_status_t *msg, Buf buffer, { xassert(msg); - pack_time(msg->booted, buffer); - pack_time(msg->last_slurmctld_msg, buffer); + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + pack_time(msg->booted, buffer); + pack_time(msg->last_slurmctld_msg, buffer); - pack16(msg->slurmd_debug, buffer); - pack16(msg->actual_cpus, buffer); - pack16(msg->actual_sockets, buffer); - pack16(msg->actual_cores, buffer); - pack16(msg->actual_threads, buffer); - - pack32(msg->actual_real_mem, buffer); - pack32(msg->actual_tmp_disk, buffer); - pack32(msg->pid, buffer); + pack16(msg->slurmd_debug, buffer); + pack16(msg->actual_cpus, buffer); + pack16(msg->actual_boards, buffer); + pack16(msg->actual_sockets, buffer); + pack16(msg->actual_cores, buffer); + pack16(msg->actual_threads, buffer); + + pack32(msg->actual_real_mem, buffer); + pack32(msg->actual_tmp_disk, buffer); + pack32(msg->pid, buffer); + + packstr(msg->hostname, buffer); + packstr(msg->slurmd_logfile, buffer); + packstr(msg->step_list, buffer); + packstr(msg->version, buffer); + } else { + pack_time(msg->booted, buffer); + pack_time(msg->last_slurmctld_msg, buffer); - packstr(msg->hostname, buffer); - packstr(msg->slurmd_logfile, buffer); - packstr(msg->step_list, buffer); - packstr(msg->version, buffer); + pack16(msg->slurmd_debug, buffer); + pack16(msg->actual_cpus, buffer); + pack16(msg->actual_sockets, buffer); + pack16(msg->actual_cores, buffer); + pack16(msg->actual_threads, buffer); + + pack32(msg->actual_real_mem, buffer); + pack32(msg->actual_tmp_disk, buffer); + pack32(msg->pid, buffer); + + packstr(msg->hostname, buffer); + packstr(msg->slurmd_logfile, buffer); + packstr(msg->step_list, buffer); + packstr(msg->version, buffer); + } } static int _unpack_slurmd_status(slurmd_status_t **msg_ptr, Buf buffer, @@ -10830,23 +12228,48 @@ static int _unpack_slurmd_status(slurmd_status_t **msg_ptr, Buf buffer, msg = xmalloc(sizeof(slurmd_status_t)); - safe_unpack_time(&msg->booted, buffer); - safe_unpack_time(&msg->last_slurmctld_msg, buffer); - - safe_unpack16(&msg->slurmd_debug, buffer); - safe_unpack16(&msg->actual_cpus, buffer); - safe_unpack16(&msg->actual_sockets, buffer); - safe_unpack16(&msg->actual_cores, buffer); - safe_unpack16(&msg->actual_threads, buffer); + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpack_time(&msg->booted, buffer); + safe_unpack_time(&msg->last_slurmctld_msg, buffer); - safe_unpack32(&msg->actual_real_mem, buffer); - safe_unpack32(&msg->actual_tmp_disk, buffer); - safe_unpack32(&msg->pid, buffer); + safe_unpack16(&msg->slurmd_debug, buffer); + safe_unpack16(&msg->actual_cpus, buffer); + safe_unpack16(&msg->actual_boards, buffer); + safe_unpack16(&msg->actual_sockets, buffer); + safe_unpack16(&msg->actual_cores, buffer); + safe_unpack16(&msg->actual_threads, buffer); + + safe_unpack32(&msg->actual_real_mem, buffer); + safe_unpack32(&msg->actual_tmp_disk, buffer); + safe_unpack32(&msg->pid, buffer); + + safe_unpackstr_xmalloc(&msg->hostname, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->slurmd_logfile, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->step_list, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->version, + &uint32_tmp, buffer); + } else { + safe_unpack_time(&msg->booted, buffer); + safe_unpack_time(&msg->last_slurmctld_msg, buffer); - safe_unpackstr_xmalloc(&msg->hostname, &uint32_tmp, buffer); - safe_unpackstr_xmalloc(&msg->slurmd_logfile, &uint32_tmp, buffer); - safe_unpackstr_xmalloc(&msg->step_list, &uint32_tmp, buffer); - safe_unpackstr_xmalloc(&msg->version, &uint32_tmp, buffer); + safe_unpack16(&msg->slurmd_debug, buffer); + safe_unpack16(&msg->actual_cpus, buffer); + safe_unpack16(&msg->actual_sockets, buffer); + safe_unpack16(&msg->actual_cores, buffer); + safe_unpack16(&msg->actual_threads, buffer); + + safe_unpack32(&msg->actual_real_mem, buffer); + safe_unpack32(&msg->actual_tmp_disk, buffer); + safe_unpack32(&msg->pid, buffer); + + safe_unpackstr_xmalloc(&msg->hostname, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->slurmd_logfile, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->step_list, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->version, &uint32_tmp, buffer); + } *msg_ptr = msg; return SLURM_SUCCESS; diff --git a/src/common/slurm_protocol_util.c b/src/common/slurm_protocol_util.c index b513bbec2342a6c86b50fde5915c8d88557498dd..3a46d30b4fc4b467d3c3b1aacbb55c82ec4c1fb6 100644 --- a/src/common/slurm_protocol_util.c +++ b/src/common/slurm_protocol_util.c @@ -52,8 +52,10 @@ uint16_t _get_slurm_version(uint32_t rpc_version) { uint16_t version; - if (rpc_version >= 10) + if (rpc_version >= 11) version = SLURM_PROTOCOL_VERSION; + else if (rpc_version >= 10) + version = SLURM_2_4_PROTOCOL_VERSION; else if (rpc_version >= 9) version = SLURM_2_3_PROTOCOL_VERSION; else if (rpc_version >= 8) @@ -84,6 +86,7 @@ int check_header_version(header_t * header) if (slurmdbd_conf) { if ((header->version != SLURM_PROTOCOL_VERSION) && + (header->version != SLURM_2_4_PROTOCOL_VERSION) && (header->version != SLURM_2_3_PROTOCOL_VERSION) && (header->version != SLURM_2_2_PROTOCOL_VERSION) && (header->version != SLURM_2_1_PROTOCOL_VERSION)) @@ -147,9 +150,10 @@ int check_header_version(header_t * header) case REQUEST_UPDATE_NODE: case REQUEST_UPDATE_PARTITION: case REQUEST_UPDATE_RESERVATION: - if ((header->version == SLURM_2_3_PROTOCOL_VERSION) - || (header->version == SLURM_2_2_PROTOCOL_VERSION) - || (header->version == SLURM_2_1_PROTOCOL_VERSION)) + if ((header->version == SLURM_2_4_PROTOCOL_VERSION) || + (header->version == SLURM_2_3_PROTOCOL_VERSION) || + (header->version == SLURM_2_2_PROTOCOL_VERSION) || + (header->version == SLURM_2_1_PROTOCOL_VERSION)) break; default: debug("unsupported RPC %d", header->msg_type); @@ -176,15 +180,17 @@ void init_header(header_t *header, slurm_msg_t *msg, uint16_t flags) if (msg->protocol_version != (uint16_t)NO_VAL) header->version = msg->protocol_version; else if (working_cluster_rec) - header->version = _get_slurm_version( + msg->protocol_version = header->version = _get_slurm_version( working_cluster_rec->rpc_version); else if ((msg->msg_type == ACCOUNTING_UPDATE_MSG) || (msg->msg_type == ACCOUNTING_FIRST_REG)) { uint32_t rpc_version = ((accounting_update_msg_t *)msg->data)->rpc_version; - header->version = _get_slurm_version(rpc_version); + msg->protocol_version = header->version = + _get_slurm_version(rpc_version); } else - header->version = SLURM_PROTOCOL_VERSION; + msg->protocol_version = header->version = + SLURM_PROTOCOL_VERSION; header->flags = flags; header->msg_type = msg->msg_type; diff --git a/src/common/slurm_step_layout.c b/src/common/slurm_step_layout.c index ffc0e2a9c9692b41d52e602032a6e11dd1fa6d8e..ef6ab37df999069e098c7fb54319f5f8a7fe0b23 100644 --- a/src/common/slurm_step_layout.c +++ b/src/common/slurm_step_layout.c @@ -164,11 +164,10 @@ slurm_step_layout_t *fake_slurm_step_layout_create( { uint32_t cpn = 1; int cpu_cnt = 0, cpu_inx = 0, i, j; -/* char *name = NULL; */ hostlist_t hl = NULL; slurm_step_layout_t *step_layout = NULL; - if((node_cnt <= 0) || (task_cnt <= 0 && !cpus_per_node) || !tlist) { + if ((node_cnt <= 0) || (task_cnt <= 0 && !cpus_per_node) || !tlist) { error("there is a problem with your fake_step_layout request\n" "node_cnt = %u, task_cnt = %u, tlist = %s", node_cnt, task_cnt, tlist); @@ -177,7 +176,7 @@ slurm_step_layout_t *fake_slurm_step_layout_create( hl = hostlist_create(tlist); /* make out how many cpus there are on each node */ - if(task_cnt > 0) + if (task_cnt > 0) cpn = (task_cnt + node_cnt - 1) / node_cnt; step_layout = xmalloc(sizeof(slurm_step_layout_t)); @@ -185,17 +184,15 @@ slurm_step_layout_t *fake_slurm_step_layout_create( step_layout->node_cnt = node_cnt; step_layout->tasks = xmalloc(sizeof(uint16_t) * node_cnt); step_layout->tids = xmalloc(sizeof(uint32_t *) * node_cnt); -/* step_layout->node_addr = */ -/* xmalloc(sizeof(slurm_addr_t) * node_cnt); */ step_layout->task_cnt = 0; - for (i=0; inode_cnt; i++) { - if(cpus_per_node && cpu_count_reps) { + for (i = 0; i < step_layout->node_cnt; i++) { + if (cpus_per_node && cpu_count_reps) { step_layout->tasks[i] = cpus_per_node[cpu_inx]; step_layout->tids[i] = xmalloc(sizeof(uint32_t) * step_layout->tasks[i]); - for (j=0; jtasks[i]; j++) + for (j = 0; j < step_layout->tasks[i]; j++) step_layout->tids[i][j] = step_layout->task_cnt++; @@ -205,7 +202,7 @@ slurm_step_layout_t *fake_slurm_step_layout_create( cpu_cnt = 0; } } else { - if(step_layout->task_cnt >= task_cnt) { + if (step_layout->task_cnt >= task_cnt) { step_layout->tasks[i] = 0; step_layout->tids[i] = NULL; } else { @@ -213,7 +210,7 @@ slurm_step_layout_t *fake_slurm_step_layout_create( step_layout->tids[i] = xmalloc(sizeof(uint32_t) * cpn); - for (j=0; jtids[i][j] = step_layout->task_cnt++; if(step_layout->task_cnt >= task_cnt) { @@ -223,26 +220,9 @@ slurm_step_layout_t *fake_slurm_step_layout_create( } } } -/* name = hostlist_shift(hl); */ -/* if(!name) { */ -/* error("fake_slurm_step_layout_create: " */ -/* "We don't have the correct nodelist."); */ -/* goto error; */ -/* } */ -/* if(slurm_conf_get_addr(name, &step_layout->node_addr[i]) == */ -/* SLURM_ERROR) { */ -/* error("fake_slurm_step_layout_create: " */ -/* "we didn't get an addr for host %s.", name); */ - -/* } */ -/* free(name); */ } hostlist_destroy(hl); return step_layout; -/* error: */ -/* hostlist_destroy(hl); */ -/* slurm_step_layout_destroy(step_layout); */ -/* return NULL; */ } @@ -252,8 +232,8 @@ extern slurm_step_layout_t *slurm_step_layout_copy( slurm_step_layout_t *step_layout) { slurm_step_layout_t *layout; - int i=0; - if(!step_layout) + int i = 0; + if (!step_layout) return NULL; layout = xmalloc(sizeof(slurm_step_layout_t)); @@ -262,16 +242,12 @@ extern slurm_step_layout_t *slurm_step_layout_copy( layout->task_cnt = step_layout->task_cnt; layout->task_dist = step_layout->task_dist; -/* layout->node_addr = xmalloc(sizeof(slurm_addr_t) * layout->node_cnt); */ -/* memcpy(layout->node_addr, step_layout->node_addr, */ -/* (sizeof(slurm_addr_t) * layout->node_cnt)); */ - layout->tasks = xmalloc(sizeof(uint16_t) * layout->node_cnt); memcpy(layout->tasks, step_layout->tasks, (sizeof(uint16_t) * layout->node_cnt)); layout->tids = xmalloc(sizeof(uint32_t *) * layout->node_cnt); - for (i=0; inode_cnt; i++) { + for (i = 0; i < layout->node_cnt; i++) { layout->tids[i] = xmalloc(sizeof(uint32_t) * layout->tasks[i]); memcpy(layout->tids[i], step_layout->tids[i], (sizeof(uint32_t) * layout->tasks[i])); @@ -283,7 +259,7 @@ extern slurm_step_layout_t *slurm_step_layout_copy( extern void pack_slurm_step_layout(slurm_step_layout_t *step_layout, Buf buffer, uint16_t protocol_version) { - uint16_t i = 0; + uint32_t i = 0; if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { if (step_layout) @@ -412,7 +388,7 @@ extern int slurm_step_layout_destroy(slurm_step_layout_t *step_layout) int slurm_step_layout_host_id (slurm_step_layout_t *s, int taskid) { int i, j; - if (taskid > s->task_cnt - 1) + if (!s->tasks || !s->tids || (taskid > s->task_cnt - 1)) return SLURM_ERROR; for (i=0; i < s->node_cnt; i++) for (j=0; jtasks[i]; j++) @@ -650,15 +626,14 @@ static int _task_layout_cyclic(slurm_step_layout_t *step_layout, int i, j, taskid = 0; bool over_subscribe = false; - for (i=0; inode_cnt; i++) { - step_layout->tids[i] = xmalloc(sizeof(uint32_t) - * step_layout->task_cnt); - } for (j=0; taskidtask_cnt; j++) { /* cycle counter */ bool space_remaining = false; for (i=0; ((inode_cnt) && (taskidtask_cnt)); i++) { if ((jtids[i], sizeof(uint32_t) + * (step_layout->tasks[i] + 1)); + step_layout->tids[i][step_layout->tasks[i]] = taskid; taskid++; diff --git a/src/common/slurm_topology.c b/src/common/slurm_topology.c index a6ea794f6e552d4fc7891f987935846a428cfd53..264ee2789e12419b0e82d8501a7b5026f0bc4a0e 100644 --- a/src/common/slurm_topology.c +++ b/src/common/slurm_topology.c @@ -1,3 +1,4 @@ + /*****************************************************************************\ * slurm_topology.c - Topology plugin function setup. ***************************************************************************** @@ -61,137 +62,19 @@ typedef struct slurm_topo_ops { char** pattern ); } slurm_topo_ops_t; +/* + * Must be synchronized with slurm_topo_ops_t above. + */ +static const char *syms[] = { + "topo_build_config", + "topo_generate_node_ranking", + "topo_get_node_addr", +}; -/* ************************************************************************ */ -/* TAG( slurm_topo_contex_t ) */ -/* ************************************************************************ */ -typedef struct slurm_topo_context { - char *topo_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int topo_errno; - slurm_topo_ops_t ops; -} slurm_topo_context_t; - -static slurm_topo_context_t *g_topo_context = NULL; -static pthread_mutex_t g_topo_context_lock = PTHREAD_MUTEX_INITIALIZER; - - -/* ************************************************************************ */ -/* TAG( slurm_topo_get_ops ) */ -/* ************************************************************************ */ -static slurm_topo_ops_t * -slurm_topo_get_ops( slurm_topo_context_t *c ) -{ - /* - * Must be synchronized with slurm_topo_ops_t above. - */ - static const char *syms[] = { - "topo_build_config", - "topo_generate_node_ranking", - "topo_get_node_addr", - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->topo_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->topo_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->topo_type); - - /* Get plugin list. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "cannot create plugin manager" ); - return NULL; - } - plugrack_set_major_type( c->plugin_list, "topo" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - c->cur_plugin = plugrack_use_by_type( c->plugin_list, c->topo_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "cannot find topology plugin for %s", c->topo_type ); - return NULL; - } - - /* Dereference the API. */ - if ( plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops ) < n_syms ) { - error( "incomplete topology plugin detected" ); - return NULL; - } - - return &c->ops; -} - - -/* ************************************************************************ */ -/* TAG( slurm_topo_context_create ) */ -/* ************************************************************************ */ -static slurm_topo_context_t * -slurm_topo_context_create( const char *topo_type ) -{ - slurm_topo_context_t *c; - - if ( topo_type == NULL ) { - debug3( "slurm_topo_context: no topology type" ); - return NULL; - } - - c = xmalloc( sizeof( slurm_topo_context_t ) ); - c->topo_type = xstrdup( topo_type ); - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - c->topo_errno = SLURM_SUCCESS; - - return c; -} - - -/* ************************************************************************ */ -/* TAG( slurm_topo_context_destroy ) */ -/* ************************************************************************ */ -static int -slurm_topo_context_destroy( slurm_topo_context_t *c ) -{ - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - return SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree( c->topo_type ); - xfree( c ); - - return SLURM_SUCCESS; -} - +static slurm_topo_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; /* *********************************************************************** */ /* TAG( slurm_topo_init ) */ @@ -205,32 +88,32 @@ extern int slurm_topo_init( void ) { int retval = SLURM_SUCCESS; - char *topo_type = NULL; + char *plugin_type = "topo"; + char *type = NULL; - slurm_mutex_lock( &g_topo_context_lock ); + if (init_run && g_context) + return retval; - if ( g_topo_context ) - goto done; + slurm_mutex_lock(&g_context_lock); - topo_type = slurm_get_topology_plugin(); - g_topo_context = slurm_topo_context_create( topo_type ); - if ( g_topo_context == NULL ) { - error( "cannot create topology context for %s", - topo_type ); - retval = SLURM_ERROR; + if (g_context) goto done; - } - if ( slurm_topo_get_ops( g_topo_context ) == NULL ) { - error( "cannot resolve topology plugin operations" ); - slurm_topo_context_destroy( g_topo_context ); - g_topo_context = NULL; + type = slurm_get_topology_plugin(); + + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); + + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; + goto done; } + init_run = true; done: - slurm_mutex_unlock( &g_topo_context_lock ); - xfree(topo_type); + slurm_mutex_unlock(&g_context_lock); + xfree(type); return retval; } @@ -242,11 +125,12 @@ slurm_topo_fini( void ) { int rc; - if (!g_topo_context) + if (!g_context) return SLURM_SUCCESS; - rc = slurm_topo_context_destroy(g_topo_context); - g_topo_context = NULL; + init_run = false; + rc = plugin_context_destroy(g_context); + g_context = NULL; return rc; } @@ -264,7 +148,7 @@ slurm_topo_build_config( void ) return SLURM_ERROR; START_TIMER; - rc = (*(g_topo_context->ops.build_config))(); + rc = (*(ops.build_config))(); END_TIMER3("slurm_topo_build_config", 20000); return rc; @@ -281,7 +165,7 @@ slurm_topo_generate_node_ranking( void ) if ( slurm_topo_init() < 0 ) return SLURM_ERROR; - return (*(g_topo_context->ops.node_ranking))(); + return (*(ops.node_ranking))(); } /* *********************************************************************** */ @@ -293,6 +177,6 @@ slurm_topo_get_node_addr( char* node_name, char ** addr, char** pattern ) if ( slurm_topo_init() < 0 ) return SLURM_ERROR; - return (*(g_topo_context->ops.get_node_addr))(node_name,addr,pattern); + return (*(ops.get_node_addr))(node_name,addr,pattern); } diff --git a/src/common/slurm_xlator.h b/src/common/slurm_xlator.h index 55e0df9bd25dfb582602aac5d0d792063f00adfc..8c73a35bd81163b1ba006fdb2c6ede3759c62c9c 100644 --- a/src/common/slurm_xlator.h +++ b/src/common/slurm_xlator.h @@ -342,10 +342,10 @@ #define plugrack_set_paranoia slurm_plugrack_set_paranoia #define plugrack_use_by_type slurm_plugrack_use_by_type -#define jobacct_common_pack slurm_jobacct_common_pack -#define jobacct_common_unpack slurm_jobacct_common_unpack -#define jobacct_common_alloc_jobacct slurm_jobacct_common_alloc_jobacct -#define jobacct_common_free_jobacct slurm_jobacct_common_free_jobacct +#define jobacctinfo_pack slurm_jobacctinfo_pack +#define jobacctinfo_unpack slurm_jobacctinfo_unpack +#define jobacctinfo_create slurm_jobacctinfo_create +#define jobacctinfo_destroy slurm_jobacctinfo_destroy /* node_select.[ch] functions */ #define destroy_select_ba_request slurm_destroy_select_ba_request @@ -363,7 +363,7 @@ #include "src/common/arg_desc.h" #include "src/common/bitstring.h" #include "src/common/hostlist.h" -#include "src/common/jobacct_common.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/list.h" #include "src/common/log.h" #include "src/common/macros.h" diff --git a/src/common/slurmdbd_defs.c b/src/common/slurmdbd_defs.c index 33856aa873a8d7829d6454a50b01e2c4018d49d8..3f188ff72c13f1c924a0a5a8f7b75badfce58b2d 100644 --- a/src/common/slurmdbd_defs.c +++ b/src/common/slurmdbd_defs.c @@ -3851,8 +3851,8 @@ slurmdbd_pack_step_complete_msg(dbd_step_comp_msg_t *msg, pack32(msg->db_index, buffer); pack_time(msg->end_time, buffer); pack32(msg->exit_code, buffer); - jobacct_common_pack((struct jobacctinfo *)msg->jobacct, - rpc_version, buffer); + jobacctinfo_pack((struct jobacctinfo *)msg->jobacct, + rpc_version, buffer); pack32(msg->job_id, buffer); pack32(msg->req_uid, buffer); pack_time(msg->start_time, buffer); @@ -3871,8 +3871,8 @@ slurmdbd_unpack_step_complete_msg(dbd_step_comp_msg_t **msg, safe_unpack32(&msg_ptr->db_index, buffer); safe_unpack_time(&msg_ptr->end_time, buffer); safe_unpack32(&msg_ptr->exit_code, buffer); - jobacct_common_unpack((struct jobacctinfo **)&msg_ptr->jobacct, - rpc_version, buffer); + jobacctinfo_unpack((struct jobacctinfo **)&msg_ptr->jobacct, + rpc_version, buffer); safe_unpack32(&msg_ptr->job_id, buffer); safe_unpack32(&msg_ptr->req_uid, buffer); safe_unpack_time(&msg_ptr->start_time, buffer); diff --git a/src/common/slurmdbd_defs.h b/src/common/slurmdbd_defs.h index 7f983253a46ae7da5890ac2fc504734b2fa7a5d0..c5bae14df57b375daac6703ab3a4bec28317b32e 100644 --- a/src/common/slurmdbd_defs.h +++ b/src/common/slurmdbd_defs.h @@ -76,7 +76,7 @@ * communicating with it (e.g. it will not accept messages with a * version higher than SLURMDBD_VERSION). */ -#define SLURMDBD_VERSION 10 /* already changed for 2.4 */ +#define SLURMDBD_VERSION 11 /* already changed for 2.5 */ #define SLURMDBD_VERSION_MIN 7 /* SLURM DBD message types */ diff --git a/src/common/stepd_api.c b/src/common/stepd_api.c index cdfe7e653a043dd64baf94ab0dbf9ebc418203aa..f9eba9eb012dba81a15cbd6362dc8de354a2f03d 100644 --- a/src/common/stepd_api.c +++ b/src/common/stepd_api.c @@ -885,7 +885,7 @@ stepd_completion(int fd, step_complete_msg_t *sent) safe_write(fd, &sent->range_first, sizeof(int)); safe_write(fd, &sent->range_last, sizeof(int)); safe_write(fd, &sent->step_rc, sizeof(int)); - jobacct_gather_g_setinfo(sent->jobacct, JOBACCT_DATA_PIPE, &fd); + jobacctinfo_setinfo(sent->jobacct, JOBACCT_DATA_PIPE, &fd); /* Receive the return code and errno */ safe_read(fd, &rc, sizeof(int)); safe_read(fd, &errnum, sizeof(int)); @@ -920,7 +920,7 @@ rwfail: * Do pack/unpack instead to be sure of independances of * slurmd and slurmstepd */ - jobacct_gather_g_pack(sent->jobacct, SLURM_PROTOCOL_VERSION, buffer); + jobacctinfo_pack(sent->jobacct, SLURM_PROTOCOL_VERSION, buffer); len = get_buf_offset(buffer); safe_write(fd, &len, sizeof(int)); safe_write(fd, get_buf_data(buffer), len); @@ -986,14 +986,14 @@ stepd_stat_jobacct(int fd, job_step_id_msg_t *sent, job_step_stat_t *resp) safe_write(fd, &req, sizeof(int)); /* Receive the jobacct struct and return */ - resp->jobacct = jobacct_gather_g_create(NULL); + resp->jobacct = jobacctinfo_create(NULL); /* Do not attempt reading data until there is something to read. * Avoid locking the jobacct_gather plugin early and creating * possible deadlock. */ if (_wait_fd_readable(fd)) goto rwfail; - rc = jobacct_gather_g_getinfo(resp->jobacct, JOBACCT_DATA_PIPE, &fd); + rc = jobacctinfo_getinfo(resp->jobacct, JOBACCT_DATA_PIPE, &fd); safe_read(fd, &tasks, sizeof(int)); resp->num_tasks = tasks; @@ -1001,7 +1001,7 @@ stepd_stat_jobacct(int fd, job_step_id_msg_t *sent, job_step_stat_t *resp) return rc; rwfail: error("gathering job accounting: %d", rc); - jobacct_gather_g_destroy(resp->jobacct); + jobacctinfo_destroy(resp->jobacct); resp->jobacct = NULL; return rc; } diff --git a/src/common/strnatcmp.c b/src/common/strnatcmp.c new file mode 100644 index 0000000000000000000000000000000000000000..c91d87fc00c7d7e2225e1c266d404417afc74d10 --- /dev/null +++ b/src/common/strnatcmp.c @@ -0,0 +1,178 @@ +/* -*- mode: c; c-file-style: "k&r" -*- + + strnatcmp.c -- Perform 'natural order' comparisons of strings in C. + Copyright (C) 2000, 2004 by Martin Pool + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + + +/* partial change history: + * + * 2004-10-10 mbp: Lift out character type dependencies into macros. + * + * Eric Sosman pointed out that ctype functions take a parameter whose + * value must be that of an unsigned int, even on platforms that have + * negative chars in their default char type. + */ + +#include +#include +#include +#include + +#include "strnatcmp.h" + + +/* These are defined as macros to make it easier to adapt this code to + * different characters types or comparison functions. */ +static inline int +nat_isdigit(nat_char a) +{ + return isdigit((unsigned char) a); +} + + +static inline int +nat_isspace(nat_char a) +{ + return isspace((unsigned char) a); +} + + +static inline nat_char +nat_toupper(nat_char a) +{ + return toupper((unsigned char) a); +} + + + +static int +compare_right(nat_char const *a, nat_char const *b) +{ + int bias = 0; + + /* The longest run of digits wins. That aside, the greatest + value wins, but we can't know that it will until we've scanned + both numbers to know that they have the same magnitude, so we + remember it in BIAS. */ + for (;; a++, b++) { + if (!nat_isdigit(*a) && !nat_isdigit(*b)) + return bias; + else if (!nat_isdigit(*a)) + return -1; + else if (!nat_isdigit(*b)) + return +1; + else if (*a < *b) { + if (!bias) + bias = -1; + } else if (*a > *b) { + if (!bias) + bias = +1; + } else if (!*a && !*b) + return bias; + } + + return 0; +} + + +static int +compare_left(nat_char const *a, nat_char const *b) +{ + /* Compare two left-aligned numbers: the first to have a + different value wins. */ + for (;; a++, b++) { + if (!nat_isdigit(*a) && !nat_isdigit(*b)) + return 0; + else if (!nat_isdigit(*a)) + return -1; + else if (!nat_isdigit(*b)) + return +1; + else if (*a < *b) + return -1; + else if (*a > *b) + return +1; + } + + return 0; +} + + +static int strnatcmp0(nat_char const *a, nat_char const *b, int fold_case) +{ + int ai, bi; + nat_char ca, cb; + int fractional, result; + + assert(a && b); + ai = bi = 0; + while (1) { + ca = a[ai]; cb = b[bi]; + + /* skip over leading spaces or zeros */ + while (nat_isspace(ca)) + ca = a[++ai]; + + while (nat_isspace(cb)) + cb = b[++bi]; + + /* process run of digits */ + if (nat_isdigit(ca) && nat_isdigit(cb)) { + fractional = (ca == '0' || cb == '0'); + + if (fractional) { + if ((result = compare_left(a+ai, b+bi)) != 0) + return result; + } else { + if ((result = compare_right(a+ai, b+bi)) != 0) + return result; + } + } + + if (!ca && !cb) { + /* The strings compare the same. Perhaps the caller + will want to call strcmp to break the tie. */ + return 0; + } + + if (fold_case) { + ca = nat_toupper(ca); + cb = nat_toupper(cb); + } + + if (ca < cb) + return -1; + else if (ca > cb) + return +1; + + ++ai; ++bi; + } +} + + + +int strnatcmp(nat_char const *a, nat_char const *b) { + return strnatcmp0(a, b, 0); +} + + +/* Compare, recognizing numeric string and ignoring case. */ +int strnatcasecmp(nat_char const *a, nat_char const *b) { + return strnatcmp0(a, b, 1); +} diff --git a/src/common/strnatcmp.h b/src/common/strnatcmp.h new file mode 100644 index 0000000000000000000000000000000000000000..51a3c4e8cb6fc2834162477995b3caedd4bd96df --- /dev/null +++ b/src/common/strnatcmp.h @@ -0,0 +1,31 @@ +/* -*- mode: c; c-file-style: "k&r" -*- + + strnatcmp.c -- Perform 'natural order' comparisons of strings in C. + Copyright (C) 2000, 2004 by Martin Pool + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + + +/* CUSTOMIZATION SECTION + * + * You can change this typedef, but must then also change the inline + * functions in strnatcmp.c */ +typedef char nat_char; + +int strnatcmp(nat_char const *a, nat_char const *b); +int strnatcasecmp(nat_char const *a, nat_char const *b); diff --git a/src/common/switch.c b/src/common/switch.c index bbfc9c9ae4e572c3155067bb32b9496e9c0d6b13..b0e129e811e38c10524d48ebc675a2e1bb67bd54 100644 --- a/src/common/switch.c +++ b/src/common/switch.c @@ -62,255 +62,138 @@ typedef struct slurm_switch_ops { int (*alloc_jobinfo) ( switch_jobinfo_t **jobinfo ); int (*build_jobinfo) ( switch_jobinfo_t *jobinfo, - char *nodelist, - uint16_t *tasks_per_node, - int cyclic_alloc, - char *network); + char *nodelist, + uint16_t *tasks_per_node, + uint32_t **tids, + char *network); switch_jobinfo_t *(*copy_jobinfo) ( switch_jobinfo_t *jobinfo ); void (*free_jobinfo) ( switch_jobinfo_t *jobinfo ); int (*pack_jobinfo) ( switch_jobinfo_t *jobinfo, - Buf buffer ); + Buf buffer ); int (*unpack_jobinfo) ( switch_jobinfo_t *jobinfo, - Buf buffer ); + Buf buffer ); int (*get_jobinfo) ( switch_jobinfo_t *switch_job, - int key, void *data); + int key, void *data); void (*print_jobinfo) ( FILE *fp, - switch_jobinfo_t *jobinfo ); + switch_jobinfo_t *jobinfo ); char * (*string_jobinfo) ( switch_jobinfo_t *jobinfo, - char *buf, size_t size); + char *buf, size_t size); int (*node_init) ( void ); int (*node_fini) ( void ); int (*job_preinit) ( switch_jobinfo_t *jobinfo ); int (*job_init) ( switch_jobinfo_t *jobinfo, - uid_t uid ); + uid_t uid, char *job_name ); int (*job_fini) ( switch_jobinfo_t *jobinfo ); int (*job_postfini) ( switch_jobinfo_t *jobinfo, - uid_t pgid, - uint32_t job_id, - uint32_t step_id ); + uid_t pgid, + uint32_t job_id, + uint32_t step_id ); int (*job_attach) ( switch_jobinfo_t *jobinfo, - char ***env, uint32_t nodeid, - uint32_t procid, uint32_t nnodes, - uint32_t nprocs, uint32_t rank); + char ***env, uint32_t nodeid, + uint32_t procid, uint32_t nnodes, + uint32_t nprocs, uint32_t rank); char * (*switch_strerror) ( int errnum ); int (*switch_errno) ( void ); int (*clear_node) ( void ); int (*alloc_nodeinfo) ( switch_node_info_t **nodeinfo ); int (*build_nodeinfo) ( switch_node_info_t *nodeinfo ); int (*pack_nodeinfo) ( switch_node_info_t *nodeinfo, - Buf buffer ); + Buf buffer ); int (*unpack_nodeinfo) ( switch_node_info_t *nodeinfo, - Buf buffer ); + Buf buffer ); int (*free_nodeinfo) ( switch_node_info_t **nodeinfo ); char * (*sprintf_nodeinfo) ( switch_node_info_t *nodeinfo, - char *buf, size_t size ); + char *buf, size_t size ); int (*step_complete) ( switch_jobinfo_t *jobinfo, - char *nodelist ); + char *nodelist ); int (*step_part_comp) ( switch_jobinfo_t *jobinfo, - char *nodelist ); + char *nodelist ); bool (*part_comp) ( void ); int (*step_allocated) ( switch_jobinfo_t *jobinfo, - char *nodelist ); + char *nodelist ); int (*state_clear) ( void ); int (*slurmctld_init) ( void ); int (*slurmd_init) ( void ); int (*slurmd_step_init) ( void ); + int (*reconfig) ( void ); } slurm_switch_ops_t; -struct slurm_switch_context { - char * switch_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int switch_errno; - slurm_switch_ops_t ops; -}; - -static slurm_switch_context_t *g_context = NULL; -static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER; - - -static slurm_switch_context_t * -_slurm_switch_context_create(const char *switch_type) -{ - slurm_switch_context_t *c; - - if ( switch_type == NULL ) { - debug3( "_slurm_switch_context_create: no switch type" ); - return NULL; - } - - c = xmalloc( sizeof( struct slurm_switch_context ) ); - - c->switch_errno = SLURM_SUCCESS; - - /* Copy the job completion authentication type. */ - c->switch_type = xstrdup( switch_type ); - if (c->switch_type == NULL ) { - debug3( "can't make local copy of switch type" ); - xfree( c ); - return NULL; - } - - /* Plugin rack is demand-loaded on first reference. */ - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - - return c; -} - -static int -_slurm_switch_context_destroy( slurm_switch_context_t *c ) -{ - int rc = SLURM_SUCCESS; - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree( c->switch_type ); - xfree( c ); - - return rc; -} - /* - * Resolve the operations from the plugin. + * These strings must be kept in the same order as the fields + * declared for slurm_switch_ops_t. */ -static slurm_switch_ops_t * -_slurm_switch_get_ops( slurm_switch_context_t *c ) -{ - /* - * These strings must be kept in the same order as the fields - * declared for slurm_switch_ops_t. - */ - static const char *syms[] = { - "switch_p_libstate_save", - "switch_p_libstate_restore", - "switch_p_alloc_jobinfo", - "switch_p_build_jobinfo", - "switch_p_copy_jobinfo", - "switch_p_free_jobinfo", - "switch_p_pack_jobinfo", - "switch_p_unpack_jobinfo", - "switch_p_get_jobinfo", - "switch_p_print_jobinfo", - "switch_p_sprint_jobinfo", - "switch_p_node_init", - "switch_p_node_fini", - "switch_p_job_preinit", - "switch_p_job_init", - "switch_p_job_fini", - "switch_p_job_postfini", - "switch_p_job_attach", - "switch_p_strerror", - "switch_p_get_errno", - "switch_p_clear_node_state", - "switch_p_alloc_node_info", - "switch_p_build_node_info", - "switch_p_pack_node_info", - "switch_p_unpack_node_info", - "switch_p_free_node_info", - "switch_p_sprintf_node_info", - "switch_p_job_step_complete", - "switch_p_job_step_part_comp", - "switch_p_part_comp", - "switch_p_job_step_allocated", - "switch_p_libstate_clear", - "switch_p_slurmctld_init", - "switch_p_slurmd_init", - "switch_p_slurmd_step_init" - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->switch_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->switch_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->switch_type); - - /* Get the plugin list, if needed. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - verbose( "Unable to create a plugin manager" ); - return NULL; - } - - plugrack_set_major_type( c->plugin_list, "switch" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - /* Find the correct plugin. */ - c->cur_plugin = - plugrack_use_by_type( c->plugin_list, c->switch_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - verbose( "can't find a plugin for type %s", c->switch_type ); - return NULL; - } - - /* Dereference the API. */ - if ( plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops ) < n_syms ) { - verbose( "incomplete switch plugin detected" ); - return NULL; - } +static const char *syms[] = { + "switch_p_libstate_save", + "switch_p_libstate_restore", + "switch_p_alloc_jobinfo", + "switch_p_build_jobinfo", + "switch_p_copy_jobinfo", + "switch_p_free_jobinfo", + "switch_p_pack_jobinfo", + "switch_p_unpack_jobinfo", + "switch_p_get_jobinfo", + "switch_p_print_jobinfo", + "switch_p_sprint_jobinfo", + "switch_p_node_init", + "switch_p_node_fini", + "switch_p_job_preinit", + "switch_p_job_init", + "switch_p_job_fini", + "switch_p_job_postfini", + "switch_p_job_attach", + "switch_p_strerror", + "switch_p_get_errno", + "switch_p_clear_node_state", + "switch_p_alloc_node_info", + "switch_p_build_node_info", + "switch_p_pack_node_info", + "switch_p_unpack_node_info", + "switch_p_free_node_info", + "switch_p_sprintf_node_info", + "switch_p_job_step_complete", + "switch_p_job_step_part_comp", + "switch_p_part_comp", + "switch_p_job_step_allocated", + "switch_p_libstate_clear", + "switch_p_slurmctld_init", + "switch_p_slurmd_init", + "switch_p_slurmd_step_init", + "switch_p_reconfig" +}; - return &c->ops; -} +static slurm_switch_ops_t ops; +static plugin_context_t *g_context = NULL; +static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER; +static bool init_run = false; extern int switch_init( void ) { int retval = SLURM_SUCCESS; - char *switch_type = NULL; + char *plugin_type = "switch"; + char *type = NULL; + + if ( init_run && g_context ) + return retval; slurm_mutex_lock( &context_lock ); if ( g_context ) goto done; - switch_type = slurm_get_switch_type(); - g_context = _slurm_switch_context_create( switch_type ); - if ( g_context == NULL ) { - error( "cannot create a context for %s", switch_type ); - retval = SLURM_ERROR; - goto done; - } + type = slurm_get_switch_type(); + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); - if ( _slurm_switch_get_ops( g_context ) == NULL ) { - error( "cannot resolve plugin operations for %s", switch_type ); - _slurm_switch_context_destroy( g_context ); - g_context = NULL; + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; + goto done; } + init_run = true; - done: +done: slurm_mutex_unlock( &context_lock ); - xfree(switch_type); + xfree(type); return retval; } @@ -321,16 +204,25 @@ extern int switch_fini(void) if (!g_context) return SLURM_SUCCESS; - rc = _slurm_switch_context_destroy(g_context); + init_run = false; + rc = plugin_context_destroy(g_context); return rc; } +extern int switch_g_reconfig(void) +{ + if ( switch_init() < 0 ) + return SLURM_ERROR; + + return (*(ops.reconfig))( ); +} + extern int switch_save(char *dir_name) { if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.state_save))( dir_name ); + return (*(ops.state_save))( dir_name ); } extern int switch_restore(char *dir_name, bool recover) @@ -338,7 +230,7 @@ extern int switch_restore(char *dir_name, bool recover) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.state_restore))( dir_name, recover ); + return (*(ops.state_restore))( dir_name, recover ); } extern int switch_clear(void) @@ -346,7 +238,7 @@ extern int switch_clear(void) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.state_clear))( ); + return (*(ops.state_clear))( ); } extern int switch_alloc_jobinfo(switch_jobinfo_t **jobinfo) @@ -354,18 +246,18 @@ extern int switch_alloc_jobinfo(switch_jobinfo_t **jobinfo) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.alloc_jobinfo))( jobinfo ); + return (*(ops.alloc_jobinfo))( jobinfo ); } extern int switch_build_jobinfo(switch_jobinfo_t *jobinfo, - char *nodelist, uint16_t *tasks_per_node, - int cyclic_alloc, char *network) + char *nodelist, uint16_t *tasks_per_node, + uint32_t **tids, char *network) { if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.build_jobinfo))( jobinfo, nodelist, - tasks_per_node, cyclic_alloc, network ); + return (*(ops.build_jobinfo))( jobinfo, nodelist, + tasks_per_node, tids, network ); } extern switch_jobinfo_t *switch_copy_jobinfo(switch_jobinfo_t *jobinfo) @@ -373,7 +265,7 @@ extern switch_jobinfo_t *switch_copy_jobinfo(switch_jobinfo_t *jobinfo) if ( switch_init() < 0 ) return NULL; - return (*(g_context->ops.copy_jobinfo))( jobinfo ); + return (*(ops.copy_jobinfo))( jobinfo ); } extern void switch_free_jobinfo(switch_jobinfo_t *jobinfo) @@ -381,7 +273,7 @@ extern void switch_free_jobinfo(switch_jobinfo_t *jobinfo) if ( switch_init() < 0 ) return; - (*(g_context->ops.free_jobinfo))( jobinfo ); + (*(ops.free_jobinfo))( jobinfo ); } extern int switch_pack_jobinfo(switch_jobinfo_t *jobinfo, Buf buffer) @@ -389,7 +281,7 @@ extern int switch_pack_jobinfo(switch_jobinfo_t *jobinfo, Buf buffer) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.pack_jobinfo))( jobinfo, buffer ); + return (*(ops.pack_jobinfo))( jobinfo, buffer ); } extern int switch_unpack_jobinfo(switch_jobinfo_t *jobinfo, Buf buffer) @@ -397,16 +289,16 @@ extern int switch_unpack_jobinfo(switch_jobinfo_t *jobinfo, Buf buffer) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.unpack_jobinfo))( jobinfo, buffer ); + return (*(ops.unpack_jobinfo))( jobinfo, buffer ); } extern int switch_g_get_jobinfo(switch_jobinfo_t *jobinfo, - int data_type, void *data) + int data_type, void *data) { if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.get_jobinfo))( jobinfo, data_type, data); + return (*(ops.get_jobinfo))( jobinfo, data_type, data); } extern void switch_print_jobinfo(FILE *fp, switch_jobinfo_t *jobinfo) @@ -414,16 +306,16 @@ extern void switch_print_jobinfo(FILE *fp, switch_jobinfo_t *jobinfo) if ( switch_init() < 0 ) return; - (*(g_context->ops.print_jobinfo)) (fp, jobinfo); + (*(ops.print_jobinfo)) (fp, jobinfo); } extern char *switch_sprint_jobinfo( switch_jobinfo_t *jobinfo, - char *buf, size_t size) + char *buf, size_t size) { if ( switch_init() < 0 ) return NULL; - return (*(g_context->ops.string_jobinfo)) (jobinfo, buf, size); + return (*(ops.string_jobinfo)) (jobinfo, buf, size); } extern int interconnect_node_init(void) @@ -431,7 +323,7 @@ extern int interconnect_node_init(void) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.node_init)) (); + return (*(ops.node_init)) (); } extern int interconnect_node_fini(void) @@ -439,7 +331,7 @@ extern int interconnect_node_fini(void) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.node_fini)) (); + return (*(ops.node_fini)) (); } extern int interconnect_preinit(switch_jobinfo_t *jobinfo) @@ -447,15 +339,16 @@ extern int interconnect_preinit(switch_jobinfo_t *jobinfo) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.job_preinit)) (jobinfo); + return (*(ops.job_preinit)) (jobinfo); } -extern int interconnect_init(switch_jobinfo_t *jobinfo, uid_t uid) +extern int interconnect_init(switch_jobinfo_t *jobinfo, uid_t uid, + char *job_name) { if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.job_init)) (jobinfo, uid); + return (*(ops.job_init)) (jobinfo, uid, job_name); } extern int interconnect_fini(switch_jobinfo_t *jobinfo) @@ -463,28 +356,28 @@ extern int interconnect_fini(switch_jobinfo_t *jobinfo) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.job_fini)) (jobinfo); + return (*(ops.job_fini)) (jobinfo); } extern int interconnect_postfini(switch_jobinfo_t *jobinfo, uid_t pgid, - uint32_t job_id, uint32_t step_id ) + uint32_t job_id, uint32_t step_id ) { if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.job_postfini)) (jobinfo, pgid, - job_id, step_id); + return (*(ops.job_postfini)) (jobinfo, pgid, + job_id, step_id); } extern int interconnect_attach(switch_jobinfo_t *jobinfo, char ***env, - uint32_t nodeid, uint32_t procid, uint32_t nnodes, - uint32_t nprocs, uint32_t gid) + uint32_t nodeid, uint32_t procid, + uint32_t nnodes, uint32_t nprocs, uint32_t gid) { if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.job_attach)) (jobinfo, env, - nodeid, procid, nnodes, nprocs, gid); + return (*(ops.job_attach)) (jobinfo, env, + nodeid, procid, nnodes, nprocs, gid); } extern int switch_get_errno(void) @@ -492,7 +385,7 @@ extern int switch_get_errno(void) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.switch_errno))( ); + return (*(ops.switch_errno))( ); } extern char *switch_strerror(int errnum) @@ -500,7 +393,7 @@ extern char *switch_strerror(int errnum) if ( switch_init() < 0 ) return NULL; - return (*(g_context->ops.switch_strerror))( errnum ); + return (*(ops.switch_strerror))( errnum ); } @@ -513,7 +406,7 @@ extern int switch_g_clear_node_state(void) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.clear_node))(); + return (*(ops.clear_node))(); } extern int switch_g_alloc_node_info(switch_node_info_t **switch_node) @@ -521,7 +414,7 @@ extern int switch_g_alloc_node_info(switch_node_info_t **switch_node) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.alloc_nodeinfo))( switch_node ); + return (*(ops.alloc_nodeinfo))( switch_node ); } extern int switch_g_build_node_info(switch_node_info_t *switch_node) @@ -529,25 +422,25 @@ extern int switch_g_build_node_info(switch_node_info_t *switch_node) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.build_nodeinfo))( switch_node ); + return (*(ops.build_nodeinfo))( switch_node ); } extern int switch_g_pack_node_info(switch_node_info_t *switch_node, - Buf buffer) + Buf buffer) { if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.pack_nodeinfo))( switch_node, buffer ); + return (*(ops.pack_nodeinfo))( switch_node, buffer ); } extern int switch_g_unpack_node_info(switch_node_info_t *switch_node, - Buf buffer) + Buf buffer) { if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.unpack_nodeinfo))( switch_node, buffer ); + return (*(ops.unpack_nodeinfo))( switch_node, buffer ); } extern int switch_g_free_node_info(switch_node_info_t **switch_node) @@ -555,34 +448,34 @@ extern int switch_g_free_node_info(switch_node_info_t **switch_node) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.free_nodeinfo))( switch_node ); + return (*(ops.free_nodeinfo))( switch_node ); } extern char*switch_g_sprintf_node_info(switch_node_info_t *switch_node, - char *buf, size_t size) + char *buf, size_t size) { if ( switch_init() < 0 ) return NULL; - return (*(g_context->ops.sprintf_nodeinfo))( switch_node, buf, size ); + return (*(ops.sprintf_nodeinfo))( switch_node, buf, size ); } extern int switch_g_job_step_complete(switch_jobinfo_t *jobinfo, - char *nodelist) + char *nodelist) { if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.step_complete))( jobinfo, nodelist ); + return (*(ops.step_complete))( jobinfo, nodelist ); } extern int switch_g_job_step_part_comp(switch_jobinfo_t *jobinfo, - char *nodelist) + char *nodelist) { if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.step_part_comp))( jobinfo, nodelist ); + return (*(ops.step_part_comp))( jobinfo, nodelist ); } extern bool switch_g_part_comp(void) @@ -590,17 +483,17 @@ extern bool switch_g_part_comp(void) if ( switch_init() < 0 ) return false; - return (*(g_context->ops.part_comp))( ); + return (*(ops.part_comp))( ); } extern int switch_g_job_step_allocated(switch_jobinfo_t *jobinfo, - char *nodelist) + char *nodelist) { if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.step_allocated))( jobinfo, nodelist ); + return (*(ops.step_allocated))( jobinfo, nodelist ); } extern int switch_g_slurmctld_init(void) @@ -608,7 +501,7 @@ extern int switch_g_slurmctld_init(void) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.slurmctld_init)) (); + return (*(ops.slurmctld_init)) (); } extern int switch_g_slurmd_init(void) @@ -616,7 +509,7 @@ extern int switch_g_slurmd_init(void) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.slurmd_init)) (); + return (*(ops.slurmd_init)) (); } extern int switch_g_slurmd_step_init(void) @@ -624,5 +517,5 @@ extern int switch_g_slurmd_step_init(void) if ( switch_init() < 0 ) return SLURM_ERROR; - return (*(g_context->ops.slurmd_step_init)) (); + return (*(ops.slurmd_step_init)) (); } diff --git a/src/common/switch.h b/src/common/switch.h index 9dcc78bcd146eea7805ced17425cb462c52af48a..0629934d172b83bdc4500916eba62dd2644f3f5e 100644 --- a/src/common/switch.h +++ b/src/common/switch.h @@ -69,6 +69,8 @@ typedef struct slurm_switch_context slurm_switch_context_t; /* initialize the switch plugin */ extern int switch_init (void); +extern int switch_g_reconfig(void); + extern int switch_g_slurmd_init(void); /* terminate the switch plugin and free all memory */ @@ -124,8 +126,8 @@ extern int switch_alloc_jobinfo (switch_jobinfo_t **jobinfo); * NOTE: storage must be freed using g_switch_free_jobinfo */ extern int switch_build_jobinfo (switch_jobinfo_t *jobinfo, - char *nodelist, uint16_t *tasks_per_node, - int cyclic_alloc, char *network); + char *nodelist, uint16_t *tasks_per_node, uint32_t **tids, + char *network); /* copy a switch job credential * IN jobinfo - the switch job credential to be copied @@ -271,7 +273,8 @@ extern int interconnect_preinit(switch_jobinfo_t *jobinfo); * than the process executing interconnect_fini() [e.g. QsNet]) * */ -extern int interconnect_init(switch_jobinfo_t *jobinfo, uid_t uid); +extern int interconnect_init(switch_jobinfo_t *jobinfo, uid_t uid, + char *job_name); /* * This function is run from the same process as interconnect_init() diff --git a/src/common/xcpuinfo.c b/src/common/xcpuinfo.c index fc27ac967a6c5a9ad3471c821b0a53c142a636a2..ff42289e4de08e6e419d168cff4c074d4fe4e66a 100644 --- a/src/common/xcpuinfo.c +++ b/src/common/xcpuinfo.c @@ -2,6 +2,7 @@ * xcpuinfo.c - cpuinfo related primitives ***************************************************************************** * Copyright (C) 2009 CEA/DAM/DIF + * Portions (hwloc) copyright (C) 2012 Bull, * Written by Matthieu Hautreux * * This file is part of SLURM, a resource management program. @@ -60,14 +61,20 @@ #include "src/common/xstring.h" #include "src/slurmd/slurmd/get_mach_stat.h" +#ifdef HAVE_HWLOC +#include +#endif + #include "xcpuinfo.h" +#if !defined(HAVE_HWLOC) static char* _cpuinfo_path = "/proc/cpuinfo"; static int _compute_block_map(uint16_t numproc, uint16_t **block_map, uint16_t **block_map_inv); static int _chk_cpuinfo_str(char *buffer, char *keyword, char **valptr); static int _chk_cpuinfo_uint32(char *buffer, char *keyword, uint32_t *val); +#endif static int _ranges_conv(char* lrange, char** prange, int mode); static int _range_to_map(char* range, uint16_t *map, uint16_t map_size, @@ -75,7 +82,7 @@ static int _range_to_map(char* range, uint16_t *map, uint16_t map_size, static int _map_to_range(uint16_t *map, uint16_t map_size, char** prange); bool initialized = false; -uint16_t procs, sockets, cores, threads=1; +uint16_t procs, boards, sockets, cores, threads=1; uint16_t block_map_size; uint16_t *block_map, *block_map_inv; @@ -135,7 +142,8 @@ get_procs(uint16_t *procs) /* * get_cpuinfo - Return detailed cpuinfo on this system * Input: numproc - number of processors on the system - * Output: p_sockets - number of physical processor sockets + * Output: p_boards - number of baseboards (containing sockets) + * p_sockets - number of physical processor sockets * p_cores - total number of physical CPU cores * p_threads - total number of hardware execution threads * block_map - asbtract->physical block distribution map @@ -143,6 +151,117 @@ get_procs(uint16_t *procs) * return code - 0 if no error, otherwise errno * NOTE: User must xfree block_map and block_map_inv */ +#ifdef HAVE_HWLOC +#if DEBUG_DETAIL +static void hwloc_children(hwloc_topology_t topology, hwloc_obj_t obj, + int depth) +{ + char string[128]; + unsigned i; + + hwloc_obj_snprintf(string, sizeof(string), topology, obj, "#", 0); + debug3("%*s%s", 2*depth, "", string); + for (i = 0; i < obj->arity; i++) { + hwloc_children(topology, obj->children[i], depth + 1); + } +} +#endif + +extern int +get_cpuinfo(uint16_t numproc, uint16_t *p_boards, + uint16_t *p_sockets, uint16_t *p_cores, uint16_t *p_threads, + uint16_t *block_map_size, + uint16_t **block_map, uint16_t **block_map_inv) +{ + hwloc_topology_t topology; + hwloc_obj_t obj; + int depth, i; + int boards, ncores, npu, nsockets; + + /* Allocate and initialize topology object. */ + hwloc_topology_init(&topology); + /* Perform the topology detection. */ + hwloc_topology_load(topology); + + boards = 1; + depth = hwloc_get_type_depth(topology, HWLOC_OBJ_GROUP); + if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { + boards = hwloc_get_nbobjs_by_depth(topology, depth); + } + *p_boards = boards; + + nsockets = 1; + depth = hwloc_get_type_depth(topology, HWLOC_OBJ_SOCKET); + if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { + nsockets = hwloc_get_nbobjs_by_depth(topology, depth); + } + *p_sockets = nsockets; + + ncores = 1; + *p_cores = 1; + depth = hwloc_get_type_depth(topology, HWLOC_OBJ_CORE); + if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { + ncores = hwloc_get_nbobjs_by_depth(topology, depth); + } + *p_cores = ncores / nsockets; + + npu = 1; + depth = hwloc_get_type_depth(topology, HWLOC_OBJ_PU); + if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { + npu = hwloc_get_nbobjs_by_depth(topology, depth); + } + *p_threads = npu / ncores; + + *block_map_size = npu; + /* See notes on _compute_block_map for details + * retval = _compute_block_map(*block_map_size, + * block_map, block_map_inv); */ + + /* Compute abstract->machine block mapping (and inverse) */ + if (block_map) { + *block_map = xmalloc(npu * sizeof(uint16_t)); + for (i = 0; i < npu; i++) { + obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_PU, i); + (*block_map)[i] = obj->os_index; + } + if (block_map_inv) { + *block_map_inv = xmalloc(npu * sizeof(uint16_t)); + for (i = 0; i < npu; i++) { + uint16_t idx = (*block_map)[i]; + (*block_map_inv)[idx] = i; + } + } + } + +#if DEBUG_DETAIL + /*** Display raw data ***/ + debug3(" "); + debug3("Boards: %u", *p_sockets); + debug3("Sockets: %u", *p_sockets); + debug3("Cores per socket: %u", *p_cores); + debug3("Threads per core: %u", *p_threads); + debug3(" "); + hwloc_children(topology, hwloc_get_root_obj(topology), 0); + + /* Display the mapping tables */ + if (block_map && block_map_inv) { + debug3(""); + debug3("Abstract -> Machine logical CPU ID block mapping:"); + debug3("(AbstractId PhysicalId Inverse"); + for (i = 0; i < numproc; i++) { + debug3(" %4d %4u %4u", + i, (*block_map)[i], (*block_map_inv)[i]); + } + debug3(""); + } + debug3(""); +#endif + hwloc_topology_destroy(topology); + return 0; + +} +#else + typedef struct cpuinfo { uint16_t seen; uint32_t cpuid; @@ -156,12 +275,15 @@ typedef struct cpuinfo { static cpuinfo_t *cpuinfo = NULL; /* array of CPU information for get_cpuinfo */ /* Note: file static for qsort/_compare_cpus*/ extern int -get_cpuinfo(uint16_t numproc, +get_cpuinfo(uint16_t numproc, uint16_t *p_boards, uint16_t *p_sockets, uint16_t *p_cores, uint16_t *p_threads, uint16_t *block_map_size, uint16_t **block_map, uint16_t **block_map_inv) { int retval; + + *p_boards = 1; /* Boards not identified from /proc/cpuinfo */ + uint16_t numcpu = 0; /* number of cpus seen */ uint16_t numphys = 0; /* number of unique "physical id"s */ uint16_t numcores = 0; /* number of unique "cores id"s */ @@ -458,7 +580,6 @@ get_cpuinfo(uint16_t numproc, return retval; } - /* _chk_cpuinfo_str * check a line of cpuinfo data (buffer) for a keyword. If it * exists, return the string value for that keyword in *valptr. @@ -601,7 +722,6 @@ static int _compute_block_map(uint16_t numproc, (*block_map_inv)[idx] = i; } } - #if DEBUG_DETAIL /* Display the mapping tables */ @@ -659,6 +779,7 @@ static int _compute_block_map(uint16_t numproc, #endif return 0; } +#endif int _ranges_conv(char* lrange,char** prange,int mode); @@ -679,7 +800,7 @@ xcpuinfo_init(void) if ( get_procs(&procs) ) return XCPUINFO_ERROR; - if ( get_cpuinfo(procs,&sockets,&cores,&threads, + if ( get_cpuinfo(procs,&boards,&sockets,&cores,&threads, &block_map_size,&block_map,&block_map_inv) ) return XCPUINFO_ERROR; diff --git a/src/common/xcpuinfo.h b/src/common/xcpuinfo.h index 0c93b84ebd51ae5603affe4e8b9ef7c22b600224..416298a2882d344545c07d34827c7e1380455392 100644 --- a/src/common/xcpuinfo.h +++ b/src/common/xcpuinfo.h @@ -45,7 +45,7 @@ #define XCPUINFO_SUCCESS 0 extern int get_procs(uint16_t *procs); -extern int get_cpuinfo(uint16_t numproc, +extern int get_cpuinfo(uint16_t numproc, uint16_t *boards, uint16_t *sockets, uint16_t *cores, uint16_t *threads, uint16_t *block_map_size, uint16_t **block_map, uint16_t **block_map_inv); diff --git a/src/database/Makefile.in b/src/database/Makefile.in index d4af5112355336755fda9c0dcd4305757bb9d6f2..572475616abdaa8f72c69248ecaec4b40cfa6066 100644 --- a/src/database/Makefile.in +++ b/src/database/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -176,9 +175,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -186,9 +183,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -220,6 +216,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -247,6 +245,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -397,9 +396,9 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libslurm_mysql.la: $(libslurm_mysql_la_OBJECTS) $(libslurm_mysql_la_DEPENDENCIES) +libslurm_mysql.la: $(libslurm_mysql_la_OBJECTS) $(libslurm_mysql_la_DEPENDENCIES) $(EXTRA_libslurm_mysql_la_DEPENDENCIES) $(libslurm_mysql_la_LINK) $(am_libslurm_mysql_la_rpath) $(libslurm_mysql_la_OBJECTS) $(libslurm_mysql_la_LIBADD) $(LIBS) -libslurm_pgsql.la: $(libslurm_pgsql_la_OBJECTS) $(libslurm_pgsql_la_DEPENDENCIES) +libslurm_pgsql.la: $(libslurm_pgsql_la_OBJECTS) $(libslurm_pgsql_la_DEPENDENCIES) $(EXTRA_libslurm_pgsql_la_DEPENDENCIES) $(libslurm_pgsql_la_LINK) $(am_libslurm_pgsql_la_rpath) $(libslurm_pgsql_la_OBJECTS) $(libslurm_pgsql_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -548,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/db_api/Makefile.in b/src/db_api/Makefile.in index 21f0c25af6d458ca7bc2e3cec599c41f998cc665..f505fe4e966f15ded6d7e02a63935c3407bf4aca 100644 --- a/src/db_api/Makefile.in +++ b/src/db_api/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -60,9 +60,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -70,6 +68,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -108,6 +107,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libslurmdb_la_DEPENDENCIES = \ @@ -185,10 +190,8 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ # This is needed if compiling on windows EXEEXT = -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -196,9 +199,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -230,6 +232,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -257,6 +261,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -488,7 +493,7 @@ clean-libLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libslurmdb.la: $(libslurmdb_la_OBJECTS) $(libslurmdb_la_DEPENDENCIES) +libslurmdb.la: $(libslurmdb_la_OBJECTS) $(libslurmdb_la_DEPENDENCIES) $(EXTRA_libslurmdb_la_DEPENDENCIES) $(libslurmdb_la_LINK) -rpath $(libdir) $(libslurmdb_la_OBJECTS) $(libslurmdb_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @@ -650,10 +655,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index c17ce381816f32cf25b779636605c0ce42223b62..c985e3474f62aacef90658b3f2916127ad9d807b 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -7,6 +7,7 @@ SUBDIRS = \ jobacct_gather \ jobcomp \ job_submit \ + launch \ mpi \ preempt \ priority \ diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in index 217dd8885db7a71e213625faf53c5259f992040a..8380a882c70940ab9e9389d80e7f335fdcb1b0ff 100644 --- a/src/plugins/Makefile.in +++ b/src/plugins/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -164,9 +163,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -174,9 +171,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -208,6 +204,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -235,6 +233,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -334,6 +333,7 @@ SUBDIRS = \ jobacct_gather \ jobcomp \ job_submit \ + launch \ mpi \ preempt \ priority \ @@ -592,10 +592,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/accounting_storage/Makefile.in b/src/plugins/accounting_storage/Makefile.in index 4d6bf1158c1fded7ba26e2d1d2cf8991b93a7e82..1322d8891c56372e158641bea4d00e1d8b149a26 100644 --- a/src/plugins/accounting_storage/Makefile.in +++ b/src/plugins/accounting_storage/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/accounting_storage/common/Makefile.in b/src/plugins/accounting_storage/common/Makefile.in index e64146f6389cb4af48441a622d4e305ebc00e255..902ccb2e31a0b3ac8b83fd43d6bc523c5c6bf1ee 100644 --- a/src/plugins/accounting_storage/common/Makefile.in +++ b/src/plugins/accounting_storage/common/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -147,9 +146,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -157,9 +154,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -191,6 +187,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -218,6 +216,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -360,7 +359,7 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libaccounting_storage_common.la: $(libaccounting_storage_common_la_OBJECTS) $(libaccounting_storage_common_la_DEPENDENCIES) +libaccounting_storage_common.la: $(libaccounting_storage_common_la_OBJECTS) $(libaccounting_storage_common_la_DEPENDENCIES) $(EXTRA_libaccounting_storage_common_la_DEPENDENCIES) $(LINK) $(libaccounting_storage_common_la_OBJECTS) $(libaccounting_storage_common_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -494,10 +493,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/accounting_storage/filetxt/Makefile.in b/src/plugins/accounting_storage/filetxt/Makefile.in index b1d7e09affde02e462d732e769934cac9d9161a7..24a8948bc0b6193caf0edbfb10eef95e3f538623 100644 --- a/src/plugins/accounting_storage/filetxt/Makefile.in +++ b/src/plugins/accounting_storage/filetxt/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) accounting_storage_filetxt_la_LIBADD = @@ -174,9 +179,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -184,9 +187,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -218,6 +220,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -245,6 +249,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -408,7 +413,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -accounting_storage_filetxt.la: $(accounting_storage_filetxt_la_OBJECTS) $(accounting_storage_filetxt_la_DEPENDENCIES) +accounting_storage_filetxt.la: $(accounting_storage_filetxt_la_OBJECTS) $(accounting_storage_filetxt_la_DEPENDENCIES) $(EXTRA_accounting_storage_filetxt_la_DEPENDENCIES) $(accounting_storage_filetxt_la_LINK) -rpath $(pkglibdir) $(accounting_storage_filetxt_la_OBJECTS) $(accounting_storage_filetxt_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -546,10 +551,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/accounting_storage/filetxt/accounting_storage_filetxt.c b/src/plugins/accounting_storage/filetxt/accounting_storage_filetxt.c index 83ac30029e982b314602774ee95aac40cdb77782..bbd421a390805bae168c922355a03c609adae77a 100644 --- a/src/plugins/accounting_storage/filetxt/accounting_storage_filetxt.c +++ b/src/plugins/accounting_storage/filetxt/accounting_storage_filetxt.c @@ -39,6 +39,7 @@ \*****************************************************************************/ #include +#include "src/common/node_select.h" #include "src/common/slurm_accounting_storage.h" #include "filetxt_jobacct_process.h" diff --git a/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.h b/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.h index d177375dc75110a6936ad3cd6a5bf3ab69ce14b0..a6eff13191e32bb59e3e64b92d83f4f469ab0afd 100644 --- a/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.h +++ b/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.h @@ -44,10 +44,16 @@ #ifndef _HAVE_FILETXT_JOBSLURMDB_PROCESS_H #define _HAVE_FILETXT_JOBSLURMDB_PROCESS_H -#include "src/common/jobacct_common.h" +#include +#include + +#include "src/common/xstring.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/slurm_accounting_storage.h" #include "src/slurmdbd/read_config.h" +#define BUFFER_SIZE 4096 + extern List filetxt_jobacct_process_get_jobs(slurmdb_job_cond_t *job_cond); extern int filetxt_jobacct_process_archive(slurmdb_archive_cond_t *arch_cond); diff --git a/src/plugins/accounting_storage/mysql/Makefile.in b/src/plugins/accounting_storage/mysql/Makefile.in index de9722ecc4f64f39f202b9a7f9f1646d1ae53e74..f3fac3d7fae0764f155642ede4a6250da1599348 100644 --- a/src/plugins/accounting_storage/mysql/Makefile.in +++ b/src/plugins/accounting_storage/mysql/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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 = @@ -224,9 +229,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -234,9 +237,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -268,6 +270,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -295,6 +299,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -481,7 +486,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -accounting_storage_mysql.la: $(accounting_storage_mysql_la_OBJECTS) $(accounting_storage_mysql_la_DEPENDENCIES) +accounting_storage_mysql.la: $(accounting_storage_mysql_la_OBJECTS) $(accounting_storage_mysql_la_DEPENDENCIES) $(EXTRA_accounting_storage_mysql_la_DEPENDENCIES) $(accounting_storage_mysql_la_LINK) $(am_accounting_storage_mysql_la_rpath) $(accounting_storage_mysql_la_OBJECTS) $(accounting_storage_mysql_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -745,10 +750,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/accounting_storage/mysql/as_mysql_job.c b/src/plugins/accounting_storage/mysql/as_mysql_job.c index 2e03d6becc4bed69d39f8b61f05d8346962d0cac..a5eb18f58db7704e04451a43bedddaf39b704706 100644 --- a/src/plugins/accounting_storage/mysql/as_mysql_job.c +++ b/src/plugins/accounting_storage/mysql/as_mysql_job.c @@ -41,8 +41,11 @@ #include "as_mysql_usage.h" #include "as_mysql_wckey.h" +#include "src/common/node_select.h" #include "src/common/parse_time.h" -#include "src/common/jobacct_common.h" +#include "src/common/slurm_jobacct_gather.h" + +#define BUFFER_SIZE 4096 /* Used in job functions for getting the database index based off the * submit time, job and assoc id. 0 is returned if none is found 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 21efe7e78c3fa506927d507cf3d86eb55afc2d40..752ed5f671304d6b1a36ad5ccd301af4ad4f089e 100644 --- a/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c +++ b/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c @@ -1202,11 +1202,11 @@ extern int setup_job_cond_limits(mysql_conn_t *mysql_conn, xstrcat(*extra, " where ("); if (job_cond->cpus_max) { - xstrfmtcat(*extra, "(t1.alloc_cpus between %u and %u))", + xstrfmtcat(*extra, "(t1.cpus_alloc between %u and %u))", job_cond->cpus_min, job_cond->cpus_max); } else { - xstrfmtcat(*extra, "(t1.alloc_cpus='%u'))", + xstrfmtcat(*extra, "(t1.cpus_alloc='%u'))", job_cond->cpus_min); } @@ -1220,11 +1220,11 @@ extern int setup_job_cond_limits(mysql_conn_t *mysql_conn, if (job_cond->nodes_max) { xstrfmtcat(*extra, - "(t1.alloc_nodes between %u and %u))", + "(t1.nodes_alloc between %u and %u))", job_cond->nodes_min, job_cond->nodes_max); } else { - xstrfmtcat(*extra, "(t1.alloc_nodes='%u'))", + xstrfmtcat(*extra, "(t1.nodes_alloc='%u'))", job_cond->nodes_min); } diff --git a/src/plugins/accounting_storage/none/Makefile.in b/src/plugins/accounting_storage/none/Makefile.in index 0632554f4bb23d84e5f27e11d003768c6b840996..0f18046fedd3a2596b42783b4b23b8dd9ec85102 100644 --- a/src/plugins/accounting_storage/none/Makefile.in +++ b/src/plugins/accounting_storage/none/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) accounting_storage_none_la_LIBADD = @@ -173,9 +178,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -183,9 +186,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -217,6 +219,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -244,6 +248,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -accounting_storage_none.la: $(accounting_storage_none_la_OBJECTS) $(accounting_storage_none_la_DEPENDENCIES) +accounting_storage_none.la: $(accounting_storage_none_la_OBJECTS) $(accounting_storage_none_la_DEPENDENCIES) $(EXTRA_accounting_storage_none_la_DEPENDENCIES) $(accounting_storage_none_la_LINK) -rpath $(pkglibdir) $(accounting_storage_none_la_OBJECTS) $(accounting_storage_none_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/accounting_storage/pgsql/Makefile.in b/src/plugins/accounting_storage/pgsql/Makefile.in index 18cc5c99e2867f59f86a62d1037c1b84690db2c0..26f0f63f11ff043279e2de74ae50e7c8a3efd8b7 100644 --- a/src/plugins/accounting_storage/pgsql/Makefile.in +++ b/src/plugins/accounting_storage/pgsql/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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 = @@ -219,9 +224,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -229,9 +232,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -263,6 +265,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -290,6 +294,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -477,7 +482,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -accounting_storage_pgsql.la: $(accounting_storage_pgsql_la_OBJECTS) $(accounting_storage_pgsql_la_DEPENDENCIES) +accounting_storage_pgsql.la: $(accounting_storage_pgsql_la_OBJECTS) $(accounting_storage_pgsql_la_DEPENDENCIES) $(EXTRA_accounting_storage_pgsql_la_DEPENDENCIES) $(accounting_storage_pgsql_la_LINK) $(am_accounting_storage_pgsql_la_rpath) $(accounting_storage_pgsql_la_OBJECTS) $(accounting_storage_pgsql_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -749,10 +754,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/accounting_storage/pgsql/as_pg_common.h b/src/plugins/accounting_storage/pgsql/as_pg_common.h index 98c84f50414a8ad29cbd6e8aa873a1c7c2cc2e3e..9d95c964dcd217735d098d8f95bbd82304d8ced8 100644 --- a/src/plugins/accounting_storage/pgsql/as_pg_common.h +++ b/src/plugins/accounting_storage/pgsql/as_pg_common.h @@ -46,7 +46,7 @@ #include "src/database/pgsql_common.h" #include "src/slurmdbd/read_config.h" #include "src/common/slurmdbd_defs.h" -#include "src/common/jobacct_common.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/uid.h" #include "src/plugins/accounting_storage/common/common_as.h" diff --git a/src/plugins/accounting_storage/pgsql/as_pg_job.c b/src/plugins/accounting_storage/pgsql/as_pg_job.c index fa84e6b2d5ba8bf192d765be1b36519757d00625..2cda905a47691ce685c5937c467dd153f68368d7 100644 --- a/src/plugins/accounting_storage/pgsql/as_pg_job.c +++ b/src/plugins/accounting_storage/pgsql/as_pg_job.c @@ -39,6 +39,8 @@ \*****************************************************************************/ #include "as_pg_common.h" +#define BUFFER_SIZE 4096 + char *job_table = "job_table"; static storage_field_t job_table_fields[] = { { "job_db_inx", "SERIAL" }, diff --git a/src/plugins/accounting_storage/slurmdbd/Makefile.in b/src/plugins/accounting_storage/slurmdbd/Makefile.in index ff99cd8b1caea3b245959383902f81078742bdab..102f4d805357f257c8bb16653e14c25dd9bda5f0 100644 --- a/src/plugins/accounting_storage/slurmdbd/Makefile.in +++ b/src/plugins/accounting_storage/slurmdbd/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) accounting_storage_slurmdbd_la_LIBADD = @@ -174,9 +179,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -184,9 +187,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -218,6 +220,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -245,6 +249,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -408,7 +413,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -accounting_storage_slurmdbd.la: $(accounting_storage_slurmdbd_la_OBJECTS) $(accounting_storage_slurmdbd_la_DEPENDENCIES) +accounting_storage_slurmdbd.la: $(accounting_storage_slurmdbd_la_OBJECTS) $(accounting_storage_slurmdbd_la_DEPENDENCIES) $(EXTRA_accounting_storage_slurmdbd_la_DEPENDENCIES) $(accounting_storage_slurmdbd_la_LINK) -rpath $(pkglibdir) $(accounting_storage_slurmdbd_la_OBJECTS) $(accounting_storage_slurmdbd_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -545,10 +550,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c b/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c index 9efb32a7e23ee82deca3628ed2a2863e9cb115e3..1551762704505f0ffeeac19533c15dc5b342d15a 100644 --- a/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c +++ b/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c @@ -54,7 +54,6 @@ #include "slurm/slurm_errno.h" #include "src/common/slurm_xlator.h" -#include "src/common/jobacct_common.h" #include "src/common/read_config.h" #include "src/common/slurm_accounting_storage.h" #include "src/common/slurmdbd_defs.h" @@ -63,6 +62,8 @@ #include "src/slurmctld/slurmctld.h" #include "src/slurmctld/locks.h" +#define BUFFER_SIZE 4096 + /* 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. diff --git a/src/plugins/auth/Makefile.in b/src/plugins/auth/Makefile.in index 5cd8e7a9cd2b622ee57ae2ca43373ccf1be999b5..7155ed707719ca313058544b857825ff45bc0311 100644 --- a/src/plugins/auth/Makefile.in +++ b/src/plugins/auth/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/auth/authd/Makefile.in b/src/plugins/auth/authd/Makefile.in index d51ab4ba32891db980ca4d8385824141f333a611..2b18cf8a11795a4e1fb32475df76e7a801a12bd2 100644 --- a/src/plugins/auth/authd/Makefile.in +++ b/src/plugins/auth/authd/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) auth_authd_la_DEPENDENCIES = @@ -172,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -410,7 +415,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -auth_authd.la: $(auth_authd_la_OBJECTS) $(auth_authd_la_DEPENDENCIES) +auth_authd.la: $(auth_authd_la_OBJECTS) $(auth_authd_la_DEPENDENCIES) $(EXTRA_auth_authd_la_DEPENDENCIES) $(auth_authd_la_LINK) $(am_auth_authd_la_rpath) $(auth_authd_la_OBJECTS) $(auth_authd_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -547,10 +552,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/auth/munge/Makefile.in b/src/plugins/auth/munge/Makefile.in index bbbd6aabec8fcd8bbbb46c3ccc331359f4fe275f..e12543d24c8cb0df5a2110b8126103b7813da043 100644 --- a/src/plugins/auth/munge/Makefile.in +++ b/src/plugins/auth/munge/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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 = @@ -173,9 +178,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -183,9 +186,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -217,6 +219,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -244,6 +248,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -411,7 +416,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -auth_munge.la: $(auth_munge_la_OBJECTS) $(auth_munge_la_DEPENDENCIES) +auth_munge.la: $(auth_munge_la_OBJECTS) $(auth_munge_la_DEPENDENCIES) $(EXTRA_auth_munge_la_DEPENDENCIES) $(auth_munge_la_LINK) $(am_auth_munge_la_rpath) $(auth_munge_la_OBJECTS) $(auth_munge_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -548,10 +553,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/auth/none/Makefile.in b/src/plugins/auth/none/Makefile.in index 965da73d8c2b39345c7432b55cd861a5fcc010fd..787758c1301aa98d9e40d77a17d68cc07ada5d7f 100644 --- a/src/plugins/auth/none/Makefile.in +++ b/src/plugins/auth/none/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) auth_none_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -auth_none.la: $(auth_none_la_OBJECTS) $(auth_none_la_DEPENDENCIES) +auth_none.la: $(auth_none_la_OBJECTS) $(auth_none_la_DEPENDENCIES) $(EXTRA_auth_none_la_DEPENDENCIES) $(auth_none_la_LINK) -rpath $(pkglibdir) $(auth_none_la_OBJECTS) $(auth_none_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/checkpoint/Makefile.in b/src/plugins/checkpoint/Makefile.in index 34843c607f4639de30a31e4c469dc24876547240..bfdc13cc34da037f340524e37d842d00f428f749 100644 --- a/src/plugins/checkpoint/Makefile.in +++ b/src/plugins/checkpoint/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/checkpoint/aix/Makefile.in b/src/plugins/checkpoint/aix/Makefile.in index 95e36e5fd25bc13841c10ff9b5000b25d63cbbab..97ddd70d28c858cf0c394873686459b388b35a30 100644 --- a/src/plugins/checkpoint/aix/Makefile.in +++ b/src/plugins/checkpoint/aix/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) checkpoint_aix_la_LIBADD = @@ -176,9 +181,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -186,9 +189,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -220,6 +222,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -247,6 +251,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -411,7 +416,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -checkpoint_aix.la: $(checkpoint_aix_la_OBJECTS) $(checkpoint_aix_la_DEPENDENCIES) +checkpoint_aix.la: $(checkpoint_aix_la_OBJECTS) $(checkpoint_aix_la_DEPENDENCIES) $(EXTRA_checkpoint_aix_la_DEPENDENCIES) $(checkpoint_aix_la_LINK) $(am_checkpoint_aix_la_rpath) $(checkpoint_aix_la_OBJECTS) $(checkpoint_aix_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -548,10 +553,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/checkpoint/blcr/Makefile.in b/src/plugins/checkpoint/blcr/Makefile.in index 8de221098c76aeace56d7e84c56c38754d244888..8ccbb7dda8825c00272a5baa22462c6f3dfdb0f3 100644 --- a/src/plugins/checkpoint/blcr/Makefile.in +++ b/src/plugins/checkpoint/blcr/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -60,9 +60,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -70,6 +68,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -108,6 +107,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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)" \ "$(DESTDIR)$(pkglibexecdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) @@ -182,9 +187,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -192,9 +195,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -226,6 +228,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -253,6 +257,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -422,7 +427,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -checkpoint_blcr.la: $(checkpoint_blcr_la_OBJECTS) $(checkpoint_blcr_la_DEPENDENCIES) +checkpoint_blcr.la: $(checkpoint_blcr_la_OBJECTS) $(checkpoint_blcr_la_DEPENDENCIES) $(EXTRA_checkpoint_blcr_la_DEPENDENCIES) $(checkpoint_blcr_la_LINK) $(am_checkpoint_blcr_la_rpath) $(checkpoint_blcr_la_OBJECTS) $(checkpoint_blcr_la_LIBADD) $(LIBS) install-dist_pkglibexecSCRIPTS: $(dist_pkglibexec_SCRIPTS) @$(NORMAL_INSTALL) @@ -455,9 +460,7 @@ uninstall-dist_pkglibexecSCRIPTS: @list='$(dist_pkglibexec_SCRIPTS)'; test -n "$(pkglibexecdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkglibexecdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkglibexecdir)" && rm -f $$files + dir='$(DESTDIR)$(pkglibexecdir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -593,10 +596,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/checkpoint/none/Makefile.in b/src/plugins/checkpoint/none/Makefile.in index 6554212162a01d31a1b6bc7ef399760489151003..201dddccb572738f2b3071059dd7fd0dab539880 100644 --- a/src/plugins/checkpoint/none/Makefile.in +++ b/src/plugins/checkpoint/none/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) checkpoint_none_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -checkpoint_none.la: $(checkpoint_none_la_OBJECTS) $(checkpoint_none_la_DEPENDENCIES) +checkpoint_none.la: $(checkpoint_none_la_OBJECTS) $(checkpoint_none_la_DEPENDENCIES) $(EXTRA_checkpoint_none_la_DEPENDENCIES) $(checkpoint_none_la_LINK) -rpath $(pkglibdir) $(checkpoint_none_la_OBJECTS) $(checkpoint_none_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/checkpoint/ompi/Makefile.in b/src/plugins/checkpoint/ompi/Makefile.in index 3292228331452ef969fdf62b76a2d20ab541ebba..0bea4bdbb2998699f64feb608f029b1df16798c6 100644 --- a/src/plugins/checkpoint/ompi/Makefile.in +++ b/src/plugins/checkpoint/ompi/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) checkpoint_ompi_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -checkpoint_ompi.la: $(checkpoint_ompi_la_OBJECTS) $(checkpoint_ompi_la_DEPENDENCIES) +checkpoint_ompi.la: $(checkpoint_ompi_la_OBJECTS) $(checkpoint_ompi_la_DEPENDENCIES) $(EXTRA_checkpoint_ompi_la_DEPENDENCIES) $(checkpoint_ompi_la_LINK) -rpath $(pkglibdir) $(checkpoint_ompi_la_OBJECTS) $(checkpoint_ompi_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/crypto/Makefile.in b/src/plugins/crypto/Makefile.in index ac81cc766eca7a6a66279ae18f95eed2c3d3c60e..8d29cb42b4df7ef5a9bdef626197b2e922b6070c 100644 --- a/src/plugins/crypto/Makefile.in +++ b/src/plugins/crypto/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/crypto/munge/Makefile.in b/src/plugins/crypto/munge/Makefile.in index bf4c4046a0b76191d0d27139aa0022fac753919e..5f6cd49babfb1b10ce3b5b4100570bcf045eb97c 100644 --- a/src/plugins/crypto/munge/Makefile.in +++ b/src/plugins/crypto/munge/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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 = @@ -173,9 +178,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -183,9 +186,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -217,6 +219,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -244,6 +248,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -411,7 +416,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -crypto_munge.la: $(crypto_munge_la_OBJECTS) $(crypto_munge_la_DEPENDENCIES) +crypto_munge.la: $(crypto_munge_la_OBJECTS) $(crypto_munge_la_DEPENDENCIES) $(EXTRA_crypto_munge_la_DEPENDENCIES) $(crypto_munge_la_LINK) $(am_crypto_munge_la_rpath) $(crypto_munge_la_OBJECTS) $(crypto_munge_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -548,10 +553,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/crypto/openssl/Makefile.in b/src/plugins/crypto/openssl/Makefile.in index 5e04c2ab5f94e952fdda1c299a506d0c66f9ab1a..2be3cae7d1d0fb3c2b1c5fe097ab86a6a8e6423a 100644 --- a/src/plugins/crypto/openssl/Makefile.in +++ b/src/plugins/crypto/openssl/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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 = @@ -178,9 +183,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -188,9 +191,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -222,6 +224,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -249,6 +253,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -414,7 +419,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -crypto_openssl.la: $(crypto_openssl_la_OBJECTS) $(crypto_openssl_la_DEPENDENCIES) +crypto_openssl.la: $(crypto_openssl_la_OBJECTS) $(crypto_openssl_la_DEPENDENCIES) $(EXTRA_crypto_openssl_la_DEPENDENCIES) $(crypto_openssl_la_LINK) $(am_crypto_openssl_la_rpath) $(crypto_openssl_la_OBJECTS) $(crypto_openssl_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -551,10 +556,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/gres/Makefile.in b/src/plugins/gres/Makefile.in index 93dbd07f2629411da20d2d4e67996ed75dfbc6b4..f6f778c4880ef601b5ed7d453ff680d6f8d34d04 100644 --- a/src/plugins/gres/Makefile.in +++ b/src/plugins/gres/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/gres/gpu/Makefile.in b/src/plugins/gres/gpu/Makefile.in index 017a28025704d4c2b544420ae039a7573efc3761..cd34534a125b05ce592bdcc028ccbf4b47199d8d 100644 --- a/src/plugins/gres/gpu/Makefile.in +++ b/src/plugins/gres/gpu/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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 = @@ -172,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -407,7 +412,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -gres_gpu.la: $(gres_gpu_la_OBJECTS) $(gres_gpu_la_DEPENDENCIES) +gres_gpu.la: $(gres_gpu_la_OBJECTS) $(gres_gpu_la_DEPENDENCIES) $(EXTRA_gres_gpu_la_DEPENDENCIES) $(gres_gpu_la_LINK) -rpath $(pkglibdir) $(gres_gpu_la_OBJECTS) $(gres_gpu_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -544,10 +549,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/gres/gpu/gres_gpu.c b/src/plugins/gres/gpu/gres_gpu.c index dfe6a5114acddd3dbe51ce714075b9425405ba05..ef7aeef2d005c508d45d117fc0963e60d2e7eb90 100644 --- a/src/plugins/gres/gpu/gres_gpu.c +++ b/src/plugins/gres/gpu/gres_gpu.c @@ -67,6 +67,7 @@ #include #include +#include #include "slurm/slurm.h" #include "slurm/slurm_errno.h" diff --git a/src/plugins/gres/nic/Makefile.in b/src/plugins/gres/nic/Makefile.in index 79e5ca9e216e8ef92220417dfd0cf8dd7d5f21a2..a3f89e075eb052ddf2a7f0694ee48c1598a48a8a 100644 --- a/src/plugins/gres/nic/Makefile.in +++ b/src/plugins/gres/nic/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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 = @@ -172,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -407,7 +412,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -gres_nic.la: $(gres_nic_la_OBJECTS) $(gres_nic_la_DEPENDENCIES) +gres_nic.la: $(gres_nic_la_OBJECTS) $(gres_nic_la_DEPENDENCIES) $(EXTRA_gres_nic_la_DEPENDENCIES) $(gres_nic_la_LINK) -rpath $(pkglibdir) $(gres_nic_la_OBJECTS) $(gres_nic_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -544,10 +549,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/job_submit/Makefile.in b/src/plugins/job_submit/Makefile.in index 6926be1531eb213e28df49f5589313215e1e6ebd..0c5d37e1dc1cbd72d87369f76f8f743885834eb2 100644 --- a/src/plugins/job_submit/Makefile.in +++ b/src/plugins/job_submit/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/job_submit/cnode/Makefile.in b/src/plugins/job_submit/cnode/Makefile.in index 14424c480959eede6f299ceb6cb38f1d4f800099..c07c38854378e0bffaeb0b3f688c6ca9ae1f1323 100644 --- a/src/plugins/job_submit/cnode/Makefile.in +++ b/src/plugins/job_submit/cnode/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) job_submit_cnode_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -job_submit_cnode.la: $(job_submit_cnode_la_OBJECTS) $(job_submit_cnode_la_DEPENDENCIES) +job_submit_cnode.la: $(job_submit_cnode_la_OBJECTS) $(job_submit_cnode_la_DEPENDENCIES) $(EXTRA_job_submit_cnode_la_DEPENDENCIES) $(job_submit_cnode_la_LINK) -rpath $(pkglibdir) $(job_submit_cnode_la_OBJECTS) $(job_submit_cnode_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/job_submit/defaults/Makefile.in b/src/plugins/job_submit/defaults/Makefile.in index 322cd59d43f539cc195dd562b791ed3b191c65f3..f1a0a03fb1035dedffe90850249a946f72c548e0 100644 --- a/src/plugins/job_submit/defaults/Makefile.in +++ b/src/plugins/job_submit/defaults/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) job_submit_defaults_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -job_submit_defaults.la: $(job_submit_defaults_la_OBJECTS) $(job_submit_defaults_la_DEPENDENCIES) +job_submit_defaults.la: $(job_submit_defaults_la_OBJECTS) $(job_submit_defaults_la_DEPENDENCIES) $(EXTRA_job_submit_defaults_la_DEPENDENCIES) $(job_submit_defaults_la_LINK) -rpath $(pkglibdir) $(job_submit_defaults_la_OBJECTS) $(job_submit_defaults_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/job_submit/logging/Makefile.in b/src/plugins/job_submit/logging/Makefile.in index 2c138b9206fd0bf1013a8f04d2ba7e5962f74584..4c5b1f934b3fae5b7910dd8731d8eab628faedd4 100644 --- a/src/plugins/job_submit/logging/Makefile.in +++ b/src/plugins/job_submit/logging/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) job_submit_logging_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -job_submit_logging.la: $(job_submit_logging_la_OBJECTS) $(job_submit_logging_la_DEPENDENCIES) +job_submit_logging.la: $(job_submit_logging_la_OBJECTS) $(job_submit_logging_la_DEPENDENCIES) $(EXTRA_job_submit_logging_la_DEPENDENCIES) $(job_submit_logging_la_LINK) -rpath $(pkglibdir) $(job_submit_logging_la_OBJECTS) $(job_submit_logging_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/job_submit/lua/Makefile.in b/src/plugins/job_submit/lua/Makefile.in index 6f99782870d0400bdbe60f62a0b8280b48e8f564..264ba070a985011618316ba334b8463cd77955bb 100644 --- a/src/plugins/job_submit/lua/Makefile.in +++ b/src/plugins/job_submit/lua/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) job_submit_lua_la_LIBADD = @@ -176,9 +181,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -186,9 +189,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -220,6 +222,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -247,6 +251,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -412,7 +417,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -job_submit_lua.la: $(job_submit_lua_la_OBJECTS) $(job_submit_lua_la_DEPENDENCIES) +job_submit_lua.la: $(job_submit_lua_la_OBJECTS) $(job_submit_lua_la_DEPENDENCIES) $(EXTRA_job_submit_lua_la_DEPENDENCIES) $(job_submit_lua_la_LINK) $(am_job_submit_lua_la_rpath) $(job_submit_lua_la_OBJECTS) $(job_submit_lua_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -549,10 +554,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/job_submit/partition/Makefile.in b/src/plugins/job_submit/partition/Makefile.in index 237d27251bb0fa90cea064ad68469ff031eec58a..a71235bcd408906aa1d82b4f7e5e73449dc3e549 100644 --- a/src/plugins/job_submit/partition/Makefile.in +++ b/src/plugins/job_submit/partition/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) job_submit_partition_la_LIBADD = @@ -172,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -406,7 +411,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -job_submit_partition.la: $(job_submit_partition_la_OBJECTS) $(job_submit_partition_la_DEPENDENCIES) +job_submit_partition.la: $(job_submit_partition_la_OBJECTS) $(job_submit_partition_la_DEPENDENCIES) $(EXTRA_job_submit_partition_la_DEPENDENCIES) $(job_submit_partition_la_LINK) -rpath $(pkglibdir) $(job_submit_partition_la_OBJECTS) $(job_submit_partition_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -543,10 +548,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/jobacct_gather/Makefile.in b/src/plugins/jobacct_gather/Makefile.in index 5a11651a221cbb86744174349ba3a0391cb77658..51cabbbd2e55387111448c373f5b21a15d0b1bfd 100644 --- a/src/plugins/jobacct_gather/Makefile.in +++ b/src/plugins/jobacct_gather/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/jobacct_gather/aix/Makefile.in b/src/plugins/jobacct_gather/aix/Makefile.in index c399b5ca9fa3cc728d38019ca559e85f8971e9e6..fa57fdc545304b382c8b10dc5916a897ada4d48a 100644 --- a/src/plugins/jobacct_gather/aix/Makefile.in +++ b/src/plugins/jobacct_gather/aix/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) jobacct_gather_aix_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -jobacct_gather_aix.la: $(jobacct_gather_aix_la_OBJECTS) $(jobacct_gather_aix_la_DEPENDENCIES) +jobacct_gather_aix.la: $(jobacct_gather_aix_la_OBJECTS) $(jobacct_gather_aix_la_DEPENDENCIES) $(EXTRA_jobacct_gather_aix_la_DEPENDENCIES) $(jobacct_gather_aix_la_LINK) -rpath $(pkglibdir) $(jobacct_gather_aix_la_OBJECTS) $(jobacct_gather_aix_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/jobacct_gather/aix/jobacct_gather_aix.c b/src/plugins/jobacct_gather/aix/jobacct_gather_aix.c index 13c66b9a104b386a045ea45206cb003835cd3a14..1d38aaaf3a5bb350fcd6d7655f64b07051a70207 100644 --- a/src/plugins/jobacct_gather/aix/jobacct_gather_aix.c +++ b/src/plugins/jobacct_gather/aix/jobacct_gather_aix.c @@ -42,7 +42,7 @@ #include #include "src/common/slurm_xlator.h" -#include "src/common/jobacct_common.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/slurm_protocol_api.h" #include "src/common/slurm_protocol_defs.h" #include "src/slurmd/common/proctrack.h" @@ -53,16 +53,6 @@ #define NPROCS 5000 #endif -/* These are defined here so when we link with something other than - * the slurmd we will have these symbols defined. They will get - * overwritten when linking with the slurmd. - */ -uint32_t jobacct_job_id; -pthread_mutex_t jobacct_lock; -uint32_t jobacct_mem_limit; -uint32_t jobacct_step_id; -uint32_t jobacct_vmem_limit; - /* * These variables are required by the generic plugin interface. If they * are not found in the plugin, the plugin loader will ignore it. @@ -94,14 +84,10 @@ uint32_t jobacct_vmem_limit; */ const char plugin_name[] = "Job accounting gather AIX plugin"; const char plugin_type[] = "jobacct_gather/aix"; -const uint32_t plugin_version = 100; +const uint32_t plugin_version = 200; /* Other useful declarations */ -static bool jobacct_shutdown = 0; -static bool jobacct_suspended = 0; -static List task_list = NULL; -static uint64_t cont_id = (uint64_t)NO_VAL; -static bool pgid_plugin = false; +static int pagesize = 0; #ifdef HAVE_AIX typedef struct prec { /* process record */ @@ -114,15 +100,9 @@ typedef struct prec { /* process record */ float vsize; /* max virtual size */ } prec_t; -static int freq = 0; -static int pagesize = 0; - /* Finally, pre-define all the routines. */ -static void _acct_kill_step(void); static void _get_offspring_data(List prec_list, prec_t *ancestor, pid_t pid); -static void _get_process_data(); -static void *_watch_tasks(void *arg); static void _destroy_prec(void *object); /* system call to get process table */ @@ -179,20 +159,24 @@ static void _get_offspring_data(List prec_list, prec_t *ancestor, pid_t pid) } /* - * _get_process_data() - Build a table of all current processes + * jobacct_gather_p_poll_data() - Build a table of all current processes * - * IN: pid. + * IN/OUT: task_list - list containing current processes. + * IN: pgid_plugin - if we are running with the pgid plugin. + * IN: cont_id - container id of processes if not running with pgid. * * OUT: none * - * THREADSAFE! Only one thread ever gets here. + * THREADSAFE! Only one thread ever gets here. It is locked in + * slurm_jobacct_gather. * * Assumption: * Any file with a name of the form "/proc/[0-9]+/stat" * is a Linux-style stat entry. We disregard the data if they look * wrong. */ -static void _get_process_data(void) +extern void jobacct_gather_p_poll_data( + List task_list, bool pgid_plugin, uint64_t cont_id) { struct procsinfo proc; pid_t *pids = NULL; @@ -229,7 +213,7 @@ static void _get_process_data(void) } for (i = 0; i < npids; i++) { pid = pids[i]; - if(!getprocs(&proc, sizeof(proc), 0, 0, &pid, 1)) + if (!getprocs(&proc, sizeof(proc), 0, 0, &pid, 1)) continue; /* Assume the process went away */ prec = xmalloc(sizeof(prec_t)); list_append(prec_list, prec); @@ -249,7 +233,7 @@ static void _get_process_data(void) /* prec->vsize, proc.pi_tsize, proc.pi_dvm, pagesize); */ } } else { - while(getprocs(&proc, sizeof(proc), 0, 0, &pid, 1) == 1) { + while (getprocs(&proc, sizeof(proc), 0, 0, &pid, 1) == 1) { prec = xmalloc(sizeof(prec_t)); list_append(prec_list, prec); prec->pid = proc.pi_pid; @@ -268,18 +252,18 @@ static void _get_process_data(void) /* prec->vsize, proc.pi_tsize, proc.pi_dvm, pagesize); */ } } - if(!list_count(prec_list)) + if (!list_count(prec_list)) goto finished; slurm_mutex_lock(&jobacct_lock); - if(!task_list || !list_count(task_list)) { + if (!task_list || !list_count(task_list)) { slurm_mutex_unlock(&jobacct_lock); goto finished; } itr = list_iterator_create(task_list); - while((jobacct = list_next(itr))) { + while ((jobacct = list_next(itr))) { itr2 = list_iterator_create(prec_list); - while((prec = list_next(itr2))) { + while ((prec = list_next(itr2))) { //debug2("pid %d ? %d", prec->ppid, jobacct->pid); if (prec->pid == jobacct->pid) { /* find all my descendents */ @@ -309,37 +293,8 @@ static void _get_process_data(void) list_iterator_destroy(itr2); } list_iterator_destroy(itr); - slurm_mutex_unlock(&jobacct_lock); - if (jobacct_mem_limit) { - debug("Step %u.%u memory used:%u limit:%u KB", - jobacct_job_id, jobacct_step_id, - total_job_mem, jobacct_mem_limit); - } - if (jobacct_job_id && jobacct_mem_limit && - (total_job_mem > jobacct_mem_limit)) { - if (jobacct_step_id == NO_VAL) { - error("Job %u exceeded %u KB memory limit, being " - "killed", jobacct_job_id, jobacct_mem_limit); - } else { - error("Step %u.%u exceeded %u KB memory limit, being " - "killed", jobacct_job_id, jobacct_step_id, - jobacct_mem_limit); - } - _acct_kill_step(); - } else if (jobacct_job_id && jobacct_vmem_limit && - (total_job_vsize > jobacct_vmem_limit)) { - if (jobacct_step_id == NO_VAL) { - error("Job %u exceeded %u KB virtual memory limit, " - "being killed", jobacct_job_id, - jobacct_vmem_limit); - } else { - error("Step %u.%u exceeded %u KB virtual memory " - "limit, being killed", jobacct_job_id, - jobacct_step_id, jobacct_vmem_limit); - } - _acct_kill_step(); - } + jobacct_gather_handle_mem_limit(total_job_mem, total_job_vsize); finished: list_destroy(prec_list); @@ -348,44 +303,6 @@ finished: return; } -/* _acct_kill_step() issue RPC to kill a slurm job step */ -static void _acct_kill_step(void) -{ - slurm_msg_t msg; - job_step_kill_msg_t req; - - slurm_msg_t_init(&msg); - /* - * Request message: - */ - req.job_id = jobacct_job_id; - req.job_step_id = jobacct_step_id; - req.signal = SIGKILL; - req.batch_flag = 0; - msg.msg_type = REQUEST_CANCEL_JOB_STEP; - msg.data = &req; - - slurm_send_only_controller_msg(&msg); -} - -/* _watch_tasks() -- monitor slurm jobs and track their memory usage - * - * IN, OUT: Irrelevant; this is invoked by pthread_create() - */ - -static void *_watch_tasks(void *arg) -{ - - while (!jobacct_shutdown) { /* Do this until shutdown is requested */ - if (!jobacct_suspended) { - _get_process_data(); /* Update the data */ - } - sleep(freq); - } - return NULL; -} - - static void _destroy_prec(void *object) { prec_t *prec = (prec_t *)object; @@ -401,22 +318,7 @@ static void _destroy_prec(void *object) */ extern int init ( void ) { - char *temp = slurm_get_proctrack_type(); - if(!strcasecmp(temp, "proctrack/pgid")) { - info("WARNING: We will use a much slower algorithm with " - "proctrack/pgid, use Proctracktype=proctrack/aix " - "with %s", plugin_name); - pgid_plugin = true; - } - xfree(temp); - temp = slurm_get_accounting_storage_type(); - if(!strcasecmp(temp, 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 " - "need to change it.", ACCOUNTING_STORAGE_TYPE_NONE); - } - xfree(temp); + pagesize = getpagesize()/1024; verbose("%s loaded", plugin_name); return SLURM_SUCCESS; @@ -427,199 +329,13 @@ extern int fini ( void ) return SLURM_SUCCESS; } -extern struct jobacctinfo *jobacct_gather_p_create(jobacct_id_t *jobacct_id) -{ - return jobacct_common_alloc_jobacct(jobacct_id); -} - -extern void jobacct_gather_p_destroy(struct jobacctinfo *jobacct) -{ - jobacct_common_free_jobacct(jobacct); -} - -extern int jobacct_gather_p_setinfo(struct jobacctinfo *jobacct, - enum jobacct_data_type type, void *data) -{ - return jobacct_common_setinfo(jobacct, type, data); - -} - -extern int jobacct_gather_p_getinfo(struct jobacctinfo *jobacct, - enum jobacct_data_type type, void *data) -{ - return jobacct_common_getinfo(jobacct, type, data); -} - -extern void jobacct_gather_p_pack(struct jobacctinfo *jobacct, - uint16_t rpc_version, Buf buffer) -{ - jobacct_common_pack(jobacct, rpc_version, buffer); -} - -extern int jobacct_gather_p_unpack(struct jobacctinfo **jobacct, - uint16_t rpc_version, Buf buffer) -{ - return jobacct_common_unpack(jobacct, rpc_version, buffer); -} - -extern void jobacct_gather_p_aggregate(struct jobacctinfo *dest, - struct jobacctinfo *from) -{ - jobacct_common_aggregate(dest, from); -} - -/* - * jobacct_startpoll() is called when the plugin is loaded by - * slurmd, before any other functions are called. Put global - * initialization here. - */ - -extern int jobacct_gather_p_startpoll(uint16_t frequency) -{ - int rc = SLURM_SUCCESS; - -#ifdef HAVE_AIX - pthread_attr_t attr; - pthread_t _watch_tasks_thread_id; - - debug("%s loaded", plugin_name); - - debug("jobacct-gather: frequency = %d", frequency); - - jobacct_shutdown = false; - - freq = frequency; - pagesize = getpagesize()/1024; - task_list = list_create(jobacct_common_free_jobacct); - if (frequency == 0) { /* don't want dynamic monitoring? */ - debug2("jobacct AIX dynamic logging disabled"); - return rc; - } - - /* 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, - &_watch_tasks, NULL)) { - debug("jobacct-gather failed to create _watch_tasks " - "thread: %m"); - frequency = 0; - } else - debug3("jobacct-gather AIX dynamic logging enabled"); - slurm_attr_destroy(&attr); -#else - error("jobacct-gather AIX not loaded, not an aix system, " - "check slurm.conf"); -#endif - return rc; -} - -extern int jobacct_gather_p_endpoll() +extern int jobacct_gather_p_endpoll ( void ) { - jobacct_shutdown = true; -#ifdef HAVE_AIX - slurm_mutex_lock(&jobacct_lock); - if(task_list) - list_destroy(task_list); - task_list = NULL; - slurm_mutex_unlock(&jobacct_lock); -#endif - return SLURM_SUCCESS; } -extern void jobacct_gather_p_change_poll(uint16_t frequency) -{ -#ifdef HAVE_AIX - if(freq == 0 && frequency != 0) { - pthread_attr_t attr; - pthread_t _watch_tasks_thread_id; - /* 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, - &_watch_tasks, NULL)) { - debug("jobacct-gather failed to create _watch_tasks " - "thread: %m"); - frequency = 0; - } else - debug3("jobacct-gather AIX dynamic logging enabled"); - slurm_attr_destroy(&attr); - jobacct_shutdown = false; - } - - freq = frequency; - debug("jobacct-gather: frequency changed = %d", frequency); - if (freq == 0) - jobacct_shutdown = true; -#endif - return; -} - -extern void jobacct_gather_p_suspend_poll() -{ - jobacct_suspended = true; -} - -extern void jobacct_gather_p_resume_poll() -{ - jobacct_suspended = false; -} - -extern int jobacct_gather_p_set_proctrack_container_id(uint64_t id) -{ - if (pgid_plugin) - return SLURM_SUCCESS; - - if (cont_id != (uint64_t)NO_VAL) - info("Warning: jobacct: set_proctrack_container_id: cont_id " - "is already set to %"PRIu64" you are setting it to " - "%"PRIu64"", cont_id, id); - if (id <= 0) { - error("jobacct: set_proctrack_container_id: " - "I was given most likely an unset cont_id %"PRIu64"", - id); - return SLURM_ERROR; - } - cont_id = id; - - return SLURM_SUCCESS; -} extern int jobacct_gather_p_add_task(pid_t pid, jobacct_id_t *jobacct_id) { - if (jobacct_shutdown) - return SLURM_ERROR; - return jobacct_common_add_task(pid, jobacct_id, task_list); -} - -extern struct jobacctinfo *jobacct_gather_p_stat_task(pid_t pid) -{ - if (jobacct_shutdown) - return NULL; - -#ifdef HAVE_AIX - _get_process_data(); -#endif - if(pid) - return jobacct_common_stat_task(pid, task_list); - else - return NULL; -} - -extern struct jobacctinfo *jobacct_gather_p_remove_task(pid_t pid) -{ - if (jobacct_shutdown) - return NULL; - return jobacct_common_remove_task(pid, task_list); -} - -extern void jobacct_gather_p_2_stats(slurmdb_stats_t *stats, - struct jobacctinfo *jobacct) -{ - jobacct_common_2_stats(stats, jobacct); + return SLURM_SUCCESS; } diff --git a/src/plugins/jobacct_gather/cgroup/Makefile.in b/src/plugins/jobacct_gather/cgroup/Makefile.in index 53e4a68cde1b478664ccb1a56881e91eb6687361..dae13013ae11f4db011d044adfd65bcbeadf8438 100644 --- a/src/plugins/jobacct_gather/cgroup/Makefile.in +++ b/src/plugins/jobacct_gather/cgroup/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) jobacct_gather_cgroup_la_LIBADD = @@ -174,9 +179,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -184,9 +187,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -218,6 +220,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -245,6 +249,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -412,7 +417,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -jobacct_gather_cgroup.la: $(jobacct_gather_cgroup_la_OBJECTS) $(jobacct_gather_cgroup_la_DEPENDENCIES) +jobacct_gather_cgroup.la: $(jobacct_gather_cgroup_la_OBJECTS) $(jobacct_gather_cgroup_la_DEPENDENCIES) $(EXTRA_jobacct_gather_cgroup_la_DEPENDENCIES) $(jobacct_gather_cgroup_la_LINK) -rpath $(pkglibdir) $(jobacct_gather_cgroup_la_OBJECTS) $(jobacct_gather_cgroup_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -551,10 +556,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c index 9d7aed9fa6b48ebb247f8be6156264c990a90503..9566d5abfffc27e59dd6cf1f328f1078ce5c8c1e 100644 --- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c +++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c @@ -56,19 +56,9 @@ * overwritten when linking with the slurmd. */ #if defined (__APPLE__) -uint32_t jobacct_job_id __attribute__((weak_import)); -pthread_mutex_t jobacct_lock __attribute__((weak_import)); -uint32_t jobacct_mem_limit __attribute__((weak_import)); -uint32_t jobacct_step_id __attribute__((weak_import)); -uint32_t jobacct_vmem_limit __attribute__((weak_import)); slurmd_conf_t *conf __attribute__((weak_import)); int bg_recover __attribute__((weak_import)) = NOT_FROM_CONTROLLER; #else -uint32_t jobacct_job_id; -pthread_mutex_t jobacct_lock; -uint32_t jobacct_mem_limit; -uint32_t jobacct_step_id; -uint32_t jobacct_vmem_limit; slurmd_conf_t *conf; int bg_recover = NOT_FROM_CONTROLLER; #endif @@ -105,7 +95,7 @@ int bg_recover = NOT_FROM_CONTROLLER; */ const char plugin_name[] = "Job accounting gather cgroup plugin"; const char plugin_type[] = "jobacct_gather/cgroup"; -const uint32_t plugin_version = 100; +const uint32_t plugin_version = 200; /* Other useful declarations */ @@ -121,40 +111,208 @@ typedef struct prec { /* process record */ // int last_cpu; } prec_t; -static int freq = 0; +static int pagesize = 0; static DIR *slash_proc = NULL; static pthread_mutex_t reading_mutex = PTHREAD_MUTEX_INITIALIZER; -static bool jobacct_shutdown = 0; -static bool jobacct_suspended = 0; -static List task_list = NULL; -static uint64_t cont_id = (uint64_t)NO_VAL; -static bool pgid_plugin = false; static slurm_cgroup_conf_t slurm_cgroup_conf; /* Finally, pre-define all local routines. */ -static void _acct_kill_step(void); static void _destroy_prec(void *object); static int _is_a_lwp(uint32_t pid); -static void _get_process_data(void); static int _get_process_data_line(int in, prec_t *prec); -static void *_watch_tasks(void *arg); + +static int _is_a_lwp(uint32_t pid) { + + FILE *status_fp = NULL; + char proc_status_file[256]; + uint32_t tgid; + int rc; + + if (snprintf(proc_status_file, 256, "/proc/%d/status", pid) > 256) { + debug("jobacct_gather_cgroup: unable to build proc_status " + "fpath"); + return -1; + } + if (!(status_fp = fopen(proc_status_file, "r"))) { + debug3("jobacct_gather_cgroup: unable to open %s", + proc_status_file); + return -1; + } + + + do { + rc = fscanf(status_fp, + "Name:\t%*s\n%*[ \ta-zA-Z0-9:()]\nTgid:\t%d\n", + &tgid); + } while (rc < 0 && errno == EINTR); + fclose(status_fp); + + /* unable to read /proc/[pid]/status content */ + if (rc != 1) { + debug3("jobacct_gather_cgroup: unable to read requested " + "pattern in %s",proc_status_file); + return -1; + } + + /* if tgid differs from pid, this is a LWP (Thread POSIX) */ + if ((uint32_t) tgid != (uint32_t) pid) { + debug3("jobacct_gather_cgroup: pid=%d is a lightweight process", + tgid); + return 1; + } else + return 0; +} + +/* _get_process_data_line() - get line of data from /proc//stat + * + * IN: in - input file descriptor + * OUT: prec - the destination for the data + * + * RETVAL: ==0 - no valid data + * !=0 - data are valid + * + * Based upon stat2proc() from the ps command. It can handle arbitrary + * executable file basenames for `cmd', i.e. those with embedded + * whitespace or embedded ')'s. Such names confuse %s (see scanf(3)), + * so the string is split and %39c is used instead. + * (except for embedded ')' "(%[^)]c)" would work. + */ +static int _get_process_data_line(int in, prec_t *prec) { + char sbuf[256], *tmp; + int num_read, nvals; + char cmd[40], state[1]; + int ppid, pgrp, session, tty_nr, tpgid; + long unsigned flags, minflt, cminflt, majflt, cmajflt; + long unsigned utime, stime, starttime, vsize; + long int cutime, cstime, priority, nice, timeout, itrealvalue, rss; + long int f1,f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12; + long int f13,f14, lastcpu; + + num_read = read(in, sbuf, (sizeof(sbuf) - 1)); + if (num_read <= 0) + return 0; + sbuf[num_read] = '\0'; + + tmp = strrchr(sbuf, ')'); /* split into "PID (cmd" and "" */ + *tmp = '\0'; /* replace trailing ')' with NUL */ + /* parse these two strings separately, skipping the leading "(". */ + nvals = sscanf(sbuf, "%d (%39c", &prec->pid, cmd); + if (nvals < 2) + return 0; + + nvals = sscanf(tmp + 2, /* skip space after ')' too */ + "%c %d %d %d %d %d " + "%lu %lu %lu %lu %lu " + "%lu %lu %ld %ld %ld %ld " + "%ld %ld %lu %lu %ld " + "%lu %lu %lu %lu %lu " + "%lu %lu %lu %lu %lu " + "%lu %lu %lu %ld %ld ", + state, &ppid, &pgrp, &session, &tty_nr, &tpgid, + &flags, &minflt, &cminflt, &majflt, &cmajflt, + &utime, &stime, &cutime, &cstime, &priority, &nice, + &timeout, &itrealvalue, &starttime, &vsize, &rss, + &f1, &f2, &f3, &f4, &f5 ,&f6, &f7, &f8, &f9, &f10, &f11, + &f12, &f13, &f14, &lastcpu); + /* There are some additional fields, which we do not scan or use */ + if ((nvals < 37) || (rss < 0)) + return 0; + + /* If current pid corresponds to a Light Weight Process + * (Thread POSIX) skip it, we will only account the original + * process (pid==tgid) + */ + if (_is_a_lwp(prec->pid) > 0) + return 0; + + /* Copy the values that slurm records into our data structure */ +// prec->last_cpu = lastcpu; + return 1; +} + +static void _destroy_prec(void *object) +{ + prec_t *prec = (prec_t *)object; + xfree(prec); + return; +} + +/* + * init() is called when the plugin is loaded, before any other functions + * are called. Put global initialization here. + */ +extern int init (void) +{ + /* If running on the slurmctld don't do any of this since it + isn't needed. + */ + if (bg_recover == NOT_FROM_CONTROLLER) { + pagesize = getpagesize(); + + /* read cgroup configuration */ + if (read_slurm_cgroup_conf(&slurm_cgroup_conf)) + return SLURM_ERROR; + + /* initialize cpuinfo internal data */ + if (xcpuinfo_init() != XCPUINFO_SUCCESS) { + free_slurm_cgroup_conf(&slurm_cgroup_conf); + return SLURM_ERROR; + } + + /* enable cpuacct cgroup subsystem */ + if (jobacct_gather_cgroup_cpuacct_init(&slurm_cgroup_conf) != + SLURM_SUCCESS) { + xcpuinfo_fini(); + free_slurm_cgroup_conf(&slurm_cgroup_conf); + return SLURM_ERROR; + } + + /* enable memory cgroup subsystem */ + if (jobacct_gather_cgroup_memory_init(&slurm_cgroup_conf) != + SLURM_SUCCESS) { + xcpuinfo_fini(); + free_slurm_cgroup_conf(&slurm_cgroup_conf); + return SLURM_ERROR; + } + info("WARNING: The %s plugin is experimental, and should " + "not currently be used in production environments.", + plugin_name); + } + + verbose("%s loaded", plugin_name); + return SLURM_SUCCESS; +} + +extern int fini (void) +{ + jobacct_gather_cgroup_cpuacct_fini(&slurm_cgroup_conf); + jobacct_gather_cgroup_memory_fini(&slurm_cgroup_conf); + + /* unload configuration */ + free_slurm_cgroup_conf(&slurm_cgroup_conf); + return SLURM_SUCCESS; +} /* - * _get_process_data() - Build a table of all current processes + * jobacct_gather_p_poll_data() - Build a table of all current processes * - * IN: pid. + * IN/OUT: task_list - list containing current processes. + * IN: pgid_plugin - if we are running with the pgid plugin. + * IN: cont_id - container id of processes if not running with pgid. * * OUT: none * - * THREADSAFE! Only one thread ever gets here. + * THREADSAFE! Only one thread ever gets here. It is locked in + * slurm_jobacct_gather. * * Assumption: * Any file with a name of the form "/proc/[0-9]+/stat" * is a Linux-style stat entry. We disregard the data if they look * wrong. */ -static void _get_process_data(void) +extern void jobacct_gather_p_poll_data( + List task_list, bool pgid_plugin, uint64_t cont_id) { static int slash_proc_open = 0; @@ -175,9 +333,8 @@ static void _get_process_data(void) long hertz; char *cpu_time, *memory_stat, *ptr; size_t cpu_time_size, memory_stat_size; - int utime, stime, total_rss, total_pgpgin, page_size; + int utime, stime, total_rss, total_pgpgin; - page_size = getpagesize(); if (!pgid_plugin && cont_id == (uint64_t)NO_VAL) { debug("cont_id hasn't been set yet not running poll"); return; @@ -239,7 +396,7 @@ static void _get_process_data(void) ptr = strstr(memory_stat, "total_pgpgin"); sscanf(ptr, "total_pgpgin %u", &total_pgpgin); prec->pages = total_pgpgin; - prec->rss = total_rss / page_size; + prec->rss = total_rss / pagesize; list_append(prec_list, prec); } else xfree(prec); @@ -322,7 +479,7 @@ static void _get_process_data(void) ptr = strstr(memory_stat, "total_pgpgin"); sscanf(ptr, "total_pgpgin %u", &total_pgpgin); prec->pages = total_pgpgin; - prec->rss = total_rss / page_size; + prec->rss = total_rss / pagesize; list_append(prec_list, prec); } else @@ -333,15 +490,8 @@ static void _get_process_data(void) } - if (!list_count(prec_list)) { + if (!list_count(prec_list) || !task_list || !list_count(task_list)) goto finished; /* We have no business being here! */ - } - - slurm_mutex_lock(&jobacct_lock); - if (!task_list || !list_count(task_list)) { - slurm_mutex_unlock(&jobacct_lock); - goto finished; - } itr = list_iterator_create(task_list); while ((jobacct = list_next(itr))) { @@ -375,42 +525,8 @@ static void _get_process_data(void) list_iterator_destroy(itr2); } list_iterator_destroy(itr); - slurm_mutex_unlock(&jobacct_lock); - if (jobacct_mem_limit) { - if (jobacct_step_id == NO_VAL) { - debug("Job %u memory used:%u limit:%u KB", - jobacct_job_id, total_job_mem, jobacct_mem_limit); - } else { - debug("Step %u.%u memory used:%u limit:%u KB", - jobacct_job_id, jobacct_step_id, - total_job_mem, jobacct_mem_limit); - } - } - if (jobacct_job_id && jobacct_mem_limit && - (total_job_mem > jobacct_mem_limit)) { - if (jobacct_step_id == NO_VAL) { - error("Job %u exceeded %u KB memory limit, being " - "killed", jobacct_job_id, jobacct_mem_limit); - } else { - error("Step %u.%u exceeded %u KB memory limit, being " - "killed", jobacct_job_id, jobacct_step_id, - jobacct_mem_limit); - } - _acct_kill_step(); - } else if (jobacct_job_id && jobacct_vmem_limit && - (total_job_vsize > jobacct_vmem_limit)) { - if (jobacct_step_id == NO_VAL) { - error("Job %u exceeded %u KB virtual memory limit, " - "being killed", jobacct_job_id, - jobacct_vmem_limit); - } else { - error("Step %u.%u exceeded %u KB virtual memory " - "limit, being killed", jobacct_job_id, - jobacct_step_id, jobacct_vmem_limit); - } - _acct_kill_step(); - } + jobacct_gather_handle_mem_limit(total_job_mem, total_job_vsize); finished: list_destroy(prec_list); @@ -418,348 +534,8 @@ finished: return; } -/* _acct_kill_step() issue RPC to kill a slurm job step */ -static void _acct_kill_step(void) +extern int jobacct_gather_p_endpoll(void) { - slurm_msg_t msg; - job_step_kill_msg_t req; - job_notify_msg_t notify_req; - - slurm_msg_t_init(&msg); - notify_req.job_id = jobacct_job_id; - notify_req.job_step_id = jobacct_step_id; - notify_req.message = "Exceeded job memory limit"; - msg.msg_type = REQUEST_JOB_NOTIFY; - msg.data = ¬ify_req; - slurm_send_only_controller_msg(&msg); - - /* - * Request message: - */ - req.job_id = jobacct_job_id; - req.job_step_id = jobacct_step_id; - req.signal = SIGKILL; - req.batch_flag = 0; - msg.msg_type = REQUEST_CANCEL_JOB_STEP; - msg.data = &req; - - slurm_send_only_controller_msg(&msg); -} - -static int _is_a_lwp(uint32_t pid) { - - FILE *status_fp = NULL; - char proc_status_file[256]; - uint32_t tgid; - int rc; - - if (snprintf(proc_status_file, 256, "/proc/%d/status", pid) > 256) { - debug("jobacct_gather_cgroup: unable to build proc_status " - "fpath"); - return -1; - } - if (!(status_fp = fopen(proc_status_file, "r"))) { - debug3("jobacct_gather_cgroup: unable to open %s", - proc_status_file); - return -1; - } - - - do { - rc = fscanf(status_fp, - "Name:\t%*s\n%*[ \ta-zA-Z0-9:()]\nTgid:\t%d\n", - &tgid); - } while (rc < 0 && errno == EINTR); - fclose(status_fp); - - /* unable to read /proc/[pid]/status content */ - if (rc != 1) { - debug3("jobacct_gather_cgroup: unable to read requested " - "pattern in %s",proc_status_file); - return -1; - } - - /* if tgid differs from pid, this is a LWP (Thread POSIX) */ - if ((uint32_t) tgid != (uint32_t) pid) { - debug3("jobacct_gather_cgroup: pid=%d is a lightweight process", - tgid); - return 1; - } else - return 0; -} - -/* _get_process_data_line() - get line of data from /proc//stat - * - * IN: in - input file descriptor - * OUT: prec - the destination for the data - * - * RETVAL: ==0 - no valid data - * !=0 - data are valid - * - * Based upon stat2proc() from the ps command. It can handle arbitrary - * executable file basenames for `cmd', i.e. those with embedded - * whitespace or embedded ')'s. Such names confuse %s (see scanf(3)), - * so the string is split and %39c is used instead. - * (except for embedded ')' "(%[^)]c)" would work. - */ -static int _get_process_data_line(int in, prec_t *prec) { - char sbuf[256], *tmp; - int num_read, nvals; - char cmd[40], state[1]; - int ppid, pgrp, session, tty_nr, tpgid; - long unsigned flags, minflt, cminflt, majflt, cmajflt; - long unsigned utime, stime, starttime, vsize; - long int cutime, cstime, priority, nice, timeout, itrealvalue, rss; - long int f1,f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12; - long int f13,f14, lastcpu; - - num_read = read(in, sbuf, (sizeof(sbuf) - 1)); - if (num_read <= 0) - return 0; - sbuf[num_read] = '\0'; - - tmp = strrchr(sbuf, ')'); /* split into "PID (cmd" and "" */ - *tmp = '\0'; /* replace trailing ')' with NUL */ - /* parse these two strings separately, skipping the leading "(". */ - nvals = sscanf(sbuf, "%d (%39c", &prec->pid, cmd); - if (nvals < 2) - return 0; - - nvals = sscanf(tmp + 2, /* skip space after ')' too */ - "%c %d %d %d %d %d " - "%lu %lu %lu %lu %lu " - "%lu %lu %ld %ld %ld %ld " - "%ld %ld %lu %lu %ld " - "%lu %lu %lu %lu %lu " - "%lu %lu %lu %lu %lu " - "%lu %lu %lu %ld %ld ", - state, &ppid, &pgrp, &session, &tty_nr, &tpgid, - &flags, &minflt, &cminflt, &majflt, &cmajflt, - &utime, &stime, &cutime, &cstime, &priority, &nice, - &timeout, &itrealvalue, &starttime, &vsize, &rss, - &f1, &f2, &f3, &f4, &f5 ,&f6, &f7, &f8, &f9, &f10, &f11, - &f12, &f13, &f14, &lastcpu); - /* There are some additional fields, which we do not scan or use */ - if ((nvals < 37) || (rss < 0)) - return 0; - - /* If current pid corresponds to a Light Weight Process - * (Thread POSIX) skip it, we will only account the original - * process (pid==tgid) - */ - if (_is_a_lwp(prec->pid) > 0) - return 0; - - /* Copy the values that slurm records into our data structure */ -// prec->last_cpu = lastcpu; - return 1; -} - -static void _task_sleep(int rem) -{ - while (rem) - rem = sleep(rem); /* subject to interupt */ -} - -/* _watch_tasks() -- monitor slurm jobs and track their memory usage - * - * IN, OUT: Irrelevant; this is invoked by pthread_create() - */ - -static void *_watch_tasks(void *arg) -{ - /* 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) { /* Do this until shutdown is requested */ - if (!jobacct_suspended) - _get_process_data(); /* Update the data */ - _task_sleep(freq); - } - return NULL; -} - - -static void _destroy_prec(void *object) -{ - prec_t *prec = (prec_t *)object; - xfree(prec); - return; -} - -/* - * init() is called when the plugin is loaded, before any other functions - * are called. Put global initialization here. - */ -extern int init (void) -{ - char *temp; - - /* If running on the slurmctld don't do any of this since it - isn't needed. - */ - if (bg_recover == NOT_FROM_CONTROLLER) { - /* read cgroup configuration */ - if (read_slurm_cgroup_conf(&slurm_cgroup_conf)) - return SLURM_ERROR; - - /* initialize cpuinfo internal data */ - if (xcpuinfo_init() != XCPUINFO_SUCCESS) { - free_slurm_cgroup_conf(&slurm_cgroup_conf); - return SLURM_ERROR; - } - - /* enable cpuacct cgroup subsystem */ - if (jobacct_gather_cgroup_cpuacct_init(&slurm_cgroup_conf) != - SLURM_SUCCESS) { - xcpuinfo_fini(); - free_slurm_cgroup_conf(&slurm_cgroup_conf); - return SLURM_ERROR; - } - - /* enable memory cgroup subsystem */ - if (jobacct_gather_cgroup_memory_init(&slurm_cgroup_conf) != - SLURM_SUCCESS) { - xcpuinfo_fini(); - free_slurm_cgroup_conf(&slurm_cgroup_conf); - return SLURM_ERROR; - } - info("WARNING: The %s plugin is experimental, and should " - "not currently be used in production environments.", - plugin_name); - } - - temp = slurm_get_proctrack_type(); - if (!strcasecmp(temp, "proctrack/pgid")) { - info("WARNING: We will use a much slower algorithm with " - "proctrack/pgid, use Proctracktype=proctrack/linuxproc " - "or Proctracktype=proctrack/rms with %s", - plugin_name); - pgid_plugin = true; - } - - xfree(temp); - temp = slurm_get_accounting_storage_type(); - if (!strcasecmp(temp, 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 " - "need to change it.", ACCOUNTING_STORAGE_TYPE_NONE); - } - xfree(temp); - - verbose("%s loaded", plugin_name); - return SLURM_SUCCESS; -} - -extern int fini (void) -{ - jobacct_gather_cgroup_cpuacct_fini(&slurm_cgroup_conf); - jobacct_gather_cgroup_memory_fini(&slurm_cgroup_conf); - - /* unload configuration */ - free_slurm_cgroup_conf(&slurm_cgroup_conf); - return SLURM_SUCCESS; -} - -extern struct jobacctinfo *jobacct_gather_p_create(jobacct_id_t *jobacct_id) -{ - return jobacct_common_alloc_jobacct(jobacct_id); -} - -extern void jobacct_gather_p_destroy(struct jobacctinfo *jobacct) -{ - jobacct_common_free_jobacct(jobacct); -} - -extern int jobacct_gather_p_setinfo(struct jobacctinfo *jobacct, - enum jobacct_data_type type, void *data) -{ - return jobacct_common_setinfo(jobacct, type, data); -} - -extern int jobacct_gather_p_getinfo(struct jobacctinfo *jobacct, - enum jobacct_data_type type, void *data) -{ - return jobacct_common_getinfo(jobacct, type, data); -} - -extern void jobacct_gather_p_pack(struct jobacctinfo *jobacct, - uint16_t rpc_version, Buf buffer) -{ - jobacct_common_pack(jobacct, rpc_version, buffer); -} - -extern int jobacct_gather_p_unpack(struct jobacctinfo **jobacct, - uint16_t rpc_version, Buf buffer) -{ - return jobacct_common_unpack(jobacct, rpc_version, buffer); -} - -extern void jobacct_gather_p_aggregate(struct jobacctinfo *dest, - struct jobacctinfo *from) -{ - jobacct_common_aggregate(dest, from); -} - -/* - * jobacct_startpoll() is called when the plugin is loaded by - * slurmd, before any other functions are called. Put global - * initialization here. - */ - -extern int jobacct_gather_p_startpoll(uint16_t frequency) -{ - int rc = SLURM_SUCCESS; - - pthread_attr_t attr; - pthread_t _watch_tasks_thread_id; - - debug("%s loaded", plugin_name); - - debug("jobacct-gather: frequency = %d", frequency); - - jobacct_shutdown = false; - - task_list = list_create(jobacct_common_free_jobacct); - - if (frequency == 0) { /* don't want dynamic monitoring? */ - debug2("jobacct-gather cgroup dynamic logging disabled"); - return rc; - } - - freq = 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, - &_watch_tasks, NULL)) { - debug("jobacct-gather failed to create _watch_tasks " - "thread: %m"); - frequency = 0; - } - else - debug3("jobacct-gather cgroup dynamic logging enabled"); - slurm_attr_destroy(&attr); - - return rc; -} - -extern int jobacct_gather_p_endpoll() -{ - jobacct_shutdown = true; - slurm_mutex_lock(&jobacct_lock); - if (task_list) - list_destroy(task_list); - task_list = NULL; - slurm_mutex_unlock(&jobacct_lock); - if (slash_proc) { slurm_mutex_lock(&reading_mutex); (void) closedir(slash_proc); @@ -770,75 +546,8 @@ extern int jobacct_gather_p_endpoll() return SLURM_SUCCESS; } -extern void jobacct_gather_p_change_poll(uint16_t frequency) -{ - if (freq == 0 && frequency != 0) { - pthread_attr_t attr; - pthread_t _watch_tasks_thread_id; - /* 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, - &_watch_tasks, NULL)) { - debug("jobacct-gather failed to create _watch_tasks " - "thread: %m"); - frequency = 0; - } else - debug3("jobacct-gather cgroup dynamic logging " - "enabled"); - slurm_attr_destroy(&attr); - jobacct_shutdown = false; - } - - freq = frequency; - debug("jobacct-gather: frequency changed = %d", frequency); - if (freq == 0) - jobacct_shutdown = true; - return; -} - -extern void jobacct_gather_p_suspend_poll() -{ - jobacct_suspended = true; -} - -extern void jobacct_gather_p_resume_poll() -{ - jobacct_suspended = false; -} - -extern int jobacct_gather_p_set_proctrack_container_id(uint64_t id) -{ - if(pgid_plugin) - return SLURM_SUCCESS; - - if (cont_id != (uint64_t)NO_VAL) - info("Warning: jobacct: set_proctrack_container_id: cont_id " - "is already set to %"PRIu64" you are setting it to " - "%"PRIu64"", cont_id, id); - if (id <= 0) { - error("jobacct: set_proctrack_container_id: " - "I was given most likely an unset cont_id %"PRIu64"", - id); - return SLURM_ERROR; - } - cont_id = id; - return SLURM_SUCCESS; -} - extern int jobacct_gather_p_add_task(pid_t pid, jobacct_id_t *jobacct_id) { - int rc; - - if (jobacct_shutdown) - return SLURM_ERROR; - if ((rc = jobacct_common_add_task(pid, jobacct_id, task_list)) != - SLURM_SUCCESS) - return SLURM_ERROR; - if (jobacct_gather_cgroup_cpuacct_attach_task(pid, jobacct_id) != SLURM_SUCCESS) return SLURM_ERROR; @@ -847,42 +556,7 @@ extern int jobacct_gather_p_add_task(pid_t pid, jobacct_id_t *jobacct_id) SLURM_SUCCESS) return SLURM_ERROR; - return rc; -} - - -extern struct jobacctinfo *jobacct_gather_p_stat_task(pid_t pid) -{ - if (jobacct_shutdown) - return NULL; - else if(pid) { - _get_process_data(); - return jobacct_common_stat_task(pid, task_list); - } else { - /* In this situation, we are just trying to get a - * basis of information since we are not pollng. So - * we will give a chance for processes to spawn before we - * gather information. 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); - _get_process_data(); - return NULL; - } -} - -extern struct jobacctinfo *jobacct_gather_p_remove_task(pid_t pid) -{ - if (jobacct_shutdown) - return NULL; - return jobacct_common_remove_task(pid, task_list); -} - -extern void jobacct_gather_p_2_stats(slurmdb_stats_t *stats, - struct jobacctinfo *jobacct) -{ - jobacct_common_2_stats(stats, jobacct); + return SLURM_SUCCESS; } extern char* jobacct_cgroup_create_slurm_cg(xcgroup_ns_t* ns) diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h index 470883b02d16a0e1131955c70b848c2b0da4308d..4d0b45d2c20c6eaea530b5c8c431ceadb6f7388a 100644 --- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h +++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h @@ -41,7 +41,7 @@ #include "src/common/xcgroup.h" #include "src/common/xcpuinfo.h" -#include "src/common/jobacct_common.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/xcgroup_read_config.h" extern xcgroup_t task_memory_cg; diff --git a/src/plugins/jobacct_gather/linux/Makefile.in b/src/plugins/jobacct_gather/linux/Makefile.in index 3c761831e38923af12d53ed1f23ec50c86868059..594bbe950b675f1e44ebe1b4612a16ec4ba9b9be 100644 --- a/src/plugins/jobacct_gather/linux/Makefile.in +++ b/src/plugins/jobacct_gather/linux/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) jobacct_gather_linux_la_LIBADD = @@ -172,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -406,7 +411,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -jobacct_gather_linux.la: $(jobacct_gather_linux_la_OBJECTS) $(jobacct_gather_linux_la_DEPENDENCIES) +jobacct_gather_linux.la: $(jobacct_gather_linux_la_OBJECTS) $(jobacct_gather_linux_la_DEPENDENCIES) $(EXTRA_jobacct_gather_linux_la_DEPENDENCIES) $(jobacct_gather_linux_la_LINK) -rpath $(pkglibdir) $(jobacct_gather_linux_la_OBJECTS) $(jobacct_gather_linux_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -543,10 +548,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/jobacct_gather/linux/jobacct_gather_linux.c b/src/plugins/jobacct_gather/linux/jobacct_gather_linux.c index 811d44aa63bea40ae448a3c36f5043cc318e3698..1d38cc2b2fe0fd562aeee246bb9af1da5cd801c3 100644 --- a/src/plugins/jobacct_gather/linux/jobacct_gather_linux.c +++ b/src/plugins/jobacct_gather/linux/jobacct_gather_linux.c @@ -39,34 +39,17 @@ * Copyright (C) 2002 The Regents of the University of California. \*****************************************************************************/ +#include #include #include #include "src/common/slurm_xlator.h" -#include "src/common/jobacct_common.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/slurm_protocol_api.h" #include "src/common/slurm_protocol_defs.h" #include "src/slurmd/common/proctrack.h" #define _DEBUG 0 -/* These are defined here so when we link with something other than - * the slurmd we will have these symbols defined. They will get - * overwritten when linking with the slurmd. - */ -#if defined (__APPLE__) -uint32_t jobacct_job_id __attribute__((weak_import)); -pthread_mutex_t jobacct_lock __attribute__((weak_import)); -uint32_t jobacct_mem_limit __attribute__((weak_import)); -uint32_t jobacct_step_id __attribute__((weak_import)); -uint32_t jobacct_vmem_limit __attribute__((weak_import)); -#else -uint32_t jobacct_job_id; -pthread_mutex_t jobacct_lock; -uint32_t jobacct_mem_limit; -uint32_t jobacct_step_id; -uint32_t jobacct_vmem_limit; -#endif - /* * These variables are required by the generic plugin interface. If they * are not found in the plugin, the plugin loader will ignore it. @@ -98,7 +81,7 @@ uint32_t jobacct_vmem_limit; */ const char plugin_name[] = "Job accounting gather LINUX plugin"; const char plugin_type[] = "jobacct_gather/linux"; -const uint32_t plugin_version = 100; +const uint32_t plugin_version = 200; /* Other useful declarations */ @@ -112,24 +95,16 @@ typedef struct prec { /* process record */ int vsize; /* virtual size */ } prec_t; -static int freq = 0; +static int pagesize = 0; static DIR *slash_proc = NULL; static pthread_mutex_t reading_mutex = PTHREAD_MUTEX_INITIALIZER; -static bool jobacct_shutdown = 0; -static bool jobacct_suspended = 0; -static List task_list = NULL; -static uint64_t cont_id = (uint64_t)NO_VAL; -static bool pgid_plugin = false; /* Finally, pre-define all local routines. */ -static void _acct_kill_step(void); static void _destroy_prec(void *object); static int _is_a_lwp(uint32_t pid); static void _get_offspring_data(List prec_list, prec_t *ancestor, pid_t pid); -static void _get_process_data(void); static int _get_process_data_line(int in, prec_t *prec); -static void *_watch_tasks(void *arg); /* * _get_offspring_data() -- collect memory usage data for the offspring @@ -177,21 +152,158 @@ _get_offspring_data(List prec_list, prec_t *ancestor, pid_t pid) { return; } +static int _is_a_lwp(uint32_t pid) { + + FILE *status_fp = NULL; + char proc_status_file[256]; + uint32_t tgid; + int rc; + + if ( snprintf(proc_status_file, 256, + "/proc/%d/status",pid) > 256 ) { + debug("jobacct_gather_linux: unable to build proc_status " + "fpath"); + return -1; + } + if ((status_fp = fopen(proc_status_file, "r"))==NULL) { + debug3("jobacct_gather_linux: unable to open %s", + proc_status_file); + return -1; + } + + + do { + rc = fscanf(status_fp, + "Name:\t%*s\n%*[ \ta-zA-Z0-9:()]\nTgid:\t%d\n", + &tgid); + } while ( rc < 0 && errno == EINTR ); + fclose(status_fp); + + /* unable to read /proc/[pid]/status content */ + if ( rc != 1 ) { + debug3("jobacct_gather_linux: unable to read requested " + "pattern in %s",proc_status_file); + return -1; + } + + /* if tgid differs from pid, this is a LWP (Thread POSIX) */ + if ( (uint32_t) tgid != (uint32_t) pid ) { + debug3("jobacct_gather_linux: pid=%d is a lightweight process", + tgid); + return 1; + } else + return 0; + +} + +/* _get_process_data_line() - get line of data from /proc//stat + * + * IN: in - input file descriptor + * OUT: prec - the destination for the data + * + * RETVAL: ==0 - no valid data + * !=0 - data are valid + * + * Based upon stat2proc() from the ps command. It can handle arbitrary executable + * file basenames for `cmd', i.e. those with embedded whitespace or embedded ')'s. + * Such names confuse %s (see scanf(3)), so the string is split and %39c is used + * instead. (except for embedded ')' "(%[^)]c)" would work. + */ +static int _get_process_data_line(int in, prec_t *prec) { + char sbuf[256], *tmp; + int num_read, nvals; + char cmd[40], state[1]; + int ppid, pgrp, session, tty_nr, tpgid; + long unsigned flags, minflt, cminflt, majflt, cmajflt; + long unsigned utime, stime, starttime, vsize; + long int cutime, cstime, priority, nice, timeout, itrealvalue, rss; + + num_read = read(in, sbuf, (sizeof(sbuf) - 1)); + if (num_read <= 0) + return 0; + sbuf[num_read] = '\0'; + + tmp = strrchr(sbuf, ')'); /* split into "PID (cmd" and "" */ + *tmp = '\0'; /* replace trailing ')' with NUL */ + /* parse these two strings separately, skipping the leading "(". */ + nvals = sscanf(sbuf, "%d (%39c", &prec->pid, cmd); + if (nvals < 2) + return 0; + + nvals = sscanf(tmp + 2, /* skip space after ')' too */ + "%c %d %d %d %d %d " + "%lu %lu %lu %lu %lu " + "%lu %lu %ld %ld %ld %ld " + "%ld %ld %lu %lu %ld", + state, &ppid, &pgrp, &session, &tty_nr, &tpgid, + &flags, &minflt, &cminflt, &majflt, &cmajflt, + &utime, &stime, &cutime, &cstime, &priority, &nice, + &timeout, &itrealvalue, &starttime, &vsize, &rss); + /* There are some additional fields, which we do not scan or use */ + if ((nvals < 22) || (rss < 0)) + return 0; + + /* If current pid corresponds to a Light Weight Process + * (Thread POSIX) skip it, we will only account the original + * process (pid==tgid) */ + if (_is_a_lwp(prec->pid) > 0) + return 0; + + /* Copy the values that slurm records into our data structure */ + prec->ppid = ppid; + prec->pages = majflt; + prec->usec = utime; + prec->ssec = stime; + prec->vsize = vsize / 1024; /* convert from bytes to KB */ + prec->rss = rss * pagesize; /* convert from pages to KB */ + + return 1; +} + +static void _destroy_prec(void *object) +{ + prec_t *prec = (prec_t *)object; + xfree(prec); + return; +} + +/* + * init() is called when the plugin is loaded, before any other functions + * are called. Put global initialization here. + */ +extern int init ( void ) +{ + pagesize = getpagesize()/1024; + + verbose("%s loaded", plugin_name); + + return SLURM_SUCCESS; +} + +extern int fini ( void ) +{ + return SLURM_SUCCESS; +} + /* - * _get_process_data() - Build a table of all current processes + * jobacct_gather_p_poll_data() - Build a table of all current processes * - * IN: pid. + * IN/OUT: task_list - list containing current processes. + * IN: pgid_plugin - if we are running with the pgid plugin. + * IN: cont_id - container id of processes if not running with pgid. * * OUT: none * - * THREADSAFE! Only one thread ever gets here. + * THREADSAFE! Only one thread ever gets here. It is locked in + * slurm_jobacct_gather. * * Assumption: * Any file with a name of the form "/proc/[0-9]+/stat" * is a Linux-style stat entry. We disregard the data if they look * wrong. */ -static void _get_process_data(void) +extern void jobacct_gather_p_poll_data( + List task_list, bool pgid_plugin, uint64_t cont_id) { static int slash_proc_open = 0; @@ -331,20 +443,13 @@ static void _get_process_data(void) } - if (!list_count(prec_list)) { + if (!list_count(prec_list) || !task_list || !list_count(task_list)) goto finished; /* We have no business being here! */ - } - - slurm_mutex_lock(&jobacct_lock); - if(!task_list || !list_count(task_list)) { - slurm_mutex_unlock(&jobacct_lock); - goto finished; - } itr = list_iterator_create(task_list); - while((jobacct = list_next(itr))) { + while ((jobacct = list_next(itr))) { itr2 = list_iterator_create(prec_list); - while((prec = list_next(itr2))) { + while ((prec = list_next(itr2))) { if (prec->pid == jobacct->pid) { #if _DEBUG info("pid:%u ppid:%u rss:%d KB", @@ -376,42 +481,8 @@ static void _get_process_data(void) list_iterator_destroy(itr2); } list_iterator_destroy(itr); - slurm_mutex_unlock(&jobacct_lock); - if (jobacct_mem_limit) { - if (jobacct_step_id == NO_VAL) { - debug("Job %u memory used:%u limit:%u KB", - jobacct_job_id, total_job_mem, jobacct_mem_limit); - } else { - debug("Step %u.%u memory used:%u limit:%u KB", - jobacct_job_id, jobacct_step_id, - total_job_mem, jobacct_mem_limit); - } - } - if (jobacct_job_id && jobacct_mem_limit && - (total_job_mem > jobacct_mem_limit)) { - if (jobacct_step_id == NO_VAL) { - error("Job %u exceeded %u KB memory limit, being " - "killed", jobacct_job_id, jobacct_mem_limit); - } else { - error("Step %u.%u exceeded %u KB memory limit, being " - "killed", jobacct_job_id, jobacct_step_id, - jobacct_mem_limit); - } - _acct_kill_step(); - } else if (jobacct_job_id && jobacct_vmem_limit && - (total_job_vsize > jobacct_vmem_limit)) { - if (jobacct_step_id == NO_VAL) { - error("Job %u exceeded %u KB virtual memory limit, " - "being killed", jobacct_job_id, - jobacct_vmem_limit); - } else { - error("Step %u.%u exceeded %u KB virtual memory " - "limit, being killed", jobacct_job_id, - jobacct_step_id, jobacct_vmem_limit); - } - _acct_kill_step(); - } + jobacct_gather_handle_mem_limit(total_job_mem, total_job_vsize); finished: list_destroy(prec_list); @@ -419,411 +490,18 @@ finished: return; } -/* _acct_kill_step() issue RPC to kill a slurm job step */ -static void _acct_kill_step(void) -{ - slurm_msg_t msg; - job_step_kill_msg_t req; - job_notify_msg_t notify_req; - - slurm_msg_t_init(&msg); - notify_req.job_id = jobacct_job_id; - notify_req.job_step_id = jobacct_step_id; - notify_req.message = "Exceeded job memory limit"; - msg.msg_type = REQUEST_JOB_NOTIFY; - msg.data = ¬ify_req; - slurm_send_only_controller_msg(&msg); - - /* - * Request message: - */ - req.job_id = jobacct_job_id; - req.job_step_id = jobacct_step_id; - req.signal = SIGKILL; - req.batch_flag = 0; - msg.msg_type = REQUEST_CANCEL_JOB_STEP; - msg.data = &req; - - slurm_send_only_controller_msg(&msg); -} - -static int _is_a_lwp(uint32_t pid) { - - FILE *status_fp = NULL; - char proc_status_file[256]; - uint32_t tgid; - int rc; - - if ( snprintf(proc_status_file, 256, - "/proc/%d/status",pid) > 256 ) { - debug("jobacct_gather_linux: unable to build proc_status " - "fpath"); - return -1; - } - if ((status_fp = fopen(proc_status_file, "r"))==NULL) { - debug3("jobacct_gather_linux: unable to open %s", - proc_status_file); - return -1; - } - - - do { - rc = fscanf(status_fp, - "Name:\t%*s\n%*[ \ta-zA-Z0-9:()]\nTgid:\t%d\n", - &tgid); - } while ( rc < 0 && errno == EINTR ); - fclose(status_fp); - - /* unable to read /proc/[pid]/status content */ - if ( rc != 1 ) { - debug3("jobacct_gather_linux: unable to read requested " - "pattern in %s",proc_status_file); - return -1; - } - - /* if tgid differs from pid, this is a LWP (Thread POSIX) */ - if ( (uint32_t) tgid != (uint32_t) pid ) { - debug3("jobacct_gather_linux: pid=%d is a lightweight process", - tgid); - return 1; - } else - return 0; - -} - -/* _get_process_data_line() - get line of data from /proc//stat - * - * IN: in - input file descriptor - * OUT: prec - the destination for the data - * - * RETVAL: ==0 - no valid data - * !=0 - data are valid - * - * Based upon stat2proc() from the ps command. It can handle arbitrary executable - * file basenames for `cmd', i.e. those with embedded whitespace or embedded ')'s. - * Such names confuse %s (see scanf(3)), so the string is split and %39c is used - * instead. (except for embedded ')' "(%[^)]c)" would work. - */ -static int _get_process_data_line(int in, prec_t *prec) { - char sbuf[256], *tmp; - int num_read, nvals; - char cmd[40], state[1]; - int ppid, pgrp, session, tty_nr, tpgid; - long unsigned flags, minflt, cminflt, majflt, cmajflt; - long unsigned utime, stime, starttime, vsize; - long int cutime, cstime, priority, nice, timeout, itrealvalue, rss; - - num_read = read(in, sbuf, (sizeof(sbuf) - 1)); - if (num_read <= 0) - return 0; - sbuf[num_read] = '\0'; - - tmp = strrchr(sbuf, ')'); /* split into "PID (cmd" and "" */ - *tmp = '\0'; /* replace trailing ')' with NUL */ - /* parse these two strings separately, skipping the leading "(". */ - nvals = sscanf(sbuf, "%d (%39c", &prec->pid, cmd); - if (nvals < 2) - return 0; - - nvals = sscanf(tmp + 2, /* skip space after ')' too */ - "%c %d %d %d %d %d " - "%lu %lu %lu %lu %lu " - "%lu %lu %ld %ld %ld %ld " - "%ld %ld %lu %lu %ld", - state, &ppid, &pgrp, &session, &tty_nr, &tpgid, - &flags, &minflt, &cminflt, &majflt, &cmajflt, - &utime, &stime, &cutime, &cstime, &priority, &nice, - &timeout, &itrealvalue, &starttime, &vsize, &rss); - /* There are some additional fields, which we do not scan or use */ - if ((nvals < 22) || (rss < 0)) - return 0; - - /* If current pid corresponds to a Light Weight Process (Thread POSIX) */ - /* skip it, we will only account the original process (pid==tgid) */ - if (_is_a_lwp(prec->pid) > 0) - return 0; - - /* Copy the values that slurm records into our data structure */ - prec->ppid = ppid; - prec->pages = majflt; - prec->usec = utime; - prec->ssec = stime; - prec->vsize = vsize / 1024; /* convert from bytes to KB */ - prec->rss = rss * getpagesize() / 1024;/* convert from pages to KB */ - return 1; -} - -static void _task_sleep(int rem) -{ - while (rem) - rem = sleep(rem); /* subject to interupt */ -} - -/* _watch_tasks() -- monitor slurm jobs and track their memory usage - * - * IN, OUT: Irrelevant; this is invoked by pthread_create() - */ - -static void *_watch_tasks(void *arg) -{ - /* 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) { /* Do this until shutdown is requested */ - if(!jobacct_suspended) { - _get_process_data(); /* Update the data */ - } - _task_sleep(freq); - } - return NULL; -} - - -static void _destroy_prec(void *object) -{ - prec_t *prec = (prec_t *)object; - xfree(prec); - return; -} - -/* - * init() is called when the plugin is loaded, before any other functions - * are called. Put global initialization here. - */ -extern int init ( void ) -{ - char *temp = slurm_get_proctrack_type(); - if(!strcasecmp(temp, "proctrack/pgid")) { - info("WARNING: We will use a much slower algorithm with " - "proctrack/pgid, use Proctracktype=proctrack/linuxproc " - "or Proctracktype=proctrack/rms with %s", - plugin_name); - pgid_plugin = true; - } - xfree(temp); - temp = slurm_get_accounting_storage_type(); - if(!strcasecmp(temp, 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 " - "need to change it.", ACCOUNTING_STORAGE_TYPE_NONE); - } - xfree(temp); - verbose("%s loaded", plugin_name); - return SLURM_SUCCESS; -} - -extern int fini ( void ) -{ - return SLURM_SUCCESS; -} - -extern struct jobacctinfo *jobacct_gather_p_create(jobacct_id_t *jobacct_id) -{ - return jobacct_common_alloc_jobacct(jobacct_id); -} - -extern void jobacct_gather_p_destroy(struct jobacctinfo *jobacct) -{ - jobacct_common_free_jobacct(jobacct); -} - -extern int jobacct_gather_p_setinfo(struct jobacctinfo *jobacct, - enum jobacct_data_type type, void *data) -{ - return jobacct_common_setinfo(jobacct, type, data); -} - -extern int jobacct_gather_p_getinfo(struct jobacctinfo *jobacct, - enum jobacct_data_type type, void *data) -{ - return jobacct_common_getinfo(jobacct, type, data); -} - -extern void jobacct_gather_p_pack(struct jobacctinfo *jobacct, - uint16_t rpc_version, Buf buffer) -{ - jobacct_common_pack(jobacct, rpc_version, buffer); -} - -extern int jobacct_gather_p_unpack(struct jobacctinfo **jobacct, - uint16_t rpc_version, Buf buffer) -{ - return jobacct_common_unpack(jobacct, rpc_version, buffer); -} - -extern void jobacct_gather_p_aggregate(struct jobacctinfo *dest, - struct jobacctinfo *from) -{ - jobacct_common_aggregate(dest, from); -} - -/* - * jobacct_startpoll() is called when the plugin is loaded by - * slurmd, before any other functions are called. Put global - * initialization here. - */ - -extern int jobacct_gather_p_startpoll(uint16_t frequency) -{ - int rc = SLURM_SUCCESS; - - pthread_attr_t attr; - pthread_t _watch_tasks_thread_id; - - debug("%s loaded", plugin_name); - - debug("jobacct-gather: frequency = %d", frequency); - - jobacct_shutdown = false; - - task_list = list_create(jobacct_common_free_jobacct); - - if (frequency == 0) { /* don't want dynamic monitoring? */ - debug2("jobacct-gather LINUX dynamic logging disabled"); - return rc; - } - - freq = 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, - &_watch_tasks, NULL)) { - debug("jobacct-gather failed to create _watch_tasks " - "thread: %m"); - frequency = 0; - } - else - debug3("jobacct-gather LINUX dynamic logging enabled"); - slurm_attr_destroy(&attr); - - return rc; -} - -extern int jobacct_gather_p_endpoll() +extern int jobacct_gather_p_endpoll(void) { - jobacct_shutdown = true; - slurm_mutex_lock(&jobacct_lock); - if(task_list) - list_destroy(task_list); - task_list = NULL; - slurm_mutex_unlock(&jobacct_lock); - if (slash_proc) { slurm_mutex_lock(&reading_mutex); (void) closedir(slash_proc); slurm_mutex_unlock(&reading_mutex); } - - return SLURM_SUCCESS; -} - -extern void jobacct_gather_p_change_poll(uint16_t frequency) -{ - if(freq == 0 && frequency != 0) { - pthread_attr_t attr; - pthread_t _watch_tasks_thread_id; - /* 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, - &_watch_tasks, NULL)) { - debug("jobacct-gather failed to create _watch_tasks " - "thread: %m"); - frequency = 0; - } - else - debug3("jobacct-gather LINUX dynamic logging enabled"); - slurm_attr_destroy(&attr); - jobacct_shutdown = false; - } - - freq = frequency; - debug("jobacct-gather: frequency changed = %d", frequency); - if (freq == 0) - jobacct_shutdown = true; - return; -} - -extern void jobacct_gather_p_suspend_poll() -{ - jobacct_suspended = true; -} - -extern void jobacct_gather_p_resume_poll() -{ - jobacct_suspended = false; -} - -extern int jobacct_gather_p_set_proctrack_container_id(uint64_t id) -{ - if(pgid_plugin) - return SLURM_SUCCESS; - - if (cont_id != (uint64_t)NO_VAL) - info("Warning: jobacct: set_proctrack_container_id: cont_id " - "is already set to %"PRIu64" you are setting it to " - "%"PRIu64"", cont_id, id); - if (id <= 0) { - error("jobacct: set_proctrack_container_id: " - "I was given most likely an unset cont_id %"PRIu64"", - id); - return SLURM_ERROR; - } - cont_id = id; - return SLURM_SUCCESS; } extern int jobacct_gather_p_add_task(pid_t pid, jobacct_id_t *jobacct_id) { - if (jobacct_shutdown) - return SLURM_ERROR; - return jobacct_common_add_task(pid, jobacct_id, task_list); -} - - -extern struct jobacctinfo *jobacct_gather_p_stat_task(pid_t pid) -{ - if (jobacct_shutdown) - return NULL; - else if(pid) { - _get_process_data(); - return jobacct_common_stat_task(pid, task_list); - } else { - /* In this situation, we are just trying to get a - * basis of information since we are not pollng. So - * we will give a chance for processes to spawn before we - * gather information. 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); - _get_process_data(); - return NULL; - } -} - -extern struct jobacctinfo *jobacct_gather_p_remove_task(pid_t pid) -{ - if (jobacct_shutdown) - return NULL; - return jobacct_common_remove_task(pid, task_list); -} - -extern void jobacct_gather_p_2_stats(slurmdb_stats_t *stats, - struct jobacctinfo *jobacct) -{ - jobacct_common_2_stats(stats, jobacct); + return SLURM_SUCCESS; } diff --git a/src/plugins/jobacct_gather/none/Makefile.in b/src/plugins/jobacct_gather/none/Makefile.in index 81b25e2896e466f0f97094af9b141f2073bdf167..047dbc078adc806cfa6897c07f644deca233891f 100644 --- a/src/plugins/jobacct_gather/none/Makefile.in +++ b/src/plugins/jobacct_gather/none/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) jobacct_gather_none_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -jobacct_gather_none.la: $(jobacct_gather_none_la_OBJECTS) $(jobacct_gather_none_la_DEPENDENCIES) +jobacct_gather_none.la: $(jobacct_gather_none_la_OBJECTS) $(jobacct_gather_none_la_DEPENDENCIES) $(EXTRA_jobacct_gather_none_la_DEPENDENCIES) $(jobacct_gather_none_la_LINK) -rpath $(pkglibdir) $(jobacct_gather_none_la_OBJECTS) $(jobacct_gather_none_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/jobacct_gather/none/jobacct_gather_none.c b/src/plugins/jobacct_gather/none/jobacct_gather_none.c index def7c8ddade63399ba454ac89f1552e16ca69c28..7ad9c520a0e4b57996064fa2aa44258b47f42bd0 100644 --- a/src/plugins/jobacct_gather/none/jobacct_gather_none.c +++ b/src/plugins/jobacct_gather/none/jobacct_gather_none.c @@ -90,6 +90,12 @@ extern int fini ( void ) return SLURM_SUCCESS; } +extern void jobacct_gather_p_poll_data(List task_list, bool pgid_plugin, + uint64_t cont_id) +{ + return; +} + extern jobacctinfo_t *jobacct_gather_p_create(jobacct_id_t *jobacct_id) { return NULL; @@ -135,7 +141,7 @@ extern int jobacct_gather_p_startpoll(uint16_t frequency) return SLURM_SUCCESS; } -extern int jobacct_gather_p_endpoll() +extern int jobacct_gather_p_endpoll(void) { return SLURM_SUCCESS; } @@ -145,12 +151,12 @@ extern void jobacct_gather_p_change_poll(uint16_t frequency) return; } -extern void jobacct_gather_p_suspend_poll() +extern void jobacct_gather_p_suspend_poll(void) { return; } -extern void jobacct_gather_p_resume_poll() +extern void jobacct_gather_p_resume_poll(void) { return; } diff --git a/src/plugins/jobcomp/Makefile.in b/src/plugins/jobcomp/Makefile.in index dc5d90ca649a259f9089b7450fa029e859b5694b..e286f2082c45d206ef03afe157c09eb220e492c6 100644 --- a/src/plugins/jobcomp/Makefile.in +++ b/src/plugins/jobcomp/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/jobcomp/filetxt/Makefile.in b/src/plugins/jobcomp/filetxt/Makefile.in index 0f0f1d418b5b79b036b7fda4f5e5e55472b67ba6..b0a058443cc93d4df4bf14e32b91fcce269795e6 100644 --- a/src/plugins/jobcomp/filetxt/Makefile.in +++ b/src/plugins/jobcomp/filetxt/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) jobcomp_filetxt_la_LIBADD = @@ -172,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -408,7 +413,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -jobcomp_filetxt.la: $(jobcomp_filetxt_la_OBJECTS) $(jobcomp_filetxt_la_DEPENDENCIES) +jobcomp_filetxt.la: $(jobcomp_filetxt_la_OBJECTS) $(jobcomp_filetxt_la_DEPENDENCIES) $(EXTRA_jobcomp_filetxt_la_DEPENDENCIES) $(jobcomp_filetxt_la_LINK) -rpath $(pkglibdir) $(jobcomp_filetxt_la_OBJECTS) $(jobcomp_filetxt_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -546,10 +551,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.c b/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.c index 184283df29f090622949a252c3aa5b820e3ecf57..22e6972c00a09f092601c7ebcc29bc3cd30278fd 100644 --- a/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.c +++ b/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.c @@ -44,11 +44,12 @@ #include #include -#include "src/common/xstring.h" #include "src/common/xmalloc.h" #include "src/common/slurm_jobcomp.h" #include "filetxt_jobcomp_process.h" +#define BUFFER_SIZE 4096 + typedef struct { char *name; char *val; diff --git a/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.h b/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.h index cebc5c6e77def5151bb1857a5888f95d04a8ecae..76e69c40bdd650c7e6b401c0bd4cdc8a401a3feb 100644 --- a/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.h +++ b/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.h @@ -44,8 +44,12 @@ #ifndef _HAVE_FILETXT_JOBCOMP_PROCESS_H #define _HAVE_FILETXT_JOBCOMP_PROCESS_H -#include "src/common/jobacct_common.h" +#include + +#include "src/common/node_select.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/slurm_accounting_storage.h" +#include "src/common/xstring.h" extern List filetxt_jobcomp_process_get_jobs(slurmdb_job_cond_t *job_cond); extern int filetxt_jobcomp_process_archive(slurmdb_archive_cond_t *arch_cond); diff --git a/src/plugins/jobcomp/mysql/Makefile.in b/src/plugins/jobcomp/mysql/Makefile.in index 41200bd90debcc4c7dc7f7112ed5fd6856eb1233..28ef1cd3fc22c6601df7cc82e72e18a367a08929 100644 --- a/src/plugins/jobcomp/mysql/Makefile.in +++ b/src/plugins/jobcomp/mysql/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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 = @@ -180,9 +185,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -190,9 +193,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -224,6 +226,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -251,6 +255,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -424,7 +429,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -jobcomp_mysql.la: $(jobcomp_mysql_la_OBJECTS) $(jobcomp_mysql_la_DEPENDENCIES) +jobcomp_mysql.la: $(jobcomp_mysql_la_OBJECTS) $(jobcomp_mysql_la_DEPENDENCIES) $(EXTRA_jobcomp_mysql_la_DEPENDENCIES) $(jobcomp_mysql_la_LINK) $(am_jobcomp_mysql_la_rpath) $(jobcomp_mysql_la_OBJECTS) $(jobcomp_mysql_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -576,10 +581,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/jobcomp/mysql/mysql_jobcomp_process.h b/src/plugins/jobcomp/mysql/mysql_jobcomp_process.h index 14a920845ba8373fcdcc60af2d8aea8a9e3caced..c99b758d42e5cb85288cce548503b3311acc5b42 100644 --- a/src/plugins/jobcomp/mysql/mysql_jobcomp_process.h +++ b/src/plugins/jobcomp/mysql/mysql_jobcomp_process.h @@ -46,7 +46,7 @@ #include "src/database/mysql_common.h" #include "src/common/slurm_jobcomp.h" -#include "src/common/jobacct_common.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/slurm_accounting_storage.h" extern mysql_conn_t *jobcomp_mysql_conn; diff --git a/src/plugins/jobcomp/none/Makefile.in b/src/plugins/jobcomp/none/Makefile.in index 56d8b36a25c6cec176b38ceaf0416da9c5e6e0f0..c714c56ad5eb20365eeb4e6be26dbfc88c4837cc 100644 --- a/src/plugins/jobcomp/none/Makefile.in +++ b/src/plugins/jobcomp/none/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) jobcomp_none_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -jobcomp_none.la: $(jobcomp_none_la_OBJECTS) $(jobcomp_none_la_DEPENDENCIES) +jobcomp_none.la: $(jobcomp_none_la_OBJECTS) $(jobcomp_none_la_DEPENDENCIES) $(EXTRA_jobcomp_none_la_DEPENDENCIES) $(jobcomp_none_la_LINK) -rpath $(pkglibdir) $(jobcomp_none_la_OBJECTS) $(jobcomp_none_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/jobcomp/pgsql/Makefile.in b/src/plugins/jobcomp/pgsql/Makefile.in index 1fc1781a5805c4e52826fb4c283f008b326f6281..b3afecdabb030fae6ec812f60d412e3dbe9dd14a 100644 --- a/src/plugins/jobcomp/pgsql/Makefile.in +++ b/src/plugins/jobcomp/pgsql/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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 = @@ -180,9 +185,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -190,9 +193,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -224,6 +226,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -251,6 +255,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -425,7 +430,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -jobcomp_pgsql.la: $(jobcomp_pgsql_la_OBJECTS) $(jobcomp_pgsql_la_DEPENDENCIES) +jobcomp_pgsql.la: $(jobcomp_pgsql_la_OBJECTS) $(jobcomp_pgsql_la_DEPENDENCIES) $(EXTRA_jobcomp_pgsql_la_DEPENDENCIES) $(jobcomp_pgsql_la_LINK) $(am_jobcomp_pgsql_la_rpath) $(jobcomp_pgsql_la_OBJECTS) $(jobcomp_pgsql_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -577,10 +582,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/jobcomp/pgsql/pgsql_jobcomp_process.h b/src/plugins/jobcomp/pgsql/pgsql_jobcomp_process.h index 9079bd0b3ba098b291718c9cf4632e0a72f4be12..f70f46aba77c81657d26287518e82566ff2cfa43 100644 --- a/src/plugins/jobcomp/pgsql/pgsql_jobcomp_process.h +++ b/src/plugins/jobcomp/pgsql/pgsql_jobcomp_process.h @@ -46,7 +46,7 @@ #include "src/database/pgsql_common.h" #include "src/common/slurm_jobcomp.h" -#include "src/common/jobacct_common.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/slurm_accounting_storage.h" extern PGconn *jobcomp_pgsql_db; diff --git a/src/plugins/jobcomp/script/Makefile.in b/src/plugins/jobcomp/script/Makefile.in index e468efff95235948e9b04c0f42cce0393c9aa12e..a0f0cbedbcf5861b5bc5c2e52c2121de63060127 100644 --- a/src/plugins/jobcomp/script/Makefile.in +++ b/src/plugins/jobcomp/script/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) jobcomp_script_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -jobcomp_script.la: $(jobcomp_script_la_OBJECTS) $(jobcomp_script_la_DEPENDENCIES) +jobcomp_script.la: $(jobcomp_script_la_OBJECTS) $(jobcomp_script_la_DEPENDENCIES) $(EXTRA_jobcomp_script_la_DEPENDENCIES) $(jobcomp_script_la_LINK) -rpath $(pkglibdir) $(jobcomp_script_la_OBJECTS) $(jobcomp_script_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/launch/Makefile.am b/src/plugins/launch/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..ed0713adee79f25108198ad6ba41a99ec5c3a013 --- /dev/null +++ b/src/plugins/launch/Makefile.am @@ -0,0 +1,10 @@ +# Makefile for launch plugins + +if REAL_BGQ_LOADED +SUBDIRS = runjob +else +SUBDIRS = slurm +if HAVE_NRT +SUBDIRS += poe +endif +endif diff --git a/src/plugins/launch/Makefile.in b/src/plugins/launch/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..b3f458b44958c1858a06a1d0fe07ed1504147e05 --- /dev/null +++ b/src/plugins/launch/Makefile.in @@ -0,0 +1,686 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 launch plugins +VPATH = @srcdir@ +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@ +@HAVE_NRT_TRUE@@REAL_BGQ_LOADED_FALSE@am__append_1 = poe +subdir = src/plugins/launch +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_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_cflags.m4 \ + $(top_srcdir)/auxdir/x_ac_cray.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_gpl_licensed.m4 \ + $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ + $(top_srcdir)/auxdir/x_ac_iso.m4 \ + $(top_srcdir)/auxdir/x_ac_lua.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_nrt.m4 \ + $(top_srcdir)/auxdir/x_ac_pam.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_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)/auxdir/x_ac_srun.m4 \ + $(top_srcdir)/auxdir/x_ac_sun_const.m4 \ + $(top_srcdir)/auxdir/x_ac_xcpu.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = slurm poe runjob +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@ +AR = @AR@ +AUTHD_CFLAGS = @AUTHD_CFLAGS@ +AUTHD_LIBS = @AUTHD_LIBS@ +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@ +CMD_LDFLAGS = @CMD_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +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@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ +HAVEPGCONFIG = @HAVEPGCONFIG@ +HAVE_AIX = @HAVE_AIX@ +HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ +HAVE_OPENSSL = @HAVE_OPENSSL@ +HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ +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@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_LDFLAGS = @LIB_LDFLAGS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@ +MUNGE_LDFLAGS = @MUNGE_LDFLAGS@ +MUNGE_LIBS = @MUNGE_LIBS@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +NCURSES = @NCURSES@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ +NUMA_LIBS = @NUMA_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +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@ +PGSQL_CFLAGS = @PGSQL_CFLAGS@ +PGSQL_LIBS = @PGSQL_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +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@ +RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ +SED = @SED@ +SEMAPHORE_LIBS = @SEMAPHORE_LIBS@ +SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +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@ +UTIL_LIBS = @UTIL_LIBS@ +VERSION = @VERSION@ +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@ +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@ +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@ +@REAL_BGQ_LOADED_FALSE@SUBDIRS = slurm $(am__append_1) +@REAL_BGQ_LOADED_TRUE@SUBDIRS = runjob $(am__append_1) +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/launch/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/plugins/launch/Makefile +.PRECIOUS: 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. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; 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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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" + +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 \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + 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: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive 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-recursive \ + uninstall uninstall-am + + +# 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/launch/poe/Makefile.am b/src/plugins/launch/poe/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..af07975882d28298f1d2bc95aa47013958a11182 --- /dev/null +++ b/src/plugins/launch/poe/Makefile.am @@ -0,0 +1,13 @@ +# Makefile for launch/poe plugin + +AUTOMAKE_OPTIONS = foreign + +PLUGIN_FLAGS = -module -avoid-version --export-dynamic + +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common + +pkglib_LTLIBRARIES = launch_poe.la + +launch_poe_la_SOURCES = launch_poe.c + +launch_poe_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) diff --git a/src/plugins/proctrack/rms/Makefile.in b/src/plugins/launch/poe/Makefile.in similarity index 91% rename from src/plugins/proctrack/rms/Makefile.in rename to src/plugins/launch/poe/Makefile.in index ca194441101c82c042b3d851aa2a7e5df6dfce60..b4d82e564870e1060e96b6cb5fa6ecdb19bca46a 100644 --- a/src/plugins/proctrack/rms/Makefile.in +++ b/src/plugins/launch/poe/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -15,7 +15,7 @@ @SET_MAKE@ -# Makefile for proctrack/aix plugin +# Makefile for launch/poe plugin VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -37,7 +37,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -subdir = src/plugins/proctrack/rms +subdir = src/plugins/launch/poe DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.m4 \ @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,15 +104,20 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) -proctrack_rms_la_DEPENDENCIES = -am_proctrack_rms_la_OBJECTS = proctrack_rms.lo -proctrack_rms_la_OBJECTS = $(am_proctrack_rms_la_OBJECTS) -proctrack_rms_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +launch_poe_la_LIBADD = +am_launch_poe_la_OBJECTS = launch_poe.lo +launch_poe_la_OBJECTS = $(am_launch_poe_la_OBJECTS) +launch_poe_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(proctrack_rms_la_LDFLAGS) $(LDFLAGS) -o $@ -@HAVE_ELAN_TRUE@am_proctrack_rms_la_rpath = -rpath $(pkglibdir) + $(launch_poe_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp am__depfiles_maybe = depfiles @@ -127,8 +131,8 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(proctrack_rms_la_SOURCES) -DIST_SOURCES = $(proctrack_rms_la_SOURCES) +SOURCES = $(launch_poe_la_SOURCES) +DIST_SOURCES = $(launch_poe_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -172,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -336,11 +340,9 @@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign PLUGIN_FLAGS = -module -avoid-version --export-dynamic INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common -@HAVE_ELAN_FALSE@pkglib_LTLIBRARIES = -@HAVE_ELAN_TRUE@pkglib_LTLIBRARIES = proctrack_rms.la -proctrack_rms_la_SOURCES = proctrack_rms.c -proctrack_rms_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) -proctrack_rms_la_LIBADD = -lrmscall +pkglib_LTLIBRARIES = launch_poe.la +launch_poe_la_SOURCES = launch_poe.c +launch_poe_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) all: all-am .SUFFIXES: @@ -354,9 +356,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/proctrack/rms/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/launch/poe/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/plugins/proctrack/rms/Makefile + $(AUTOMAKE) --foreign src/plugins/launch/poe/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -406,8 +408,8 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -proctrack_rms.la: $(proctrack_rms_la_OBJECTS) $(proctrack_rms_la_DEPENDENCIES) - $(proctrack_rms_la_LINK) $(am_proctrack_rms_la_rpath) $(proctrack_rms_la_OBJECTS) $(proctrack_rms_la_LIBADD) $(LIBS) +launch_poe.la: $(launch_poe_la_OBJECTS) $(launch_poe_la_DEPENDENCIES) $(EXTRA_launch_poe_la_DEPENDENCIES) + $(launch_poe_la_LINK) -rpath $(pkglibdir) $(launch_poe_la_OBJECTS) $(launch_poe_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -415,7 +417,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctrack_rms.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launch_poe.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -543,10 +545,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/launch/poe/launch_poe.c b/src/plugins/launch/poe/launch_poe.c new file mode 100644 index 0000000000000000000000000000000000000000..50436ac2bc17fd901dc4a064e4ee20ff36bedfe2 --- /dev/null +++ b/src/plugins/launch/poe/launch_poe.c @@ -0,0 +1,795 @@ +/*****************************************************************************\ + * launch_poe.c - Define job launch using IBM's poe. + ***************************************************************************** + * Copyright (C) 2012 SchedMD LLC + * Written by Danny Auble + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 +#include +#include +#include +#include + +#include "src/srun/libsrun/launch.h" +#include "src/common/env.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 + * + * / + * + * where is a description of the intended application of + * the plugin (e.g., "task" for task control) and 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 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[] = "launch poe plugin"; +const char plugin_type[] = "launch/poe"; +const uint32_t plugin_version = 101; + +static char *cmd_fname = NULL; +static char *stepid_fname = NULL; +static char *poe_cmd_line = NULL; + +/* Return the next available step ID */ +static int _get_next_stepid(uint32_t job_id, char *dname, int dname_size) +{ + int fd, i, rc, step_id; + char *work_dir; + ssize_t io_size = 0; + char buf[16]; + + /* NOTE: Directory must be shared between nodes for cmd_file to work */ + if (!(work_dir = getenv("HOME"))) { + work_dir = xmalloc(512); + if (!getcwd(work_dir, 512)) + fatal("getcwd(): %m"); + snprintf(dname, dname_size, "%s/.slurm_loadl", work_dir); + xfree(work_dir); + } else { + snprintf(dname, dname_size, "%s/.slurm_loadl", work_dir); + } + mkdir(dname, 0700); + + /* Create or open our stepid file */ + if (!stepid_fname) + stepid_fname = xstrdup_printf("%s/slurm_stepid_%u", + dname, job_id); + while (((fd = open(stepid_fname, O_CREAT|O_EXCL|O_RDWR, 0600)) < 0) && + (errno == EINTR)) + ; + if ((fd < 0) && (errno == EEXIST)) + fd = open(stepid_fname, O_RDWR); + if (fd < 0) + fatal("open(%s): %m", stepid_fname); + + /* Set exclusive lock on the file */ + for (i = 0; ; i++) { + rc = flock(fd, LOCK_EX | LOCK_NB); + if (rc == 0) + break; + if (i > 10) + fatal("flock(%s): %m", stepid_fname); + usleep(100); + } + + /* Read latest step ID from the file */ + for (i = 0; ; i++) { + io_size = read(fd, buf, sizeof(buf)); + if (io_size >= 0) + break; + if (i > 10) { + flock(fd, LOCK_UN); + fatal("read(%s): %m", stepid_fname); + } + } + if (io_size > 0) + step_id = atoi(buf) + 1; + else + step_id = 1; + + /* Write new step ID value */ + snprintf(buf, sizeof(buf), "%d", step_id); + for (i = 0; ; i++) { + lseek(fd, 0, SEEK_SET); + io_size = write(fd, buf, sizeof(buf)); + if (io_size == sizeof(buf)) + break; + if (i > 10) { + flock(fd, LOCK_UN); + fatal("write(%s): %m", stepid_fname); + } + } + + /* Unlock the file */ + for (i = 0; ; i++) { + rc = flock(fd, LOCK_UN); + if (rc == 0) + break; + if (i > 10) + fatal("flock(%s): %m", stepid_fname); + } + + return step_id; +} + +/* Given a program name, return its communication protocol */ +static char *_get_cmd_protocol(char *cmd) +{ + int stdout_pipe[2] = {-1, -1}, stderr_pipe[2] = {-1, -1}; + int read_size, buf_rem = 16 * 1024, offset = 0, status; + pid_t pid; + char *buf, *protocol = "mpi"; + + if ((pipe(stdout_pipe) == -1) || (pipe(stderr_pipe) == -1)) { + error("pipe: %m"); + return "mpi"; + } + + pid = fork(); + if (pid < 0) { + error("fork: %m"); + return "mpi"; + } else if (pid == 0) { + if ((dup2(stdout_pipe[1], 1) == -1) || + (dup2(stderr_pipe[1], 2) == -1)) { + error("dup2: %m"); + return NULL; + } + (void) close(0); /* stdin */ + (void) close(stdout_pipe[0]); + (void) close(stdout_pipe[1]); + (void) close(stderr_pipe[0]); + (void) close(stderr_pipe[1]); + + execlp("/usr/bin/ldd", "ldd", cmd, NULL); + error("execv(ldd) error: %m"); + return NULL; + } + + (void) close(stdout_pipe[1]); + (void) close(stderr_pipe[1]); + buf = xmalloc(buf_rem); + while ((read_size = read(stdout_pipe[0], &buf[offset], buf_rem))) { + if (read_size > 0) { + buf_rem -= read_size; + offset += read_size; + if (buf_rem == 0) + break; + } else if ((errno != EAGAIN) || (errno != EINTR)) { + error("read(pipe): %m"); + break; + } + } + if (strstr(buf, "libmpi.so")) + protocol = "mpi"; + else if (strstr(buf, "libshmem.so")) + protocol = "shmem"; + else if (strstr(buf, "libxlpgas.so")) + protocol = "pgas"; + else if (strstr(buf, "libpami.so")) + protocol = "pami"; + else if (strstr(buf, "liblapi.so")) + protocol = "lapi"; + xfree(buf); + while ((waitpid(pid, &status, 0) == -1) && (errno == EINTR)) + ; + (void) close(stdout_pipe[0]); + (void) close(stderr_pipe[0]); + + return protocol; +} + +/* + * Parse a multi-prog input file line + * line IN - line to parse + * num_task OUT - number of tasks to be started + * cmd OUT - command to execute, caller must xfree this + * args OUT - arguments to the command, caller must xfree this + */ +static void _parse_prog_line(char *in_line, int *num_tasks, char **cmd, + char **args) +{ + int i; + int first_arg_inx = 0, last_arg_inx = 0; + int first_cmd_inx, last_cmd_inx; + int first_task_inx, last_task_inx; + hostset_t hs; + + /* Get the task ID string */ + for (i = 0; in_line[i]; i++) { + if (!isspace(in_line[i])) + break; + } + if (in_line[i] == '#') + goto fini; + if (!isdigit(in_line[i])) + goto bad_line; + first_task_inx = i; + for (i++; in_line[i]; i++) { + if (isspace(in_line[i])) + break; + } + if (!isspace(in_line[i])) + goto bad_line; + last_task_inx = i; + + /* Get the command */ + for (i++; in_line[i]; i++) { + if (!isspace(in_line[i])) + break; + } + if (in_line[i] == '\0') + goto bad_line; + first_cmd_inx = i; + for (i++; in_line[i]; i++) { + if (isspace(in_line[i])) + break; + } + if (!isspace(in_line[i])) + goto bad_line; + last_cmd_inx = i; + + /* Get the command's arguments */ + for (i++; in_line[i]; i++) { + if (!isspace(in_line[i])) + break; + } + if (in_line[i]) + first_arg_inx = i; + for ( ; in_line[i]; i++) { + if (in_line[i] == '\n') { + last_arg_inx = i; + break; + } + } + + /* Now transfer data to the function arguments */ + in_line[last_task_inx] = '\0'; + hs = hostset_create(in_line + first_task_inx); + in_line[last_task_inx] = ' '; + if (!hs) + goto bad_line; + *num_tasks = hostset_count(hs); + hostset_destroy(hs); + + in_line[last_cmd_inx] = '\0'; + *cmd = xstrdup(in_line + first_cmd_inx); + in_line[last_cmd_inx] = ' '; + + if (last_arg_inx) + in_line[last_arg_inx] = '\0'; + if (first_arg_inx) + *args = xstrdup(in_line + first_arg_inx); + else + *args = NULL; + if (last_arg_inx) + in_line[last_arg_inx] = '\n'; + return; + +bad_line: + error("invalid input line: %s", in_line); +fini: *num_tasks = -1; + return; +} + +/* + * Either get or set a POE command line, + * line IN/OUT - line to set or get + * length IN - size of line in bytes + * step_id IN - -1 if input line, otherwise the step ID to output + * RET true if more lines to get + */ +static bool _multi_prog_parse(char *line, int length, int step_id) +{ + static int cmd_count = 0, inx = 0, total_tasks = 0; + static char **args = NULL, **cmd = NULL; + static int *num_tasks = NULL; + int i; + + if (step_id < 0) { + char *tmp_args = NULL, *tmp_cmd = NULL; + int tmp_tasks = -1; + _parse_prog_line(line, &tmp_tasks, &tmp_cmd, &tmp_args); + + if (tmp_tasks < 0) { + if (line[0] != '#') + error("bad line %s", line); + return true; + } + + xrealloc(args, (sizeof(char *) * (cmd_count + 1))); + xrealloc(cmd, (sizeof(char *) * (cmd_count + 1))); + xrealloc(num_tasks, (sizeof(int) * (cmd_count + 1))); + args[cmd_count] = tmp_args; + cmd[cmd_count] = tmp_cmd; + num_tasks[cmd_count] = tmp_tasks; + total_tasks += tmp_tasks; + cmd_count++; + return true; + } else if (inx >= cmd_count) { + for (i = 0; i < cmd_count; i++) { + xfree(args[i]); + xfree(cmd[i]); + } + xfree(args); + xfree(cmd); + xfree(num_tasks); + cmd_count = 0; + inx = 0; + total_tasks = 0; + return false; + } else if (args[inx]) { + /* @%%: */ + snprintf(line, length, "%s@%d%c%d%c%s:%d %s", + cmd[inx], step_id, '%', total_tasks, '%', + _get_cmd_protocol(cmd[inx]), num_tasks[inx], + args[inx]); + inx++; + return true; + } else { + /* @%%: */ + snprintf(line, length, "%s@%d%c%d%c%s:%d", + cmd[inx], step_id, '%', total_tasks, '%', + _get_cmd_protocol(cmd[inx]), num_tasks[inx]); + inx++; + return true; + } +} + +/* Build a POE command line based upon srun options (using global variables) */ +static char *_build_poe_command(uint32_t job_id) +{ + int i, step_id; + char *cmd_line = NULL, *tmp_str; + char dname[512], value[32]; + bool need_cmdfile = false; + char *protocol = "mpi"; + + /* + * In order to support MPMD or job steps smaller than the job + * allocation size, specify a command file using the poe option + * -cmdfile or MP_CMDFILE env var. See page 43 here: + * http://publib.boulder.ibm.com/epubs/pdf/c2367811.pdf + * The command file should contain one more more lines of the following + * form: + * @%%: + * IBM is working to eliminate the need to specify protocol, but until + * then it might be determined as follows: + * + * We are currently looking at 'ldd ' and checking the name of + * the MPI and PAMI libraries and on x86, also checking to see if Intel + * MPI library is used. + * This is done at runtime in PMD and depending on '-mpilib' option and + * '-config' option used, change the LD_LIBRARY_PATH to properly + * support the different PE Runtime levels the customer have installed + * on their cluster. + * + * There is precedence order that would be important if multiple + * libraries are listed in the 'ldd output' as long as you know it is + * not a mixed protocol (i.e. Openshmem + MPI, UPC + MPI, etc) + * application. + * 1) If MPI library is found (libmpi.so) -> use 'mpi' + * 2) if Openshmem library is found (libshmem.so) -> use 'shmem' + * 3) if UPC runtime library is found (libxlpgas.so) -> use 'pgas' + * 4) if only PAMI library is found (libpami.so) -> use 'pami' + * 5) if only LAPI library is found (liblapi.so) -> use 'lapi' + */ + if (opt.multi_prog) + need_cmdfile = true; + if (opt.ntasks_set && !need_cmdfile) { + tmp_str = getenv("SLURM_NPROCS"); + if (!tmp_str) + tmp_str = getenv("SLURM_NNODES"); + if (tmp_str && (opt.ntasks != atoi(tmp_str))) + need_cmdfile = true; + } + + if (opt.multi_prog) { + protocol = "multi"; + } else { + protocol = _get_cmd_protocol(opt.argv[1]); + } + debug("cmd:%s protcol:%s", opt.argv[1], protocol); + + step_id = _get_next_stepid(job_id, dname, sizeof(dname)); + + if (need_cmdfile) { + char *buf; + int fd, i, j, k; + + /* NOTE: The command file needs to be in a directory that can + * be read from the compute node(s), so /tmp does not work. + * We use the user's home directory (based upon "HOME" + * environment variable) otherwise use current working + * directory. The file name contains the job ID and step ID. */ + xstrfmtcat(cmd_fname, + "%s/slurm_cmdfile_%u.%d", dname, job_id, step_id); + while ((fd = creat(cmd_fname, 0600)) < 0) { + if (errno == EINTR) + continue; + fatal("creat(%s): %m", cmd_fname); + } + + i = strlen(opt.argv[1]) + 128; + buf = xmalloc(i); + if (opt.multi_prog) { + char in_line[512]; + FILE *fp = fopen(opt.argv[1], "r"); + if (!fp) + fatal("fopen(%s): %m", opt.argv[1]); + /* Read and parse SLURM MPMD format file here */ + while (fgets(in_line, sizeof(in_line), fp)) + _multi_prog_parse(in_line, 512, -1); + fclose(fp); + /* Write LoadLeveler MPMD format file here */ + while (_multi_prog_parse(in_line, 512, step_id)) + j = xstrfmtcat(buf, "%s\n", in_line); + } else { + /* @%%: */ + xstrfmtcat(buf, "%s@%d%c%d%c%s:%d", + opt.argv[1], step_id, '%', + opt.ntasks, '%', protocol, opt.ntasks); + for (i = 2; i < opt.argc; i++) /* start at argv[2] */ + xstrfmtcat(buf, " %s", opt.argv[i]); + xstrfmtcat(buf, "\n"); + } + i = 0; + j = strlen(buf); + while ((k = write(fd, &buf[i], j))) { + if (k > 0) { + i += k; + j -= k; + } else if ((errno != EAGAIN) && (errno != EINTR)) { + error("write(cmdfile): %m"); + break; + } + } + (void) close(fd); + setenv("MP_NEWJOB", "parallel", 1); + setenv("MP_CMDFILE", cmd_fname, 1); + } else { + xstrfmtcat(cmd_line, " %s", opt.argv[1]); + /* Each token gets double quotes around it in case any + * arguments contain spaces */ + for (i = 2; i < opt.argc; i++) { + xstrfmtcat(cmd_line, " \"%s\"", opt.argv[i]); + } + } + + if (opt.network) { + if (strstr(opt.network, "dedicated")) + setenv("MP_ADAPTER_USE", "dedicated", 1); + else if (strstr(opt.network, "shared")) + setenv("MP_ADAPTER_USE", "shared", 1); + } + if (opt.cpu_bind_type) { + if ((opt.cpu_bind_type & CPU_BIND_TO_THREADS) || + (opt.cpu_bind_type & CPU_BIND_TO_CORES)) { + setenv("MP_BINDPROC", "yes", 1); + } + } + if (opt.shared != (uint16_t) NO_VAL) { + if (opt.shared) + setenv("MP_CPU_USE", "unique", 1); + else + setenv("MP_CPU_USE", "multiple", 1); + } + if (opt.network) { + if (strstr(opt.network, "hfi")) + setenv("MP_DEVTYPE", "hfi", 1); + else if (strstr(opt.network, "ib")) + setenv("MP_DEVTYPE", "ib", 1); + } + if (opt.network) { + if (strstr(opt.network, "sn_all")) + setenv("MP_EUIDEVICE", "sn_all", 1); + else if (strstr(opt.network, "sn_single")) + setenv("MP_EUIDEVICE", "sn_single", 1); + else if ((tmp_str = strstr(opt.network, "eth"))) { + char buf[5]; + strncpy(buf, tmp_str, 5); + buf[4] = '\0'; + setenv("MP_EUIDEVICE", buf, 1); + } + } + if (opt.network) { + if (strstr(opt.network, "ip") || strstr(opt.network, "ip")) + setenv("MP_EUILIB", "IP", 1); + else if (strstr(opt.network, "us") || + strstr(opt.network, "US")) + setenv("MP_EUILIB", "US", 1); + } + if (opt.nodelist) { + char *fname = NULL, *host_name, *host_line; + pid_t pid = getpid(); + hostlist_t hl; + int fd, len, offset, wrote; + hl = hostlist_create(opt.nodelist); + if (!hl) + fatal("Invalid nodelist: %s", opt.nodelist); + xstrfmtcat(fname, "slurm_hostlist.%u", (uint32_t) pid); + if ((fd = creat(fname, 0600)) < 0) + fatal("creat(%s): %m", fname); + while ((host_name = hostlist_shift(hl))) { + host_line = NULL; + xstrfmtcat(host_line, "%s\n", host_name); + free(host_name); + len = strlen(host_line) + 1; + offset = 0; + while (len > offset) { + wrote = write(fd, host_line + offset, + len - offset); + if (wrote < 0) { + if ((errno == EAGAIN) || + (errno == EINTR)) + continue; + fatal("write(%s): %m", fname); + } + offset += wrote; + } + xfree(host_line); + } + hostlist_destroy(hl); + info("wrote hostlist file at %s", fname); + xfree(fname); + close(fd); + } + if (opt.msg_timeout) { + snprintf(value, sizeof(value), "%d", opt.msg_timeout); + setenv("MP_TIMEOUT", value, 1); + } + if (opt.immediate) + setenv("MP_RETRY", "0", 1); + /* if (_verbose) { */ + /* int info_level = MIN((_verbose + 1), 6); */ + /* snprintf(value, sizeof(value), "%d", info_level); */ + /* setenv("MP_INFOLEVEL", value, 1); */ + /* } */ + if (opt.labelio) + setenv("MP_LABELIO", "yes", 0); + if (!strcmp(protocol, "multi")) + setenv("MP_MSG_API", "mpi", 0); + else if (!strcmp(protocol, "mpi")) + setenv("MP_MSG_API", "mpi", 0); + else if (!strcmp(protocol, "lapi")) + setenv("MP_MSG_API", "lapi", 0); + else if (!strcmp(protocol, "pami")) + setenv("MP_MSG_API", "pami", 0); + else if (!strcmp(protocol, "upc")) + setenv("MP_MSG_API", "upc", 0); + else if (!strcmp(protocol, "shmem")) { + setenv("MP_MSG_API", "shmem,xmi", 0); + setenv("MP_USE_BULK_XFER", "no", 0); + } + if (opt.min_nodes != NO_VAL) { + snprintf(value, sizeof(value), "%u", opt.min_nodes); + setenv("MP_NODES", value, 1); + } + if (opt.ntasks) { + snprintf(value, sizeof(value), "%u", opt.ntasks); + setenv("MP_PROCS", value, 1); + } + if (opt.cpu_bind_type) { + if (opt.cpu_bind_type & CPU_BIND_TO_THREADS) + setenv("MP_TASK_AFFINITY", "cpu", 1); + else if (opt.cpu_bind_type & CPU_BIND_TO_CORES) + setenv("MP_TASK_AFFINITY", "core", 1); + else if (opt.cpus_per_task) { + snprintf(value, sizeof(value), "cpu:%d", + opt.cpus_per_task); + setenv("MP_TASK_AFFINITY", value, 1); + } + } + if (opt.ntasks_per_node != NO_VAL) { + snprintf(value, sizeof(value), "%u", opt.ntasks_per_node); + setenv("MP_TASKS_PER_NODE", value, 1); + } + if (opt.unbuffered) { + setenv("MP_STDERRMODE", "unordered", 1); + setenv("MP_STDOUTMODE", "unordered", 1); + } + + /* Since poe doesn't need to know about the partition and it + really needs to have RMPOOL set just set it to something. + */ + setenv("MP_RMPOOL", "SLURM", 1); + setenv("SLURM_STARTED_STEP", "YES", 1); + //disable_status = opt.disable_status; + //quit_on_intr = opt.quit_on_intr; + //srun_jobid = xstrdup(opt.jobid); + +#if _DEBUG_SRUN + info("cmd_line:%s", cmd_line); +#endif + xfree(cmd_line); + return NULL; +} + +/* + * init() is called when the plugin is loaded, before any other functions + * are called. Put global initialization here. + */ +extern int init(void) +{ + verbose("%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; +} + +extern int launch_p_setup_srun_opt(char **rest) +{ + if (opt.test_only) { + error("--test-only not supported with poe"); + exit (1); + } else if (opt.no_alloc) { + error("--no-allocate not supported with LoadLeveler"); + exit (1); + } + + opt.argc++; + + /* We need to do +2 here just incase multi-prog is needed (we + add an extra argv on so just make space for it). + */ + opt.argv = (char **) xmalloc((opt.argc + 2) * sizeof(char *)); + + opt.argv[0] = xstrdup("poe"); + /* Set default job name to the executable name rather than + * "runjob" */ + if (!opt.job_name_set_cmd && (1 < opt.argc)) { + opt.job_name_set_cmd = true; + opt.job_name = xstrdup(rest[0]); + } + + return 1; +} + +extern int launch_p_create_job_step(srun_job_t *job, bool use_all_cpus, + void (*signal_function)(int), + sig_atomic_t *destroy_job) +{ + poe_cmd_line = _build_poe_command(job->jobid); + + return SLURM_SUCCESS; +} + +extern int launch_p_step_launch( + srun_job_t *job, slurm_step_io_fds_t *cio_fds, uint32_t *global_rc) +{ + int rc = 0; + pid_t pid; + int stderr_pipe[2] = {-1, -1}; + int stdin_pipe[2] = {-1, -1}, stdout_pipe[2] = {-1, -1}; + + if ((pipe(stdin_pipe) == -1) + || (pipe(stdout_pipe) == -1) + || (pipe(stderr_pipe) == -1)) { + error("pipe: %m"); + return 1; + } + + pid = fork(); + if (pid < 0) { + /* (void) close(stdin_pipe[0]); */ + /* (void) close(stdin_pipe[1]); */ + /* (void) close(stdout_pipe[0]); */ + /* (void) close(stdout_pipe[1]); */ + /* (void) close(stderr_pipe[0]); */ + /* (void) close(stderr_pipe[1]); */ + error("fork: %m"); + return 1; + } else if (pid > 0) { + if (waitpid(pid, NULL, 0) < 0) + error("Unable to reap slurmd child process"); + } else { + /* if ((dup2(stdin_pipe[0], 0) == -1) || */ + /* (dup2(stdout_pipe[1], 1) == -1) || */ + /* (dup2(stderr_pipe[1], 2) == -1)) { */ + /* error("dup2: %m"); */ + /* return 1; */ + /* } */ + + /* (void) close(stderr_pipe[0]); */ + /* (void) close(stderr_pipe[1]); */ + /* (void) close(stdin_pipe[0]); */ + /* (void) close(stdin_pipe[1]); */ + /* (void) close(stdout_pipe[0]); */ + /* (void) close(stdout_pipe[1]); */ + + execvp(opt.argv[0], opt.argv); + error("execv(poe) error: %m"); + return 1; + } + + (void) close(stdin_pipe[0]); + (void) close(stdout_pipe[1]); + (void) close(stderr_pipe[1]); + + /* NOTE: dummy_pipe is only used to wake the select() function in the + * loop below when the spawned process terminates */ + return rc; +} + +extern int launch_p_step_wait(srun_job_t *job, bool got_alloc) +{ + return 0; +} + +extern int launch_p_step_terminate(void) +{ + if (cmd_fname) + (void) unlink(cmd_fname); + if (stepid_fname) + (void) unlink(stepid_fname); + return SLURM_SUCCESS; +} + + +extern void launch_p_print_status(void) +{ + +} + +extern void launch_p_fwd_signal(int signal) +{ + +} diff --git a/src/plugins/launch/runjob/Makefile.am b/src/plugins/launch/runjob/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..43edff4664ded1d286d94989d9075a83da875dcc --- /dev/null +++ b/src/plugins/launch/runjob/Makefile.am @@ -0,0 +1,19 @@ +# Makefile for launch/runjob plugin + +AUTOMAKE_OPTIONS = foreign + +PLUGIN_FLAGS = -module -avoid-version --export-dynamic + +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common $(BG_INCLUDES) + +pkglib_LTLIBRARIES = launch_runjob.la + +launch_runjob_la_SOURCES = launch_runjob.c + +if BGQ_LOADED +launch_runjob_la_SOURCES += runjob_interface.cc +# because totalview needs the libraries on load we link in srun and not here. +#launch_runjob_la_LDFLAGS += $(RUNJOB_LDFLAGS) +endif + +launch_runjob_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) diff --git a/src/plugins/launch/runjob/Makefile.in b/src/plugins/launch/runjob/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..33d866d00a00e586a96f9879e5e6733cee17772d --- /dev/null +++ b/src/plugins/launch/runjob/Makefile.in @@ -0,0 +1,695 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 launch/runjob plugin + +VPATH = @srcdir@ +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@ +@BGQ_LOADED_TRUE@am__append_1 = runjob_interface.cc +subdir = src/plugins/launch/runjob +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_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_cflags.m4 \ + $(top_srcdir)/auxdir/x_ac_cray.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_gpl_licensed.m4 \ + $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ + $(top_srcdir)/auxdir/x_ac_iso.m4 \ + $(top_srcdir)/auxdir/x_ac_lua.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_nrt.m4 \ + $(top_srcdir)/auxdir/x_ac_pam.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_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)/auxdir/x_ac_srun.m4 \ + $(top_srcdir)/auxdir/x_ac_sun_const.m4 \ + $(top_srcdir)/auxdir/x_ac_xcpu.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +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) +launch_runjob_la_LIBADD = +am__launch_runjob_la_SOURCES_DIST = launch_runjob.c \ + runjob_interface.cc +@BGQ_LOADED_TRUE@am__objects_1 = runjob_interface.lo +am_launch_runjob_la_OBJECTS = launch_runjob.lo $(am__objects_1) +launch_runjob_la_OBJECTS = $(am_launch_runjob_la_OBJECTS) +launch_runjob_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(launch_runjob_la_LDFLAGS) $(LDFLAGS) -o $@ +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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(launch_runjob_la_SOURCES) +DIST_SOURCES = $(am__launch_runjob_la_SOURCES_DIST) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTHD_CFLAGS = @AUTHD_CFLAGS@ +AUTHD_LIBS = @AUTHD_LIBS@ +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@ +CMD_LDFLAGS = @CMD_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +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@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ +HAVEPGCONFIG = @HAVEPGCONFIG@ +HAVE_AIX = @HAVE_AIX@ +HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ +HAVE_OPENSSL = @HAVE_OPENSSL@ +HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ +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@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_LDFLAGS = @LIB_LDFLAGS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@ +MUNGE_LDFLAGS = @MUNGE_LDFLAGS@ +MUNGE_LIBS = @MUNGE_LIBS@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +NCURSES = @NCURSES@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ +NUMA_LIBS = @NUMA_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +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@ +PGSQL_CFLAGS = @PGSQL_CFLAGS@ +PGSQL_LIBS = @PGSQL_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +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@ +RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ +SED = @SED@ +SEMAPHORE_LIBS = @SEMAPHORE_LIBS@ +SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +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@ +UTIL_LIBS = @UTIL_LIBS@ +VERSION = @VERSION@ +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@ +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@ +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 +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common $(BG_INCLUDES) +pkglib_LTLIBRARIES = launch_runjob.la +launch_runjob_la_SOURCES = launch_runjob.c $(am__append_1) +# because totalview needs the libraries on load we link in srun and not here. +#launch_runjob_la_LDFLAGS += $(RUNJOB_LDFLAGS) +launch_runjob_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .cc .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/launch/runjob/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/plugins/launch/runjob/Makefile +.PRECIOUS: 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) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @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 " $(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)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +launch_runjob.la: $(launch_runjob_la_OBJECTS) $(launch_runjob_la_DEPENDENCIES) $(EXTRA_launch_runjob_la_DEPENDENCIES) + $(launch_runjob_la_LINK) -rpath $(pkglibdir) $(launch_runjob_la_OBJECTS) $(launch_runjob_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launch_runjob.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runjob_interface.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +.cc.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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" + +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 all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags 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 uninstall uninstall-am uninstall-pkglibLTLIBRARIES + + +# 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/launch/runjob/launch_runjob.c b/src/plugins/launch/runjob/launch_runjob.c new file mode 100644 index 0000000000000000000000000000000000000000..e4bb674d78f4c72c8ebcd411df0db3eabacd6c88 --- /dev/null +++ b/src/plugins/launch/runjob/launch_runjob.c @@ -0,0 +1,424 @@ +/*****************************************************************************\ + * launch_runjob.c - Define job launch using IBM's runjob. Typically + * for use with a BGQ machine. + ***************************************************************************** + * Copyright (C) 2012 SchedMD LLC + * Written by Danny Auble + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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/proc_args.h" +#include "src/common/slurm_jobacct_gather.h" +#include "src/common/slurm_auth.h" + +#include "src/api/step_ctx.h" +#include "src/api/step_launch.h" + +#include "src/srun/libsrun/launch.h" + +#include "src/plugins/launch/runjob/runjob_interface.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 + * + * / + * + * where is a description of the intended application of + * the plugin (e.g., "task" for task control) and 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 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[] = "launch runjob plugin"; +const char plugin_type[] = "launch/runjob"; +const uint32_t plugin_version = 101; + +static srun_job_t *local_srun_job = NULL; + +static void _send_step_complete_rpc(int step_rc) +{ + slurm_msg_t req; + step_complete_msg_t msg; + int rc; + + memset(&msg, 0, sizeof(step_complete_msg_t)); + msg.job_id = local_srun_job->jobid; + msg.job_step_id = local_srun_job->stepid; + msg.range_first = 0; + msg.range_last = 0; + msg.step_rc = step_rc; + msg.jobacct = jobacctinfo_create(NULL); + + slurm_msg_t_init(&req); + req.msg_type = REQUEST_STEP_COMPLETE; + req.data = &msg; +/* req.address = step_complete.parent_addr; */ + + debug3("Sending step complete RPC to slurmctld"); + if (slurm_send_recv_controller_rc_msg(&req, &rc) < 0) + error("Error sending step complete RPC to slurmctld"); + jobacctinfo_destroy(msg.jobacct); +} + +static void +_handle_msg(slurm_msg_t *msg) +{ + static uint32_t slurm_uid = NO_VAL; + uid_t req_uid = g_slurm_auth_get_uid(msg->auth_cred, NULL); + uid_t uid = getuid(); + job_step_kill_msg_t *ss; + srun_user_msg_t *um; + + if (slurm_uid == NO_VAL) + slurm_uid = slurm_get_slurm_user_id(); + if ((req_uid != slurm_uid) && (req_uid != 0) && (req_uid != uid)) { + error ("Security violation, slurm message from uid %u", + (unsigned int) req_uid); + return; + } + + switch (msg->msg_type) { + 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"); + 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_STEP_SIGNAL: + ss = msg->data; + debug("received step signal %u RPC", ss->signal); + runjob_signal(ss->signal); + slurm_free_job_step_kill_msg(msg->data); + break; + default: + debug("received spurious message type: %u", + msg->msg_type); + break; + } + return; +} + +static void *_msg_thr_internal(void *arg) +{ + slurm_addr_t cli_addr; + slurm_fd_t newsockfd; + slurm_msg_t *msg; + int *slurmctld_fd_ptr = (int *)arg; + + (void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); + (void) pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); + + while (!srun_shutdown) { + newsockfd = slurm_accept_msg_conn(*slurmctld_fd_ptr, &cli_addr); + if (newsockfd == SLURM_SOCKET_ERROR) { + if (errno != EINTR) + error("slurm_accept_msg_conn: %m"); + continue; + } + msg = xmalloc(sizeof(slurm_msg_t)); + if (slurm_receive_msg(newsockfd, msg, 0) != 0) { + error("slurm_receive_msg: %m"); + /* close the new socket */ + slurm_close_accepted_conn(newsockfd); + continue; + } + _handle_msg(msg); + slurm_free_msg(msg); + slurm_close_accepted_conn(newsockfd); + } + return NULL; +} + +static pthread_t +_spawn_msg_handler(void) +{ + pthread_attr_t attr; + pthread_t msg_thread; + static int slurmctld_fd; + + slurmctld_fd = + local_srun_job->step_ctx->launch_state->slurmctld_socket_fd; + if (slurmctld_fd < 0) + return (pthread_t) 0; + local_srun_job->step_ctx->launch_state->slurmctld_socket_fd = -1; + + slurm_attr_init(&attr); + if (pthread_create(&msg_thread, &attr, _msg_thr_internal, + (void *) &slurmctld_fd)) + error("pthread_create of message thread: %m"); + slurm_attr_destroy(&attr); + return msg_thread; +} + +/* + * init() is called when the plugin is loaded, before any other functions + * are called. Put global initialization here. + */ +extern int init(void) +{ + verbose("%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; +} + +extern int launch_p_setup_srun_opt(char **rest) +{ + int command_pos = 0; + uint32_t taskid = NO_VAL; + + if (opt.reboot) { + info("WARNING: If your job is smaller than the block " + "it is going to run on and other jobs are " + "running on it the --reboot option will not be " + "honored. If this is the case, contact your " + "admin to reboot the block for you."); + } + + /* A bit of setup for IBM's runjob. runjob only has so many + options, so it isn't that bad. + */ + if (!opt.test_only) { + /* Since we need the opt.argc to allocate the opt.argv array + * we need to do this before actually messing with + * things. All the extra options added to argv will be + * handled after the allocation. */ + + /* Default location of the actual command to be ran. We always + * have to add 3 options (calling prog, '--env-all' and ':') no + * matter what. */ + command_pos = 3; + + if (opt.ntasks_per_node != NO_VAL) + command_pos += 2; + if (opt.ntasks_set) + command_pos += 2; + if (opt.cwd_set) + command_pos += 2; + if (opt.labelio) + command_pos += 2; + if (_verbose) + command_pos += 2; + if (opt.ifname) { + if (!parse_uint32(opt.ifname, &taskid) + && ((int) taskid < opt.ntasks)) { + command_pos += 2; + } + } + if (opt.runjob_opts) { + char *save_ptr = NULL, *tok; + char *tmp = xstrdup(opt.runjob_opts); + tok = strtok_r(tmp, " ", &save_ptr); + while (tok) { + command_pos++; + tok = strtok_r(NULL, " ", &save_ptr); + } + xfree(tmp); + } + + opt.argc += command_pos; + } + + /* We need to do +2 here just incase multi-prog is needed (we + add an extra argv on so just make space for it). + */ + opt.argv = (char **) xmalloc((opt.argc + 2) * sizeof(char *)); + + if (!opt.test_only) { + int i = 0; + /* First arg has to be something when sending it to the + runjob api. This can be anything, srun seemed most + logical, but it doesn't matter. + */ + opt.argv[i++] = xstrdup("srun"); + /* srun launches tasks using runjob API. Slurmd is not used */ + if (opt.ntasks_per_node != NO_VAL) { + opt.argv[i++] = xstrdup("-p"); + opt.argv[i++] = xstrdup_printf("%d", + opt.ntasks_per_node); + } + + if (opt.ntasks_set) { + opt.argv[i++] = xstrdup("--np"); + opt.argv[i++] = xstrdup_printf("%d", opt.ntasks); + } + + if (opt.cwd_set) { + opt.argv[i++] = xstrdup("--cwd"); + opt.argv[i++] = xstrdup(opt.cwd); + } + + if (opt.labelio) { + opt.argv[i++] = xstrdup("--label"); + opt.argv[i++] = xstrdup("short"); + /* Since we are getting labels from runjob. and we + * don't want 2 sets (slurm's will always be 000) + * remove it case. */ + opt.labelio = 0; + } + + if (_verbose) { + opt.argv[i++] = xstrdup("--verbose"); + opt.argv[i++] = xstrdup_printf("%d", _verbose); + } + + if (taskid != NO_VAL) { + opt.argv[i++] = xstrdup("--stdinrank"); + opt.argv[i++] = xstrdup_printf("%u", taskid); + } + + if (opt.runjob_opts) { + char *save_ptr = NULL, *tok; + char *tmp = xstrdup(opt.runjob_opts); + tok = strtok_r(tmp, " ", &save_ptr); + while (tok) { + opt.argv[i++] = xstrdup(tok); + tok = strtok_r(NULL, " ", &save_ptr); + } + xfree(tmp); + } + + /* Export all the environment so the runjob_mux will get the + * correct info about the job, namely the block. */ + opt.argv[i++] = xstrdup("--env-all"); + + /* With runjob anything after a ':' is treated as the actual + * job, which in this case is exactly what it is. So, very + * sweet. */ + opt.argv[i++] = xstrdup(":"); + + /* Sanity check to make sure we set it up correctly. */ + if (i != command_pos) { + fatal ("command_pos is set to %d but we are going to " + "put it at %d, please update src/srun/opt.c", + command_pos, i); + } + + /* Set default job name to the executable name rather than + * "runjob" */ + if (!opt.job_name_set_cmd && (command_pos < opt.argc)) { + opt.job_name_set_cmd = true; + opt.job_name = xstrdup(rest[0]); + } + } + return command_pos; +} + +extern int launch_p_create_job_step(srun_job_t *job, bool use_all_cpus, + void (*signal_function)(int), + sig_atomic_t *destroy_job) +{ + return launch_common_create_job_step(job, use_all_cpus, + signal_function, + destroy_job); +} + +extern int launch_p_step_launch( + srun_job_t *job, slurm_step_io_fds_t *cio_fds, uint32_t *global_rc) +{ + pthread_t msg_thread; + + local_srun_job = job; + + msg_thread = _spawn_msg_handler(); + + *global_rc = runjob_launch(opt.argc, opt.argv, + cio_fds->in.fd, + cio_fds->out.fd, + cio_fds->err.fd); + _send_step_complete_rpc(*global_rc); + if (msg_thread) { + srun_shutdown = true; + pthread_cancel(msg_thread); + pthread_join(msg_thread, NULL); + } + + return 0; +} + +extern int launch_p_step_wait(srun_job_t *job, bool got_alloc) +{ + return 0; +} + +extern int launch_p_step_terminate(void) +{ + info("Terminating job step %u.%u", + local_srun_job->jobid, local_srun_job->stepid); + runjob_signal(SIGKILL); + return SLURM_SUCCESS; +} + + +extern void launch_p_print_status(void) +{ + +} + +extern void launch_p_fwd_signal(int signal) +{ + runjob_signal(signal); +} diff --git a/src/srun/runjob_interface.cc b/src/plugins/launch/runjob/runjob_interface.cc similarity index 100% rename from src/srun/runjob_interface.cc rename to src/plugins/launch/runjob/runjob_interface.cc diff --git a/src/srun/runjob_interface.h b/src/plugins/launch/runjob/runjob_interface.h similarity index 100% rename from src/srun/runjob_interface.h rename to src/plugins/launch/runjob/runjob_interface.h diff --git a/src/plugins/launch/slurm/Makefile.am b/src/plugins/launch/slurm/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..80b3e9b7153f94b61b230f6373ecdbbad4aa031b --- /dev/null +++ b/src/plugins/launch/slurm/Makefile.am @@ -0,0 +1,13 @@ +# Makefile for launch/slurm plugin + +AUTOMAKE_OPTIONS = foreign + +PLUGIN_FLAGS = -module -avoid-version --export-dynamic + +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common + +pkglib_LTLIBRARIES = launch_slurm.la + +launch_slurm_la_SOURCES = launch_slurm.c task_state.c + +launch_slurm_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) diff --git a/src/plugins/switch/federation/Makefile.in b/src/plugins/launch/slurm/Makefile.in similarity index 87% rename from src/plugins/switch/federation/Makefile.in rename to src/plugins/launch/slurm/Makefile.in index 9fb83fbd5a70416e150f8eb4bea321e3610dce1d..d759970f8488f54ae1dbe7415b36dace9bd3a1a9 100644 --- a/src/plugins/switch/federation/Makefile.in +++ b/src/plugins/launch/slurm/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -15,7 +15,7 @@ @SET_MAKE@ -# Makefile for switch/federation plugin +# Makefile for launch/slurm plugin VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -37,7 +37,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -subdir = src/plugins/switch/federation +subdir = src/plugins/launch/slurm DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.m4 \ @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,21 +104,20 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) -switch_federation_la_LIBADD = -am__switch_federation_la_SOURCES_DIST = federation.c federation.h \ - federation_keys.h switch_federation.c -@HAVE_FEDERATION_TRUE@am_switch_federation_la_OBJECTS = federation.lo \ -@HAVE_FEDERATION_TRUE@ switch_federation.lo -am__EXTRA_switch_federation_la_SOURCES_DIST = federation.c \ - federation.h federation_keys.h switch_federation.c -switch_federation_la_OBJECTS = $(am_switch_federation_la_OBJECTS) -switch_federation_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +launch_slurm_la_LIBADD = +am_launch_slurm_la_OBJECTS = launch_slurm.lo task_state.lo +launch_slurm_la_OBJECTS = $(am_launch_slurm_la_OBJECTS) +launch_slurm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(switch_federation_la_LDFLAGS) $(LDFLAGS) -o $@ -@HAVE_FEDERATION_TRUE@am_switch_federation_la_rpath = -rpath \ -@HAVE_FEDERATION_TRUE@ $(pkglibdir) + $(launch_slurm_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp am__depfiles_maybe = depfiles @@ -133,10 +131,8 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(switch_federation_la_SOURCES) \ - $(EXTRA_switch_federation_la_SOURCES) -DIST_SOURCES = $(am__switch_federation_la_SOURCES_DIST) \ - $(am__EXTRA_switch_federation_la_SOURCES_DIST) +SOURCES = $(launch_slurm_la_SOURCES) +DIST_SOURCES = $(launch_slurm_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -180,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -190,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -224,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -251,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -341,28 +337,12 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -DFEDERATION_CONFIG_FILE=\"$(sysconfdir)/federation.conf\" AUTOMAKE_OPTIONS = foreign -@HAVE_FEDERATION_FALSE@federation_lib = -@HAVE_FEDERATION_TRUE@federation_lib = switch_federation.la PLUGIN_FLAGS = -module -avoid-version --export-dynamic INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common -pkglib_LTLIBRARIES = $(federation_lib) - -# Federation switch plugin. -@HAVE_FEDERATION_TRUE@switch_federation_la_SOURCES = \ -@HAVE_FEDERATION_TRUE@ federation.c federation.h \ -@HAVE_FEDERATION_TRUE@ federation_keys.h \ -@HAVE_FEDERATION_TRUE@ switch_federation.c - -@HAVE_FEDERATION_TRUE@switch_federation_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) \ -@HAVE_FEDERATION_TRUE@ $(FEDERATION_LDFLAGS) - -@HAVE_FEDERATION_FALSE@EXTRA_switch_federation_la_SOURCES = \ -@HAVE_FEDERATION_FALSE@ federation.c federation.h \ -@HAVE_FEDERATION_FALSE@ federation_keys.h \ -@HAVE_FEDERATION_FALSE@ switch_federation.c - +pkglib_LTLIBRARIES = launch_slurm.la +launch_slurm_la_SOURCES = launch_slurm.c task_state.c +launch_slurm_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) all: all-am .SUFFIXES: @@ -376,9 +356,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/switch/federation/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/launch/slurm/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/plugins/switch/federation/Makefile + $(AUTOMAKE) --foreign src/plugins/launch/slurm/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -428,8 +408,8 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -switch_federation.la: $(switch_federation_la_OBJECTS) $(switch_federation_la_DEPENDENCIES) - $(switch_federation_la_LINK) $(am_switch_federation_la_rpath) $(switch_federation_la_OBJECTS) $(switch_federation_la_LIBADD) $(LIBS) +launch_slurm.la: $(launch_slurm_la_OBJECTS) $(launch_slurm_la_DEPENDENCIES) $(EXTRA_launch_slurm_la_DEPENDENCIES) + $(launch_slurm_la_LINK) -rpath $(pkglibdir) $(launch_slurm_la_OBJECTS) $(launch_slurm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -437,8 +417,8 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/federation.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/switch_federation.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launch_slurm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task_state.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -566,10 +546,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/launch/slurm/launch_slurm.c b/src/plugins/launch/slurm/launch_slurm.c new file mode 100644 index 0000000000000000000000000000000000000000..597da9843e8a05e0be755001722af46e38e0b9d2 --- /dev/null +++ b/src/plugins/launch/slurm/launch_slurm.c @@ -0,0 +1,536 @@ +/*****************************************************************************\ + * launch_slurm.c - Define job launch using slurm. + ***************************************************************************** + * Copyright (C) 2012 SchedMD LLC + * Written by Danny Auble + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 + +#define _GNU_SOURCE + +#include +#include + +#include "src/api/pmi_server.h" +#include "src/srun/libsrun/allocate.h" +#include "src/srun/libsrun/launch.h" +#include "src/srun/libsrun/multi_prog.h" + +#include "src/plugins/launch/slurm/task_state.h" + +#ifndef OPEN_MPI_PORT_ERROR +/* This exit code indicates the launched Open MPI tasks could + * not open the reserved port. It was already open by some + * other process. */ +#define OPEN_MPI_PORT_ERROR 108 +#endif + +#define MAX_STEP_RETRIES 4 + +/* + * 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 + * + * / + * + * where is a description of the intended application of + * the plugin (e.g., "task" for task control) and 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 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[] = "launch SLURM plugin"; +const char plugin_type[] = "launch/slurm"; +const uint32_t plugin_version = 101; + +static srun_job_t *local_srun_job = NULL; +static uint32_t *local_global_rc = NULL; + +static task_state_t task_state; +static time_t launch_start_time; +static bool retry_step_begin = false; +static int retry_step_cnt = 0; + +extern int launch_p_step_terminate(); + +static char *_hostset_to_string(hostset_t hs) +{ + size_t n = 1024; + size_t maxsize = 1024*64; + char *str = NULL; + + do { + str = xrealloc(str, n); + } while (hostset_ranged_string(hs, n*=2, str) < 0 && (n < maxsize)); + + /* + * If string was truncated, indicate this with a '+' suffix. + */ + if (n >= maxsize) + strcpy(str + (maxsize - 2), "+"); + + return str; +} + +/* Convert an array of task IDs into a list of host names + * RET: the string, caller must xfree() this value */ +static char *_task_ids_to_host_list(int ntasks, uint32_t taskids[]) +{ + int i; + hostset_t hs; + char *hosts; + slurm_step_layout_t *sl; + + if ((sl = launch_common_get_slurm_step_layout(local_srun_job)) == NULL) + return (xstrdup("Unknown")); + + hs = hostset_create(NULL); + for (i = 0; i < ntasks; i++) { + char *host = slurm_step_layout_host_name(sl, taskids[i]); + if (host) { + hostset_insert(hs, host); + free(host); + } else { + error("Could not identify host name for task %u", + taskids[i]); + } + } + + hosts = _hostset_to_string(hs); + hostset_destroy(hs); + + return (hosts); +} + +/* Convert an array of task IDs into a string. + * RET: the string, caller must xfree() this value + * NOTE: the taskids array is not necessarily in numeric order, + * so we use existing bitmap functions to format */ +static char *_task_array_to_string(int ntasks, uint32_t taskids[]) +{ + bitstr_t *tasks_bitmap = NULL; + char *str; + int i; + + tasks_bitmap = bit_alloc(local_srun_job->ntasks); + if (!tasks_bitmap) { + error("bit_alloc: memory allocation failure"); + exit(error_exit); + } + for (i=0; i slurm_get_msg_timeout()) + return 0; + return 1; +} + +static void +_handle_openmpi_port_error(const char *tasks, const char *hosts, + slurm_step_ctx_t *step_ctx) +{ + uint32_t job_id, step_id; + char *msg = "retrying"; + + if (!retry_step_begin) { + retry_step_begin = true; + retry_step_cnt++; + } + + if (retry_step_cnt >= MAX_STEP_RETRIES) + msg = "aborting"; + error("%s: tasks %s unable to claim reserved port, %s.", + hosts, tasks, msg); + + slurm_step_ctx_get(step_ctx, SLURM_STEP_CTX_JOBID, &job_id); + slurm_step_ctx_get(step_ctx, SLURM_STEP_CTX_STEPID, &step_id); + info("Terminating job step %u.%u", job_id, step_id); + slurm_kill_job_step(job_id, step_id, SIGKILL); +} + +static void _task_start(launch_tasks_response_msg_t *msg) +{ + MPIR_PROCDESC *table; + int taskid; + int i; + + if (msg->count_of_pids) + verbose("Node %s, %d tasks started", + msg->node_name, msg->count_of_pids); + else + /* This message should be displayed through the api, + hense it is a debug2 instead of an error. + */ + debug2("No tasks started on node %s: %s", + msg->node_name, slurm_strerror(msg->return_code)); + + + for (i = 0; i < msg->count_of_pids; i++) { + taskid = msg->task_ids[i]; + table = &MPIR_proctable[taskid]; + table->host_name = xstrdup(msg->node_name); + /* table->executable_name is set elsewhere */ + table->pid = msg->local_pids[i]; + + if (msg->return_code == 0) { + task_state_update(task_state, + taskid, TS_START_SUCCESS); + } else { + task_state_update(task_state, + taskid, TS_START_FAILURE); + } + } + +} + +static void _task_finish(task_exit_msg_t *msg) +{ + char *tasks; + char *hosts; + uint32_t rc = 0; + int normal_exit = 0; + + const char *task_str = _taskstr(msg->num_tasks); + + verbose("Received task exit notification for %d %s (status=0x%04x).", + msg->num_tasks, task_str, msg->return_code); + + tasks = _task_array_to_string(msg->num_tasks, msg->task_id_list); + hosts = _task_ids_to_host_list(msg->num_tasks, msg->task_id_list); + + if (WIFEXITED(msg->return_code)) { + if ((rc = WEXITSTATUS(msg->return_code)) == 0) { + verbose("%s: %s %s: Completed", hosts, task_str, tasks); + normal_exit = 1; + } + else if (_is_openmpi_port_error(rc)) { + _handle_openmpi_port_error(tasks, hosts, + local_srun_job->step_ctx); + } else { + error("%s: %s %s: Exited with exit code %d", + hosts, task_str, tasks, rc); + } + if (!WIFEXITED(*local_global_rc) + || (rc > WEXITSTATUS(*local_global_rc))) + *local_global_rc = msg->return_code; + } + else if (WIFSIGNALED(msg->return_code)) { + const char *signal_str = strsignal(WTERMSIG(msg->return_code)); + char * core_str = ""; +#ifdef WCOREDUMP + if (WCOREDUMP(msg->return_code)) + core_str = " (core dumped)"; +#endif + if (local_srun_job->state >= SRUN_JOB_CANCELLED) { + verbose("%s: %s %s: %s%s", + hosts, task_str, tasks, signal_str, core_str); + } else { + rc = msg->return_code; + error("%s: %s %s: %s%s", + hosts, task_str, tasks, signal_str, core_str); + } + if (*local_global_rc == 0) + *local_global_rc = msg->return_code; + } + + xfree(tasks); + xfree(hosts); + + _update_task_exit_state(msg->num_tasks, msg->task_id_list, + !normal_exit); + + if (task_state_first_abnormal_exit(task_state) + && _kill_on_bad_exit()) + launch_p_step_terminate(); + + if (task_state_first_exit(task_state) && (opt.max_wait > 0)) + _setup_max_wait_timer(); +} + +/* + * init() is called when the plugin is loaded, before any other functions + * are called. Put global initialization here. + */ +extern int init(void) +{ + verbose("%s loaded", plugin_name); + return SLURM_SUCCESS; +} + +/* + * fini() is called when the plugin is removed. Clear any allocated + * storage here. + */ +extern int fini(void) +{ + task_state_destroy(task_state); + + return SLURM_SUCCESS; +} + +extern int launch_p_setup_srun_opt(char **rest) +{ + if (opt.debugger_test && opt.parallel_debug) + MPIR_being_debugged = 1; + + /* We need to do +2 here just incase multi-prog is needed (we + add an extra argv on so just make space for it). + */ + opt.argv = (char **) xmalloc((opt.argc + 2) * sizeof(char *)); + + return 0; +} + +extern int launch_p_create_job_step(srun_job_t *job, bool use_all_cpus, + void (*signal_function)(int), + sig_atomic_t *destroy_job) +{ + /* set the jobid for totalview */ + totalview_jobid = NULL; + xstrfmtcat(totalview_jobid, "%u", job->ctx_params.job_id); + + return launch_common_create_job_step(job, use_all_cpus, + signal_function, + destroy_job); +} + +extern int launch_p_step_launch( + srun_job_t *job, slurm_step_io_fds_t *cio_fds, uint32_t *global_rc) +{ + slurm_step_launch_params_t launch_params; + slurm_step_launch_callbacks_t callbacks; + int rc = 0; + + local_srun_job = job; + local_global_rc = global_rc; + + task_state = task_state_create(opt.ntasks); + + slurm_step_launch_params_t_init(&launch_params); + launch_params.gid = opt.gid; + launch_params.alias_list = job->alias_list; + launch_params.argc = opt.argc; + launch_params.argv = opt.argv; + launch_params.multi_prog = opt.multi_prog ? true : false; + launch_params.cwd = opt.cwd; + launch_params.slurmd_debug = opt.slurmd_debug; + launch_params.buffered_stdio = !opt.unbuffered; + launch_params.labelio = opt.labelio ? true : false; + launch_params.remote_output_filename =fname_remote_string(job->ofname); + launch_params.remote_input_filename = fname_remote_string(job->ifname); + launch_params.remote_error_filename = fname_remote_string(job->efname); + launch_params.task_prolog = opt.task_prolog; + launch_params.task_epilog = opt.task_epilog; + launch_params.cpu_bind = opt.cpu_bind; + launch_params.cpu_bind_type = opt.cpu_bind_type; + launch_params.mem_bind = opt.mem_bind; + launch_params.mem_bind_type = opt.mem_bind_type; + launch_params.open_mode = opt.open_mode; + if (opt.acctg_freq >= 0) + launch_params.acctg_freq = opt.acctg_freq; + launch_params.pty = opt.pty; + if (opt.cpus_set) + launch_params.cpus_per_task = opt.cpus_per_task; + else + launch_params.cpus_per_task = 1; + launch_params.cpu_freq = opt.cpu_freq; + launch_params.task_dist = opt.distribution; + launch_params.ckpt_dir = opt.ckpt_dir; + launch_params.restart_dir = opt.restart_dir; + launch_params.preserve_env = opt.preserve_env; + 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; + + memcpy(&launch_params.local_fds, cio_fds, sizeof(slurm_step_io_fds_t)); + + if (MPIR_being_debugged) { + launch_params.parallel_debug = true; + pmi_server_max_threads(1); + } else { + launch_params.parallel_debug = false; + } + callbacks.task_start = _task_start; + callbacks.task_finish = _task_finish; + + mpir_init(job->ctx_params.task_count); + + update_job_state(job, SRUN_JOB_LAUNCHING); + launch_start_time = time(NULL); + if (slurm_step_launch(job->step_ctx, &launch_params, &callbacks) != + SLURM_SUCCESS) { + error("Application launch failed: %m"); + *local_global_rc = 1; + slurm_step_launch_abort(job->step_ctx); + slurm_step_launch_wait_finish(job->step_ctx); + goto cleanup; + } + + update_job_state(job, SRUN_JOB_STARTING); + if (slurm_step_launch_wait_start(job->step_ctx) == SLURM_SUCCESS) { + update_job_state(job, SRUN_JOB_RUNNING); + /* Only set up MPIR structures if the step launched + * correctly. */ + if (opt.multi_prog) + mpir_set_multi_name(job->ctx_params.task_count, + launch_params.argv[0]); + else + mpir_set_executable_names(launch_params.argv[0]); + MPIR_debug_state = MPIR_DEBUG_SPAWNED; + if (opt.debugger_test) + mpir_dump_proctable(); + else + MPIR_Breakpoint(job); + } else { + info("Job step %u.%u aborted before step completely launched.", + job->jobid, job->stepid); + } + +cleanup: + + return rc; +} + +extern int launch_p_step_wait(srun_job_t *job, bool got_alloc) +{ + int rc = 0; + + slurm_step_launch_wait_finish(job->step_ctx); + if ((MPIR_being_debugged == 0) && retry_step_begin && + (retry_step_cnt < MAX_STEP_RETRIES)) { + retry_step_begin = false; + slurm_step_ctx_destroy(job->step_ctx); + if (got_alloc) { + if (create_job_step(job, true) < 0) + exit(error_exit); + } else { + if (create_job_step(job, false) < 0) + exit(error_exit); + } + task_state_destroy(task_state); + rc = -1; + } + return rc; +} + +extern int launch_p_step_terminate(void) +{ + info("Terminating job step %u.%u", + local_srun_job->jobid, local_srun_job->stepid); + return slurm_kill_job_step(local_srun_job->jobid, + local_srun_job->stepid, SIGKILL); +} + + +extern void launch_p_print_status(void) +{ + task_state_print(task_state, (log_f)info); +} + +extern void launch_p_fwd_signal(int signal) +{ + switch (signal) { + case SIGKILL: + slurm_step_launch_abort(local_srun_job->step_ctx); + break; + default: + slurm_step_launch_fwd_signal(local_srun_job->step_ctx, signal); + break; + } +} diff --git a/src/srun/task_state.c b/src/plugins/launch/slurm/task_state.c similarity index 99% rename from src/srun/task_state.c rename to src/plugins/launch/slurm/task_state.c index e3f7fca0ee5c819136ed2d936d490f3045cd7f16..5748427fda4de2703e0a2119e5161275848ea29b 100644 --- a/src/srun/task_state.c +++ b/src/plugins/launch/slurm/task_state.c @@ -47,7 +47,7 @@ #include "src/common/bitstring.h" #include "src/common/xassert.h" -#include "src/srun/task_state.h" +#include "src/plugins/launch/slurm/task_state.h" struct task_state_struct { int n_tasks; diff --git a/src/srun/task_state.h b/src/plugins/launch/slurm/task_state.h similarity index 100% rename from src/srun/task_state.h rename to src/plugins/launch/slurm/task_state.h diff --git a/src/plugins/mpi/Makefile.in b/src/plugins/mpi/Makefile.in index 727a2c41980a47892cfa3fd494a38e4e6be71d8c..01d8e2a1f9ffafea7014dcf41e4aa7c6a39bdb9f 100644 --- a/src/plugins/mpi/Makefile.in +++ b/src/plugins/mpi/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/mpi/lam/Makefile.in b/src/plugins/mpi/lam/Makefile.in index 2db73fb4a4fa7e2d3bc5fd3279969411f3aa663f..c6da654d5e7dea26b9cac7ded53d11e34db9ebc1 100644 --- a/src/plugins/mpi/lam/Makefile.in +++ b/src/plugins/mpi/lam/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) mpi_lam_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -403,7 +408,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -mpi_lam.la: $(mpi_lam_la_OBJECTS) $(mpi_lam_la_DEPENDENCIES) +mpi_lam.la: $(mpi_lam_la_OBJECTS) $(mpi_lam_la_DEPENDENCIES) $(EXTRA_mpi_lam_la_DEPENDENCIES) $(mpi_lam_la_LINK) -rpath $(pkglibdir) $(mpi_lam_la_OBJECTS) $(mpi_lam_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -540,10 +545,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/mpi/mpich1_p4/Makefile.in b/src/plugins/mpi/mpich1_p4/Makefile.in index 9ae5a4dcd650cf66bcf288f6d2590e9236995299..ae7d4aca5a5ae6ecb7923b4604f5bd28c74bbe8c 100644 --- a/src/plugins/mpi/mpich1_p4/Makefile.in +++ b/src/plugins/mpi/mpich1_p4/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) mpi_mpich1_p4_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -mpi_mpich1_p4.la: $(mpi_mpich1_p4_la_OBJECTS) $(mpi_mpich1_p4_la_DEPENDENCIES) +mpi_mpich1_p4.la: $(mpi_mpich1_p4_la_OBJECTS) $(mpi_mpich1_p4_la_DEPENDENCIES) $(EXTRA_mpi_mpich1_p4_la_DEPENDENCIES) $(mpi_mpich1_p4_la_LINK) -rpath $(pkglibdir) $(mpi_mpich1_p4_la_OBJECTS) $(mpi_mpich1_p4_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/mpi/mpich1_shmem/Makefile.in b/src/plugins/mpi/mpich1_shmem/Makefile.in index e7ff210e99d92e0b2e34b291d322767ca4ea3830..9d9fcb462d39b37c11ebf73b72b6aa845196904e 100644 --- a/src/plugins/mpi/mpich1_shmem/Makefile.in +++ b/src/plugins/mpi/mpich1_shmem/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) mpi_mpich1_shmem_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -403,7 +408,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -mpi_mpich1_shmem.la: $(mpi_mpich1_shmem_la_OBJECTS) $(mpi_mpich1_shmem_la_DEPENDENCIES) +mpi_mpich1_shmem.la: $(mpi_mpich1_shmem_la_OBJECTS) $(mpi_mpich1_shmem_la_DEPENDENCIES) $(EXTRA_mpi_mpich1_shmem_la_DEPENDENCIES) $(mpi_mpich1_shmem_la_LINK) -rpath $(pkglibdir) $(mpi_mpich1_shmem_la_OBJECTS) $(mpi_mpich1_shmem_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -540,10 +545,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/mpi/mpichgm/Makefile.in b/src/plugins/mpi/mpichgm/Makefile.in index ba876e9b256ee93081dbf660fa214948c0029779..a05abe8399cf98d8d7460cb030af463dba1b142f 100644 --- a/src/plugins/mpi/mpichgm/Makefile.in +++ b/src/plugins/mpi/mpichgm/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) mpi_mpichgm_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -407,7 +412,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -mpi_mpichgm.la: $(mpi_mpichgm_la_OBJECTS) $(mpi_mpichgm_la_DEPENDENCIES) +mpi_mpichgm.la: $(mpi_mpichgm_la_OBJECTS) $(mpi_mpichgm_la_DEPENDENCIES) $(EXTRA_mpi_mpichgm_la_DEPENDENCIES) $(mpi_mpichgm_la_LINK) -rpath $(pkglibdir) $(mpi_mpichgm_la_OBJECTS) $(mpi_mpichgm_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -545,10 +550,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/mpi/mpichmx/Makefile.in b/src/plugins/mpi/mpichmx/Makefile.in index 6ee7f5c78e57610fca7632d6bbb681fa08fb4ab3..848f2ecc8e3a26dd4f9473e61357a06e1a63a9fa 100644 --- a/src/plugins/mpi/mpichmx/Makefile.in +++ b/src/plugins/mpi/mpichmx/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) mpi_mpichmx_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -407,7 +412,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -mpi_mpichmx.la: $(mpi_mpichmx_la_OBJECTS) $(mpi_mpichmx_la_DEPENDENCIES) +mpi_mpichmx.la: $(mpi_mpichmx_la_OBJECTS) $(mpi_mpichmx_la_DEPENDENCIES) $(EXTRA_mpi_mpichmx_la_DEPENDENCIES) $(mpi_mpichmx_la_LINK) -rpath $(pkglibdir) $(mpi_mpichmx_la_OBJECTS) $(mpi_mpichmx_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -545,10 +550,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/mpi/mvapich/Makefile.in b/src/plugins/mpi/mvapich/Makefile.in index 0d4c6753ee4857e163153dc846cdde92b08c0e2b..30088828614825abf70a7540b16da18af975ab29 100644 --- a/src/plugins/mpi/mvapich/Makefile.in +++ b/src/plugins/mpi/mvapich/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) mpi_mvapich_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -mpi_mvapich.la: $(mpi_mvapich_la_OBJECTS) $(mpi_mvapich_la_DEPENDENCIES) +mpi_mvapich.la: $(mpi_mvapich_la_OBJECTS) $(mpi_mvapich_la_DEPENDENCIES) $(EXTRA_mpi_mvapich_la_DEPENDENCIES) $(mpi_mvapich_la_LINK) -rpath $(pkglibdir) $(mpi_mvapich_la_OBJECTS) $(mpi_mvapich_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -543,10 +548,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/mpi/none/Makefile.in b/src/plugins/mpi/none/Makefile.in index c43638b34f37aa5022d3f5aeb2f28c3a471ce838..1be18bee8f2eb753f3cc5cda74da16802a778eae 100644 --- a/src/plugins/mpi/none/Makefile.in +++ b/src/plugins/mpi/none/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) mpi_none_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -mpi_none.la: $(mpi_none_la_OBJECTS) $(mpi_none_la_DEPENDENCIES) +mpi_none.la: $(mpi_none_la_OBJECTS) $(mpi_none_la_DEPENDENCIES) $(EXTRA_mpi_none_la_DEPENDENCIES) $(mpi_none_la_LINK) -rpath $(pkglibdir) $(mpi_none_la_OBJECTS) $(mpi_none_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/mpi/openmpi/Makefile.in b/src/plugins/mpi/openmpi/Makefile.in index 2077aff90564237c02b39940acfb47d295d18265..db1b1cd1f975282bb25edf655bac9a3923d3b786 100644 --- a/src/plugins/mpi/openmpi/Makefile.in +++ b/src/plugins/mpi/openmpi/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) mpi_openmpi_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -mpi_openmpi.la: $(mpi_openmpi_la_OBJECTS) $(mpi_openmpi_la_DEPENDENCIES) +mpi_openmpi.la: $(mpi_openmpi_la_OBJECTS) $(mpi_openmpi_la_DEPENDENCIES) $(EXTRA_mpi_openmpi_la_DEPENDENCIES) $(mpi_openmpi_la_LINK) -rpath $(pkglibdir) $(mpi_openmpi_la_OBJECTS) $(mpi_openmpi_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/mpi/pmi2/Makefile.in b/src/plugins/mpi/pmi2/Makefile.in index 0e7af1a3ec69b5a39f007abe08cf6ad8cf80285b..fc02463aa937d7f677c8caf4f885b5a566e9dc57 100644 --- a/src/plugins/mpi/pmi2/Makefile.in +++ b/src/plugins/mpi/pmi2/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) mpi_pmi2_la_LIBADD = @@ -172,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -416,7 +421,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -mpi_pmi2.la: $(mpi_pmi2_la_OBJECTS) $(mpi_pmi2_la_DEPENDENCIES) +mpi_pmi2.la: $(mpi_pmi2_la_OBJECTS) $(mpi_pmi2_la_DEPENDENCIES) $(EXTRA_mpi_pmi2_la_DEPENDENCIES) $(mpi_pmi2_la_LINK) -rpath $(pkglibdir) $(mpi_pmi2_la_OBJECTS) $(mpi_pmi2_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -570,10 +575,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/mpi/pmi2/setup.h b/src/plugins/mpi/pmi2/setup.h index 2c28314c49d93d1d15e5743d8e5680e54ff70a81..ad24da01189f24c9ce696448cc200a173ba52cdb 100644 --- a/src/plugins/mpi/pmi2/setup.h +++ b/src/plugins/mpi/pmi2/setup.h @@ -59,8 +59,8 @@ #include "src/slurmd/slurmstepd/slurmstepd_job.h" -#include "src/srun/srun_job.h" -#include "src/srun/opt.h" +#include "src/srun/libsrun/srun_job.h" +#include "src/srun/libsrun/opt.h" #include "tree.h" diff --git a/src/plugins/preempt/Makefile.in b/src/plugins/preempt/Makefile.in index 2fc0264575839f8e2fcd3a58465c99dd4ac71aca..0edd668a15fc6ac06f6366007cf5117fe7c9c6ab 100644 --- a/src/plugins/preempt/Makefile.in +++ b/src/plugins/preempt/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/preempt/none/Makefile.in b/src/plugins/preempt/none/Makefile.in index 96a1cf942f4897f1586dfe389dd9d1add2ec386a..3c510dd612b29260229a8a573563b5048b551bb8 100644 --- a/src/plugins/preempt/none/Makefile.in +++ b/src/plugins/preempt/none/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) preempt_none_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -403,7 +408,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -preempt_none.la: $(preempt_none_la_OBJECTS) $(preempt_none_la_DEPENDENCIES) +preempt_none.la: $(preempt_none_la_OBJECTS) $(preempt_none_la_DEPENDENCIES) $(EXTRA_preempt_none_la_DEPENDENCIES) $(preempt_none_la_LINK) -rpath $(pkglibdir) $(preempt_none_la_OBJECTS) $(preempt_none_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -540,10 +545,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/preempt/partition_prio/Makefile.in b/src/plugins/preempt/partition_prio/Makefile.in index 3f2b76b4ec59458eda074f8a3d082f300131b245..225afc41f779a6d63b97fa5a7cfa87baca7d79f4 100644 --- a/src/plugins/preempt/partition_prio/Makefile.in +++ b/src/plugins/preempt/partition_prio/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) preempt_partition_prio_la_LIBADD = @@ -173,9 +178,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -183,9 +186,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -217,6 +219,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -244,6 +248,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -preempt_partition_prio.la: $(preempt_partition_prio_la_OBJECTS) $(preempt_partition_prio_la_DEPENDENCIES) +preempt_partition_prio.la: $(preempt_partition_prio_la_OBJECTS) $(preempt_partition_prio_la_DEPENDENCIES) $(EXTRA_preempt_partition_prio_la_DEPENDENCIES) $(preempt_partition_prio_la_LINK) -rpath $(pkglibdir) $(preempt_partition_prio_la_OBJECTS) $(preempt_partition_prio_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/preempt/qos/Makefile.in b/src/plugins/preempt/qos/Makefile.in index 40722650a7a2da21fcbaf90c9f00d78ca7b3e222..2b07a2aace117b4a353e4f1dde31d35099b55362 100644 --- a/src/plugins/preempt/qos/Makefile.in +++ b/src/plugins/preempt/qos/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) preempt_qos_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -403,7 +408,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -preempt_qos.la: $(preempt_qos_la_OBJECTS) $(preempt_qos_la_DEPENDENCIES) +preempt_qos.la: $(preempt_qos_la_OBJECTS) $(preempt_qos_la_DEPENDENCIES) $(EXTRA_preempt_qos_la_DEPENDENCIES) $(preempt_qos_la_LINK) -rpath $(pkglibdir) $(preempt_qos_la_OBJECTS) $(preempt_qos_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -540,10 +545,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/priority/Makefile.in b/src/plugins/priority/Makefile.in index 885941b1bd678b22928bb33e8fcda844b5e7c654..a5830fb26a70437dfa6a2da870254022b5c83ead 100644 --- a/src/plugins/priority/Makefile.in +++ b/src/plugins/priority/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -164,9 +163,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -174,9 +171,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -208,6 +204,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -235,6 +233,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -574,10 +573,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/priority/basic/Makefile.in b/src/plugins/priority/basic/Makefile.in index ee5461c98a814faa789d4f4f3a45f71444e411ec..0f99868ffdd2a4be0b1b11ead2603cd01142fa7a 100644 --- a/src/plugins/priority/basic/Makefile.in +++ b/src/plugins/priority/basic/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) priority_basic_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -priority_basic.la: $(priority_basic_la_OBJECTS) $(priority_basic_la_DEPENDENCIES) +priority_basic.la: $(priority_basic_la_OBJECTS) $(priority_basic_la_DEPENDENCIES) $(EXTRA_priority_basic_la_DEPENDENCIES) $(priority_basic_la_LINK) -rpath $(pkglibdir) $(priority_basic_la_OBJECTS) $(priority_basic_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/priority/multifactor/Makefile.in b/src/plugins/priority/multifactor/Makefile.in index 8c1ef826d7c41d4911b175ce766f70aa2b42eea8..7dd3679f69c2d16499c8efc9613bbf093f7b79df 100644 --- a/src/plugins/priority/multifactor/Makefile.in +++ b/src/plugins/priority/multifactor/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) priority_multifactor_la_DEPENDENCIES = @@ -172,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -407,7 +412,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -priority_multifactor.la: $(priority_multifactor_la_OBJECTS) $(priority_multifactor_la_DEPENDENCIES) +priority_multifactor.la: $(priority_multifactor_la_OBJECTS) $(priority_multifactor_la_DEPENDENCIES) $(EXTRA_priority_multifactor_la_DEPENDENCIES) $(priority_multifactor_la_LINK) -rpath $(pkglibdir) $(priority_multifactor_la_OBJECTS) $(priority_multifactor_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -544,10 +549,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/proctrack/Makefile.am b/src/plugins/proctrack/Makefile.am index b08bac6b41d97926552de6470757270e198cbec8..dc470537149d3f56ed0df7533f46744581bb9e08 100644 --- a/src/plugins/proctrack/Makefile.am +++ b/src/plugins/proctrack/Makefile.am @@ -12,4 +12,4 @@ if HAVE_LUA LUA = lua endif -SUBDIRS = $(AIX_PROCTRACK) $(SGI_JOB) $(LUA) pgid linuxproc rms cgroup +SUBDIRS = $(AIX_PROCTRACK) $(SGI_JOB) $(LUA) pgid linuxproc cgroup diff --git a/src/plugins/proctrack/Makefile.in b/src/plugins/proctrack/Makefile.in index 2188755230a6969a0808189816c415213dddf955..2e3f3e3c4b006ac2ca6a081a6c2b4dd3a417d5ba 100644 --- a/src/plugins/proctrack/Makefile.in +++ b/src/plugins/proctrack/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -99,7 +98,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ distdir ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = aix sgi_job lua pgid linuxproc rms cgroup +DIST_SUBDIRS = aix sgi_job lua pgid linuxproc cgroup DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -330,7 +329,7 @@ top_srcdir = @top_srcdir@ @HAVE_AIX_PROCTRACK_TRUE@AIX_PROCTRACK = aix @HAVE_SGI_JOB_TRUE@SGI_JOB = sgi_job @HAVE_LUA_TRUE@LUA = lua -SUBDIRS = $(AIX_PROCTRACK) $(SGI_JOB) $(LUA) pgid linuxproc rms cgroup +SUBDIRS = $(AIX_PROCTRACK) $(SGI_JOB) $(LUA) pgid linuxproc cgroup all: all-recursive .SUFFIXES: @@ -579,10 +578,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/proctrack/aix/Makefile.in b/src/plugins/proctrack/aix/Makefile.in index 7d8b04029864d6577f0b7f144a496fd788769d6a..32c012df2ff456af0c4f833fb46ec0e9a1092409 100644 --- a/src/plugins/proctrack/aix/Makefile.in +++ b/src/plugins/proctrack/aix/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) proctrack_aix_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -407,7 +412,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -proctrack_aix.la: $(proctrack_aix_la_OBJECTS) $(proctrack_aix_la_DEPENDENCIES) +proctrack_aix.la: $(proctrack_aix_la_OBJECTS) $(proctrack_aix_la_DEPENDENCIES) $(EXTRA_proctrack_aix_la_DEPENDENCIES) $(proctrack_aix_la_LINK) -rpath $(pkglibdir) $(proctrack_aix_la_OBJECTS) $(proctrack_aix_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -544,10 +549,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/proctrack/cgroup/Makefile.in b/src/plugins/proctrack/cgroup/Makefile.in index 650eebe3a7b9d8f548afd5e85001c9f3ce51952d..4d3c3b319f76de7c44e06edbafd8aa4a0cff1f74 100644 --- a/src/plugins/proctrack/cgroup/Makefile.in +++ b/src/plugins/proctrack/cgroup/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) proctrack_cgroup_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -proctrack_cgroup.la: $(proctrack_cgroup_la_OBJECTS) $(proctrack_cgroup_la_DEPENDENCIES) +proctrack_cgroup.la: $(proctrack_cgroup_la_OBJECTS) $(proctrack_cgroup_la_DEPENDENCIES) $(EXTRA_proctrack_cgroup_la_DEPENDENCIES) $(proctrack_cgroup_la_LINK) -rpath $(pkglibdir) $(proctrack_cgroup_la_OBJECTS) $(proctrack_cgroup_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/proctrack/linuxproc/Makefile.in b/src/plugins/proctrack/linuxproc/Makefile.in index 7366392c00ded669e95a007a484e14d1abc4e6ce..bfd12146aa030a6b059d331e1d8d2b031c327b59 100644 --- a/src/plugins/proctrack/linuxproc/Makefile.in +++ b/src/plugins/proctrack/linuxproc/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) proctrack_linuxproc_la_LIBADD = @@ -172,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -410,7 +415,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -proctrack_linuxproc.la: $(proctrack_linuxproc_la_OBJECTS) $(proctrack_linuxproc_la_DEPENDENCIES) +proctrack_linuxproc.la: $(proctrack_linuxproc_la_OBJECTS) $(proctrack_linuxproc_la_DEPENDENCIES) $(EXTRA_proctrack_linuxproc_la_DEPENDENCIES) $(proctrack_linuxproc_la_LINK) -rpath $(pkglibdir) $(proctrack_linuxproc_la_OBJECTS) $(proctrack_linuxproc_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -548,10 +553,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/proctrack/lua/Makefile.in b/src/plugins/proctrack/lua/Makefile.in index 855915b3a296bb5699d9814fb9609abb5e48898d..ab00309a1662257595be5845f337d3828666b274 100644 --- a/src/plugins/proctrack/lua/Makefile.in +++ b/src/plugins/proctrack/lua/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) proctrack_lua_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -404,7 +409,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -proctrack_lua.la: $(proctrack_lua_la_OBJECTS) $(proctrack_lua_la_DEPENDENCIES) +proctrack_lua.la: $(proctrack_lua_la_OBJECTS) $(proctrack_lua_la_DEPENDENCIES) $(EXTRA_proctrack_lua_la_DEPENDENCIES) $(proctrack_lua_la_LINK) -rpath $(pkglibdir) $(proctrack_lua_la_OBJECTS) $(proctrack_lua_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -541,10 +546,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/proctrack/pgid/Makefile.in b/src/plugins/proctrack/pgid/Makefile.in index ad9ab6e67ab1ad2ca04378e44da8397135174d0a..d0c8905a3f6effb02b7d02ac27b0db24a9f7babf 100644 --- a/src/plugins/proctrack/pgid/Makefile.in +++ b/src/plugins/proctrack/pgid/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) proctrack_pgid_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -proctrack_pgid.la: $(proctrack_pgid_la_OBJECTS) $(proctrack_pgid_la_DEPENDENCIES) +proctrack_pgid.la: $(proctrack_pgid_la_OBJECTS) $(proctrack_pgid_la_DEPENDENCIES) $(EXTRA_proctrack_pgid_la_DEPENDENCIES) $(proctrack_pgid_la_LINK) -rpath $(pkglibdir) $(proctrack_pgid_la_OBJECTS) $(proctrack_pgid_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/proctrack/rms/Makefile.am b/src/plugins/proctrack/rms/Makefile.am deleted file mode 100644 index 4dc679c0115e133c1e907e68e5a4bc759f414824..0000000000000000000000000000000000000000 --- a/src/plugins/proctrack/rms/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# Makefile for proctrack/aix plugin - -AUTOMAKE_OPTIONS = foreign - -PLUGIN_FLAGS = -module -avoid-version --export-dynamic - -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common - -if HAVE_ELAN -pkglib_LTLIBRARIES = proctrack_rms.la -else -pkglib_LTLIBRARIES = -endif - -proctrack_rms_la_SOURCES = proctrack_rms.c -proctrack_rms_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) -proctrack_rms_la_LIBADD = -lrmscall diff --git a/src/plugins/proctrack/rms/proctrack_rms.c b/src/plugins/proctrack/rms/proctrack_rms.c deleted file mode 100644 index 6a95962f172029c7dd585cd97d317bac9603b293..0000000000000000000000000000000000000000 --- a/src/plugins/proctrack/rms/proctrack_rms.c +++ /dev/null @@ -1,383 +0,0 @@ -/*****************************************************************************\ - * proctrack_rms.c - process tracking via QsNet rms kernel module - ***************************************************************************** - * Copyright (C) 2005 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * CODE-OCEC-09-009. All rights reserved. - * - * This file is part of SLURM, a resource management program. - * For details, see . - * 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 - -#if HAVE_STDINT_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#endif - -#include - -#include -#include -#include -#include -#include - -#include "slurm/slurm.h" -#include "slurm/slurm_errno.h" -#include "src/common/log.h" -#include "src/slurmd/common/proctrack.h" - -const char plugin_name[] = "Process tracking for QsNet via the rms module"; -const char plugin_type[] = "proctrack/rms"; -const uint32_t plugin_version = 91; - -static int _prg_destructor_fork(void); -static void _prg_destructor_send(int fd, int prgid); - -#define MAX_IDS 512 - -extern int init (void) -{ - /* close librmscall's internal fd to /proc/rms/control */ - pthread_atfork(NULL, NULL, rmsmod_fini); - return SLURM_SUCCESS; -} - -extern int fini (void) -{ - return SLURM_SUCCESS; -} - - -/* - * When proctrack/rms is used in conjunction with switch/elan, - * slurm_container_plugin_create will not normally create the program - * description. It just retrieves the prgid created in switch/elan. - * - * When the program description cannot be retrieved (switch/elan is not - * being used, the job step is a batch script, etc.) then rms_prgcreate() - * is called here. - */ -extern int slurm_container_plugin_create (slurmd_job_t *job) -{ - int prgid; - /* - * Return a handle to an existing prgid or create a new one - */ - if (rms_getprgid ((int) job->jmgr_pid, &prgid) < 0) { - int fd = _prg_destructor_fork(); - /* Use slurmd job-step manager's pid as a unique identifier */ - prgid = job->jmgr_pid; - if ((rms_prgcreate (prgid, job->uid, 1)) < 0) { - error ("ptrack/rms: rms_prgcreate: %m"); - _prg_destructor_send(fd, -1); - return SLURM_ERROR; - } - _prg_destructor_send(fd, prgid); - } - debug3("proctrack/rms: prgid = %d", prgid); - - job->cont_id = (uint64_t)prgid; - return SLURM_SUCCESS; -} - -extern int slurm_container_plugin_add (slurmd_job_t *job, pid_t pid) -{ - return SLURM_SUCCESS; -} - -/* - * slurm_container_plugin_signal assumes that the slurmd jobstep manager - * is always the last process in the rms program description. - * No signals are sent to the last process. - */ -extern int slurm_container_plugin_signal (uint64_t id, int signal) -{ - pid_t *pids; - int nids = 0; - int i; - int rc; - - if (id <= 0) - return -1; - - pids = malloc(MAX_IDS * sizeof(pid_t)); - if (!pids) { - error("proctrack/rms container signal: malloc failed: %m"); - return -1; - } - if ((rc = rms_prginfo((int)id, MAX_IDS, pids, &nids)) < 0) { - error("proctrack/rms rms_prginfo failed %d: %m", rc); - free(pids); - /* - * Ignore errors, program desc has probably already - * been cleaned up. - */ - return -1; - } - - rc = -1; - for (i = nids-2; i >= 0 ; i--) { - debug2("proctrack/rms(pid %d) Sending signal %d to process %d", - getpid(), signal, pids[i]); - rc &= kill(pids[i], signal); - debug2(" rc = %d", rc); - } - free(pids); - debug3("proctrack/rms signal container returning %d", rc); - return rc; -} - - -/* - * The switch/elan plugin is really responsible for creating and - * destroying rms program descriptions. slurm_destroy_container simply - * returns SLURM_SUCCESS when the program description contains one and - * only one process, assumed to be the slurmd jobstep manager. - */ -extern int slurm_container_plugin_destroy (uint64_t id) -{ - debug2("proctrack/rms: destroying container %"PRIu64"", id); - if (id == 0) - return SLURM_SUCCESS; - - if (slurm_container_plugin_signal(id, 0) == -1) - return SLURM_SUCCESS; - - return SLURM_ERROR; -} - - -extern uint64_t slurm_container_plugin_find (pid_t pid) -{ - int prgid = 0; - - if (rms_getprgid ((int) pid, &prgid) < 0) - return (uint64_t) 0; - return (uint64_t) prgid; -} - -extern bool slurm_container_plugin_has_pid (uint64_t cont_id, pid_t pid) -{ - int prgid = 0; - - if (rms_getprgid ((int) pid, &prgid) < 0) - return false; - if ((uint64_t)prgid != cont_id) - return false; - - return true; -} - -extern int -slurm_container_plugin_wait(uint64_t cont_id) -{ - int delay = 1; - - if (cont_id == 0 || cont_id == 1) { - errno = EINVAL; - return SLURM_ERROR; - } - - /* Spin until the container is empty */ - while (slurm_container_plugin_signal(cont_id, 0) != -1) { - slurm_container_plugin_signal(cont_id, SIGKILL); - sleep(delay); - if (delay < 120) { - delay *= 2; - } else { - error("Unable to destroy container %"PRIu64"", cont_id); - } - } - - return SLURM_SUCCESS; -} - -/* - * This module assumes that the slurmstepd (running as root) is always the - * last process in the rms program description. We do not include - * the slurmstepd in the list of pids that we return. - */ -extern int -slurm_container_plugin_get_pids(uint64_t cont_id, pid_t **pids, int *npids) -{ - pid_t *p; - int np; - int len = 32; - - p = xmalloc(len * sizeof(pid_t)); - while(rms_prginfo((int)cont_id, len, p, &np) == -1) { - if (errno == EINVAL) { - /* array is too short, double its length */ - len *= 2; - xrealloc(p, len); - } else { - xfree(p); - *pids = NULL; - *npids = 0; - return SLURM_ERROR; - } - } - - /* Don't include the last pid (slurmstepd) in the list */ - if (np > 0) { - p[np-1] = 0; - np--; - } - - *npids = np; - *pids = p; - - return SLURM_SUCCESS; -} - -static void -_close_all_fd_except(int fd) -{ - int openmax; - int i; - - openmax = sysconf(_SC_OPEN_MAX); - for (i = 0; i <= openmax; i++) { - if (i != fd) - close(i); - } -} - - -/* - * Fork a child process that waits for a pipe to close, signalling that the - * parent process has exited. Then call rms_prgdestroy. - */ -static int -_prg_destructor_fork(void) -{ - pid_t pid; - int fdpair[2]; - int prgid; - int i; - int dummy; - - if (pipe(fdpair) < 0) { - error("_prg_destructor_fork: failed creating pipe"); - return -1; - } - - pid = fork(); - if (pid < 0) { - error("_prg_destructor_fork: failed to fork program destructor"); - } else if (pid > 0) { - /* parent */ - close(fdpair[0]); - waitpid(pid, (int *)NULL, 0); - return fdpair[1]; - } - - /****************************************/ - /* fork again so the destructor process - * will not be a child of the slurmd - */ - pid = fork(); - if (pid < 0) { - error("_prg_destructor_fork: second fork failed"); - } else if (pid > 0) { - exit(0); - } - - /* child */ - close(fdpair[1]); - - /* close librmscall's internal fd to /proc/rms/control */ - rmsmod_fini(); - - _close_all_fd_except(fdpair[0]); - /* Wait for the program description id from the child */ - if (read(fdpair[0], &prgid, sizeof(prgid)) != sizeof(prgid)) { - error("_prg_destructor_fork read failed: %m"); - exit(1); - } - - if (prgid == -1) - exit(1); - - /* - * Wait for the pipe to close, signalling that the parent - * has exited. - */ - while (read(fdpair[0], &dummy, sizeof(dummy)) > 0) {} - - /* - * Verify that program description is empty. If not, send a SIGKILL. - */ - for (i = 0; i < 30; i++) { - int maxids = 8; - pid_t pids[8]; - int nids = 0; - - if (rms_prginfo(prgid, maxids, pids, &nids) < 0) { - error("_prg_destructor_fork: rms_prginfo: %m"); - } - if (nids == 0) - break; - if (rms_prgsignal(prgid, SIGKILL) < 0) { - error("_prg_destructor_fork: rms_prgsignal: %m"); - } - sleep(1); - } - - if (rms_prgdestroy(prgid) < 0) { - error("rms_prgdestroy"); - } - exit(0); -} - - - -/* - * Send the prgid of the newly created program description to the process - * forked earlier by _prg_destructor_fork(), using the file descriptor - * "fd" which was returned by the call to _prg_destructor_fork(). - */ -static void -_prg_destructor_send(int fd, int prgid) -{ - debug3("_prg_destructor_send %d", prgid); - if (write (fd, &prgid, sizeof(prgid)) != sizeof(prgid)) { - error ("_prg_destructor_send failed: %m"); - } - /* Deliberately avoid closing fd. When this process exits, it - will close fd signalling to the child process that it is - time to call rms_prgdestroy */ - /*close(fd);*/ -} diff --git a/src/plugins/proctrack/sgi_job/Makefile.in b/src/plugins/proctrack/sgi_job/Makefile.in index 9b5b94992102cc686c711ed7c822ae31a814f841..ee2dbe69707002b797c5912dfd0f0e318cce3a9a 100644 --- a/src/plugins/proctrack/sgi_job/Makefile.in +++ b/src/plugins/proctrack/sgi_job/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) proctrack_sgi_job_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -403,7 +408,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -proctrack_sgi_job.la: $(proctrack_sgi_job_la_OBJECTS) $(proctrack_sgi_job_la_DEPENDENCIES) +proctrack_sgi_job.la: $(proctrack_sgi_job_la_OBJECTS) $(proctrack_sgi_job_la_DEPENDENCIES) $(EXTRA_proctrack_sgi_job_la_DEPENDENCIES) $(proctrack_sgi_job_la_LINK) -rpath $(pkglibdir) $(proctrack_sgi_job_la_OBJECTS) $(proctrack_sgi_job_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -540,10 +545,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/sched/Makefile.in b/src/plugins/sched/Makefile.in index 8e9c30f51fe4c73384434235bccb2d082ecbc5dc..91913de59d37b5a31525b949c64ca68c53d619ae 100644 --- a/src/plugins/sched/Makefile.in +++ b/src/plugins/sched/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/sched/backfill/Makefile.in b/src/plugins/sched/backfill/Makefile.in index 3fc62c37774432920e588abde2c156f2be131431..c3898745629cbd76976d667e1898de97b47a8e87 100644 --- a/src/plugins/sched/backfill/Makefile.in +++ b/src/plugins/sched/backfill/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) sched_backfill_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -407,7 +412,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -sched_backfill.la: $(sched_backfill_la_OBJECTS) $(sched_backfill_la_DEPENDENCIES) +sched_backfill.la: $(sched_backfill_la_OBJECTS) $(sched_backfill_la_DEPENDENCIES) $(EXTRA_sched_backfill_la_DEPENDENCIES) $(sched_backfill_la_LINK) -rpath $(pkglibdir) $(sched_backfill_la_OBJECTS) $(sched_backfill_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -545,10 +550,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/sched/backfill/backfill.c b/src/plugins/sched/backfill/backfill.c index cfe3e7d121217f896fb833f74d117b175d9cdcaf..766f34f92818984c39dfa693ee879f1f01dd7f23 100644 --- a/src/plugins/sched/backfill/backfill.c +++ b/src/plugins/sched/backfill/backfill.c @@ -290,7 +290,8 @@ static int _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap, rc = select_g_job_test(job_ptr, *avail_bitmap, high_cnt, max_nodes, req_nodes, SELECT_MODE_WILL_RUN, - preemptee_candidates, NULL, exc_core_bitmap); + preemptee_candidates, NULL, + exc_core_bitmap); } /* Restore the feature counts */ @@ -307,22 +308,23 @@ static int _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap, * then on shared nodes (if so configured). */ uint16_t orig_shared; time_t now = time(NULL); - char str[100]; + char str[100]; preemptee_candidates = slurm_find_preemptable_jobs(job_ptr); orig_shared = job_ptr->details->shared; job_ptr->details->shared = 0; tmp_bitmap = bit_copy(*avail_bitmap); - if(exc_core_bitmap){ - bit_fmt(str, (sizeof(str) - 1), exc_core_bitmap); - debug2(" _try_sched with exclude core bitmap: %s", str); - } + if (exc_core_bitmap){ + bit_fmt(str, (sizeof(str) - 1), exc_core_bitmap); + debug2(" _try_sched with exclude core bitmap: %s",str); + } rc = select_g_job_test(job_ptr, *avail_bitmap, min_nodes, max_nodes, req_nodes, SELECT_MODE_WILL_RUN, - preemptee_candidates, NULL, exc_core_bitmap); + preemptee_candidates, NULL, + exc_core_bitmap); job_ptr->details->shared = orig_shared; @@ -333,7 +335,8 @@ static int _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap, rc = select_g_job_test(job_ptr, *avail_bitmap, min_nodes, max_nodes, req_nodes, SELECT_MODE_WILL_RUN, - preemptee_candidates, NULL, exc_core_bitmap); + preemptee_candidates, NULL, + exc_core_bitmap); } else FREE_NULL_BITMAP(tmp_bitmap); } @@ -390,8 +393,12 @@ static void _load_config(void) fatal("Invalid backfill scheduler max_job_bf: %d", max_backfill_job_cnt); } + /* "bf_res=" is vestigial from version 2.3 and can be removed later. + * Only "bf_resolution=" is documented. */ if (sched_params && (tmp_ptr=strstr(sched_params, "bf_res="))) backfill_resolution = atoi(tmp_ptr + 7); + if (sched_params && (tmp_ptr=strstr(sched_params, "bf_resolution="))) + backfill_resolution = atoi(tmp_ptr + 14); if (backfill_resolution < 1) { fatal("Invalid backfill scheduler resolution: %d", backfill_resolution); @@ -558,7 +565,7 @@ static int _attempt_backfill(void) filter_root = true; job_queue = build_job_queue(true); - if (list_count(job_queue) <= 1) { + if (list_count(job_queue) == 0) { debug("backfill: no jobs to backfill"); list_destroy(job_queue); return 0; @@ -694,8 +701,9 @@ static int _attempt_backfill(void) TRY_LATER: FREE_NULL_BITMAP(avail_bitmap); start_res = later_start; later_start = 0; - exc_core_bitmap = NULL; - j = job_test_resv(job_ptr, &start_res, true, &avail_bitmap, &exc_core_bitmap); + exc_core_bitmap = NULL; + j = job_test_resv(job_ptr, &start_res, true, &avail_bitmap, + &exc_core_bitmap); if (j != SLURM_SUCCESS) { job_ptr->time_limit = orig_time_limit; continue; @@ -782,8 +790,8 @@ static int _attempt_backfill(void) job_ptr->job_id); slurmctld_diag_stats.bf_last_depth_try++; - j = _try_sched(job_ptr, &avail_bitmap, - min_nodes, max_nodes, req_nodes, exc_core_bitmap); + j = _try_sched(job_ptr, &avail_bitmap, min_nodes, max_nodes, + req_nodes, exc_core_bitmap); now = time(NULL); if (j != SLURM_SUCCESS) { job_ptr->time_limit = orig_time_limit; diff --git a/src/plugins/sched/builtin/Makefile.in b/src/plugins/sched/builtin/Makefile.in index fa2775925964805da2902517348ba0a816553dd7..9454d447e833d4b5fe13db2887d6a9875434b97b 100644 --- a/src/plugins/sched/builtin/Makefile.in +++ b/src/plugins/sched/builtin/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) sched_builtin_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -408,7 +413,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -sched_builtin.la: $(sched_builtin_la_OBJECTS) $(sched_builtin_la_DEPENDENCIES) +sched_builtin.la: $(sched_builtin_la_OBJECTS) $(sched_builtin_la_DEPENDENCIES) $(EXTRA_sched_builtin_la_DEPENDENCIES) $(sched_builtin_la_LINK) -rpath $(pkglibdir) $(sched_builtin_la_OBJECTS) $(sched_builtin_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -546,10 +551,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/sched/builtin/builtin.c b/src/plugins/sched/builtin/builtin.c index ea3fca194baa690f6dcd7991347082bf2c4ab463..b581a0d5b35f23423cf613ed68c7a6ec4e8725ec 100644 --- a/src/plugins/sched/builtin/builtin.c +++ b/src/plugins/sched/builtin/builtin.c @@ -105,7 +105,7 @@ static void _my_sleep(int secs) static void _load_config(void) { - char *sched_params, *tmp_ptr; + char *sched_params, *select_type, *tmp_ptr; sched_timeout = slurm_get_msg_timeout() / 2; sched_timeout = MAX(sched_timeout, 1); @@ -127,6 +127,15 @@ static void _load_config(void) max_backfill_job_cnt); } xfree(sched_params); + + select_type = slurm_get_select_type(); + if (!strcmp(select_type, "select/serial")) { + /* Do not spend time computing expected start time for + * pending jobs */ + max_backfill_job_cnt = 0; + stop_builtin_agent(); + } + xfree(select_type); } static void _compute_start_times(void) @@ -185,14 +194,16 @@ static void _compute_start_times(void) continue; } - j = job_test_resv(job_ptr, &now, true, &avail_bitmap, &exc_core_bitmap); + j = job_test_resv(job_ptr, &now, true, &avail_bitmap, + &exc_core_bitmap); if (j != SLURM_SUCCESS) continue; rc = select_g_job_test(job_ptr, avail_bitmap, min_nodes, max_nodes, req_nodes, SELECT_MODE_WILL_RUN, - preemptee_candidates, NULL, exc_core_bitmap); + preemptee_candidates, NULL, + exc_core_bitmap); if (rc == SLURM_SUCCESS) { last_job_update = now; if (job_ptr->time_limit == INFINITE) diff --git a/src/plugins/sched/hold/Makefile.in b/src/plugins/sched/hold/Makefile.in index e2c43f513077cf055b0312879697daadb36fcb0a..3ddd9843010664cfc92cee84296b41b5ee552dd2 100644 --- a/src/plugins/sched/hold/Makefile.in +++ b/src/plugins/sched/hold/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) sched_hold_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -404,7 +409,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -sched_hold.la: $(sched_hold_la_OBJECTS) $(sched_hold_la_DEPENDENCIES) +sched_hold.la: $(sched_hold_la_OBJECTS) $(sched_hold_la_DEPENDENCIES) $(EXTRA_sched_hold_la_DEPENDENCIES) $(sched_hold_la_LINK) -rpath $(pkglibdir) $(sched_hold_la_OBJECTS) $(sched_hold_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -541,10 +546,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/sched/wiki/Makefile.in b/src/plugins/sched/wiki/Makefile.in index f4d33aa34c36f75a48baffe6ba2483c081587eb9..0042bb89b65aff61a3355e31eb2c2b2a240eb131 100644 --- a/src/plugins/sched/wiki/Makefile.in +++ b/src/plugins/sched/wiki/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) sched_wiki_la_LIBADD = @@ -173,9 +178,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -183,9 +186,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -217,6 +219,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -244,6 +248,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -420,7 +425,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -sched_wiki.la: $(sched_wiki_la_OBJECTS) $(sched_wiki_la_DEPENDENCIES) +sched_wiki.la: $(sched_wiki_la_OBJECTS) $(sched_wiki_la_DEPENDENCIES) $(EXTRA_sched_wiki_la_DEPENDENCIES) $(sched_wiki_la_LINK) -rpath $(pkglibdir) $(sched_wiki_la_OBJECTS) $(sched_wiki_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -567,10 +572,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/sched/wiki2/Makefile.in b/src/plugins/sched/wiki2/Makefile.in index 782db1b320351445b13788124f97e296a18ae127..f5e8e0886007f595bef6470d2e799ec2b6331a3f 100644 --- a/src/plugins/sched/wiki2/Makefile.in +++ b/src/plugins/sched/wiki2/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) sched_wiki2_la_LIBADD = @@ -176,9 +181,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -186,9 +189,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -220,6 +222,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -247,6 +251,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -431,7 +436,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -sched_wiki2.la: $(sched_wiki2_la_OBJECTS) $(sched_wiki2_la_DEPENDENCIES) +sched_wiki2.la: $(sched_wiki2_la_OBJECTS) $(sched_wiki2_la_DEPENDENCIES) $(EXTRA_sched_wiki2_la_DEPENDENCIES) $(sched_wiki2_la_LINK) -rpath $(pkglibdir) $(sched_wiki2_la_OBJECTS) $(sched_wiki2_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -586,10 +591,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/sched/wiki2/get_jobs.c b/src/plugins/sched/wiki2/get_jobs.c index 3e004d5f431c91b52635225626bd2f77b04168d9..d3717356a7bb62134ee09685ac106ad82aaaffa7 100644 --- a/src/plugins/sched/wiki2/get_jobs.c +++ b/src/plugins/sched/wiki2/get_jobs.c @@ -347,6 +347,11 @@ static char * _dump_job(struct job_record *job_ptr, time_t update_time) xstrcat(buf, tmp); } + if (job_ptr->resp_host) { + snprintf(tmp, sizeof(tmp),"SUBMITHOST=\"%s\";", job_ptr->resp_host); + xstrcat(buf, tmp); + } + if (job_ptr->wckey) { if ((quote = strchr(job_ptr->wckey, (int) '\"'))) { /* Moab does not like strings containing a quote */ diff --git a/src/plugins/sched/wiki2/job_will_run.c b/src/plugins/sched/wiki2/job_will_run.c index c6bbab5b9dce288b6038363afc458985646c12ca..13eeeedebaf45a87634a3a34276ccd40412e7d9f 100644 --- a/src/plugins/sched/wiki2/job_will_run.c +++ b/src/plugins/sched/wiki2/job_will_run.c @@ -174,7 +174,8 @@ static char * _will_run_test(uint32_t jobid, time_t start_time, /* Enforce reservation: access control, time and nodes */ start_res = start_time; - rc = job_test_resv(job_ptr, &start_res, true, &resv_bitmap, &exc_core_bitmap); + rc = job_test_resv(job_ptr, &start_res, true, &resv_bitmap, + &exc_core_bitmap); if (rc != SLURM_SUCCESS) { *err_code = -730; *err_msg = "Job denied access to reservation"; @@ -457,7 +458,8 @@ static char * _will_run_test2(uint32_t jobid, time_t start_time, /* Enforce reservation: access control, time and nodes */ start_res = start_time; - rc = job_test_resv(job_ptr, &start_res, true, &resv_bitmap, &exc_core_bitmap); + rc = job_test_resv(job_ptr, &start_res, true, &resv_bitmap, + &exc_core_bitmap); if (rc != SLURM_SUCCESS) { *err_code = -730; *err_msg = "Job denied access to reservation"; @@ -542,7 +544,8 @@ static char * _will_run_test2(uint32_t jobid, time_t start_time, 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, &preempted_jobs, exc_core_bitmap); + preemptee_candidates, &preempted_jobs, + exc_core_bitmap); if (preemptee_candidates) list_destroy(preemptee_candidates); diff --git a/src/plugins/select/Makefile.am b/src/plugins/select/Makefile.am index dbcc83bb8b446c15d4692c70a172b7a90660599c..a70777315b293da1a7b7be9027ddc4b2e1dda112 100644 --- a/src/plugins/select/Makefile.am +++ b/src/plugins/select/Makefile.am @@ -4,7 +4,7 @@ if WITH_CXX BLUEGENE = bluegene endif -SUBDIRS = $(BLUEGENE) cons_res cray linear +SUBDIRS = $(BLUEGENE) cons_res cray linear serial # Each plugin here needs a plugin_id, here are the currect plug_ids # for each plugin. @@ -15,3 +15,4 @@ SUBDIRS = $(BLUEGENE) cons_res cray linear # bgq = 103 # cray + linear = 104 # cray + cons_res = 105 ==> Not current possible on Cray with ALPS/BASIL. +# serial = 106 diff --git a/src/plugins/select/Makefile.in b/src/plugins/select/Makefile.in index ed7d457eabd4bea45247a9376012a434ec127d24..24fad4de969140d10a44d424d667e6a921bbb630 100644 --- a/src/plugins/select/Makefile.in +++ b/src/plugins/select/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -99,7 +98,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ distdir ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = bluegene cons_res cray linear +DIST_SUBDIRS = bluegene cons_res cray linear serial DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -328,7 +327,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @WITH_CXX_TRUE@BLUEGENE = bluegene -SUBDIRS = $(BLUEGENE) cons_res cray linear +SUBDIRS = $(BLUEGENE) cons_res cray linear serial all: all-recursive .SUFFIXES: @@ -577,10 +576,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: @@ -685,6 +689,7 @@ uninstall-am: # bgq = 103 # cray + linear = 104 # cray + cons_res = 105 ==> Not current possible on Cray with ALPS/BASIL. +# serial = 106 # 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. diff --git a/src/plugins/select/bluegene/Makefile.am b/src/plugins/select/bluegene/Makefile.am index 95af1f7dd87a9fc29ed05cf423ed693269fff479..6266282ce85d25cde74f2521a8d78830947d01ab 100644 --- a/src/plugins/select/bluegene/Makefile.am +++ b/src/plugins/select/bluegene/Makefile.am @@ -13,7 +13,8 @@ pkglib_LTLIBRARIES = select_bluegene.la noinst_LTLIBRARIES = libba_common.la libconfigure_api.la -convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) +convenience_libs = $(top_builddir)/src/api/libslurmhelper.la \ + -lpthread $(DL_LIBS) # These are needed for pack/unpack of structures for cross-cluster stuff select_bluegene_la_SOURCES = select_bluegene.c \ @@ -57,9 +58,8 @@ if BGQ_LOADED pkglib_LTLIBRARIES += runjob_plugin.la runjob_plugin_la_SOURCES = runjob_plugin.cc - runjob_plugin_la_LDFLAGS = -export-dynamic $(SO_LDFLAGS) $(PLUGIN_FLAGS) \ - $(convenience_libs) -lpthread - + runjob_plugin_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) + runjob_plugin_la_LIBADD = $(convenience_libs) endif select_bluegene_la_SOURCES += \ diff --git a/src/plugins/select/bluegene/Makefile.in b/src/plugins/select/bluegene/Makefile.in index 88a7acfa68e55513b0172aad848a5cda94fbc76b..116114b9e7f70426f3cea5356e7442b7d3a38dae 100644 --- a/src/plugins/select/bluegene/Makefile.in +++ b/src/plugins/select/bluegene/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -89,9 +89,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -99,6 +97,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -137,6 +136,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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)" "$(DESTDIR)$(sbindir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) libba_common_la_LIBADD = @@ -163,7 +168,11 @@ libsched_if64_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(libsched_if64_la_LDFLAGS) $(LDFLAGS) -o $@ @BGL_LOADED_TRUE@@BG_L_P_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@am_libsched_if64_la_rpath = -rpath \ @BGL_LOADED_TRUE@@BG_L_P_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@ $(pkglibdir) -runjob_plugin_la_LIBADD = +am__DEPENDENCIES_1 = +am__DEPENDENCIES_2 = $(top_builddir)/src/api/libslurmhelper.la \ + $(am__DEPENDENCIES_1) +@BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@runjob_plugin_la_DEPENDENCIES = \ +@BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@ $(am__DEPENDENCIES_2) am__runjob_plugin_la_SOURCES_DIST = runjob_plugin.cc @BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@am_runjob_plugin_la_OBJECTS = \ @BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@ runjob_plugin.lo @@ -173,11 +182,10 @@ runjob_plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(CXXFLAGS) $(runjob_plugin_la_LDFLAGS) $(LDFLAGS) -o $@ @BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@am_runjob_plugin_la_rpath = \ @BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@ -rpath $(pkglibdir) -am__DEPENDENCIES_1 = -@BLUEGENE_LOADED_TRUE@am__DEPENDENCIES_2 = $(block_allocator_lib) \ +@BLUEGENE_LOADED_TRUE@am__DEPENDENCIES_3 = $(block_allocator_lib) \ @BLUEGENE_LOADED_TRUE@ $(am__DEPENDENCIES_1) select_bluegene_la_DEPENDENCIES = libba_common.la \ - $(am__DEPENDENCIES_2) + $(am__DEPENDENCIES_3) am__select_bluegene_la_SOURCES_DIST = select_bluegene.c bg_job_info.c \ bg_job_info.h bg_node_info.c bg_node_info.h bg_core.c \ bg_core.h bg_defined_block.c bg_defined_block.h \ @@ -202,10 +210,8 @@ am__slurm_epilog_SOURCES_DIST = slurm_epilog.c @BLUEGENE_LOADED_TRUE@am_slurm_epilog_OBJECTS = \ @BLUEGENE_LOADED_TRUE@ slurm_epilog.$(OBJEXT) slurm_epilog_OBJECTS = $(am_slurm_epilog_OBJECTS) -am__DEPENDENCIES_3 = $(top_builddir)/src/api/libslurm.o \ - $(am__DEPENDENCIES_1) @BLUEGENE_LOADED_TRUE@slurm_epilog_DEPENDENCIES = \ -@BLUEGENE_LOADED_TRUE@ $(am__DEPENDENCIES_3) +@BLUEGENE_LOADED_TRUE@ $(am__DEPENDENCIES_2) slurm_epilog_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(slurm_epilog_LDFLAGS) $(LDFLAGS) -o $@ @@ -214,7 +220,7 @@ am__slurm_prolog_SOURCES_DIST = slurm_prolog.c @BLUEGENE_LOADED_TRUE@ slurm_prolog.$(OBJEXT) slurm_prolog_OBJECTS = $(am_slurm_prolog_OBJECTS) @BLUEGENE_LOADED_TRUE@slurm_prolog_DEPENDENCIES = \ -@BLUEGENE_LOADED_TRUE@ $(am__DEPENDENCIES_3) +@BLUEGENE_LOADED_TRUE@ $(am__DEPENDENCIES_2) slurm_prolog_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(slurm_prolog_LDFLAGS) $(LDFLAGS) -o $@ @@ -334,9 +340,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -344,9 +348,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -378,6 +381,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -405,6 +410,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -503,7 +509,9 @@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common $(BG_INCLUDES) pkglib_LTLIBRARIES = select_bluegene.la $(am__append_2) \ $(am__append_3) $(am__append_5) noinst_LTLIBRARIES = libba_common.la libconfigure_api.la -convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) +convenience_libs = $(top_builddir)/src/api/libslurmhelper.la \ + -lpthread $(DL_LIBS) + # These are needed for pack/unpack of structures for cross-cluster stuff select_bluegene_la_SOURCES = select_bluegene.c bg_job_info.c \ @@ -521,9 +529,8 @@ select_bluegene_la_LIBADD = libba_common.la $(am__append_7) @BG_L_P_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@block_allocator_lib = ba/libblock_allocator.la @BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@nodist_EXTRA_select_bluegene_la_SOURCES = dummy.cxx @BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@runjob_plugin_la_SOURCES = runjob_plugin.cc -@BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@runjob_plugin_la_LDFLAGS = -export-dynamic $(SO_LDFLAGS) $(PLUGIN_FLAGS) \ -@BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@ $(convenience_libs) -lpthread - +@BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@runjob_plugin_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) +@BGQ_LOADED_TRUE@@BLUEGENE_LOADED_TRUE@runjob_plugin_la_LIBADD = $(convenience_libs) @BLUEGENE_LOADED_TRUE@slurm_prolog_LDADD = $(convenience_libs) @BLUEGENE_LOADED_TRUE@slurm_prolog_SOURCES = slurm_prolog.c @BLUEGENE_LOADED_TRUE@slurm_prolog_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) @@ -604,17 +611,17 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libba_common.la: $(libba_common_la_OBJECTS) $(libba_common_la_DEPENDENCIES) +libba_common.la: $(libba_common_la_OBJECTS) $(libba_common_la_DEPENDENCIES) $(EXTRA_libba_common_la_DEPENDENCIES) $(LINK) $(libba_common_la_OBJECTS) $(libba_common_la_LIBADD) $(LIBS) -libconfigure_api.la: $(libconfigure_api_la_OBJECTS) $(libconfigure_api_la_DEPENDENCIES) +libconfigure_api.la: $(libconfigure_api_la_OBJECTS) $(libconfigure_api_la_DEPENDENCIES) $(EXTRA_libconfigure_api_la_DEPENDENCIES) $(LINK) $(libconfigure_api_la_OBJECTS) $(libconfigure_api_la_LIBADD) $(LIBS) -libsched_if.la: $(libsched_if_la_OBJECTS) $(libsched_if_la_DEPENDENCIES) +libsched_if.la: $(libsched_if_la_OBJECTS) $(libsched_if_la_DEPENDENCIES) $(EXTRA_libsched_if_la_DEPENDENCIES) $(libsched_if_la_LINK) $(am_libsched_if_la_rpath) $(libsched_if_la_OBJECTS) $(libsched_if_la_LIBADD) $(LIBS) -libsched_if64.la: $(libsched_if64_la_OBJECTS) $(libsched_if64_la_DEPENDENCIES) +libsched_if64.la: $(libsched_if64_la_OBJECTS) $(libsched_if64_la_DEPENDENCIES) $(EXTRA_libsched_if64_la_DEPENDENCIES) $(libsched_if64_la_LINK) $(am_libsched_if64_la_rpath) $(libsched_if64_la_OBJECTS) $(libsched_if64_la_LIBADD) $(LIBS) -runjob_plugin.la: $(runjob_plugin_la_OBJECTS) $(runjob_plugin_la_DEPENDENCIES) +runjob_plugin.la: $(runjob_plugin_la_OBJECTS) $(runjob_plugin_la_DEPENDENCIES) $(EXTRA_runjob_plugin_la_DEPENDENCIES) $(runjob_plugin_la_LINK) $(am_runjob_plugin_la_rpath) $(runjob_plugin_la_OBJECTS) $(runjob_plugin_la_LIBADD) $(LIBS) -select_bluegene.la: $(select_bluegene_la_OBJECTS) $(select_bluegene_la_DEPENDENCIES) +select_bluegene.la: $(select_bluegene_la_OBJECTS) $(select_bluegene_la_DEPENDENCIES) $(EXTRA_select_bluegene_la_DEPENDENCIES) $(select_bluegene_la_LINK) -rpath $(pkglibdir) $(select_bluegene_la_OBJECTS) $(select_bluegene_la_LIBADD) $(LIBS) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @@ -659,10 +666,10 @@ clean-sbinPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -slurm_epilog$(EXEEXT): $(slurm_epilog_OBJECTS) $(slurm_epilog_DEPENDENCIES) +slurm_epilog$(EXEEXT): $(slurm_epilog_OBJECTS) $(slurm_epilog_DEPENDENCIES) $(EXTRA_slurm_epilog_DEPENDENCIES) @rm -f slurm_epilog$(EXEEXT) $(slurm_epilog_LINK) $(slurm_epilog_OBJECTS) $(slurm_epilog_LDADD) $(LIBS) -slurm_prolog$(EXEEXT): $(slurm_prolog_OBJECTS) $(slurm_prolog_DEPENDENCIES) +slurm_prolog$(EXEEXT): $(slurm_prolog_OBJECTS) $(slurm_prolog_DEPENDENCIES) $(EXTRA_slurm_prolog_DEPENDENCIES) @rm -f slurm_prolog$(EXEEXT) $(slurm_prolog_LINK) $(slurm_prolog_OBJECTS) $(slurm_prolog_LDADD) $(LIBS) @@ -972,10 +979,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/bluegene/ba/Makefile.in b/src/plugins/select/bluegene/ba/Makefile.in index f83aaa55d13b0f1bbc1b7799cd6fe81d5b8f4e9c..27486b36de369cb53ae94a36564d6850be8df772 100644 --- a/src/plugins/select/bluegene/ba/Makefile.in +++ b/src/plugins/select/bluegene/ba/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -59,9 +59,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -69,6 +67,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -161,9 +160,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -171,9 +168,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -205,6 +201,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -232,6 +230,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -384,7 +383,7 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libblock_allocator.la: $(libblock_allocator_la_OBJECTS) $(libblock_allocator_la_DEPENDENCIES) +libblock_allocator.la: $(libblock_allocator_la_OBJECTS) $(libblock_allocator_la_DEPENDENCIES) $(EXTRA_libblock_allocator_la_DEPENDENCIES) $(libblock_allocator_la_LINK) $(libblock_allocator_la_OBJECTS) $(libblock_allocator_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @@ -395,7 +394,7 @@ clean-noinstPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -wire_test$(EXEEXT): $(wire_test_OBJECTS) $(wire_test_DEPENDENCIES) +wire_test$(EXEEXT): $(wire_test_OBJECTS) $(wire_test_DEPENDENCIES) $(EXTRA_wire_test_DEPENDENCIES) @rm -f wire_test$(EXEEXT) $(wire_test_LINK) $(wire_test_OBJECTS) $(wire_test_LDADD) $(LIBS) @@ -531,10 +530,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/bluegene/ba_bgq/Makefile.in b/src/plugins/select/bluegene/ba_bgq/Makefile.in index 5e11027456fd702e29fe3c3a433ca7b909d7d667..678feca64e479509c09baaf7fcea25270ef16283 100644 --- a/src/plugins/select/bluegene/ba_bgq/Makefile.in +++ b/src/plugins/select/bluegene/ba_bgq/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -59,9 +59,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -69,6 +67,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -171,9 +170,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +178,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +211,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +240,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -397,7 +396,7 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libblock_allocator.la: $(libblock_allocator_la_OBJECTS) $(libblock_allocator_la_DEPENDENCIES) +libblock_allocator.la: $(libblock_allocator_la_OBJECTS) $(libblock_allocator_la_DEPENDENCIES) $(EXTRA_libblock_allocator_la_DEPENDENCIES) $(libblock_allocator_la_LINK) $(libblock_allocator_la_OBJECTS) $(libblock_allocator_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @@ -408,7 +407,7 @@ clean-noinstPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -wire_test$(EXEEXT): $(wire_test_OBJECTS) $(wire_test_DEPENDENCIES) +wire_test$(EXEEXT): $(wire_test_OBJECTS) $(wire_test_DEPENDENCIES) $(EXTRA_wire_test_DEPENDENCIES) @rm -f wire_test$(EXEEXT) $(wire_test_LINK) $(wire_test_OBJECTS) $(wire_test_LDADD) $(LIBS) @@ -566,10 +565,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/bluegene/ba_bgq/block_allocator.c b/src/plugins/select/bluegene/ba_bgq/block_allocator.c index cf40e5828293a9adfedefd3f158206120f3f5042..ee4c5712a7b0ffa67f33531503be694bbf0c5238 100644 --- a/src/plugins/select/bluegene/ba_bgq/block_allocator.c +++ b/src/plugins/select/bluegene/ba_bgq/block_allocator.c @@ -661,22 +661,25 @@ extern int check_and_set_mp_list(List mps) curr_ba_switch->usage)); rc = SLURM_ERROR; goto end_it; - } else if ((curr_ba_switch->usage - & BG_SWITCH_CABLE_ERROR_SET) - && (ba_switch->usage & BG_SWITCH_OUT_PASS)) { - if (ba_debug_flags & DEBUG_FLAG_BG_ALGO_DEEP) - info("check_and_set_mp_list: " - "%s(%d)'s cable is not available " - "can't make this block. " - "We need %s and system is %s", - ba_mp->coord_str, i, - ba_switch_usage_str( - ba_switch->usage), - ba_switch_usage_str( - curr_ba_switch->usage)); - rc = SLURM_ERROR; - goto end_it; } + /* Since we are only checking to see if this + block is creatable we don't need to check + hardware issues like bad cables. + */ + /* else if ((curr_ba_switch->usage */ + /* & BG_SWITCH_CABLE_ERROR_SET) */ + /* && (ba_switch->usage & BG_SWITCH_OUT_PASS)) { */ + /* if (ba_debug_flags & DEBUG_FLAG_BG_ALGO_DEEP) */ + /* info("check_and_set_mp_list: " */ + /* "%s(%d)'s cable is not available " */ + /* "can't really make this block. " */ + /* "We need %s and system is %s", */ + /* ba_mp->coord_str, i, */ + /* ba_switch_usage_str( */ + /* ba_switch->usage), */ + /* ba_switch_usage_str( */ + /* curr_ba_switch->usage)); */ + /* } */ if (ba_debug_flags & DEBUG_FLAG_BG_ALGO_DEEP) info("check_and_set_mp_list: " @@ -1151,17 +1154,8 @@ try_again: break; clear_cnt = bit_clear_count(total_bitmap); + FREE_NULL_BITMAP(total_bitmap); - /* User asked for a bad CPU count or we can't place it - here in this small allocation. */ - if (jobinfo->cnode_cnt < bg_conf->mp_cnode_cnt) { - list_iterator_destroy(itr); - if (ba_debug_flags & DEBUG_FLAG_BG_ALGO) - info("We couldn't place a sub block of %d", - *node_count); - (*node_count)++; - goto try_again; - } /* Grab the most empty midplane to be used later if we can't find a spot. @@ -1553,7 +1547,8 @@ extern struct job_record *ba_remove_job_in_block_job_list( if (!bg_record->job_list) return NULL; - xassert((ba_mp = list_peek(bg_record->ba_mp_list))); + ba_mp = list_peek(bg_record->ba_mp_list); + xassert(ba_mp); if (in_job_ptr && in_job_ptr->magic != JOB_MAGIC) { /* This can happen if the mmcs job hangs out in the system @@ -1717,6 +1712,11 @@ extern int ba_translate_coord2nc(uint16_t *cnode_coords) return nc_loc; } +/* ba_system_mutex needs to be locked before calling this. */ +extern ba_mp_t *ba_inx2ba_mp(int inx) +{ + return ba_main_grid_array[inx]; +} static char *_copy_from_main(List main_mps, List ret_list) { diff --git a/src/plugins/select/bluegene/ba_bgq/block_allocator.h b/src/plugins/select/bluegene/ba_bgq/block_allocator.h index 2911f6641d2c79ae9631e5876f0b132b3b283abe..337dc3b37c519c13a67c7fb7c1004edf8842bcaf 100644 --- a/src/plugins/select/bluegene/ba_bgq/block_allocator.h +++ b/src/plugins/select/bluegene/ba_bgq/block_allocator.h @@ -54,4 +54,6 @@ extern ba_mp_t ****ba_main_grid; extern ba_geo_system_t *ba_mp_geo_system; extern int ba_translate_coord2nc(uint16_t *cnode_coords); +extern ba_mp_t *ba_inx2ba_mp(int inx); + #endif /* _BLOCK_ALLOCATOR_H_ */ diff --git a/src/plugins/select/bluegene/bg_core.c b/src/plugins/select/bluegene/bg_core.c index f8c84dacb4b10b0a87c9a13c5c8ac8b5b8b1457d..cf7886624ae11565f336d2d8ccc9a8509e692525 100644 --- a/src/plugins/select/bluegene/bg_core.c +++ b/src/plugins/select/bluegene/bg_core.c @@ -122,6 +122,15 @@ static int _post_block_free(bg_record_t *bg_record, bool restore) removed out of all the lists. */ remove_from_bg_list(bg_lists->booted, bg_record); + if (remove_from_bg_list(bg_lists->job_running, bg_record) + == SLURM_SUCCESS) { + debug2("_post_block_free: we are freeing block %s and " + "it was in the job_running list. This can happen if a " + "block is removed while waiting for mmcs to finish " + "removing the job from the block.", + bg_record->bg_block_id); + num_unused_cpus += bg_record->cpu_cnt; + } /* If we don't have any mp_counts force block removal */ if (restore && bg_record->mp_count) @@ -525,7 +534,7 @@ extern int free_block_list(uint32_t job_id, List track_list, itr = list_iterator_create(bg_record->job_list); while ((job_ptr = list_next(itr))) { if ((job_ptr->magic != JOB_MAGIC) - || !IS_JOB_FINISHED(job_ptr)) + || IS_JOB_FINISHED(job_ptr)) continue; freeit = xmalloc(sizeof(kill_job_struct_t)); freeit->jobid = job_ptr->job_id; diff --git a/src/plugins/select/bluegene/bg_dynamic_block.c b/src/plugins/select/bluegene/bg_dynamic_block.c index ff0fa9a20a819228456460a5023123f561e9c365..db6f8452786497d9b7f585a54eeec8ce22c734ea 100644 --- a/src/plugins/select/bluegene/bg_dynamic_block.c +++ b/src/plugins/select/bluegene/bg_dynamic_block.c @@ -44,7 +44,7 @@ static int _split_block(List block_list, List new_blocks, static int _breakup_blocks(List block_list, List new_blocks, select_ba_request_t *request, List my_block_list, - bool only_free, bool only_small); + int cnodes, bool only_free, bool only_small); /* * create_dynamic_block - create new block(s) to be used for a new @@ -65,8 +65,13 @@ extern List create_dynamic_block(List block_list, bitstr_t *my_bitmap = NULL; select_ba_request_t blockreq; int cnodes = request->procs / bg_conf->cpu_ratio; + int orig_cnodes; uint16_t start_geo[SYSTEM_DIMENSIONS]; + if (cnodes < bg_conf->smallest_block) + cnodes = bg_conf->smallest_block; + orig_cnodes = cnodes; + if (bg_conf->sub_blocks && (cnodes < bg_conf->mp_cnode_cnt)) { cnodes = bg_conf->mp_cnode_cnt; } else if (cnodes < bg_conf->smallest_block) { @@ -205,6 +210,7 @@ extern List create_dynamic_block(List block_list, if (request->avail_mp_bitmap) ba_set_removable_mps(request->avail_mp_bitmap, 1); +try_small_again: if (request->size==1 && cnodes < bg_conf->mp_cnode_cnt) { switch(cnodes) { #ifdef HAVE_BGL @@ -256,21 +262,21 @@ extern List create_dynamic_block(List block_list, /* check only blocks that are free and small */ if (_breakup_blocks(block_list, new_blocks, request, my_block_list, - true, true) + cnodes, true, true) == SLURM_SUCCESS) goto finished; /* check only blocks that are free and any size */ if (_breakup_blocks(block_list, new_blocks, request, my_block_list, - true, false) + cnodes, true, false) == SLURM_SUCCESS) goto finished; /* check usable blocks that are small with any state */ if (_breakup_blocks(block_list, new_blocks, request, my_block_list, - false, true) + cnodes, false, true) == SLURM_SUCCESS) goto finished; @@ -282,7 +288,7 @@ extern List create_dynamic_block(List block_list, */ /* if (_breakup_blocks(block_list, new_blocks, */ /* request, my_block_list, */ - /* false, false) */ + /* cnodes, false, false) */ /* == SLURM_SUCCESS) */ /* goto finished; */ @@ -440,6 +446,11 @@ setup_records: } finished: + if (!new_blocks && orig_cnodes != cnodes) { + cnodes = orig_cnodes; + goto try_small_again; + } + if (request->avail_mp_bitmap && (bit_ffc(request->avail_mp_bitmap) == -1)) ba_reset_all_removed_mps(); @@ -453,12 +464,15 @@ finished: } list_iterator_destroy(itr); - xfree(request->save_name); - if (results) + if (results) { list_destroy(results); + results = NULL; + } + errno = rc; + return new_blocks; } @@ -768,7 +782,7 @@ finished: static int _breakup_blocks(List block_list, List new_blocks, select_ba_request_t *request, List my_block_list, - bool only_free, bool only_small) + int cnodes, bool only_free, bool only_small) { int rc = SLURM_ERROR; bg_record_t *bg_record = NULL; @@ -776,7 +790,6 @@ static int _breakup_blocks(List block_list, List new_blocks, int total_cnode_cnt=0; char start_char[SYSTEM_DIMENSIONS+1]; bitstr_t *ionodes = bit_alloc(bg_conf->ionodes_per_mp); - int cnodes = request->procs / bg_conf->cpu_ratio; int curr_mp_bit = -1; int dim; diff --git a/src/plugins/select/bluegene/bg_job_place.c b/src/plugins/select/bluegene/bg_job_place.c index 0e03200ca3da2788a4b83d1ae257089e26120a01..5654dcf25ce779680c81d8f1c7f7b41d22ef9fb4 100644 --- a/src/plugins/select/bluegene/bg_job_place.c +++ b/src/plugins/select/bluegene/bg_job_place.c @@ -1480,7 +1480,8 @@ static int _sync_block_lists(List full_list, List incomp_list) then we don't need to add either, (since it is already in the list). */ - if (!new_record->bg_block_id || new_record->original) + if ((new_record->magic != BLOCK_MAGIC) + || !new_record->bg_block_id || new_record->original) continue; list_remove(itr); if (bg_conf->slurm_debug_flags & DEBUG_FLAG_BG_PICK) diff --git a/src/plugins/select/bluegene/bg_node_info.c b/src/plugins/select/bluegene/bg_node_info.c index 0e0fe86d4feb4ec99547a522bb4262d1f234411b..ab3062634be8e5d4b19e428a1a5d284b8dfbf19c 100644 --- a/src/plugins/select/bluegene/bg_node_info.c +++ b/src/plugins/select/bluegene/bg_node_info.c @@ -289,7 +289,7 @@ extern int select_nodeinfo_free(select_nodeinfo_t *nodeinfo) return SLURM_SUCCESS; } -extern int select_nodeinfo_set_all(time_t last_query_time) +extern int select_nodeinfo_set_all(void) { ListIterator itr = NULL; struct node_record *node_ptr = NULL; diff --git a/src/plugins/select/bluegene/bg_node_info.h b/src/plugins/select/bluegene/bg_node_info.h index 8fdcd440a040693ad33a2449102cc1181970ccbe..7bc89d8223d006e5265e011b088b3cdab5365b7d 100644 --- a/src/plugins/select/bluegene/bg_node_info.h +++ b/src/plugins/select/bluegene/bg_node_info.h @@ -77,7 +77,7 @@ extern select_nodeinfo_t *select_nodeinfo_alloc(uint32_t size); extern int select_nodeinfo_free(select_nodeinfo_t *nodeinfo); -extern int select_nodeinfo_set_all(time_t last_query_time); +extern int select_nodeinfo_set_all(void); extern int select_nodeinfo_get(select_nodeinfo_t *nodeinfo, enum select_nodedata_type dinfo, diff --git a/src/plugins/select/bluegene/bg_record_functions.c b/src/plugins/select/bluegene/bg_record_functions.c index 6c540176dcb6853a6132fb06d704dc5a659e63d4..7d35a9bcbb3bbe2fbf3cf885f9a71928ef364e64 100644 --- a/src/plugins/select/bluegene/bg_record_functions.c +++ b/src/plugins/select/bluegene/bg_record_functions.c @@ -956,7 +956,8 @@ extern int down_nodecard(char *mp_name, bitoff_t io_start, List requests = NULL; List delete_list = NULL; ListIterator itr = NULL; - bg_record_t *bg_record = NULL, *found_record = NULL, tmp_record; + bg_record_t *bg_record = NULL, *found_record = NULL, + tmp_record, *error_bg_record = NULL; bg_record_t *smallest_bg_record = NULL; struct node_record *node_ptr = NULL; int mp_bit = 0; @@ -1068,16 +1069,18 @@ extern int down_nodecard(char *mp_name, bitoff_t io_start, smallest_bg_record = bg_record; } list_iterator_destroy(itr); - slurm_mutex_unlock(&block_state_mutex); - if (!slurmctld_locked) - unlock_slurmctld(job_write_lock); + + /* We cannot unlock block_state_mutex here until we are done + * with smallest_bg_record. + */ if (bg_conf->layout_mode != LAYOUT_DYNAMIC) { debug3("running non-dynamic mode"); /* This should never happen, but just in case... */ - if (delete_list) + if (delete_list) { list_destroy(delete_list); - + delete_list = NULL; + } /* If we found a block that is smaller or equal to a midplane we will just mark it in an error state as opposed to draining the node. @@ -1086,14 +1089,16 @@ extern int down_nodecard(char *mp_name, bitoff_t io_start, && (smallest_bg_record->cnode_cnt < bg_conf->mp_cnode_cnt)){ if (smallest_bg_record->state & BG_BLOCK_ERROR_FLAG) { rc = SLURM_NO_CHANGE_IN_DATA; + slurm_mutex_unlock(&block_state_mutex); goto cleanup; } - rc = put_block_in_error_state( - smallest_bg_record, reason); + slurm_mutex_unlock(&block_state_mutex); + error_bg_record = smallest_bg_record; goto cleanup; } + slurm_mutex_unlock(&block_state_mutex); debug("No block under 1 midplane available for this nodecard. " "Draining the whole node."); if (!node_already_down(mp_name)) { @@ -1113,27 +1118,22 @@ extern int down_nodecard(char *mp_name, bitoff_t io_start, if (delete_list) { int cnt_set = 0; bitstr_t *iobitmap = bit_alloc(bg_conf->ionodes_per_mp); - /* don't lock here since it is handled inside - the put_block_in_error_state - */ itr = list_iterator_create(delete_list); while ((bg_record = list_next(itr))) { debug2("combining smaller than nodecard " "dynamic block %s", bg_record->bg_block_id); - while ((bg_record->job_running > NO_JOB_RUNNING) - || (bg_record->job_list - && list_count(bg_record->job_list))) - sleep(1); - bit_or(iobitmap, bg_record->ionode_bitmap); cnt_set++; } list_iterator_destroy(itr); list_destroy(delete_list); + delete_list = NULL; + if (!cnt_set) { FREE_NULL_BITMAP(iobitmap); rc = SLURM_ERROR; + slurm_mutex_unlock(&block_state_mutex); goto cleanup; } /* set the start to be the same as the start of the @@ -1155,29 +1155,26 @@ extern int down_nodecard(char *mp_name, bitoff_t io_start, } else if (smallest_bg_record) { debug2("smallest dynamic block is %s", smallest_bg_record->bg_block_id); - if (smallest_bg_record->state & BG_BLOCK_ERROR_FLAG) { - rc = SLURM_NO_CHANGE_IN_DATA; - goto cleanup; - } - - while ((smallest_bg_record->job_running > NO_JOB_RUNNING) - || (smallest_bg_record->job_list - && list_count(smallest_bg_record->job_list))) - sleep(1); if (smallest_bg_record->cnode_cnt == create_size) { - rc = put_block_in_error_state( - smallest_bg_record, reason); + slurm_mutex_unlock(&block_state_mutex); + error_bg_record = smallest_bg_record; goto cleanup; } + /* If the block is bigger than the asked for error we + need to resume it to keep accounting correct. + */ + if (smallest_bg_record->state & BG_BLOCK_ERROR_FLAG) + resume_block(smallest_bg_record); + if (create_size > smallest_bg_record->cnode_cnt) { /* we should never get here. This means we * have a create_size that is bigger than a * block that is already made. */ - rc = put_block_in_error_state( - smallest_bg_record, reason); + slurm_mutex_unlock(&block_state_mutex); + error_bg_record = smallest_bg_record; goto cleanup; } debug3("node count is %d", smallest_bg_record->cnode_cnt); @@ -1202,9 +1199,10 @@ extern int down_nodecard(char *mp_name, bitoff_t io_start, if (create_size != bg_conf->nodecard_cnode_cnt) { blockreq.small128 = blockreq.small32 / 4; blockreq.small32 = 0; - io_start = 0; - } else if ((io_start = - bit_ffs(smallest_bg_record->ionode_bitmap)) == -1) + } + + if ((io_start = + bit_ffs(smallest_bg_record->ionode_bitmap)) == -1) /* set the start to be the same as the start of the ionode_bitmap. If no ionodes set (not a small block) set io_start = 0. */ @@ -1225,6 +1223,7 @@ extern int down_nodecard(char *mp_name, bitoff_t io_start, blockreq.small128 = 4; break; case 512: + slurm_mutex_unlock(&block_state_mutex); if (!node_already_down(mp_name)) { if (slurmctld_locked) drain_nodes(mp_name, reason, @@ -1248,7 +1247,6 @@ extern int down_nodecard(char *mp_name, bitoff_t io_start, smallest block that takes up the entire midplane. */ } - /* Here we need to add blocks that take up nodecards on this midplane. Since Slurm only keeps track of midplanes natively this is the only want to handle this case. @@ -1256,7 +1254,48 @@ extern int down_nodecard(char *mp_name, bitoff_t io_start, requests = list_create(destroy_bg_record); add_bg_record(requests, NULL, &blockreq, 1, io_start); - slurm_mutex_lock(&block_state_mutex); + if (bg_conf->sub_blocks + && (!smallest_bg_record + || smallest_bg_record->cnode_cnt == bg_conf->mp_cnode_cnt)) { + bg_record_t *rem_record = NULL; + memset(&blockreq, 0, sizeof(select_ba_request_t)); + blockreq.conn_type[0] = SELECT_SMALL; + blockreq.save_name = mp_name; + blockreq.small256 = 2; + add_bg_record(requests, NULL, &blockreq, 1, io_start); + + itr = list_iterator_create(requests); + while ((bg_record = list_next(itr))) { + if (bit_overlap(bg_record->ionode_bitmap, + tmp_record.ionode_bitmap)) { + if (bg_record->cnode_cnt == 256) { + print_bg_record(bg_record); + rem_record = bg_record; + list_remove(itr); + break; + } + } + } + if (!rem_record) { + /* this should never happen */ + error("down_nodecard: something bad happened " + "with creation of 256 block"); + } else { + list_iterator_reset(itr); + while ((bg_record = list_next(itr))) { + if (bg_record->cnode_cnt == 256) + continue; + if (!bit_overlap(bg_record->ionode_bitmap, + rem_record->ionode_bitmap)) { + print_bg_record(bg_record); + list_delete_item(itr); + } + } + destroy_bg_record(rem_record); + } + list_iterator_destroy(itr); + } + delete_list = list_create(NULL); while ((bg_record = list_pop(requests))) { itr = list_iterator_create(bg_lists->main); @@ -1287,29 +1326,38 @@ extern int down_nodecard(char *mp_name, bitoff_t io_start, tmp_record.ionode_bitmap)) { /* here we know the error block doesn't exist so just set the state here */ - slurm_mutex_unlock(&block_state_mutex); - rc = put_block_in_error_state(bg_record, reason); - slurm_mutex_lock(&block_state_mutex); + error_bg_record = bg_record; } } list_destroy(requests); + sort_bg_record_inc_size(bg_lists->main); + last_bg_update = time(NULL); + slurm_mutex_unlock(&block_state_mutex); + +cleanup: + if (!slurmctld_locked) + unlock_slurmctld(job_write_lock); + FREE_NULL_BITMAP(tmp_record.mp_bitmap); + FREE_NULL_BITMAP(tmp_record.ionode_bitmap); + if (error_bg_record) { + /* all locks must be released before going into + * put_block_in_error_state. + */ + if (slurmctld_locked) + unlock_slurmctld(job_write_lock); + rc = put_block_in_error_state(error_bg_record, reason); + if (slurmctld_locked) + lock_slurmctld(job_write_lock); + } if (delete_list) { bool delete_it = 0; if (bg_conf->layout_mode == LAYOUT_DYNAMIC) delete_it = 1; - slurm_mutex_unlock(&block_state_mutex); free_block_list(NO_VAL, delete_list, delete_it, 0); list_destroy(delete_list); + delete_list = NULL; } - slurm_mutex_lock(&block_state_mutex); - sort_bg_record_inc_size(bg_lists->main); - slurm_mutex_unlock(&block_state_mutex); - last_bg_update = time(NULL); - -cleanup: - FREE_NULL_BITMAP(tmp_record.mp_bitmap); - FREE_NULL_BITMAP(tmp_record.ionode_bitmap); return rc; @@ -1568,10 +1616,13 @@ extern int bg_reset_block(bg_record_t *bg_record, struct job_record *job_ptr) if (!list_count(bg_lists->job_running) && (num_unused_cpus != num_possible_unused_cpus)) { + /* This should never happen, but if it does reset the + num_unused_cpus and go on your way. + */ error("Hey we are here with no jobs and we have only " "%d usuable cpus. We should have %d!", num_unused_cpus, num_possible_unused_cpus); - xassert(0); + //xassert(0); num_unused_cpus = num_possible_unused_cpus; } diff --git a/src/plugins/select/bluegene/bl/Makefile.in b/src/plugins/select/bluegene/bl/Makefile.in index d87debefe264da7fcc19fc1a522c38d71545a91e..d4ff159f991d06a093c5427a22831ece3857f370 100644 --- a/src/plugins/select/bluegene/bl/Makefile.in +++ b/src/plugins/select/bluegene/bl/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -150,9 +149,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -160,9 +157,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -194,6 +190,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -221,6 +219,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -368,7 +367,7 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libbridge_linker.la: $(libbridge_linker_la_OBJECTS) $(libbridge_linker_la_DEPENDENCIES) +libbridge_linker.la: $(libbridge_linker_la_OBJECTS) $(libbridge_linker_la_DEPENDENCIES) $(EXTRA_libbridge_linker_la_DEPENDENCIES) $(libbridge_linker_la_LINK) $(libbridge_linker_la_OBJECTS) $(libbridge_linker_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -504,10 +503,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/bluegene/bl/bridge_linker.c b/src/plugins/select/bluegene/bl/bridge_linker.c index d4caf237986225dde7e7666d8d9a7d51647b3603..27c90400af8dd74b4ea9efa2340f6d1756ef2de9 100644 --- a/src/plugins/select/bluegene/bl/bridge_linker.c +++ b/src/plugins/select/bluegene/bl/bridge_linker.c @@ -1687,7 +1687,7 @@ extern int bridge_block_sync_users(bg_record_t *bg_record) #ifdef HAVE_BG_FILES char *user; rm_partition_t *block_ptr = NULL; - int rc, i, user_count; + int rc, i, user_count, found=0; char *user_name = NULL; /* We can't use bridge_get_block_info here because users are @@ -1753,18 +1753,19 @@ extern int bridge_block_sync_users(bg_record_t *bg_record) continue; } - if (!strcmp(user, bg_conf->slurm_user_name)) { - free(user); - continue; - } + /* It has been found on L the block owner is not + needed as a regular user so we are now removing + it. It is unknown if this is the case for P but we + 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)) { */ + /* free(user); */ + /* continue; */ + /* } */ if (user_name && !strcmp(user, user_name)) { - returnc = REMOVE_USER_FOUND; - if ((rc = bridge_block_add_user(bg_record, user)) - != SLURM_SUCCESS) { - debug("couldn't add user %s to block %s", - user, bg_record->bg_block_id); - } + found=1; free(user); continue; } @@ -1779,6 +1780,17 @@ extern int bridge_block_sync_users(bg_record_t *bg_record) } free(user); } + + // no users currently, or we didn't find outselves in the lookup + if (!found && user_name) { + returnc = REMOVE_USER_FOUND; + if ((rc = bridge_block_add_user(bg_record, user_name)) + != SLURM_SUCCESS) { + debug("couldn't add user %s to block %s", + user, bg_record->bg_block_id); + } + } + if ((rc = bridge_free_block(block_ptr)) != SLURM_SUCCESS) { error("bridge_free_block(): %s", bg_err_str(rc)); } diff --git a/src/plugins/select/bluegene/bl_bgq/Makefile.in b/src/plugins/select/bluegene/bl_bgq/Makefile.in index 00c108867cc2d32c9ab941f3e55f1c76be87e667..30e9f2bd95762c160c89269123fc603905e4ead6 100644 --- a/src/plugins/select/bluegene/bl_bgq/Makefile.in +++ b/src/plugins/select/bluegene/bl_bgq/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -159,9 +158,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -169,9 +166,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -203,6 +199,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -230,6 +228,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -374,7 +373,7 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libbridge_linker.la: $(libbridge_linker_la_OBJECTS) $(libbridge_linker_la_DEPENDENCIES) +libbridge_linker.la: $(libbridge_linker_la_OBJECTS) $(libbridge_linker_la_DEPENDENCIES) $(EXTRA_libbridge_linker_la_DEPENDENCIES) $(libbridge_linker_la_LINK) $(libbridge_linker_la_OBJECTS) $(libbridge_linker_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -510,10 +509,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/bluegene/bl_bgq/bridge_linker.cc b/src/plugins/select/bluegene/bl_bgq/bridge_linker.cc index 2def294598519f86f779c9abdf4feea30f0cf47c..a41261a55c800eeb247ecc7433c4f5323c8669d6 100644 --- a/src/plugins/select/bluegene/bl_bgq/bridge_linker.cc +++ b/src/plugins/select/bluegene/bl_bgq/bridge_linker.cc @@ -67,6 +67,23 @@ static bool initialized = false; #ifdef HAVE_BG_FILES + +// For future code +// +// static int _check_version( +// const unsigned major, const unsigned minor, const unsigned micro) +// { +// if ((version::major > major) +// || (version::major == major +// && version::minor > minor) +// || (version::major == major +// && version::minor == minor +// && version::mod >= micro)) +// return true; + +// return false; +// } + /* ba_system_mutex needs to be locked before coming here */ static void _setup_ba_mp(int level, uint16_t *coords, ComputeHardware::ConstPtr bgqsys) @@ -309,6 +326,7 @@ static int _block_wait_for_jobs(char *bg_block_id, struct job_record *job_ptr) static void _remove_jobs_on_block_and_reset(char *block_id, struct job_record *job_ptr) { + char *mp_str = NULL; bg_record_t *bg_record = NULL; int job_remove_failed = 0; slurmctld_lock_t job_read_lock = @@ -335,11 +353,7 @@ static void _remove_jobs_on_block_and_reset(char *block_id, if (bg_record) { if (job_remove_failed) { if (bg_record->mp_str) - slurm_drain_nodes( - bg_record->mp_str, - (char *) - "_term_agent: Couldn't remove job", - slurm_get_slurm_user_id()); + mp_str = xstrdup(bg_record->mp_str); else error("Block %s doesn't have a node list.", block_id); @@ -355,6 +369,15 @@ static void _remove_jobs_on_block_and_reset(char *block_id, slurm_mutex_unlock(&block_state_mutex); if (job_ptr) unlock_slurmctld(job_read_lock); + + /* avoid locking issues just do this afterwards. */ + if (mp_str) { + slurm_drain_nodes(mp_str, + (char *)"_term_agent: Couldn't remove job", + slurm_get_slurm_user_id()); + xfree(mp_str); + } + } extern int bridge_init(char *properties_file) @@ -688,6 +711,7 @@ extern int bridge_block_boot(bg_record_t *bg_record) return SLURM_ERROR; #ifdef HAVE_BG_FILES + char *function_name; /* Lets see if we are connected to the IO. */ try { uint32_t avail, unavail; @@ -715,34 +739,62 @@ extern int bridge_block_boot(bg_record_t *bg_record) } try { - std::vector mp_vec; - if (!Block::isIOConnected(bg_record->bg_block_id, &mp_vec)) { + std::vector res_vec; +#ifdef HAVE_BG_NEW_IO_CHECK + std::vector unconn_ionode_vec; + + function_name = (char *)"Block::checkIO"; + Block::checkIO(bg_record->bg_block_id, + &unconn_ionode_vec, + &res_vec); + if (!res_vec.empty()) { error("Block %s is not IOConnected, " + "contact your admin. Midplanes not " + "connected ...", bg_record->bg_block_id); + slurm_mutex_lock(&ba_system_mutex); + BOOST_FOREACH(const std::string& res, res_vec) { + ba_mp_t *ba_mp = loc2ba_mp(res.c_str()); + if (ba_mp) + error("%s(%s)", + res.c_str(), ba_mp->coord_str); + else + error("%s", res.c_str()); + } + slurm_mutex_unlock(&ba_system_mutex); + return BG_ERROR_NO_IOBLOCK_CONNECTED; + } +#else + function_name = (char *)"Block::isIOConnected"; + if (!Block::isIOConnected( + bg_record->bg_block_id, &res_vec)) { + error("Using old method, " + "block %s is not IOConnected, " "contact your admin. Hardware not " "connected ...", bg_record->bg_block_id); - BOOST_FOREACH(const std::string& mp, mp_vec) { - error("%s", mp.c_str()); + BOOST_FOREACH(const std::string& res, res_vec) { + error("%s", res.c_str()); } return BG_ERROR_NO_IOBLOCK_CONNECTED; } +#endif } catch (const bgsched::DatabaseException& err) { - rc = bridge_handle_database_errors("Block::isIOConnected", + rc = bridge_handle_database_errors(function_name, err.getError().toValue()); if (rc != SLURM_SUCCESS) return rc; } catch (const bgsched::InputException& err) { - rc = bridge_handle_input_errors("Block::isIOConnected", + rc = bridge_handle_input_errors(function_name, err.getError().toValue(), bg_record); if (rc != SLURM_SUCCESS) return rc; } catch (const bgsched::InternalException& err) { - rc = bridge_handle_internal_errors("Block::isIOConnected", + rc = bridge_handle_internal_errors(function_name, err.getError().toValue()); if (rc != SLURM_SUCCESS) return rc; } catch (...) { - error("isIOConnected request failed ... continuing."); + error("%s request failed ... continuing.", function_name); rc = SLURM_ERROR; } diff --git a/src/plugins/select/bluegene/bl_bgq/bridge_status.cc b/src/plugins/select/bluegene/bl_bgq/bridge_status.cc index 9da55412963e1ecf43cf2f6e1f6013a2651d80c5..999287e2a064f20d2035c1da5f907d45b84d1c9b 100644 --- a/src/plugins/select/bluegene/bl_bgq/bridge_status.cc +++ b/src/plugins/select/bluegene/bl_bgq/bridge_status.cc @@ -910,13 +910,13 @@ void event_handler::handleRealtimeStartedRealtimeEvent( if (!rt_running) { uint16_t coords[SYSTEM_DIMENSIONS]; slurm_mutex_lock(&rt_mutex); - info("RealTime server started backup!"); - rt_running = 1; + info("RealTime server started back up!"); /* To make sure we don't have any missing state */ if (blocks_are_created) _do_block_poll(); /* only do every 30 seconds */ _do_hardware_poll(0, coords, bridge_get_compute_hardware()); + rt_running = 1; } } diff --git a/src/plugins/select/bluegene/configure_api.c b/src/plugins/select/bluegene/configure_api.c index 83e3590e36d48336d86ec415408ebaefebf48772..22a94b78d8ce85e12cfb19bfe5a49b87e1c0dbfb 100644 --- a/src/plugins/select/bluegene/configure_api.c +++ b/src/plugins/select/bluegene/configure_api.c @@ -65,142 +65,59 @@ typedef struct { void (*set_ba_debug_flags) (uint32_t debug_flags); } bg_configure_api_ops_t; -typedef struct bg_configure_context { - char *type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int bg_configure_errno; - bg_configure_api_ops_t ops; -} bg_configure_context_t; - -static bg_configure_context_t *bg_configure_context = NULL; -static pthread_mutex_t bg_configure_context_lock = - PTHREAD_MUTEX_INITIALIZER; - -static bg_configure_api_ops_t *_get_ops(bg_configure_context_t *c) -{ - /* - * Must be synchronized with bg_configure_api_ops_t above. - */ - static const char *syms[] = { - "ba_init", - "ba_fini", - "ba_setup_wires", - "reset_ba_system", - "destroy_ba_mp", - "ba_passthroughs_string", - "ba_update_mp_state", - "ba_set_removable_mps", - "ba_reset_all_removed_mps", - "new_ba_request", - "allocate_block", - "remove_block", - "str2ba_mp", - "loc2ba_mp", - "coord2ba_mp", - "give_geo", - "config_make_tbl", - "set_ba_debug_flags", - }; - int n_syms = sizeof(syms) / sizeof(char *); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->type, n_syms, syms, - (void **) &c->ops); - if (c->cur_plugin != PLUGIN_INVALID_HANDLE) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->type); - - /* Get plugin list. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "cannot create plugin manager" ); - return NULL; - } - plugrack_set_major_type(c->plugin_list, "select"); - plugrack_set_paranoia(c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir(c->plugin_list, plugin_dir); - xfree(plugin_dir); - } - - c->cur_plugin = plugrack_use_by_type(c->plugin_list, c->type); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "cannot find accounting_storage plugin for %s", - c->type ); - return NULL; - } - - /* Dereference the API. */ - if ( plugin_get_syms(c->cur_plugin, - n_syms, - syms, - (void **) &c->ops ) < n_syms) { - error("incomplete select plugin detected"); - return NULL; - } - - return &c->ops; -} - /* - * Destroy a node selection context + * Must be synchronized with bg_configure_api_ops_t above. */ -static int _context_destroy(bg_configure_context_t *c) -{ - int rc = SLURM_SUCCESS; - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if (c->plugin_list) { - if (plugrack_destroy(c->plugin_list) != SLURM_SUCCESS) - rc = SLURM_ERROR; - } else { - plugin_unload(c->cur_plugin); - } - - xfree(c->type); - - return rc; -} - +static const char *syms[] = { + "ba_init", + "ba_fini", + "ba_setup_wires", + "reset_ba_system", + "destroy_ba_mp", + "ba_passthroughs_string", + "ba_update_mp_state", + "ba_set_removable_mps", + "ba_reset_all_removed_mps", + "new_ba_request", + "allocate_block", + "remove_block", + "str2ba_mp", + "loc2ba_mp", + "coord2ba_mp", + "give_geo", + "config_make_tbl", + "set_ba_debug_flags", +}; + +static bg_configure_api_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; extern int bg_configure_init(void) { int rc = SLURM_SUCCESS; - slurm_mutex_lock(&bg_configure_context_lock); + char *plugin_type = "select", *type="select/bluegene"; + if (init_run && g_context) + return rc; + + slurm_mutex_lock(&g_context_lock); - if (bg_configure_context) + if (g_context) goto done; - bg_configure_context = xmalloc(sizeof(bg_configure_context_t)); - bg_configure_context->type = xstrdup("select/bluegene"); - bg_configure_context->cur_plugin = PLUGIN_INVALID_HANDLE; - bg_configure_context->bg_configure_errno = SLURM_SUCCESS; + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); - if (!_get_ops(bg_configure_context)) { - error("cannot resolve select plugin operations for configure"); - _context_destroy(bg_configure_context); - bg_configure_context = NULL; + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); rc = SLURM_ERROR; + goto done; } + init_run = true; done: - slurm_mutex_unlock(&bg_configure_context_lock); + slurm_mutex_unlock(&g_context_lock); return rc; } @@ -209,14 +126,15 @@ extern int bg_configure_fini(void) { int rc = SLURM_SUCCESS; - slurm_mutex_lock(&bg_configure_context_lock); - if (!bg_configure_context) + slurm_mutex_lock(&g_context_lock); + if (!g_context) goto fini; - rc = _context_destroy(bg_configure_context); - bg_configure_context = NULL; + init_run = false; + rc = plugin_context_destroy(g_context); + g_context = NULL; fini: - slurm_mutex_unlock(&bg_configure_context_lock); + slurm_mutex_unlock(&g_context_lock); return rc; } @@ -226,7 +144,7 @@ extern void bg_configure_ba_init( if (bg_configure_init() < 0) return; - (*(bg_configure_context->ops.ba_init))(node_info_ptr, load_bridge); + (*(ops.ba_init))(node_info_ptr, load_bridge); } extern void bg_configure_ba_fini(void) @@ -234,7 +152,7 @@ extern void bg_configure_ba_fini(void) if (bg_configure_init() < 0) return; - (*(bg_configure_context->ops.ba_fini))(); + (*(ops.ba_fini))(); } extern void bg_configure_ba_setup_wires(void) @@ -242,7 +160,7 @@ extern void bg_configure_ba_setup_wires(void) if (bg_configure_init() < 0) return; - (*(bg_configure_context->ops.ba_setup_wires))(); + (*(ops.ba_setup_wires))(); } extern void bg_configure_reset_ba_system(bool track_down_mps) @@ -250,7 +168,7 @@ extern void bg_configure_reset_ba_system(bool track_down_mps) if (bg_configure_init() < 0) return; - (*(bg_configure_context->ops.reset_ba_system))(track_down_mps); + (*(ops.reset_ba_system))(track_down_mps); } extern void bg_configure_destroy_ba_mp(void *ptr) @@ -258,7 +176,7 @@ extern void bg_configure_destroy_ba_mp(void *ptr) if (bg_configure_init() < 0) return; - (*(bg_configure_context->ops.destroy_ba_mp))(ptr); + (*(ops.destroy_ba_mp))(ptr); } extern char *bg_configure_ba_passthroughs_string(uint16_t passthrough) @@ -266,7 +184,7 @@ extern char *bg_configure_ba_passthroughs_string(uint16_t passthrough) if (bg_configure_init() < 0) return NULL; - return (*(bg_configure_context->ops.ba_passthroughs_string)) + return (*(ops.ba_passthroughs_string)) (passthrough); } @@ -275,7 +193,7 @@ extern void bg_configure_ba_update_mp_state(ba_mp_t *ba_mp, uint16_t state) if (bg_configure_init() < 0) return; - (*(bg_configure_context->ops.ba_update_mp_state))(ba_mp, state); + (*(ops.ba_update_mp_state))(ba_mp, state); } extern int bg_configure_ba_set_removable_mps(bitstr_t *bitmap, bool except) @@ -283,7 +201,7 @@ extern int bg_configure_ba_set_removable_mps(bitstr_t *bitmap, bool except) if (bg_configure_init() < 0) return SLURM_ERROR; - return (*(bg_configure_context->ops.ba_set_removable_mps)) + return (*(ops.ba_set_removable_mps)) (bitmap, except); } @@ -292,7 +210,7 @@ extern int bg_configure_ba_reset_all_removed_mps(void) if (bg_configure_init() < 0) return SLURM_ERROR; - return (*(bg_configure_context->ops.ba_reset_all_removed_mps))(); + return (*(ops.ba_reset_all_removed_mps))(); } @@ -301,7 +219,7 @@ extern int bg_configure_new_ba_request(select_ba_request_t* ba_request) if (bg_configure_init() < 0) return SLURM_ERROR; - return (*(bg_configure_context->ops.new_ba_request))(ba_request); + return (*(ops.new_ba_request))(ba_request); } extern int bg_configure_allocate_block( @@ -310,7 +228,7 @@ extern int bg_configure_allocate_block( if (bg_configure_init() < 0) return SLURM_ERROR; - return (*(bg_configure_context->ops.allocate_block)) + return (*(ops.allocate_block)) (ba_request, results); } @@ -319,7 +237,7 @@ extern int bg_configure_remove_block(List mps, bool is_small) if (bg_configure_init() < 0) return SLURM_ERROR; - return (*(bg_configure_context->ops.remove_block))(mps, is_small); + return (*(ops.remove_block))(mps, is_small); } extern ba_mp_t *bg_configure_str2ba_mp(const char *coords) @@ -327,7 +245,7 @@ extern ba_mp_t *bg_configure_str2ba_mp(const char *coords) if (bg_configure_init() < 0) return NULL; - return (*(bg_configure_context->ops.str2ba_mp))(coords); + return (*(ops.str2ba_mp))(coords); } extern ba_mp_t *bg_configure_loc2ba_mp(const char *mp_id) @@ -335,7 +253,7 @@ extern ba_mp_t *bg_configure_loc2ba_mp(const char *mp_id) if (bg_configure_init() < 0) return NULL; - return (*(bg_configure_context->ops.loc2ba_mp))(mp_id); + return (*(ops.loc2ba_mp))(mp_id); } extern ba_mp_t *bg_configure_coord2ba_mp(const uint16_t *coord) @@ -343,7 +261,7 @@ extern ba_mp_t *bg_configure_coord2ba_mp(const uint16_t *coord) if (bg_configure_init() < 0) return NULL; - return (*(bg_configure_context->ops.coord2ba_mp))(coord); + return (*(ops.coord2ba_mp))(coord); } extern char *bg_configure_give_geo(uint16_t *int_geo, int dims, bool with_sep) @@ -351,7 +269,7 @@ extern char *bg_configure_give_geo(uint16_t *int_geo, int dims, bool with_sep) if (bg_configure_init() < 0) return NULL; - return (*(bg_configure_context->ops.give_geo))(int_geo, dims, with_sep); + return (*(ops.give_geo))(int_geo, dims, with_sep); } extern s_p_hashtbl_t *bg_configure_config_make_tbl(char *filename) @@ -359,7 +277,7 @@ extern s_p_hashtbl_t *bg_configure_config_make_tbl(char *filename) if (bg_configure_init() < 0) return NULL; - return (*(bg_configure_context->ops.config_make_tbl))(filename); + return (*(ops.config_make_tbl))(filename); } extern void ba_configure_set_ba_debug_flags(uint32_t debug_flags) @@ -367,5 +285,5 @@ extern void ba_configure_set_ba_debug_flags(uint32_t debug_flags) if (bg_configure_init() < 0) return; - (*(bg_configure_context->ops.set_ba_debug_flags))(debug_flags); + (*(ops.set_ba_debug_flags))(debug_flags); } diff --git a/src/plugins/select/bluegene/runjob_plugin.cc b/src/plugins/select/bluegene/runjob_plugin.cc index 91103965ee9a7a454a0b882376afd77ff50f4690..995efb4e931b7fc1ee21a99026db085c21a6abdb 100644 --- a/src/plugins/select/bluegene/runjob_plugin.cc +++ b/src/plugins/select/bluegene/runjob_plugin.cc @@ -48,6 +48,7 @@ extern "C" { #include "src/common/xmalloc.h" #include "src/common/list.h" #include "src/common/hostlist.h" +#include "src/common/slurm_protocol_defs.h" #include } @@ -103,7 +104,6 @@ typedef struct { static List runjob_list = NULL; static pthread_mutex_t runjob_list_lock = PTHREAD_MUTEX_INITIALIZER; - static void _destroy_runjob_job(void *object) { runjob_job_t *runjob_job = (runjob_job_t *)object; @@ -114,6 +114,22 @@ static void _destroy_runjob_job(void *object) } } +static void _send_failed_cnodes(uint32_t job_id, uint32_t step_id, uint16_t sig) +{ + int rc; + + while ((rc = slurm_kill_job_step(job_id, step_id, sig))) { + rc = slurm_get_errno(); + + if (rc == ESLURM_ALREADY_DONE || rc == ESLURM_INVALID_JOB_ID) + break; + std::cerr << "Trying to fail cnodes, message from slurmctld: " + << slurm_strerror(rc) << std::endl; + sleep (5); + } +} + + Plugin::Plugin() : bgsched::runjob::Plugin(), _mutex() @@ -249,7 +265,8 @@ void Plugin::execute(bgsched::runjob::Verify& verify) + " block=" + boost::lexical_cast(block_cnode_cnt); goto deny_job; - } else if (step_cnode_cnt < block_cnode_cnt) { + } else if ((step_cnode_cnt < block_cnode_cnt) + && (step_cnode_cnt <= 512)) { uint16_t dim; uint16_t tmp_uint16[HIGHEST_DIMENSIONS]; @@ -366,6 +383,7 @@ void Plugin::execute(const bgsched::runjob::Terminated& data) { ListIterator itr = NULL; runjob_job_t *runjob_job = NULL; + uint16_t sig = 0; boost::lock_guard lock( _mutex ); // std::cout << "runjob " << data.pid() << " shadowing job " @@ -396,6 +414,10 @@ void Plugin::execute(const bgsched::runjob::Terminated& data) } else if (data.kill_timeout()) { std::cerr << runjob_job->job_id << "." << runjob_job->step_id << " had a kill_timeout()" << std::endl; + /* In an older driver this wasn't always caught, so + send it. + */ + sig = SIG_NODE_FAIL; } else if (!nodes.empty()) { char tmp_char[6]; @@ -418,7 +440,12 @@ void Plugin::execute(const bgsched::runjob::Terminated& data) << " had a message of '" << data.message() << "'. (" << runjob_job->total_cnodes << ")" << std::endl; - } + } // else if (data.status() == 9) + // sig = SIGKILL; + + if (sig) + _send_failed_cnodes( + runjob_job->job_id, runjob_job->step_id, sig); _destroy_runjob_job(runjob_job); } diff --git a/src/plugins/select/bluegene/select_bluegene.c b/src/plugins/select/bluegene/select_bluegene.c index 04abf102124ec8c3fedcf78b5ff846e1efacdf49..86b121fb5ac16172f7fa48a4e3dc8380c34193e7 100644 --- a/src/plugins/select/bluegene/select_bluegene.c +++ b/src/plugins/select/bluegene/select_bluegene.c @@ -42,7 +42,7 @@ #include "bg_read_config.h" #include "bg_defined_block.h" -#ifdef HAVE_BGQ +#ifndef HAVE_BG_L_P # include "ba_bgq/block_allocator.h" #else # include "ba/block_allocator.h" @@ -1917,7 +1917,32 @@ extern bitstr_t *select_p_step_pick_nodes(struct job_record *job_ptr, "assigned to it, but for some reason we are " "trying to start a step on it?", job_ptr->job_id); - + else if (bg_record->magic != BLOCK_MAGIC) { + bg_record = find_bg_record_in_list( + bg_lists->main, jobinfo->bg_block_id); + if (!bg_record || (bg_record->magic != BLOCK_MAGIC)) { + int rc; + error("select_p_step_pick_nodes: " + "Whoa, some how we got a bad block for job %u, " + "it should be %s but we couldn't find " + "it on the system, no step for you, " + "and ending job.", + job_ptr->job_id, jobinfo->bg_block_id); + slurm_mutex_unlock(&block_state_mutex); + if ((rc = job_requeue(0, job_ptr->job_id, + -1, (uint16_t)NO_VAL, false))) { + error("Couldn't requeue job %u, failing it: %s", + job_ptr->job_id, slurm_strerror(rc)); + job_fail(job_ptr->job_id); + } + return NULL; + } + error("select_p_step_pick_nodes: Whoa, some how we got a " + "bad block for job %u, it should be %s " + "(we found it so no big deal, but strange)", + job_ptr->job_id, jobinfo->bg_block_id); + jobinfo->bg_record = bg_record; + } xassert(!step_jobinfo->units_used); xfree(step_jobinfo->bg_block_id); @@ -1926,8 +1951,10 @@ extern bitstr_t *select_p_step_pick_nodes(struct job_record *job_ptr, if (((cluster_flags & CLUSTER_FLAG_BGL) || (cluster_flags & CLUSTER_FLAG_BGP)) - || (node_count == bg_record->cnode_cnt)) { - /* If we are using the whole block we need to verify + || ((node_count == bg_record->cnode_cnt) + || (node_count > bg_conf->mp_cnode_cnt))) { + /* If we are using the whole block (or more than 1 + midplane of it) we need to verify if anything else is used. If anything else is used return NULL, else return that we can use the entire thing. @@ -1938,7 +1965,8 @@ extern bitstr_t *select_p_step_pick_nodes(struct job_record *job_ptr, if (list_count(job_ptr->step_list)) { if (bg_conf->slurm_debug_flags & DEBUG_FLAG_BG_PICK) info("select_p_step_pick_nodes: Looking " - "for the entire block %s for job %u, " + "for more than one midplane of " + "block %s for job %u, " "but some of it is used.", bg_record->bg_block_id, job_ptr->job_id); goto end_it; @@ -1946,31 +1974,49 @@ extern bitstr_t *select_p_step_pick_nodes(struct job_record *job_ptr, if (!(picked_mps = bit_copy(job_ptr->node_bitmap))) fatal("bit_copy malloc failure"); - if (cluster_flags & CLUSTER_FLAG_BGQ - && (bg_record->mp_count == 1)) { + if (cluster_flags & CLUSTER_FLAG_BGQ) { bitstr_t *used_bitmap; + if (node_count > bg_conf->mp_cnode_cnt) { + /* Here we have to make sure nothing + else is able to run on this block + since we are using more than 1 + midplane but potentially not the + entire allocation. + */ + FREE_NULL_BITMAP(jobinfo->units_avail); + FREE_NULL_BITMAP(jobinfo->units_used); + jobinfo->units_avail = + ba_create_ba_mp_cnode_bitmap(bg_record); + jobinfo->units_used = + bit_copy(jobinfo->units_avail); + } if (jobinfo->units_avail) used_bitmap = jobinfo->units_used; else { - xassert((ba_mp = list_peek( - bg_record->ba_mp_list))); + ba_mp = list_peek(bg_record->ba_mp_list); + xassert(ba_mp); if (!ba_mp->cnode_bitmap) ba_mp->cnode_bitmap = ba_create_ba_mp_cnode_bitmap( bg_record); used_bitmap = ba_mp->cnode_bitmap; } + /* units_used and units_avail will be the + same, the exact opposite of used_bitmap. + */ step_jobinfo->units_used = bit_copy(used_bitmap); - step_jobinfo->units_avail = bit_copy(used_bitmap); bit_not(step_jobinfo->units_used); + step_jobinfo->units_avail = + bit_copy(step_jobinfo->units_used); bit_or(used_bitmap, step_jobinfo->units_used); } step_jobinfo->ionode_str = xstrdup(jobinfo->ionode_str); } else if (jobinfo->units_avail) { bitstr_t *total_bitmap = jobinfo->units_used; - xassert((ba_mp = list_peek(bg_record->ba_mp_list))); + ba_mp = list_peek(bg_record->ba_mp_list); + xassert(ba_mp); if (ba_mp->cnode_err_bitmap) { total_bitmap = bit_copy(jobinfo->units_used); bit_or(total_bitmap, ba_mp->cnode_err_bitmap); @@ -2061,7 +2107,7 @@ end_it: extern int select_p_step_finish(struct step_record *step_ptr) { bg_record_t *bg_record = NULL; - select_jobinfo_t *jobinfo = NULL; + select_jobinfo_t *jobinfo = NULL, *step_jobinfo = NULL; int rc = SLURM_SUCCESS; char *tmp_char = NULL; @@ -2076,10 +2122,18 @@ extern int select_p_step_finish(struct step_record *step_ptr) } jobinfo = step_ptr->job_ptr->select_jobinfo->data; + step_jobinfo = step_ptr->select_jobinfo->data; - if (jobinfo->units_avail) + if (step_jobinfo->cnode_cnt > bg_conf->mp_cnode_cnt) { + /* This means we were using units_avail and units_used + as midplanes not cnodes for either the whole job + allocation or a portion of it. + */ + FREE_NULL_BITMAP(jobinfo->units_avail); + FREE_NULL_BITMAP(jobinfo->units_used); + } else if (jobinfo->units_avail) rc = ba_sub_block_in_bitmap_clear( - step_ptr->select_jobinfo->data, jobinfo->units_used); + step_jobinfo, jobinfo->units_used); else { slurm_mutex_lock(&block_state_mutex); bg_record = jobinfo->bg_record; @@ -2089,6 +2143,26 @@ extern int select_p_step_finish(struct step_record *step_ptr) "assigned to it, but for some reason we are " "trying to end the step?", step_ptr->job_ptr->job_id, step_ptr->step_id); + else if (bg_record->magic != BLOCK_MAGIC) { + bg_record = find_bg_record_in_list( + bg_lists->main, jobinfo->bg_block_id); + if (!bg_record || (bg_record->magic != BLOCK_MAGIC)) { + error("select_p_step_finish: " + "Whoa, some how we got a bad block " + "for job %u, it should be %s but " + "we couldn't find it on the system, " + "so no real need to clear it up.", + step_ptr->job_ptr->job_id, + jobinfo->bg_block_id); + slurm_mutex_unlock(&block_state_mutex); + return SLURM_ERROR; + } + error("select_p_step_finish: Whoa, some how we " + "got a bad block for job %u, it should be %s " + "(we found it so no big deal, but strange)", + step_ptr->job_ptr->job_id, jobinfo->bg_block_id); + jobinfo->bg_record = bg_record; + } rc = ba_sub_block_in_record_clear(bg_record, step_ptr); slurm_mutex_unlock(&block_state_mutex); } @@ -2195,12 +2269,12 @@ extern int select_p_select_nodeinfo_free(select_nodeinfo_t *nodeinfo) return select_nodeinfo_free(nodeinfo); } -extern int select_p_select_nodeinfo_set_all(time_t last_query_time) +extern int select_p_select_nodeinfo_set_all(void) { if (bg_recover != NOT_FROM_CONTROLLER) bridge_status_init(); - return select_nodeinfo_set_all(last_query_time); + return select_nodeinfo_set_all(); } extern int select_p_select_nodeinfo_set(struct job_record *job_ptr) @@ -2478,14 +2552,15 @@ extern int select_p_update_block(update_block_msg_t *block_desc_ptr) info("Pending job %u on block %s " "will try to be requeued " "because overlapping block %s " - "is in an error state.", + "is being removed.", found_record->job_running, found_record->bg_block_id, bg_record->bg_block_id); else - info("Failing job %u on block %s " + info("Running job %u on block %s " + "will try to be requeued " "because overlapping block %s " - "is in an error state.", + "is being removed.", found_record->job_running, found_record->bg_block_id, bg_record->bg_block_id); @@ -2498,7 +2573,7 @@ extern int select_p_update_block(update_block_msg_t *block_desc_ptr) struct job_record *job_ptr = NULL; ListIterator job_itr = list_iterator_create( found_record->job_list); - while ((job_ptr = list_next(itr))) { + while ((job_ptr = list_next(job_itr))) { if (job_ptr->magic != JOB_MAGIC) { error("select_p_update_block: " "bad magic found when " @@ -2512,18 +2587,17 @@ extern int select_p_update_block(update_block_msg_t *block_desc_ptr) info("Pending job %u on " "block %s " "will try to be requeued " - "because overlapping " - "block %s " + "because related block %s " "is in an error state.", job_ptr->job_id, found_record->bg_block_id, bg_record->bg_block_id); else - info("Failing job %u on " + info("Running job %u on " "block %s " - "because overlapping " - "block %s " - "is in an error state.", + "will try to be requeued " + "because related block %s " + "is being removed.", job_ptr->job_id, found_record->bg_block_id, bg_record->bg_block_id); @@ -2779,6 +2853,120 @@ end_it: #endif } +/* While the realtime server should get all the cnode state changes on + * older versions of the IBM driver if a job has a timeout it doesn't + * always happen. So what happens is the runjob_mux will now send a + * nice cancel to the slurmctld to make sure it gets marked. + */ +extern int select_p_fail_cnode(struct step_record *step_ptr) +{ +#if defined HAVE_BG && !defined HAVE_BG_L_P + bg_record_t *bg_record; + select_nodeinfo_t *nodeinfo; + select_jobinfo_t *jobinfo; + select_jobinfo_t *step_jobinfo; + struct node_record *node_ptr = NULL; + ListIterator itr, itr2; + ba_mp_t *ba_mp = NULL, *found_ba_mp; + int i; + + xassert(step_ptr); + + jobinfo = step_ptr->job_ptr->select_jobinfo->data; + step_jobinfo = step_ptr->select_jobinfo->data; + + /* block_state must be locked before ba_system */ + slurm_mutex_lock(&block_state_mutex); + slurm_mutex_lock(&ba_system_mutex); + for (i=0; istep_node_bitmap); i++) { + if (!bit_test(step_ptr->step_node_bitmap, i)) + continue; + ba_mp = ba_inx2ba_mp(i); + xassert(ba_mp); + + if (!ba_mp->cnode_err_bitmap) + ba_mp->cnode_err_bitmap = + bit_alloc(bg_conf->mp_cnode_cnt); + + if (jobinfo->units_avail) { + bit_or(ba_mp->cnode_err_bitmap, + step_jobinfo->units_used); + } else { + bit_nset(ba_mp->cnode_err_bitmap, 0, + bit_size(ba_mp->cnode_err_bitmap)-1); + } + node_ptr = &(node_record_table_ptr[ba_mp->index]); + xassert(node_ptr->select_nodeinfo); + nodeinfo = (select_nodeinfo_t *)node_ptr->select_nodeinfo->data; + xassert(nodeinfo); + xfree(nodeinfo->failed_cnodes); + nodeinfo->failed_cnodes = ba_node_map_ranged_hostlist( + ba_mp->cnode_err_bitmap, ba_mp_geo_system); + } + + if (!ba_mp) { + error("select_p_fail_cnode: no ba_mp? " + "This should never happen"); + slurm_mutex_unlock(&ba_system_mutex); + slurm_mutex_unlock(&block_state_mutex); + return SLURM_ERROR; + } + + itr = list_iterator_create(bg_lists->main); + while ((bg_record = (bg_record_t *)list_next(itr))) { + if (!bit_overlap(step_ptr->step_node_bitmap, + bg_record->mp_bitmap)) + continue; + itr2 = list_iterator_create(bg_record->ba_mp_list); + while ((found_ba_mp = (ba_mp_t *)list_next(itr2))) { + float err_ratio; + + if (!found_ba_mp->used + || !bit_test(step_ptr->step_node_bitmap, + found_ba_mp->index)) + continue; + + /* perhaps this block isn't involved in this + error */ + if (jobinfo->units_avail + && found_ba_mp->cnode_usable_bitmap + && bit_overlap(found_ba_mp->cnode_usable_bitmap, + ba_mp->cnode_err_bitmap)) + continue; + + if (!found_ba_mp->cnode_err_bitmap) + found_ba_mp->cnode_err_bitmap = + bit_alloc(bg_conf->mp_cnode_cnt); + + bit_or(found_ba_mp->cnode_err_bitmap, + ba_mp->cnode_err_bitmap); + bg_record->cnode_err_cnt = + bit_set_count(found_ba_mp->cnode_err_bitmap); + + + err_ratio = (float)bg_record->cnode_err_cnt + / (float)bg_record->cnode_cnt; + bg_record->err_ratio = err_ratio * 100; + + /* handle really small ratios */ + if (!bg_record->err_ratio && bg_record->cnode_err_cnt) + bg_record->err_ratio = 1; + + debug("select_p_fail_cnode: " + "count in error for %s is %u with ratio at %u", + bg_record->bg_block_id, + bg_record->cnode_err_cnt, + bg_record->err_ratio); + } + list_iterator_destroy(itr2); + } + list_iterator_destroy(itr); + slurm_mutex_unlock(&ba_system_mutex); + slurm_mutex_unlock(&block_state_mutex); +#endif + return SLURM_SUCCESS; +} + extern int select_p_get_info_from_plugin (enum select_plugindata_info dinfo, struct job_record *job_ptr, void *data) @@ -2920,6 +3108,14 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data) if (job_desc->min_nodes == (uint32_t) NO_VAL) return SLURM_SUCCESS; + else if ((job_desc->min_nodes == 1) + && (job_desc->min_cpus != NO_VAL)) { + job_desc->min_nodes = job_desc->min_cpus; + if (job_desc->ntasks_per_node + && job_desc->ntasks_per_node != NO_VAL) + job_desc->min_nodes /= + job_desc->ntasks_per_node; + } get_select_jobinfo(job_desc->select_jobinfo->data, SELECT_JOBDATA_GEOMETRY, &req_geometry); @@ -3132,7 +3328,8 @@ extern int select_p_reconfigure(void) #endif } -extern bitstr_t *select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, bitstr_t **core_bitmap) +extern bitstr_t *select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, + bitstr_t **core_bitmap) { #ifdef HAVE_BG /* Reserve a block of appropriate geometry by issuing a fake job diff --git a/src/plugins/select/bluegene/sfree/Makefile.in b/src/plugins/select/bluegene/sfree/Makefile.in index bba7ce19da5834deb26a69155ff876008c9a3efd..9f8350870e452f4f2afd1ca42df4bd1efeb1d536 100644 --- a/src/plugins/select/bluegene/sfree/Makefile.in +++ b/src/plugins/select/bluegene/sfree/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -153,9 +152,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -163,9 +160,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -197,6 +193,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -224,6 +222,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -397,7 +396,7 @@ clean-sbinPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sfree$(EXEEXT): $(sfree_OBJECTS) $(sfree_DEPENDENCIES) +sfree$(EXEEXT): $(sfree_OBJECTS) $(sfree_DEPENDENCIES) $(EXTRA_sfree_DEPENDENCIES) @rm -f sfree$(EXEEXT) $(sfree_LINK) $(sfree_OBJECTS) $(sfree_LDADD) $(LIBS) @@ -536,10 +535,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/cons_res/Makefile.in b/src/plugins/select/cons_res/Makefile.in index 69fe19af65a4588b730baac20aff46f353cc8b2c..4d44b71d3911675c0a1067fd15a3735eed0b30f8 100644 --- a/src/plugins/select/cons_res/Makefile.in +++ b/src/plugins/select/cons_res/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) select_cons_res_la_LIBADD = @@ -172,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -409,7 +414,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -select_cons_res.la: $(select_cons_res_la_OBJECTS) $(select_cons_res_la_DEPENDENCIES) +select_cons_res.la: $(select_cons_res_la_OBJECTS) $(select_cons_res_la_DEPENDENCIES) $(EXTRA_select_cons_res_la_DEPENDENCIES) $(select_cons_res_la_LINK) -rpath $(pkglibdir) $(select_cons_res_la_OBJECTS) $(select_cons_res_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -548,10 +553,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/cons_res/dist_tasks.c b/src/plugins/select/cons_res/dist_tasks.c index 0c6e8358e7eb967b7e5a0fd470af20e7dc440a0a..3ae3af650d7017d6d30729b6b366f9c81f9f3acf 100644 --- a/src/plugins/select/cons_res/dist_tasks.c +++ b/src/plugins/select/cons_res/dist_tasks.c @@ -5,6 +5,8 @@ * Copyright (C) 2006-2008 Hewlett-Packard Development Company, L.P. * Written by Susanne M. Balle, * CODE-OCEC-09-009. All rights reserved. + * Portions copyright (C) 2012 Bull + * Written by Martin Perry * * This file is part of SLURM, a resource management program. * For details, see . @@ -48,6 +50,68 @@ #define ALLOCATE_FULL_SOCKET 1 #endif +/* Max boards supported for best-fit across boards */ +/* Larger board configurations may require new algorithm */ +/* for acceptable performance */ +#define MAX_BOARDS 8 + +/* Combination counts + * comb_counts[n-1][k-1] = number of combinations of + * k items from a set of n items + * + * Formula is n!/k!(n-k)! + */ +uint32_t comb_counts[MAX_BOARDS][MAX_BOARDS] = + {{1,0,0,0,0,0,0,0}, + {2,1,0,0,0,0,0,0}, + {3,3,1,0,0,0,0,0}, + {4,6,4,1,0,0,0,0}, + {5,10,10,5,1,0,0,0}, + {6,15,20,15,6,1,0,0}, + {7,21,35,35,21,7,1,0}, + {8,28,56,70,56,28,8,1}}; + +/* Generate all combinations of k integers from the + * set of integers 0 to n-1. + * Return combinations in comb_list. + * + * Example: For k = 2 and n = 4, there are six + * combinations: + * {0,1},{0,2},{0,3},{1,2},{1,3},{2,3} + * + */ +void _gen_combs(int *comb_list, int n, int k) +{ + int *comb = xmalloc(k * sizeof(int)); + + /* Setup comb for the initial combination */ + int i, b; + for (i = 0; i < k; ++i) + comb[i] = i; + b = 0; + + /* Generate all the other combinations */ + while (1) { + for (i=0; i < k; i++) { + comb_list[b+i] = comb[i]; + } + b+=k; + i = k - 1; + ++comb[i]; + while ((i >= 0) && (comb[i] >= n - k + 1 + i)) { + --i; + ++comb[i]; + } + + if (comb[0] > n - k) + break; /* No more combinations */ + + for (i = i + 1; i < k; ++i) + comb[i] = comb[i - 1] + 1; + } + xfree(comb); +} + /* _compute_task_c_b_task_dist - compute the number of tasks on each * of the node for the cyclic and block distribution. We need to do * this in the case of consumable resources so that we have an exact @@ -95,7 +159,6 @@ static int _compute_c_b_task_dist(struct job_record *job_ptr) "setting to 1"); maxtasks = 1; } - if (job_ptr->details->cpus_per_task == 0) job_ptr->details->cpus_per_task = 1; for (tid = 0, i = job_ptr->details->cpus_per_task ; (tid < maxtasks); @@ -194,7 +257,16 @@ static int _compute_plane_dist(struct job_record *job_ptr) } /* sync up core bitmap with new CPU count using a best-fit approach - * on the available sockets + * on the available resources on each node + * + * "Best-fit" means: + * 1st priority: Use smallest number of boards with sufficient + * available CPUs + * 2nd priority: Use smallest number of sockets with sufficient + * available CPUs + * 3rd priority: Use board combination with the smallest number + * of available CPUs + * 4th priority: Use higher-numbered boards/sockets/cores first * * The CPU array contains the distribution of CPUs, which can include * virtual CPUs (hyperthreads) @@ -202,20 +274,53 @@ static int _compute_plane_dist(struct job_record *job_ptr) static void _block_sync_core_bitmap(struct job_record *job_ptr, const uint16_t cr_type) { - uint32_t c, s, i, j, n, size, csize, core_cnt; + uint32_t c, s, i, j, n, b, z, size, csize, core_cnt; uint16_t cpus, num_bits, vpus = 1; job_resources_t *job_res = job_ptr->job_resrcs; bool alloc_cores = false, alloc_sockets = false; uint16_t ntasks_per_core = 0xffff; + 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* sockets_cpu_cnt; + int* board_combs; + int* socket_list; + int* elig_brd_combs; + int* elig_cpu_cnt; bool* sockets_used; + uint16_t boards_nb; + uint16_t nboards_nb; uint16_t sockets_nb; uint16_t ncores_nb; uint16_t nsockets_nb; + uint16_t sock_per_brd; + uint16_t sock_per_comb; uint16_t req_cpus,best_fit_cpus = 0; uint32_t best_fit_location = 0; + uint64_t ncomb_brd; bool sufficient,best_fit_sufficient; + /* qsort compare function for ascending int list */ + int _cmp_int_ascend (const void *a, const void *b) + { + return (*(int*)a - *(int*)b); + } + + /* qsort compare function for descending int list */ + int _cmp_int_descend (const void *a, const void *b) + { + return (*(int*)b - *(int*)a); + } + + /* qsort compare function for board combination socket + * list */ + int _cmp_sock (const void *a, const void *b) + { + return (sockets_cpu_cnt[*(int*)b] - + sockets_cpu_cnt[*(int*)a]); + } + if (!job_res) return; @@ -246,6 +351,9 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr, sockets_nb = select_node_record[0].sockets; sockets_cpu_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)); for (c = 0, i = 0, n = 0; n < size; n++) { @@ -255,33 +363,163 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr, core_cnt = 0; ncores_nb = select_node_record[n].cores; nsockets_nb = select_node_record[n].sockets; + nboards_nb = select_node_record[n].boards; num_bits = nsockets_nb * ncores_nb; if ((c + num_bits) > csize) - fatal ("cons_res: _block_sync_core_bitmap index error"); + fatal("cons_res: _block_sync_core_bitmap index error"); cpus = job_res->cpus[i]; vpus = MIN(select_node_record[n].vpus, ntasks_per_core); + if (nboards_nb > MAX_BOARDS) { + debug3("cons_res: node[%u]: exceeds max boards; " + "doing best-fit across sockets only", n); + nboards_nb = 1; + } + if ( nsockets_nb > sockets_nb) { sockets_nb = nsockets_nb; xrealloc(sockets_cpu_cnt, sockets_nb * sizeof(int)); xrealloc(sockets_used,sockets_nb * sizeof(bool)); } - /* count cores provided by each socket */ + 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)); + } + + /* 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; + } for (s = 0; s < nsockets_nb; s++) { sockets_cpu_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) ) + if ( bit_test(job_res->core_bitmap,j) ) { sockets_cpu_cnt[s]++; + boards_cpu_cnt[b]++; + sort_brds_cpu_cnt[b]++; + } + } + } + + /* Sort boards in descending order of available core count */ + qsort(sort_brds_cpu_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 >= cpus) + break; + } + b_min = b+1; + sock_per_comb = b_min * sock_per_brd; + + /* Allocate space for list of board combinations */ + ncomb_brd = comb_counts[nboards_nb-1][b_min-1]; + board_combs = xmalloc(ncomb_brd * b_min * sizeof(int)); + /* Generate all combinations of b_min boards on the node */ + _gen_combs(board_combs, nboards_nb, b_min); + + /* Determine which combinations have enough available cores + * for the allocation (eligible board combinations) + */ + elig_brd_combs = xmalloc(ncomb_brd * sizeof(int)); + elig_cpu_cnt = xmalloc(ncomb_brd * sizeof(int)); + elig = 0; + for (comb_idx = 0; comb_idx < ncomb_brd; comb_idx++) { + count = 0; + for (comb_brd_idx = 0; comb_brd_idx < b_min; + comb_brd_idx++) { + board_num = board_combs[(comb_idx * b_min) + + comb_brd_idx]; + count += boards_cpu_cnt[board_num]; + } + if (count >= cpus) { + elig_brd_combs[elig] = comb_idx; + elig_cpu_cnt[elig] = count; + elig++; } } - /* select cores in the sockets using a best-fit approach */ + /* Allocate space for list of sockets for each eligible board + * combination */ + socket_list = xmalloc(elig * sock_per_comb * sizeof(int)); + + /* Generate sorted list of sockets for each eligible board + * combination, and find combination with minimum number + * of sockets and minimum number of cpus required for the + * allocation + */ + s_min = sock_per_comb; + comb_min = 0; + cpu_min = sock_per_comb * ncores_nb; + for (elig_idx = 0; elig_idx < elig; elig_idx++) { + comb_idx = elig_brd_combs[elig_idx]; + for (comb_brd_idx = 0; comb_brd_idx < b_min; + comb_brd_idx++) { + board_num = board_combs[(comb_idx * b_min) + + comb_brd_idx]; + sock_list_idx = (elig_idx * sock_per_comb) + + (comb_brd_idx * sock_per_brd); + for (sock_idx = 0; sock_idx < sock_per_brd; + sock_idx++) { + socket_list[sock_list_idx + sock_idx] + = (board_num * sock_per_brd) + + sock_idx; + } + } + /* Sort this socket list in descending order of + * available core count */ + qsort(&socket_list[elig_idx*sock_per_comb], + sock_per_comb, sizeof (int), _cmp_sock); + /* Determine minimum number of sockets required for + * the allocation from this socket list */ + count = 0; + 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 >= cpus) + break; + } + b++; + /* Use board combination with minimum number + * of required sockets and minimum number of CPUs + */ + if ((b < s_min) || + (b == s_min && elig_cpu_cnt[elig_idx] + <= cpu_min)) { + s_min = b; + comb_min = elig_idx; + cpu_min = elig_cpu_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 cpus: %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, + sizeof (int), _cmp_int_ascend); + + xfree(board_combs); + xfree(elig_brd_combs); + xfree(elig_cpu_cnt); + + /* select cores from the sockets of the best-fit board + * combination using a best-fit approach */ while( cpus > 0 ) { best_fit_cpus = 0; @@ -295,7 +533,8 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr, /* search for the best socket, */ /* starting from the last one to let more room */ /* in the first one for system usage */ - for ( s = nsockets_nb - 1 ; (int) s >= (int) 0 ; s-- ) { + for ( z = sock_per_comb-1; (int) z >= (int) 0; z-- ) { + s = socket_list[(comb_min*sock_per_comb)+z]; sufficient = sockets_cpu_cnt[s] >= req_cpus ; if ( (best_fit_cpus == 0) || (sufficient && !best_fit_sufficient ) || @@ -313,9 +552,10 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr, if ( best_fit_cpus == 0 ) break; - debug3("dist_task: best_fit : using node[%u]:" - "socket[%u] : %u cores available", - n, best_fit_location, + debug3("cons_res: best_fit: using node[%u]: " + "board[%u]: socket[%u]: %u cores available", + n, best_fit_location/sock_per_brd, + best_fit_location, sockets_cpu_cnt[best_fit_location]); /* select socket cores from last to first */ @@ -373,6 +613,7 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr, } + xfree(socket_list); if (cpus > 0) { /* cpu count should NEVER be greater than the number * of set bits in the core bitmap for a given node */ @@ -392,17 +633,18 @@ 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(sockets_used); } - /* Sync up the core_bitmap with the CPU array using cyclic distribution * * The CPU array contains the distribution of CPUs, which can include * virtual CPUs (hyperthreads) */ -static void _cyclic_sync_core_bitmap(struct job_record *job_ptr, +static int _cyclic_sync_core_bitmap(struct job_record *job_ptr, const uint16_t cr_type) { uint32_t c, i, j, s, n, *sock_start, *sock_end, size, csize, core_cnt; @@ -411,9 +653,10 @@ static void _cyclic_sync_core_bitmap(struct job_record *job_ptr, bitstr_t *core_map; bool *sock_used, alloc_cores = false, alloc_sockets = false; uint16_t ntasks_per_core = 0xffff; + int error_code = SLURM_SUCCESS; if ((job_res == NULL) || (job_res->core_bitmap == NULL)) - return; + return error_code; if (cr_type & CR_CORE) alloc_cores = true; @@ -499,13 +742,12 @@ static void _cyclic_sync_core_bitmap(struct job_record *job_ptr, } if (prev_cpus == cpus) { /* we're stuck! */ - job_ptr->priority = 0; - job_ptr->state_reason = WAIT_HELD; - _dump_job_res(job_res); - _dump_nodes(); - - info("cons_res: sync loop not progressing"); - return -1; + job_ptr->priority = 0; + job_ptr->state_reason = WAIT_HELD; + error("cons_res: sync loop not progressing, " + "holding job %u", job_ptr->job_id); + error_code = SLURM_ERROR; + goto fini; } } /* clear the rest of the cores in each socket @@ -534,9 +776,10 @@ static void _cyclic_sync_core_bitmap(struct job_record *job_ptr, /* advance 'c' to the beginning of the next node */ c += sockets * cps; } - xfree(sock_start); +fini: xfree(sock_start); xfree(sock_end); xfree(sock_used); + return error_code; } @@ -642,11 +885,11 @@ extern int cr_dist(struct job_record *job_ptr, const uint16_t cr_type) case SLURM_DIST_BLOCK_CYCLIC: case SLURM_DIST_CYCLIC_CYCLIC: case SLURM_DIST_UNKNOWN: - _cyclic_sync_core_bitmap(job_ptr, cr_type); + error_code = _cyclic_sync_core_bitmap(job_ptr, cr_type); break; default: error("select/cons_res: invalid task_dist entry"); return SLURM_ERROR; } - return SLURM_SUCCESS; + return error_code; } diff --git a/src/plugins/select/cons_res/job_test.c b/src/plugins/select/cons_res/job_test.c index e930c2efe927cdd17625ab6fd9c91b51dd23f554..3b2d2a168d8bd9e1806d2a7c7b1535aff2f5e8bd 100644 --- a/src/plugins/select/cons_res/job_test.c +++ b/src/plugins/select/cons_res/job_test.c @@ -383,7 +383,7 @@ fini: uint16_t _allocate_cores(struct job_record *job_ptr, bitstr_t *core_map, const uint32_t node_i, bool cpu_type) { - uint16_t cpu_count = 0, avail_cpus = 0, num_tasks = 0; + uint16_t avail_cpus = 0, num_tasks = 0; uint32_t core_begin = cr_get_coremap_offset(node_i); uint32_t core_end = cr_get_coremap_offset(node_i+1); uint32_t c; @@ -522,8 +522,6 @@ uint16_t _allocate_cores(struct job_record *job_ptr, bitstr_t *core_map, } else { j = avail_cpus / cpus_per_task; num_tasks = MIN(num_tasks, j); - if (job_ptr->details->ntasks_per_node) - avail_cpus = num_tasks * cpus_per_task; } if ((job_ptr->details->ntasks_per_node && @@ -545,21 +543,10 @@ uint16_t _allocate_cores(struct job_record *job_ptr, bitstr_t *core_map, bit_clear(core_map, c); else { free_cores[i]--; - /* we have to ensure that cpu_count - * is not bigger than avail_cpus due to - * hyperthreading or this would break - * the selection logic providing more - * cpus than allowed after task-related data - * processing of stage 3 - */ - if (avail_cpus >= threads_per_core) { + if (avail_cpus >= threads_per_core) avail_cpus -= threads_per_core; - cpu_count += threads_per_core; - } - else { - cpu_count += avail_cpus; + else avail_cpus = 0; - } } } @@ -570,10 +557,9 @@ uint16_t _allocate_cores(struct job_record *job_ptr, bitstr_t *core_map, fini: if (!num_tasks) { bit_nclear(core_map, core_begin, core_end-1); - cpu_count = 0; } xfree(free_cores); - return cpu_count; + return num_tasks * cpus_per_task; } @@ -1877,16 +1863,16 @@ static uint16_t *_select_nodes(struct job_record *job_ptr, uint32_t min_nodes, int rc; uint16_t *cpu_cnt, *cpus = NULL; uint32_t start, n, a; - //char str[100]; + //char str[100]; bitstr_t *req_map = job_ptr->details->req_node_bitmap; if (bit_set_count(node_map) < min_nodes) return NULL; - //bit_fmt(str, (sizeof(str) - 1), node_map); - //info("ALEJ: _select_nodes nodemap: %s", str); - //bit_fmt(str, (sizeof(str) - 1), core_map); - //info("ALEJ: _select_nodes coremap: %s", str); + //bit_fmt(str, (sizeof(str) - 1), node_map); + //info("ALEJ: _select_nodes nodemap: %s", str); + //bit_fmt(str, (sizeof(str) - 1), core_map); + //info("ALEJ: _select_nodes coremap: %s", str); /* get resource usage for this job from each available node */ _get_res_usage(job_ptr, node_map, core_map, cr_node_cnt, @@ -1913,6 +1899,9 @@ static uint16_t *_select_nodes(struct job_record *job_ptr, uint32_t min_nodes, //bit_fmt(str, (sizeof(str) - 1), node_map); //info("ALEJ: _select_nodes nodemap: %s", str); + //bit_fmt(str, (sizeof(str) - 1), node_map); + //info("ALEJ: _select_nodes nodemap: %s", str); + /* choose the best nodes for the job */ rc = _choose_nodes(job_ptr, node_map, min_nodes, max_nodes, req_nodes, cr_node_cnt, cpu_cnt); @@ -1964,7 +1953,8 @@ extern int cr_job_test(struct job_record *job_ptr, bitstr_t *bitmap, uint16_t cr_type, enum node_cr_state job_node_req, uint32_t cr_node_cnt, struct part_res_record *cr_part_ptr, - struct node_use_record *node_usage, bitstr_t *exc_core_bitmap) + struct node_use_record *node_usage, + bitstr_t *exc_core_bitmap) { int error_code = SLURM_SUCCESS, ll; /* ll = layout array index */ uint16_t *layout_ptr = NULL; @@ -2104,16 +2094,16 @@ extern int cr_job_test(struct job_record *job_ptr, bitstr_t *bitmap, bit_copybits(bitmap, orig_map); bit_copybits(free_cores, avail_cores); - if(exc_core_bitmap){ - char str[100]; - - bit_fmt(str, (sizeof(str) - 1), exc_core_bitmap); - debug2("excluding cores reserved: %s", str); + if (exc_core_bitmap) { + char str[100]; - bit_not(exc_core_bitmap); - bit_and(free_cores, exc_core_bitmap); - bit_not(exc_core_bitmap); - } + bit_fmt(str, (sizeof(str) - 1), exc_core_bitmap); + debug2("excluding cores reserved: %s", str); + + bit_not(exc_core_bitmap); + bit_and(free_cores, exc_core_bitmap); + bit_not(exc_core_bitmap); + } /* remove all existing allocations from free_cores */ tmpcore = bit_copy(free_cores); @@ -2162,11 +2152,11 @@ extern int cr_job_test(struct job_record *job_ptr, bitstr_t *bitmap, bit_copybits(bitmap, orig_map); bit_copybits(free_cores, avail_cores); - if(exc_core_bitmap){ - bit_not(exc_core_bitmap); - bit_and(free_cores, exc_core_bitmap); - bit_not(exc_core_bitmap); - } + if (exc_core_bitmap) { + bit_not(exc_core_bitmap); + bit_and(free_cores, exc_core_bitmap); + bit_not(exc_core_bitmap); + } for (jp_ptr = cr_part_ptr; jp_ptr; jp_ptr = jp_ptr->next) { if (jp_ptr->part_ptr == job_ptr->part_ptr) diff --git a/src/plugins/select/cons_res/select_cons_res.c b/src/plugins/select/cons_res/select_cons_res.c index 07b35069fd5e998f5b7b07ed3904ee62bfcb7ec9..f956be7ee92843eeff8191765d20daf6bfe1946f 100644 --- a/src/plugins/select/cons_res/select_cons_res.c +++ b/src/plugins/select/cons_res/select_cons_res.c @@ -207,7 +207,8 @@ static int _rm_job_from_res(struct part_res_record *part_record_ptr, static int _run_now(struct job_record *job_ptr, bitstr_t *bitmap, uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, uint16_t job_node_req, - List preemptee_candidates, List *preemptee_job_list, bitstr_t *exc_core_bitmap); + List preemptee_candidates, List *preemptee_job_list, + bitstr_t *exc_core_bitmap); static int _sort_usable_nodes_dec(struct job_record *job_a, struct job_record *job_b); static int _test_only(struct job_record *job_ptr, bitstr_t *bitmap, @@ -216,7 +217,8 @@ static int _test_only(struct job_record *job_ptr, bitstr_t *bitmap, static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, uint16_t job_node_req, - List preemptee_candidates, List *preemptee_job_list, bitstr_t *exc_core_bitmap); + List preemptee_candidates, List *preemptee_job_list, + bitstr_t *exc_core_bitmap); static void _dump_job_res(struct job_resources *job) { char str[64]; @@ -1520,7 +1522,8 @@ static int _sort_usable_nodes_dec(struct job_record *job_a, static int _run_now(struct job_record *job_ptr, bitstr_t *bitmap, uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, uint16_t job_node_req, - List preemptee_candidates, List *preemptee_job_list, bitstr_t *exc_core_bitmap) + List preemptee_candidates, List *preemptee_job_list, + bitstr_t *exc_core_bitmap) { int rc; bitstr_t *orig_map = NULL, *save_bitmap; @@ -1580,7 +1583,8 @@ top: orig_map = bit_copy(save_bitmap); SELECT_MODE_WILL_RUN, cr_type, job_node_req, select_node_cnt, - future_part, future_usage, exc_core_bitmap); + future_part, future_usage, + exc_core_bitmap); tmp_job_ptr->details->usable_nodes = 0; /* * If successful, set the last job's usable count to a @@ -1666,7 +1670,8 @@ top: orig_map = bit_copy(save_bitmap); static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, uint16_t job_node_req, - List preemptee_candidates, List *preemptee_job_list, bitstr_t *exc_core_bitmap) + List preemptee_candidates, List *preemptee_job_list, + bitstr_t *exc_core_bitmap) { struct part_res_record *future_part; struct node_use_record *future_usage; @@ -1769,7 +1774,8 @@ static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, max_nodes, req_nodes, SELECT_MODE_WILL_RUN, cr_type, job_node_req, select_node_cnt, - future_part, future_usage, exc_core_bitmap); + future_part, future_usage, + exc_core_bitmap); if (rc == SLURM_SUCCESS) { if (tmp_job_ptr->end_time <= now) job_ptr->start_time = now + 1; @@ -1927,6 +1933,7 @@ extern int select_p_node_init(struct node_record *node_ptr, int node_cnt) struct config_record *config_ptr; config_ptr = node_ptr[i].config_ptr; select_node_record[i].cpus = config_ptr->cpus; + select_node_record[i].boards = config_ptr->boards; select_node_record[i].sockets = config_ptr->sockets; select_node_record[i].cores = config_ptr->cores; select_node_record[i].vpus = config_ptr->threads; @@ -1934,6 +1941,7 @@ extern int select_p_node_init(struct node_record *node_ptr, int node_cnt) real_memory; } else { select_node_record[i].cpus = node_ptr[i].cpus; + select_node_record[i].boards = node_ptr[i].boards; select_node_record[i].sockets = node_ptr[i].sockets; select_node_record[i].cores = node_ptr[i].cores; select_node_record[i].vpus = node_ptr[i].threads; @@ -1993,7 +2001,8 @@ extern int select_p_job_test(struct job_record *job_ptr, bitstr_t * bitmap, uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, uint16_t mode, List preemptee_candidates, - List *preemptee_job_list, bitstr_t *exc_core_bitmap) + List *preemptee_job_list, + bitstr_t *exc_core_bitmap) { int rc = EINVAL; uint16_t job_node_req; @@ -2001,7 +2010,7 @@ extern int select_p_job_test(struct job_record *job_ptr, bitstr_t * bitmap, xassert(bitmap); - debug2("select_p_job_test for job %u", job_ptr->job_id); + debug2("select_p_job_test for job %u", job_ptr->job_id); if (!debug_check) { debug_check = true; if (slurm_get_debug_flags() & DEBUG_FLAG_CPU_BIND) @@ -2026,14 +2035,16 @@ extern int select_p_job_test(struct job_record *job_ptr, bitstr_t * bitmap, if (mode == SELECT_MODE_WILL_RUN) { rc = _will_run_test(job_ptr, bitmap, min_nodes, max_nodes, req_nodes, job_node_req, - preemptee_candidates, preemptee_job_list, exc_core_bitmap); + preemptee_candidates, preemptee_job_list, + exc_core_bitmap); } else if (mode == SELECT_MODE_TEST_ONLY) { rc = _test_only(job_ptr, bitmap, min_nodes, max_nodes, req_nodes, job_node_req); } else if (mode == SELECT_MODE_RUN_NOW) { rc = _run_now(job_ptr, bitmap, min_nodes, max_nodes, req_nodes, job_node_req, - preemptee_candidates, preemptee_job_list, exc_core_bitmap); + preemptee_candidates, preemptee_job_list, + exc_core_bitmap); } else fatal("select_p_job_test: Mode %d is invalid", mode); @@ -2214,7 +2225,7 @@ extern select_nodeinfo_t *select_p_select_nodeinfo_alloc(void) extern int select_p_select_nodeinfo_free(select_nodeinfo_t *nodeinfo) { - if(nodeinfo) { + if (nodeinfo) { if (nodeinfo->magic != NODEINFO_MAGIC) { error("select_p_select_nodeinfo_free: " "nodeinfo magic bad"); @@ -2237,8 +2248,8 @@ extern int select_p_select_nodeinfo_set_all(void) select_nodeinfo_t *nodeinfo = NULL; /* only set this once when the last_node_update is newer than - the last time we set things up. */ - if(last_set_all && (last_node_update < last_set_all)) { + * the last time we set things up. */ + if (last_set_all && (last_node_update < last_set_all)) { debug2("Node select info for set all hasn't " "changed since %ld", (long)last_set_all); @@ -2432,6 +2443,11 @@ extern int select_p_update_sub_node (update_part_msg_t *part_desc_ptr) return SLURM_SUCCESS; } +extern int select_p_fail_cnode(struct step_record *step_ptr) +{ + return SLURM_SUCCESS; +} + extern int select_p_get_info_from_plugin(enum select_plugindata_info info, struct job_record *job_ptr, void *data) @@ -2524,117 +2540,116 @@ extern int select_p_reconfigure(void) /* DUPLICATE CODE: see job_test.c */ /* Adding a filter for setting cores based on avail bitmap */ bitstr_t *_make_core_bitmap_filtered(bitstr_t *node_map, int filter) -{ - uint32_t n, c, nodes, size; - uint32_t coff; - - nodes = bit_size(node_map); - size = cr_get_coremap_offset(nodes); - bitstr_t *core_map = bit_alloc(size); - if (!core_map) - return NULL; - - if(!filter) - return core_map; - - nodes = bit_size(node_map); - for (n = 0, c = 0; n < nodes; n++) { - if (bit_test(node_map, n)) { - coff = cr_get_coremap_offset(n+1); - while (c < coff) { - bit_set(core_map, c++); - } - } - } - return core_map; -} +{ + uint32_t n, c, nodes, size; + uint32_t coff; + + nodes = bit_size(node_map); + size = cr_get_coremap_offset(nodes); + bitstr_t *core_map = bit_alloc(size); + if (!core_map) + return NULL; + + if (!filter) + return core_map; + + nodes = bit_size(node_map); + for (n = 0, c = 0; n < nodes; n++) { + if (bit_test(node_map, n)) { + coff = cr_get_coremap_offset(n+1); + while (c < coff) { + bit_set(core_map, c++); + } + } + } + return core_map; +} -/* Once here, avail_bitmap has nodes not used by any job o reservation */ -bitstr_t *sequential_pick(bitstr_t *avail_bitmap, uint32_t node_cnt, uint32_t core_cnt, bitstr_t **core_bitmap) +/* Once here, avail_bitmap has nodes not used by any job or reservation */ +bitstr_t *sequential_pick(bitstr_t *avail_bitmap, uint32_t node_cnt, + uint32_t core_cnt, bitstr_t **core_bitmap) { - bitstr_t *sp_avail_bitmap; + bitstr_t *sp_avail_bitmap; char str[100]; + /* Just allowing symetric requests today */ + uint32_t cores_per_node = core_cnt / MAX(node_cnt, 1); - uint32_t cores_per_node = core_cnt / node_cnt; /* Just allowing symetric requests */ + debug2("reserving %d cores per node in %d nodes", + cores_per_node, node_cnt); - debug2("reserving %d cores per node in %d nodes", cores_per_node, node_cnt); - - sp_avail_bitmap = bit_alloc(bit_size(avail_bitmap)); - if(sp_avail_bitmap == NULL){ + sp_avail_bitmap = bit_alloc(bit_size(avail_bitmap)); + if (sp_avail_bitmap == NULL) { fatal ("memory allocation failure"); - } + } - bit_fmt(str, (sizeof(str) - 1), avail_bitmap); + bit_fmt(str, (sizeof(str) - 1), avail_bitmap); + bit_fmt(str, (sizeof(str) - 1), sp_avail_bitmap); - bit_fmt(str, (sizeof(str) - 1), sp_avail_bitmap); + if (core_cnt) { /* Reservation is using partial nodes */ + *core_bitmap = _make_core_bitmap_filtered(avail_bitmap, 0); - if(core_cnt){ /* Reservation is using partial nodes */ - - *core_bitmap = _make_core_bitmap_filtered(avail_bitmap, 0); + while (core_cnt) { + uint32_t inx, coff; + int i; - while(core_cnt){ - uint32_t inx, coff; - int i; + inx = bit_ffs(avail_bitmap); + if (inx < 0) + break; - inx = bit_ffs(avail_bitmap); - if(inx < 0) - break; - - coff = cr_get_coremap_offset(inx); + coff = cr_get_coremap_offset(inx); - for(i = 0; i < cores_per_node; i++){ /* TODO: checking cores_per_nodes is lower than real cores per node */ - bit_set(*core_bitmap, coff++); - core_cnt--; - } - - /* Add this node to the final node bitmap */ - bit_set(sp_avail_bitmap, inx); + for (i = 0; i < cores_per_node; i++) { + /* TODO: checking cores_per_nodes is lower + * than real cores per node */ + bit_set(*core_bitmap, coff++); + core_cnt--; + } - /* Clear this node from the initial available bitmap */ - bit_clear(avail_bitmap, inx); - } + /* Add this node to the final node bitmap */ + bit_set(sp_avail_bitmap, inx); - bit_fmt(str, (sizeof(str) - 1), *core_bitmap); - - if(core_cnt){ - info("reservation request can not be satisfied"); - FREE_NULL_BITMAP(sp_avail_bitmap); - return NULL; - } + /* Clear this node from the initial available bitmap */ + bit_clear(avail_bitmap, inx); + } - } - else{ /* Reservation is using full nodes */ + bit_fmt(str, (sizeof(str) - 1), *core_bitmap); - while(node_cnt){ + if (core_cnt) { + info("reservation request can not be satisfied"); + FREE_NULL_BITMAP(sp_avail_bitmap); + return NULL; + } - uint32_t inx; - int i; + } else { /* Reservation is using full nodes */ - inx = bit_ffs(avail_bitmap); - if(inx < 0) - break; + while (node_cnt) { + uint32_t inx; + + inx = bit_ffs(avail_bitmap); + if (inx < 0) + break; - /* Add this node to the final node bitmap */ - bit_set(sp_avail_bitmap, inx); - node_cnt--; + /* Add this node to the final node bitmap */ + bit_set(sp_avail_bitmap, inx); + node_cnt--; - /* Clear this node from the initial available bitmap */ - bit_clear(avail_bitmap, inx); - } + /* Clear this node from the initial available bitmap */ + bit_clear(avail_bitmap, inx); + } - if(node_cnt){ - info("reservation request can not be satisfied"); - FREE_NULL_BITMAP(sp_avail_bitmap); - return NULL; - } + if (node_cnt) { + info("reservation request can not be satisfied"); + FREE_NULL_BITMAP(sp_avail_bitmap); + return NULL; + } - } + } - //bit_fmt(str, (sizeof(str) - 1), sp_avail_bitmap); - //info("sequential pick using nodemap: %s", str); + //bit_fmt(str, (sizeof(str) - 1), sp_avail_bitmap); + //info("sequential pick using nodemap: %s", str); - return sp_avail_bitmap; + return sp_avail_bitmap; } /* @@ -2647,7 +2662,8 @@ bitstr_t *sequential_pick(bitstr_t *avail_bitmap, uint32_t node_cnt, uint32_t co * IN core_bitmap - cores which can not be used for this reservation * RET - nodes selected for use by the reservation */ -extern bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, uint32_t core_cnt, bitstr_t **core_bitmap) +extern bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, + uint32_t core_cnt, bitstr_t **core_bitmap) { bitstr_t **switches_bitmap; /* nodes on this switch */ int *switches_cpu_cnt; /* total CPUs on switch */ @@ -2655,8 +2671,8 @@ extern bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, int *switches_required; /* set if has required node */ bitstr_t *avail_nodes_bitmap = NULL; /* nodes on any switch */ - bitstr_t *sp_avail_bitmap; - int rem_nodes, rem_cores; /* remaining resources desired */ + bitstr_t *sp_avail_bitmap; + int rem_nodes, rem_cores; /* remaining resources desired */ int i, j; int best_fit_inx, first, last; int best_fit_nodes; @@ -2665,8 +2681,10 @@ extern bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, xassert(avail_bitmap); - if (!switch_record_cnt || !switch_record_table) - return sequential_pick(avail_bitmap, node_cnt, core_cnt, core_bitmap); + if (!switch_record_cnt || !switch_record_table) { + return sequential_pick(avail_bitmap, node_cnt, core_cnt, + core_bitmap); + } /* Use topology state information */ if (bit_set_count(avail_bitmap) < node_cnt) @@ -2683,24 +2701,25 @@ extern bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, switches_required = xmalloc(sizeof(int) * switch_record_cnt); for (i=0; i= rem_nodes) && (switches_cpu_cnt[j] >= core_cnt); + sufficient = (switches_node_cnt[j] >= rem_nodes) && + (switches_cpu_cnt[j] >= core_cnt); /* If first possibility OR */ /* first set large enough for request OR */ /* tightest fit (less resource waste) OR */ @@ -2790,8 +2811,8 @@ extern bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, } bit_set(avail_nodes_bitmap, i); - if(core_cnt) - rem_cores -= cr_node_num_cores[i]; + if (core_cnt) + rem_cores -= cr_node_num_cores[i]; if (--rem_nodes <= 0) break; } @@ -2808,54 +2829,54 @@ fini: for (i=0; i bit_size(avail_bitmap))) - break; - - debug2("Using node inx %d (cores_per_node: %d, core_cnt: %d", inx, cores_per_node, core_cnt); - coff = cr_get_coremap_offset(inx); - - for(i = 0; i < cores_per_node; i++){ /* TODO: checking cores_per_nodes is lower than real cores per node */ - bit_set(*core_bitmap, coff++); - core_cnt--; - } - - /* Add this node to the final node bitmap */ - bit_set(sp_avail_bitmap, inx); - - /* Clear this node from the initial available bitmap */ - bit_clear(avail_bitmap, inx); - } - - //bit_fmt(str, (sizeof(str) - 1), *core_bitmap); - //info("ALEJ: sequential pick using coremap: %s", str); - - if(core_cnt){ - info("reservation request can not be satisfied"); - FREE_NULL_BITMAP(sp_avail_bitmap); - return NULL; - } - - return sp_avail_bitmap; - } + if (core_cnt) { /* Reservation is using partial nodes */ + //char str[100]; + int cores_per_node; + + sp_avail_bitmap = bit_alloc(bit_size(avail_bitmap)); + if (sp_avail_bitmap == NULL) + fatal ("memory allocation failure"); + + *core_bitmap = _make_core_bitmap_filtered(avail_bitmap, 0); + + cores_per_node = core_cnt / MAX(node_cnt, 1); + + while (core_cnt) { + uint32_t inx, coff; + int i; + + inx = bit_ffs(avail_bitmap); + if ((inx < 0) || (inx > bit_size(avail_bitmap))) + break; + + debug2("Using node inx %d cores_per_node: %d " + "core_cnt: %d", inx, cores_per_node, core_cnt); + coff = cr_get_coremap_offset(inx); + + for (i = 0; i < cores_per_node; i++){ + /* TODO: checking cores_per_nodes is lower + * than real cores per node */ + bit_set(*core_bitmap, coff++); + core_cnt--; + } + + /* Add this node to the final node bitmap */ + bit_set(sp_avail_bitmap, inx); + + /* Clear this node from the initial available bitmap */ + bit_clear(avail_bitmap, inx); + } + + //bit_fmt(str, (sizeof(str) - 1), *core_bitmap); + //info("ALEJ: sequential pick using coremap: %s", str); + + if (core_cnt) { + info("reservation request can not be satisfied"); + FREE_NULL_BITMAP(sp_avail_bitmap); + return NULL; + } + return sp_avail_bitmap; + } return avail_nodes_bitmap; } diff --git a/src/plugins/select/cons_res/select_cons_res.h b/src/plugins/select/cons_res/select_cons_res.h index 7efd0ac4c098b873b802dd09cd11420d7d5a944f..8fa6bb33a22afa56cbc7c6c87c814385bc755442 100644 --- a/src/plugins/select/cons_res/select_cons_res.h +++ b/src/plugins/select/cons_res/select_cons_res.h @@ -79,9 +79,9 @@ * preemption, which can override these protections. */ enum node_cr_state { - NODE_CR_AVAILABLE = 0, /* The node may be IDLE or IN USE (shared) */ - NODE_CR_ONE_ROW = 1, /* node is in use by Shared=NO part */ - NODE_CR_RESERVED = 100, /* node is in use by Shared=EXCLUSIVE part */ + NODE_CR_AVAILABLE = 0, /* The node may be IDLE or IN USE (shared) */ + NODE_CR_ONE_ROW = 1, /* node is in use by Shared=NO part */ + NODE_CR_RESERVED = 10000, /* node is in use by Shared=EXCLUSIVE part */ }; /* a partition's per-row CPU allocation data */ @@ -104,6 +104,7 @@ struct part_res_record { struct node_res_record { struct node_record *node_ptr; /* ptr to the actual node */ uint16_t cpus; /* count of processors configured */ + uint16_t boards; /* count of boards configured */ uint16_t sockets; /* count of sockets configured */ uint16_t cores; /* count of cores configured */ uint16_t vpus; /* count of virtual cpus (hyperthreads) diff --git a/src/plugins/select/cray/Makefile.in b/src/plugins/select/cray/Makefile.in index 5f61f42398730d539fab8f2e8bea53b38b230fe3..71f2b74d902522f9a68e71ed515dc69a086aabbc 100644 --- a/src/plugins/select/cray/Makefile.in +++ b/src/plugins/select/cray/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -106,6 +105,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) @HAVE_CRAY_EMULATION_FALSE@@HAVE_CRAY_TRUE@select_cray_la_DEPENDENCIES = \ @@ -218,9 +223,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -228,9 +231,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -262,6 +264,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -289,6 +293,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -460,7 +465,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -select_cray.la: $(select_cray_la_OBJECTS) $(select_cray_la_DEPENDENCIES) +select_cray.la: $(select_cray_la_OBJECTS) $(select_cray_la_DEPENDENCIES) $(EXTRA_select_cray_la_DEPENDENCIES) $(select_cray_la_LINK) -rpath $(pkglibdir) $(select_cray_la_OBJECTS) $(select_cray_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -748,10 +753,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/cray/libalps/Makefile.in b/src/plugins/select/cray/libalps/Makefile.in index 0dec64119d40502c1245940105093401e07bb0d9..207b2f4eac22929bebc584d15a437dce312cca13 100644 --- a/src/plugins/select/cray/libalps/Makefile.in +++ b/src/plugins/select/cray/libalps/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -157,9 +156,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -167,9 +164,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -201,6 +197,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -228,6 +226,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -387,7 +386,7 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libalps.la: $(libalps_la_OBJECTS) $(libalps_la_DEPENDENCIES) +libalps.la: $(libalps_la_OBJECTS) $(libalps_la_DEPENDENCIES) $(EXTRA_libalps_la_DEPENDENCIES) $(libalps_la_LINK) $(libalps_la_OBJECTS) $(libalps_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -640,10 +639,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/cray/libemulate/Makefile.in b/src/plugins/select/cray/libemulate/Makefile.in index 70bb1450d35d3c3e4a5fc488ebb6d6a19eaabfed..dc6e65f83865df64414515e1b8372653846458b9 100644 --- a/src/plugins/select/cray/libemulate/Makefile.in +++ b/src/plugins/select/cray/libemulate/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -151,9 +150,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -161,9 +158,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -195,6 +191,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -222,6 +220,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -367,7 +366,7 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libalps.la: $(libalps_la_OBJECTS) $(libalps_la_DEPENDENCIES) +libalps.la: $(libalps_la_OBJECTS) $(libalps_la_DEPENDENCIES) $(EXTRA_libalps_la_DEPENDENCIES) $(libalps_la_LINK) $(libalps_la_OBJECTS) $(libalps_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -516,10 +515,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/cray/other_select.c b/src/plugins/select/cray/other_select.c index 8b096d733ae19692fd3bd35d9562f6a46488d9e1..cac5b2910ce1e54bbeae4f46885c67a30fdbe51f 100644 --- a/src/plugins/select/cray/other_select.c +++ b/src/plugins/select/cray/other_select.c @@ -59,145 +59,64 @@ #include "src/common/xstring.h" #include "src/common/node_select.h" -/* If there is a new select plugin, list it here */ -static slurm_select_context_t *other_select_context = NULL; -static pthread_mutex_t other_select_context_lock = - PTHREAD_MUTEX_INITIALIZER; - /* - * Locate and load the appropriate plugin - */ -static slurm_select_ops_t *_other_select_get_ops(slurm_select_context_t *c) -{ - /* - * Must be synchronized with slurm_select_ops_t in node_select.h and - * the list in node_select.c:_select_get_ops(). - */ - static const char *syms[] = { - "plugin_id", - "select_p_state_save", - "select_p_state_restore", - "select_p_job_init", - "select_p_node_ranking", - "select_p_node_init", - "select_p_block_init", - "select_p_job_test", - "select_p_job_begin", - "select_p_job_ready", - "select_p_job_expand_allow", - "select_p_job_expand", - "select_p_job_resized", - "select_p_job_signal", - "select_p_job_fini", - "select_p_job_suspend", - "select_p_job_resume", - "select_p_step_pick_nodes", - "select_p_step_finish", - "select_p_pack_select_info", - "select_p_select_nodeinfo_pack", - "select_p_select_nodeinfo_unpack", - "select_p_select_nodeinfo_alloc", - "select_p_select_nodeinfo_free", - "select_p_select_nodeinfo_set_all", - "select_p_select_nodeinfo_set", - "select_p_select_nodeinfo_get", - "select_p_select_jobinfo_alloc", - "select_p_select_jobinfo_free", - "select_p_select_jobinfo_set", - "select_p_select_jobinfo_get", - "select_p_select_jobinfo_copy", - "select_p_select_jobinfo_pack", - "select_p_select_jobinfo_unpack", - "select_p_select_jobinfo_sprint", - "select_p_select_jobinfo_xstrdup", - "select_p_update_block", - "select_p_update_sub_node", - "select_p_get_info_from_plugin", - "select_p_update_node_config", - "select_p_update_node_state", - "select_p_alter_node_cnt", - "select_p_reconfigure", - "select_p_resv_test", - "select_p_ba_init", - "select_p_ba_fini", - "select_p_ba_get_dims", - }; - int n_syms = sizeof(syms) / sizeof(char *); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->select_type, n_syms, syms, - (void **) &c->ops); - if (c->cur_plugin != PLUGIN_INVALID_HANDLE) - return &c->ops; - - if (errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->select_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->select_type); - - /* Get plugin list. */ - if (!c->plugin_list) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if (!c->plugin_list) { - error("cannot create plugin manager"); - return NULL; - } - plugrack_set_major_type(c->plugin_list, "select"); - plugrack_set_paranoia(c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir(c->plugin_list, plugin_dir); - xfree(plugin_dir); - } - - c->cur_plugin = plugrack_use_by_type(c->plugin_list, c->select_type); - if (c->cur_plugin == PLUGIN_INVALID_HANDLE) { - error("cannot find node selection plugin for %s", - c->select_type); - - return NULL; - } - - /* Dereference the API. */ - if (plugin_get_syms(c->cur_plugin, - n_syms, - syms, - (void **) &c->ops) < n_syms) { - error("incomplete node selection plugin detected"); - return NULL; - } - - return &c->ops; -} - -/* - * Destroy a node selection context - */ -static int _other_select_context_destroy(slurm_select_context_t *c) -{ - int rc = SLURM_SUCCESS; - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if (c->plugin_list) { - if (plugrack_destroy(c->plugin_list) != SLURM_SUCCESS) - rc = SLURM_ERROR; - } else { - plugin_unload(c->cur_plugin); - } - - xfree(c->select_type); - - return rc; -} + * Must be synchronized with slurm_select_ops_t in node_select.h. + */ +const char *node_select_syms[] = { + "plugin_id", + "select_p_state_save", + "select_p_state_restore", + "select_p_job_init", + "select_p_node_ranking", + "select_p_node_init", + "select_p_block_init", + "select_p_job_test", + "select_p_job_begin", + "select_p_job_ready", + "select_p_job_expand_allow", + "select_p_job_expand", + "select_p_job_resized", + "select_p_job_signal", + "select_p_job_fini", + "select_p_job_suspend", + "select_p_job_resume", + "select_p_step_pick_nodes", + "select_p_step_finish", + "select_p_pack_select_info", + "select_p_select_nodeinfo_pack", + "select_p_select_nodeinfo_unpack", + "select_p_select_nodeinfo_alloc", + "select_p_select_nodeinfo_free", + "select_p_select_nodeinfo_set_all", + "select_p_select_nodeinfo_set", + "select_p_select_nodeinfo_get", + "select_p_select_jobinfo_alloc", + "select_p_select_jobinfo_free", + "select_p_select_jobinfo_set", + "select_p_select_jobinfo_get", + "select_p_select_jobinfo_copy", + "select_p_select_jobinfo_pack", + "select_p_select_jobinfo_unpack", + "select_p_select_jobinfo_sprint", + "select_p_select_jobinfo_xstrdup", + "select_p_update_block", + "select_p_update_sub_node", + "select_p_fail_cnode", + "select_p_get_info_from_plugin", + "select_p_update_node_config", + "select_p_update_node_state", + "select_p_alter_node_cnt", + "select_p_reconfigure", + "select_p_resv_test", + "select_p_ba_init", + "select_p_ba_fini", + "select_p_ba_get_dims", +}; + +static slurm_select_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; /* * Initialize context for node selection plugin @@ -205,11 +124,15 @@ static int _other_select_context_destroy(slurm_select_context_t *c) extern int other_select_init(void) { int retval = SLURM_SUCCESS; - char *select_type = NULL; + char *plugin_type = "select"; + char *type = NULL; - slurm_mutex_lock(&other_select_context_lock); + if (init_run && g_context) + return retval; - if (other_select_context) + slurm_mutex_lock(&g_context_lock); + + if (g_context) goto done; /* @@ -222,26 +145,22 @@ extern int other_select_init(void) * time in the future this is allowable use code such as this * to make things switch to the cons_res plugin. * if (slurmctld_conf.select_type_param & CR_CONS_RES) - * select_type = "select/cons_res"; + * type = "select/cons_res"; * else - * select_type = "select/linear"; + * type = "select/linear"; */ - select_type = "select/linear"; - - other_select_context = xmalloc(sizeof(slurm_select_context_t)); - other_select_context->select_type = xstrdup(select_type); - other_select_context->cur_plugin = PLUGIN_INVALID_HANDLE; - other_select_context->select_errno = SLURM_SUCCESS; - - if (!_other_select_get_ops(other_select_context)) { - error("cannot resolve acct_storage plugin operations"); - _other_select_context_destroy(other_select_context); - other_select_context = NULL; + type = "select/linear"; + if (!(g_context = plugin_context_create( + plugin_type, type, (void **)&ops, + node_select_syms, sizeof(node_select_syms)))) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; + goto done; } + init_run = true; done: - slurm_mutex_unlock(&other_select_context_lock); + slurm_mutex_unlock(&g_context_lock); return retval; } @@ -249,14 +168,15 @@ extern int other_select_fini(void) { int rc = SLURM_SUCCESS; - slurm_mutex_lock(&other_select_context_lock); - if (!other_select_context) + slurm_mutex_lock(&g_context_lock); + init_run = false; + if (!g_context) goto fini; - rc = _other_select_context_destroy(other_select_context); - other_select_context = NULL; + rc = plugin_context_destroy(g_context); + g_context = NULL; fini: - slurm_mutex_unlock(&other_select_context_lock); + slurm_mutex_unlock(&g_context_lock); return rc; } @@ -269,7 +189,7 @@ extern int other_state_save(char *dir_name) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.state_save))(dir_name); + return (*(ops.state_save))(dir_name); } /* @@ -282,7 +202,7 @@ extern int other_state_restore(char *dir_name) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.state_restore))(dir_name); + return (*(ops.state_restore))(dir_name); } /* @@ -294,7 +214,7 @@ extern int other_job_init(List job_list) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.job_init))(job_list); + return (*(ops.job_init))(job_list); } /* @@ -307,7 +227,7 @@ extern int other_node_init(struct node_record *node_ptr, int node_cnt) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.node_init))(node_ptr, node_cnt); + return (*(ops.node_init))(node_ptr, node_cnt); } @@ -320,7 +240,7 @@ extern int other_block_init(List block_list) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.block_init))(block_list); + return (*(ops.block_init))(block_list); } /* @@ -351,7 +271,7 @@ extern int other_job_test(struct job_record *job_ptr, bitstr_t *bitmap, if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.job_test)) + return (*(ops.job_test)) (job_ptr, bitmap, min_nodes, max_nodes, req_nodes, mode, @@ -369,8 +289,7 @@ extern int other_job_begin(struct job_record *job_ptr) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.job_begin)) - (job_ptr); + return (*(ops.job_begin))(job_ptr); } /* @@ -384,8 +303,7 @@ extern int other_job_ready(struct job_record *job_ptr) if (other_select_init() < 0) return -1; - return (*(other_select_context->ops.job_ready)) - (job_ptr); + return (*(ops.job_ready))(job_ptr); } /* @@ -396,7 +314,7 @@ extern bool other_job_expand_allow(void) if (other_select_init() < 0) return false; - return (*(other_select_context->ops.job_expand_allow))(); + return (*(ops.job_expand_allow))(); } /* @@ -411,8 +329,7 @@ extern int other_job_expand(struct job_record *from_job_ptr, if (other_select_init() < 0) return -1; - return (*(other_select_context->ops.job_expand)) - (from_job_ptr, to_job_ptr); + return (*(ops.job_expand))(from_job_ptr, to_job_ptr); } /* @@ -426,8 +343,7 @@ extern int other_job_resized(struct job_record *job_ptr, if (other_select_init() < 0) return -1; - return (*(other_select_context->ops.job_resized)) - (job_ptr, node_ptr); + return (*(ops.job_resized))(job_ptr, node_ptr); } /* @@ -440,8 +356,7 @@ extern int other_job_signal(struct job_record *job_ptr, int signal) if (other_select_init() < 0) return -1; - return (*(other_select_context->ops.job_signal)) - (job_ptr, signal); + return (*(ops.job_signal))(job_ptr, signal); } /* @@ -453,8 +368,7 @@ extern int other_job_fini(struct job_record *job_ptr) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.job_fini)) - (job_ptr); + return (*(ops.job_fini))(job_ptr); } /* @@ -469,8 +383,7 @@ extern int other_job_suspend(struct job_record *job_ptr, bool indf_susp) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.job_suspend)) - (job_ptr, indf_susp); + return (*(ops.job_suspend))(job_ptr, indf_susp); } /* @@ -485,8 +398,7 @@ extern int other_job_resume(struct job_record *job_ptr, bool indf_susp) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.job_resume)) - (job_ptr, indf_susp); + return (*(ops.job_resume))(job_ptr, indf_susp); } /* @@ -508,8 +420,7 @@ extern bitstr_t *other_step_pick_nodes(struct job_record *job_ptr, if (other_select_init() < 0) return NULL; - return (*(other_select_context->ops.step_pick_nodes)) - (job_ptr, jobinfo, node_count); + return (*(ops.step_pick_nodes))(job_ptr, jobinfo, node_count); } /* @@ -521,7 +432,7 @@ extern int other_step_finish(struct step_record *step_ptr) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.step_finish)) + return (*(ops.step_finish)) (step_ptr); } @@ -531,7 +442,7 @@ extern int other_pack_select_info(time_t last_query_time, uint16_t show_flags, if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.pack_select_info)) + return (*(ops.pack_select_info)) (last_query_time, show_flags, buffer, protocol_version); } @@ -542,8 +453,7 @@ extern int other_select_nodeinfo_pack(select_nodeinfo_t *nodeinfo, if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.nodeinfo_pack)) - (nodeinfo, buffer, protocol_version); + return (*(ops.nodeinfo_pack))(nodeinfo, buffer, protocol_version); } extern int other_select_nodeinfo_unpack(select_nodeinfo_t **nodeinfo, @@ -553,8 +463,7 @@ extern int other_select_nodeinfo_unpack(select_nodeinfo_t **nodeinfo, if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.nodeinfo_unpack)) - (nodeinfo, buffer, protocol_version); + return (*(ops.nodeinfo_unpack))(nodeinfo, buffer, protocol_version); } extern select_nodeinfo_t *other_select_nodeinfo_alloc(void) @@ -562,7 +471,7 @@ extern select_nodeinfo_t *other_select_nodeinfo_alloc(void) if (other_select_init() < 0) return NULL; - return (*(other_select_context->ops.nodeinfo_alloc))(); + return (*(ops.nodeinfo_alloc))(); } extern int other_select_nodeinfo_free(select_nodeinfo_t *nodeinfo) @@ -570,15 +479,15 @@ extern int other_select_nodeinfo_free(select_nodeinfo_t *nodeinfo) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.nodeinfo_free))(nodeinfo); + return (*(ops.nodeinfo_free))(nodeinfo); } -extern int other_select_nodeinfo_set_all(time_t last_query_time) +extern int other_select_nodeinfo_set_all(void) { if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.nodeinfo_set_all))(last_query_time); + return (*(ops.nodeinfo_set_all))(); } extern int other_select_nodeinfo_set(struct job_record *job_ptr) @@ -586,7 +495,7 @@ extern int other_select_nodeinfo_set(struct job_record *job_ptr) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.nodeinfo_set))(job_ptr); + return (*(ops.nodeinfo_set))(job_ptr); } extern int other_select_nodeinfo_get(select_nodeinfo_t *nodeinfo, @@ -597,8 +506,7 @@ extern int other_select_nodeinfo_get(select_nodeinfo_t *nodeinfo, if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.nodeinfo_get)) - (nodeinfo, dinfo, state, data); + return (*(ops.nodeinfo_get))(nodeinfo, dinfo, state, data); } extern select_jobinfo_t *other_select_jobinfo_alloc(void) @@ -606,7 +514,7 @@ extern select_jobinfo_t *other_select_jobinfo_alloc(void) if (other_select_init() < 0) return NULL; - return (*(other_select_context->ops.jobinfo_alloc))();; + return (*(ops.jobinfo_alloc))();; } /* free storage previously allocated for a select job credential @@ -616,7 +524,7 @@ extern int other_select_jobinfo_free(select_jobinfo_t *jobinfo) { if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.jobinfo_free))(jobinfo); + return (*(ops.jobinfo_free))(jobinfo); } extern int other_select_jobinfo_set(select_jobinfo_t *jobinfo, @@ -626,8 +534,7 @@ extern int other_select_jobinfo_set(select_jobinfo_t *jobinfo, if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.jobinfo_set)) - (jobinfo, data_type, data); + return (*(ops.jobinfo_set))(jobinfo, data_type, data); } /* get data from a select job credential @@ -642,8 +549,7 @@ extern int other_select_jobinfo_get(select_jobinfo_t *jobinfo, if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.jobinfo_get)) - (jobinfo, data_type, data); + return (*(ops.jobinfo_get))(jobinfo, data_type, data); } /* copy a select job credential @@ -657,7 +563,7 @@ extern select_jobinfo_t *other_select_jobinfo_copy( if (other_select_init() < 0) return NULL; - return (*(other_select_context->ops.jobinfo_copy))(jobinfo); + return (*(ops.jobinfo_copy))(jobinfo); } /* pack a select job credential into a buffer in machine independent form @@ -672,8 +578,7 @@ extern int other_select_jobinfo_pack(select_jobinfo_t *jobinfo, if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.jobinfo_pack)) - (jobinfo, buffer, protocol_version); + return (*(ops.jobinfo_pack))(jobinfo, buffer, protocol_version); } /* unpack a select job credential from a buffer @@ -689,8 +594,7 @@ extern int other_select_jobinfo_unpack(select_jobinfo_t **jobinfo, if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.jobinfo_unpack)) - (jobinfo, buffer, protocol_version); + return (*(ops.jobinfo_unpack))(jobinfo, buffer, protocol_version); } /* write select job credential to a string @@ -706,8 +610,7 @@ extern char *other_select_jobinfo_sprint(select_jobinfo_t *jobinfo, if (other_select_init() < 0) return NULL; - return (*(other_select_context->ops.jobinfo_sprint)) - (jobinfo, buf, size, mode); + return (*(ops.jobinfo_sprint))(jobinfo, buf, size, mode); } /* write select job info to a string * IN jobinfo - a select job credential @@ -720,8 +623,7 @@ extern char *other_select_jobinfo_xstrdup( if (other_select_init() < 0) return NULL; - return (*(other_select_context->ops. - jobinfo_xstrdup))(jobinfo, mode); + return (*(ops.jobinfo_xstrdup))(jobinfo, mode); } /* @@ -733,8 +635,7 @@ extern int other_update_block (update_block_msg_t *block_desc_ptr) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops. - update_block))(block_desc_ptr); + return (*(ops.update_block))(block_desc_ptr); } /* @@ -746,8 +647,20 @@ extern int other_update_sub_node (update_block_msg_t *block_desc_ptr) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops. - update_sub_node))(block_desc_ptr); + return (*(ops.update_sub_node))(block_desc_ptr); +} + +/* + * Fail certain cnodes in a blocks midplane (usually comes from the + * IBM runjob mux) + * IN step_ptr - step that failed + */ +extern int other_fail_cnode (struct step_record *step_ptr) +{ + if (other_select_init() < 0) + return SLURM_ERROR; + + return (*(ops.fail_cnode))(step_ptr); } /* @@ -763,8 +676,7 @@ extern int other_get_info_from_plugin (enum select_plugindata_info dinfo, if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops. - get_info_from_plugin))(dinfo, job_ptr, data); + return (*(ops.get_info_from_plugin))(dinfo, job_ptr, data); } /* @@ -778,7 +690,7 @@ extern int other_update_node_config (int index) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops. + return (*(ops. update_node_config))(index); } @@ -794,7 +706,7 @@ extern int other_update_node_state (struct node_record *node_ptr) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.update_node_state))(node_ptr); + return (*(ops.update_node_state))(node_ptr); } /* @@ -806,7 +718,7 @@ extern int other_alter_node_cnt (enum select_node_cnt type, void *data) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.alter_node_cnt))(type, data); + return (*(ops.alter_node_cnt))(type, data); } /* @@ -817,7 +729,7 @@ extern int other_reconfigure (void) if (other_select_init() < 0) return SLURM_ERROR; - return (*(other_select_context->ops.reconfigure))(); + return (*(ops.reconfigure))(); } /* @@ -829,13 +741,14 @@ extern int other_reconfigure (void) * IN node_cnt - count of required nodes * RET - nodes selected for use by the reservation */ -extern bitstr_t * other_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, bitstr_t **core_bitmap) +extern bitstr_t * other_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, + uint32_t core_cnt, bitstr_t **core_bitmap) { if (other_select_init() < 0) return NULL; - return (*(other_select_context->ops.resv_test)) - (avail_bitmap, node_cnt, 0, NULL); + return (*(ops.resv_test))(avail_bitmap, node_cnt, core_cnt, + core_bitmap); } extern void other_ba_init(node_info_msg_t *node_info_ptr, bool sanity_check) @@ -843,7 +756,7 @@ extern void other_ba_init(node_info_msg_t *node_info_ptr, bool sanity_check) if (other_select_init() < 0) return; - (*(other_select_context->ops.ba_init))(node_info_ptr, sanity_check); + (*(ops.ba_init))(node_info_ptr, sanity_check); } extern void other_ba_fini(void) @@ -851,7 +764,7 @@ extern void other_ba_fini(void) if (other_select_init() < 0) return; - (*(other_select_context->ops.ba_fini))(); + (*(ops.ba_fini))(); } extern int *other_ba_get_dims(void) @@ -859,5 +772,5 @@ extern int *other_ba_get_dims(void) if (other_select_init() < 0) return NULL; - return (*(other_select_context->ops.ba_get_dims))(); + return (*(ops.ba_get_dims))(); } diff --git a/src/plugins/select/cray/other_select.h b/src/plugins/select/cray/other_select.h index e1b23f37652f89e034e05c2b7cad27762bb9b1be..2a6dc28e98af1ca20510a6501f0d398f64f842d6 100644 --- a/src/plugins/select/cray/other_select.h +++ b/src/plugins/select/cray/other_select.h @@ -101,6 +101,13 @@ extern int other_update_block(update_block_msg_t *block_desc_ptr); */ extern int other_update_sub_node(update_block_msg_t *block_desc_ptr); +/* + * Fail certain cnodes in a blocks midplane (usually comes from the + * IBM runjob mux) + * IN step_ptr - step that failed + */ +extern int other_fail_cnode (struct step_record *step_ptr); + /* * Get select data from a plugin * IN node_pts - current node record @@ -343,7 +350,7 @@ extern select_nodeinfo_t *other_select_nodeinfo_alloc(void); extern int other_select_nodeinfo_free(select_nodeinfo_t *nodeinfo); -extern int other_select_nodeinfo_set_all(time_t last_query_time); +extern int other_select_nodeinfo_set_all(void); extern int other_select_nodeinfo_set(struct job_record *job_ptr); @@ -371,7 +378,8 @@ extern int other_pack_select_info(time_t last_query_time, uint16_t show_flags, /* Note reconfiguration or change in partition configuration */ extern int other_reconfigure(void); -extern bitstr_t * other_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, bitstr_t **core_bitmap); +extern bitstr_t * other_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, + uint32_t core_cnt, bitstr_t **core_bitmap); extern void other_ba_init(node_info_msg_t *node_info_ptr, bool sanity_check); extern void other_ba_fini(void); diff --git a/src/plugins/select/cray/select_cray.c b/src/plugins/select/cray/select_cray.c index b3d1bf997390ec7aa453951483fd3df5db08a878..8c7c53361e77d2be522e217624283691bb1794a1 100644 --- a/src/plugins/select/cray/select_cray.c +++ b/src/plugins/select/cray/select_cray.c @@ -472,9 +472,9 @@ unpack_error: return SLURM_ERROR; } -extern int select_p_select_nodeinfo_set_all(time_t last_query_time) +extern int select_p_select_nodeinfo_set_all(void) { - return other_select_nodeinfo_set_all(last_query_time); + return other_select_nodeinfo_set_all(); } extern int select_p_select_nodeinfo_set(struct job_record *job_ptr) @@ -782,6 +782,11 @@ extern int select_p_update_sub_node(update_block_msg_t *block_desc_ptr) return other_update_sub_node(block_desc_ptr); } +extern int select_p_fail_cnode(struct step_record *step_ptr) +{ + return other_fail_cnode(step_ptr); +} + extern int select_p_get_info_from_plugin(enum select_jobdata_type info, struct job_record *job_ptr, void *data) @@ -811,9 +816,10 @@ extern int select_p_reconfigure(void) return other_reconfigure(); } -extern bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, bitstr_t **core_bitmap) +extern bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, + uint32_t core_cnt, bitstr_t **core_bitmap) { - return other_resv_test(avail_bitmap, node_cnt, core_bitmap); + return other_resv_test(avail_bitmap, node_cnt, core_cnt, core_bitmap); } extern void select_p_ba_init(node_info_msg_t *node_info_ptr, bool sanity_check) diff --git a/src/plugins/select/linear/Makefile.in b/src/plugins/select/linear/Makefile.in index 8ca7ffa9096191beefd2fadf2271d966eb95a2ba..a4602045df5a5a66000007645f691c1dcb3e0d13 100644 --- a/src/plugins/select/linear/Makefile.in +++ b/src/plugins/select/linear/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) select_linear_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -select_linear.la: $(select_linear_la_OBJECTS) $(select_linear_la_DEPENDENCIES) +select_linear.la: $(select_linear_la_OBJECTS) $(select_linear_la_DEPENDENCIES) $(EXTRA_select_linear_la_DEPENDENCIES) $(select_linear_la_LINK) -rpath $(pkglibdir) $(select_linear_la_OBJECTS) $(select_linear_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/linear/select_linear.c b/src/plugins/select/linear/select_linear.c index b839e06b8fc958f8f7bda85f826b5f6783703c46..e2304d09869e5a6a25e985342e771226fec62bc4 100644 --- a/src/plugins/select/linear/select_linear.c +++ b/src/plugins/select/linear/select_linear.c @@ -452,7 +452,7 @@ static uint16_t _get_avail_cpus(struct job_record *job_ptr, int index) { struct node_record *node_ptr; uint16_t avail_cpus; - uint16_t cpus, sockets, cores, threads; + uint16_t cpus, boards, sockets, cores, threads; uint16_t cpus_per_task = 1; uint16_t ntasks_per_node = 0, ntasks_per_socket, ntasks_per_core; uint16_t min_sockets, min_cores, min_threads; @@ -482,19 +482,24 @@ static uint16_t _get_avail_cpus(struct job_record *job_ptr, int index) node_ptr = select_node_ptr + index; if (select_fast_schedule) { /* don't bother checking each node */ cpus = node_ptr->config_ptr->cpus; + boards = node_ptr->config_ptr->boards; sockets = node_ptr->config_ptr->sockets; cores = node_ptr->config_ptr->cores; threads = node_ptr->config_ptr->threads; } else { cpus = node_ptr->cpus; + boards = node_ptr->boards; sockets = node_ptr->sockets; cores = node_ptr->cores; threads = node_ptr->threads; } #if SELECT_DEBUG - info("host %s HW_ cpus %u sockets %u cores %u threads %u ", - node_ptr->name, cpus, sockets, cores, threads); + info("host %s HW_ cpus %u boards %u sockets %u cores %u threads %u ", + node_ptr->name, cpus, boards, sockets, cores, threads); +#else + debug("host %s HW_ cpus %u boards %u sockets %u cores %u threads %u ", + node_ptr->name, cpus, boards, sockets, cores, threads); #endif avail_cpus = slurm_get_avail_procs( @@ -3078,7 +3083,7 @@ extern int select_p_select_nodeinfo_free(select_nodeinfo_t *nodeinfo) return SLURM_SUCCESS; } -extern int select_p_select_nodeinfo_set_all(time_t last_query_time) +extern int select_p_select_nodeinfo_set_all(void) { struct node_record *node_ptr = NULL; int i=0; @@ -3086,7 +3091,7 @@ extern int select_p_select_nodeinfo_set_all(time_t last_query_time) /* only set this once when the last_node_update is newer than * the last time we set things up. */ - if(last_set_all && (last_node_update < last_set_all)) { + if (last_set_all && (last_node_update < last_set_all)) { debug2("Node select info for set all hasn't " "changed since %ld", (long)last_set_all); @@ -3295,6 +3300,11 @@ extern int select_p_update_sub_node (update_block_msg_t *block_desc_ptr) return SLURM_SUCCESS; } +extern int select_p_fail_cnode(struct step_record *step_ptr) +{ + return SLURM_SUCCESS; +} + extern int select_p_get_info_from_plugin (enum select_plugindata_info dinfo, struct job_record *job_ptr, void *data) @@ -3337,7 +3347,8 @@ extern int select_p_reconfigure(void) * IN node_cnt - count of required nodes * RET - nodes selected for use by the reservation */ -extern bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, bitstr_t **core_bitmap) +extern bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, + bitstr_t **core_bitmap) { bitstr_t **switches_bitmap; /* nodes on this switch */ int *switches_cpu_cnt; /* total CPUs on switch */ diff --git a/src/plugins/select/serial/Makefile.am b/src/plugins/select/serial/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..5ebea9d033cf89d0c448bb362bd3389b5299a137 --- /dev/null +++ b/src/plugins/select/serial/Makefile.am @@ -0,0 +1,15 @@ +# Makefile for select/serial plugin + +AUTOMAKE_OPTIONS = foreign + +PLUGIN_FLAGS = -module -avoid-version --export-dynamic + +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common + +pkglib_LTLIBRARIES = select_serial.la + +# serial job resource selection plugin. +select_serial_la_SOURCES = select_serial.c select_serial.h \ + dist_tasks.c dist_tasks.h \ + job_test.c job_test.h +select_serial_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) diff --git a/src/plugins/switch/elan/Makefile.in b/src/plugins/select/serial/Makefile.in similarity index 88% rename from src/plugins/switch/elan/Makefile.in rename to src/plugins/select/serial/Makefile.in index 703171bd851f0d5610f3ebcfb482717a27f84d27..6996a9daff3a26a926dd5aa6b49ad3c6b4d354ba 100644 --- a/src/plugins/switch/elan/Makefile.in +++ b/src/plugins/select/serial/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -15,7 +15,7 @@ @SET_MAKE@ -# Makefile for switch/elan plugin +# Makefile for select/serial plugin VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -37,7 +37,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -subdir = src/plugins/switch/elan +subdir = src/plugins/select/serial DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.m4 \ @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,19 +104,21 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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 = -@HAVE_ELAN_TRUE@switch_elan_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@HAVE_ELAN_TRUE@ $(top_builddir)/src/api/libslurm.la -am__switch_elan_la_SOURCES_DIST = switch_elan.c qsw.c qsw.h -@HAVE_ELAN_TRUE@am_switch_elan_la_OBJECTS = switch_elan.lo qsw.lo -am__EXTRA_switch_elan_la_SOURCES_DIST = switch_elan.c qsw.c qsw.h -switch_elan_la_OBJECTS = $(am_switch_elan_la_OBJECTS) -switch_elan_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +select_serial_la_LIBADD = +am_select_serial_la_OBJECTS = select_serial.lo dist_tasks.lo \ + job_test.lo +select_serial_la_OBJECTS = $(am_select_serial_la_OBJECTS) +select_serial_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(switch_elan_la_LDFLAGS) $(LDFLAGS) -o $@ -@HAVE_ELAN_TRUE@am_switch_elan_la_rpath = -rpath $(pkglibdir) + $(select_serial_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp am__depfiles_maybe = depfiles @@ -131,9 +132,8 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(switch_elan_la_SOURCES) $(EXTRA_switch_elan_la_SOURCES) -DIST_SOURCES = $(am__switch_elan_la_SOURCES_DIST) \ - $(am__EXTRA_switch_elan_la_SOURCES_DIST) +SOURCES = $(select_serial_la_SOURCES) +DIST_SOURCES = $(select_serial_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -177,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -187,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -221,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -248,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -339,28 +339,16 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign -@HAVE_ELAN_FALSE@elan_lib = -@HAVE_ELAN_TRUE@elan_lib = switch_elan.la PLUGIN_FLAGS = -module -avoid-version --export-dynamic INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common -pkglib_LTLIBRARIES = $(elan_lib) +pkglib_LTLIBRARIES = select_serial.la -# Quadrics elan3 or elan4 switch plugin. -@HAVE_ELAN_TRUE@switch_elan_la_SOURCES = \ -@HAVE_ELAN_TRUE@ switch_elan.c \ -@HAVE_ELAN_TRUE@ qsw.c qsw.h - - -# Add libslurm to switch_elan to provide some symbols that are not -# available in slurmctld (slurm_setenvpf) -@HAVE_ELAN_TRUE@switch_elan_la_LIBADD = $(ELAN_LIBS) \ -@HAVE_ELAN_TRUE@ $(top_builddir)/src/api/libslurm.la - -@HAVE_ELAN_TRUE@switch_elan_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) -@HAVE_ELAN_FALSE@EXTRA_switch_elan_la_SOURCES = \ -@HAVE_ELAN_FALSE@ switch_elan.c \ -@HAVE_ELAN_FALSE@ qsw.c qsw.h +# serial job resource selection plugin. +select_serial_la_SOURCES = select_serial.c select_serial.h \ + dist_tasks.c dist_tasks.h \ + job_test.c job_test.h +select_serial_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) all: all-am .SUFFIXES: @@ -374,9 +362,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/switch/elan/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/select/serial/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/plugins/switch/elan/Makefile + $(AUTOMAKE) --foreign src/plugins/select/serial/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -426,8 +414,8 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -switch_elan.la: $(switch_elan_la_OBJECTS) $(switch_elan_la_DEPENDENCIES) - $(switch_elan_la_LINK) $(am_switch_elan_la_rpath) $(switch_elan_la_OBJECTS) $(switch_elan_la_LIBADD) $(LIBS) +select_serial.la: $(select_serial_la_OBJECTS) $(select_serial_la_DEPENDENCIES) $(EXTRA_select_serial_la_DEPENDENCIES) + $(select_serial_la_LINK) -rpath $(pkglibdir) $(select_serial_la_OBJECTS) $(select_serial_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -435,8 +423,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qsw.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/switch_elan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dist_tasks.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_test.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select_serial.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -564,10 +553,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/select/serial/dist_tasks.c b/src/plugins/select/serial/dist_tasks.c new file mode 100644 index 0000000000000000000000000000000000000000..8ddef4efd47073b694d719256e9a7cad209e1d7b --- /dev/null +++ b/src/plugins/select/serial/dist_tasks.c @@ -0,0 +1,87 @@ +/*****************************************************************************\ + * dist_tasks.c - Assign specific CPUs to the job + ***************************************************************************** + * Copyright (C) 2012 SchedMD LLC. + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 "select_serial.h" +#include "dist_tasks.h" + +/* Compute the number of CPUs to use on each node */ +static int _compute_c_b_task_dist(struct job_record *job_ptr) +{ + job_resources_t *job_res = job_ptr->job_resrcs; + + if (!job_res || !job_res->cpus) { + error("select/serial: _compute_c_b_task_dist job_res==NULL"); + return SLURM_ERROR; + } + if (job_res->nhosts != 1) { + error("select/serial: _compute_c_b_task_dist given nhosts==%u", + job_res->nhosts); + return SLURM_ERROR; + } + + xfree(job_res->cpus); + job_res->cpus = xmalloc(sizeof(uint16_t)); + job_res->cpus[0] = 1; + + return SLURM_SUCCESS; +} + +/* Select the specific cores in the job's allocation */ +static void _block_sync_core_bitmap(struct job_record *job_ptr, + const uint16_t cr_type) +{ + job_resources_t *job_res = job_ptr->job_resrcs; + int c_first, c_size; + + if (!job_res || !job_res->core_bitmap) + return; + + c_size = bit_size(job_res->core_bitmap); + c_first = bit_ffs(job_res->core_bitmap); + bit_nclear(job_res->core_bitmap, 0, c_size - 1); + bit_set(job_res->core_bitmap, c_first); +} + +extern int cr_dist(struct job_record *job_ptr, const uint16_t cr_type) +{ + int error_code; + + error_code = _compute_c_b_task_dist(job_ptr); + if (error_code != SLURM_SUCCESS) + return error_code; + + _block_sync_core_bitmap(job_ptr, cr_type); + return SLURM_SUCCESS; +} diff --git a/src/plugins/switch/federation/federation_keys.h b/src/plugins/select/serial/dist_tasks.h similarity index 71% rename from src/plugins/switch/federation/federation_keys.h rename to src/plugins/select/serial/dist_tasks.h index 3553b2152c3420ac5bb4a2feb23d05a9710d837d..f2cbe28de36eb427a68561eba397b9fd78a7e0b3 100644 --- a/src/plugins/switch/federation/federation_keys.h +++ b/src/plugins/select/serial/dist_tasks.h @@ -1,10 +1,8 @@ /*****************************************************************************\ - ** federation_keys.h - Key definitions used by the get_jobinfo functions - ** $Id$ + * dist_tasks.h - Assign task count for each resources ***************************************************************************** - * Copyright (C) 2004 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Jason King + * Copyright (C) 2006 Hewlett-Packard Development Company, L.P. + * Written by Susanne M. Balle, * CODE-OCEC-09-009. All rights reserved. * * This file is part of SLURM, a resource management program. @@ -37,25 +35,19 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifndef _FEDERATION_KEYS_INCLUDED -#define _FEDERATION_KEYS_INCLUDED +#ifndef _SERIAL_DIST_TASKS_H +#define _SERIAL_DIST_TASKS_H -#define FED_ADAPTERNAME_LEN 5 +#if HAVE_CONFIG_H +# include "config.h" +#endif -enum { - /* Federation specific get_jobinfo keys */ - FED_JOBINFO_TABLEINFO, - FED_JOBINFO_TABLESPERTASK, - FED_JOBINFO_KEY, - FED_JOBINFO_PROTOCOL, - FED_JOBINFO_MODE -}; +#if HAVE_STRING_H +# include +#endif -/* Information shared between slurm_ll_api and the slurm federation driver */ -typedef struct fed_tableinfo { - uint32_t table_length; - NTBL **table; - char adapter_name[FED_ADAPTERNAME_LEN]; -} fed_tableinfo_t; +#include "select_serial.h" -#endif /* _FEDERATION_KEYS_INCLUDED */ +int cr_dist(struct job_record *job_ptr,const uint16_t cr_type); + +#endif /* !_SERIAL_DIST_TASKS_H */ diff --git a/src/plugins/select/serial/job_test.c b/src/plugins/select/serial/job_test.c new file mode 100644 index 0000000000000000000000000000000000000000..eb9a9f75f6894563c3a01474ed81ecae769c8d66 --- /dev/null +++ b/src/plugins/select/serial/job_test.c @@ -0,0 +1,930 @@ +/*****************************************************************************\ + * job_test.c + ***************************************************************************** + * Copyright (C) 2005-2008 Hewlett-Packard Development Company, L.P. + * Written by Susanne M. Balle , who borrowed heavily + * from select/linear + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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" +# if HAVE_STDINT_H +# include +# endif +# if HAVE_INTTYPES_H +# include +# endif +#endif +#include + +#include "dist_tasks.h" +#include "job_test.h" +#include "select_serial.h" + +/* _allocate_cores - Given the job requirements, determine which cores + * from the given node can be allocated (if any) to this + * job. Returns the number of cpus that can be used by + * this node AND a bitmap of the selected cores. + * + * IN job_ptr - pointer to job requirements + * IN/OUT core_map - bitmap of cores available for use/selected for use + * IN node_i - index of node to be evaluated + */ +uint16_t _allocate_cores(struct job_record *job_ptr, bitstr_t *core_map, + const uint32_t node_i) +{ + uint32_t core_begin = cr_get_coremap_offset(node_i); + uint32_t core_end = cr_get_coremap_offset(node_i + 1); + uint32_t c; + uint16_t free_core_count = 0; + + for (c = core_begin; c < core_end; c++) { + if (bit_test(core_map, c)) + free_core_count++; + } + + return free_core_count; +} + + +/* + * _can_job_run_on_node - Given the job requirements, determine which + * resources from the given node (if any) can be + * allocated to this job. Returns the number of + * cpus that can be used by this node and a bitmap + * of available resources for allocation. + * NOTE: This process does NOT support overcommitting resources + * + * 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 cr_type - Consumable Resource setting + * IN test_only - ignore allocated memory check + * + * NOTE: The returned cpu_count may be less than the number of set bits in + * core_map for the given node. The cr_dist functions will determine + * 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, + struct node_use_record *node_usage, + uint16_t cr_type, + bool test_only) +{ + uint16_t cpus; + uint32_t avail_mem, req_mem, gres_cpus; + int core_start_bit, core_end_bit; + struct node_record *node_ptr = node_record_table_ptr + node_i; + List gres_list; + + if (!test_only && IS_NODE_COMPLETING(node_ptr)) { + /* Do not allocate more jobs to nodes with completing jobs */ + cpus = 0; + return cpus; + } + + cpus = _allocate_cores(job_ptr, core_map, node_i); + + core_start_bit = cr_get_coremap_offset(node_i); + core_end_bit = cr_get_coremap_offset(node_i + 1) - 1; + node_ptr = select_node_record[node_i].node_ptr; + + if ((cr_type & CR_MEMORY) && cpus) { + req_mem = job_ptr->details->pn_min_memory & ~MEM_PER_CPU; + avail_mem = select_node_record[node_i].real_memory; + if (!test_only) + avail_mem -= node_usage[node_i].alloc_memory; + if (req_mem > avail_mem) + cpus = 0; + } + + if (node_usage[node_i].gres_list) + gres_list = node_usage[node_i].gres_list; + else + gres_list = node_ptr->gres_list; + gres_cpus = 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 ((gres_cpus < job_ptr->details->ntasks_per_node) || + ((job_ptr->details->cpus_per_task > 1) && + (gres_cpus < job_ptr->details->cpus_per_task))) + gres_cpus = 0; + if (gres_cpus < cpus) + cpus = gres_cpus; + + if (cpus == 0) + bit_nclear(core_map, core_start_bit, core_end_bit); + + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: _can_job_run_on_node: %u cpus on %s(%d), " + "mem %u/%u", + cpus, select_node_record[node_i].node_ptr->name, + node_usage[node_i].node_state, + node_usage[node_i].alloc_memory, + select_node_record[node_i].real_memory); + } + + return cpus; +} + + +/* Test to see if a node already has running jobs for _other_ partitions. + * If (sharing_only) then only check sharing partitions. This is because + * the job was submitted to a single-row partition which does not share + * allocated CPUs with multi-row partitions. + */ +static int _is_node_busy(struct part_res_record *p_ptr, uint32_t node_i, + int sharing_only, struct part_record *my_part_ptr) +{ + uint32_t r, cpu_begin = cr_get_coremap_offset(node_i); + uint32_t i, cpu_end = cr_get_coremap_offset(node_i+1); + + for (; p_ptr; p_ptr = p_ptr->next) { + if (sharing_only && + ((p_ptr->num_rows < 2) || + (p_ptr->part_ptr == my_part_ptr))) + continue; + if (!p_ptr->row) + continue; + for (r = 0; r < p_ptr->num_rows; r++) { + if (!p_ptr->row[r].row_bitmap) + continue; + for (i = cpu_begin; i < cpu_end; i++) { + if (bit_test(p_ptr->row[r].row_bitmap, i)) + return 1; + } + } + } + return 0; +} + + +/* + * Determine which of these nodes are usable by this job + * + * Remove nodes from the bitmap that don't have enough memory or gres to + * support the job. + * + * Return SLURM_ERROR if a required node can't be used. + * + * if node_state = NODE_CR_RESERVED, clear bitmap (if node is required + * then should we return NODE_BUSY!?!) + * + * if node_state = NODE_CR_ONE_ROW, then this node can only be used by + * another NODE_CR_ONE_ROW job + * + * if node_state = NODE_CR_AVAILABLE AND: + * - job_node_req = NODE_CR_RESERVED, then we need idle nodes + * - job_node_req = NODE_CR_ONE_ROW, then we need idle or non-sharing nodes + */ +static int _verify_node_state(struct part_res_record *cr_part_ptr, + struct job_record *job_ptr, bitstr_t * bitmap, + uint16_t cr_type, + struct node_use_record *node_usage, + enum node_cr_state job_node_req) +{ + struct node_record *node_ptr; + uint32_t i, free_mem, gres_cpus, min_mem; + int i_first, i_last; + List gres_list; + + if (job_ptr->details->pn_min_memory & MEM_PER_CPU) + min_mem = job_ptr->details->pn_min_memory & (~MEM_PER_CPU); + else + min_mem = job_ptr->details->pn_min_memory; + i_first = bit_ffs(bitmap); + if (i_first >= 0) + i_last = bit_fls(bitmap); + else + i_last = -2; + for (i = i_first; i <= i_last; i++) { + if (!bit_test(bitmap, i)) + continue; + node_ptr = select_node_record[i].node_ptr; + + /* node-level memory check */ + if ((job_ptr->details->pn_min_memory) && + (cr_type & CR_MEMORY)) { + free_mem = select_node_record[i].real_memory; + free_mem -= node_usage[i].alloc_memory; + if (free_mem < min_mem) { + debug3("select/serial: node %s no mem %u < %u", + select_node_record[i].node_ptr->name, + free_mem, min_mem); + goto clear_bit; + } + } + + /* node-level gres check */ + if (node_usage[i].gres_list) + gres_list = node_usage[i].gres_list; + else + gres_list = node_ptr->gres_list; + gres_cpus = gres_plugin_job_test(job_ptr->gres_list, + gres_list, true, + NULL, 0, 0, job_ptr->job_id, + node_ptr->name); + if (gres_cpus == 0) { + debug3("select/serial: node %s lacks gres", + node_ptr->name); + goto clear_bit; + } + + /* exclusive node check */ + if (node_usage[i].node_state >= NODE_CR_RESERVED) { + debug3("select/serial: node %s in exclusive use", + node_ptr->name); + goto clear_bit; + + /* non-resource-sharing node check */ + } else if (node_usage[i].node_state >= NODE_CR_ONE_ROW) { + if ((job_node_req == NODE_CR_RESERVED) || + (job_node_req == NODE_CR_AVAILABLE)) { + debug3("select/serial: node %s non-sharing", + node_ptr->name); + goto clear_bit; + } + /* cannot use this node if it is running jobs + * in sharing partitions */ + if (_is_node_busy(cr_part_ptr, i, 1, + job_ptr->part_ptr)) { + debug3("select/serial: node %s sharing?", + node_ptr->name); + goto clear_bit; + } + + /* node is NODE_CR_AVAILABLE - check job request */ + } else { + if (job_node_req == NODE_CR_RESERVED) { + if (_is_node_busy(cr_part_ptr, i, 0, + job_ptr->part_ptr)) { + debug3("select/serial: node %s busy", + node_ptr->name); + goto clear_bit; + } + } else if (job_node_req == NODE_CR_ONE_ROW) { + /* cannot use this node if it is running jobs + * in sharing partitions */ + if (_is_node_busy(cr_part_ptr, i, 1, + job_ptr->part_ptr)) { + debug3("select/serial: node %s vbusy", + node_ptr->name); + goto clear_bit; + } + } + } + continue; /* node is usable, test next node */ + +clear_bit: /* This node is not usable by this job */ + bit_clear(bitmap, i); + if (job_ptr->details->req_node_bitmap && + bit_test(job_ptr->details->req_node_bitmap, i)) { + return SLURM_ERROR; + } + } + + return SLURM_SUCCESS; +} + +/* given an "avail" node_bitmap, return a corresponding "avail" core_bitmap */ +bitstr_t *_make_core_bitmap(bitstr_t *node_map) +{ + uint32_t n, c, nodes, size; + uint32_t coff; + int i_first, i_last; + + nodes = bit_size(node_map); + size = cr_get_coremap_offset(nodes); + bitstr_t *core_map = bit_alloc(size); + if (!core_map) + fatal("bit_alloc: malloc failure"); + + i_first = bit_ffs(node_map); + if (i_first >= 0) + i_last = bit_fls(node_map); + else + i_last = -2; + for (n = i_first, c = 0; n <= i_last; n++) { + if (bit_test(node_map, n)) { + coff = cr_get_coremap_offset(n + 1); + while (c < coff) { + bit_set(core_map, c++); + } + } + } + return core_map; +} + +/* Compute resource usage for the given job on all available resources + * + * IN: job_ptr - pointer to the job requesting resources + * IN: node_map - bitmap of available nodes + * IN/OUT: core_map - bitmap of available cores + * IN: cr_node_cnt - total number of nodes in the cluster + * IN: cr_type - resource type + * OUT: cpu_cnt - number of cpus that can be used by this job + * IN: test_only - ignore allocated memory check + * RET SLURM_SUCCESS index of selected node or -1 if none + */ +static int _get_res_usage(struct job_record *job_ptr, bitstr_t *node_map, + bitstr_t *core_map, uint32_t cr_node_cnt, + struct node_use_record *node_usage, + uint16_t cr_type, uint16_t **cpu_cnt_ptr, + bool test_only) +{ + uint16_t *cpu_cnt; + uint32_t n; + int i_first, i_last; + int node_inx = -1; + + if (cr_node_cnt != node_record_count) { + error("select/serial: node count inconsistent with slurmctld"); + return SLURM_ERROR; + } + if (job_ptr->details && job_ptr->details->req_node_bitmap) + bit_and(node_map, job_ptr->details->req_node_bitmap); + cpu_cnt = xmalloc(cr_node_cnt * sizeof(uint16_t)); + i_first = bit_ffs(node_map); + if (i_first >= 0) + i_last = bit_fls(node_map); + else + i_last = -2; + for (n = i_first; n <= i_last; n++) { + if (!bit_test(node_map, n)) + continue; + cpu_cnt[n] = _can_job_run_on_node(job_ptr, core_map, n, + node_usage, cr_type, + test_only); + if (cpu_cnt[n]) { + bit_nclear(node_map, 0, (node_record_count - 1)); + bit_set(node_map, n); + node_inx = n; + break; /* select/serial: only need one node */ + } + } + *cpu_cnt_ptr = cpu_cnt; + return node_inx; +} + + +/* Select the best set of resources for the given job + * IN: job_ptr - pointer to the job requesting resources + * IN/OUT: node_map - bitmap of available nodes / bitmap of selected nodes + * IN: cr_node_cnt - total number of nodes in the cluster + * IN/OUT: core_map - bitmap of available cores / bitmap of selected cores + * IN: cr_type - resource type + * IN: test_only - ignore allocated memory check + * RET - array with number of CPUs available per node or NULL if not runnable + */ +static uint16_t *_select_nodes(struct job_record *job_ptr, + bitstr_t *node_map, uint32_t cr_node_cnt, + bitstr_t *core_map, + struct node_use_record *node_usage, + uint16_t cr_type, bool test_only) +{ + int node_inx; + uint16_t *cpu_cnt, *cpus = NULL; + + if (bit_set_count(node_map) == 0) + return NULL; + + /* get resource usage for this job from first available node */ + node_inx = _get_res_usage(job_ptr, node_map, core_map, cr_node_cnt, + node_usage, cr_type, &cpu_cnt, test_only); + + /* if successful, sync up the core_map with the node_map, and + * create a cpus array */ + if (node_inx >= 0) { + cpus = xmalloc(sizeof(uint16_t)); + cpus[0] = cpu_cnt[node_inx]; + if (node_inx != 0) { + bit_nclear(core_map, 0, + (cr_get_coremap_offset(node_inx))-1); + } + if (node_inx < (cr_node_cnt - 1)) { + bit_nclear(core_map, + (cr_get_coremap_offset(node_inx + 1)), + (cr_get_coremap_offset(cr_node_cnt) - 1)); + } + } + + xfree(cpu_cnt); + return cpus; +} + + +/* cr_job_test - does most of the real work for select_p_job_test(), which + * includes contiguous selection, load-leveling and max_share logic + * + * PROCEDURE: + * + * Step 1: compare nodes in "avail" bitmap with current node state data + * to find available nodes that match the job request + * + * Step 2: check resources in "avail" bitmap with allocated resources from + * higher priority partitions (busy resources are UNavailable) + * + * Step 3: select resource usage on remaining resources in "avail" bitmap + * for this job, with the placement influenced by existing + * allocations + */ +extern int cr_job_test(struct job_record *job_ptr, bitstr_t *bitmap, int mode, + uint16_t cr_type, enum node_cr_state job_node_req, + uint32_t cr_node_cnt, + struct part_res_record *cr_part_ptr, + struct node_use_record *node_usage) +{ + int error_code = SLURM_SUCCESS; + bitstr_t *orig_map, *avail_cores, *free_cores; + bitstr_t *tmpcore = NULL; + bool test_only; + uint32_t c, i, j, k, n, csize, save_mem = 0; + job_resources_t *job_res; + struct job_details *details_ptr; + struct part_res_record *p_ptr, *jp_ptr; + uint16_t *cpu_count; + + details_ptr = job_ptr->details; + + free_job_resources(&job_ptr->job_resrcs); + + if (mode == SELECT_MODE_TEST_ONLY) + test_only = true; + else /* SELECT_MODE_RUN_NOW || SELECT_MODE_WILL_RUN */ + test_only = false; + + /* check node_state and update the node bitmap as necessary */ + if (!test_only) { + error_code = _verify_node_state(cr_part_ptr, job_ptr, + bitmap, cr_type, node_usage, + job_node_req); + if (error_code != SLURM_SUCCESS) + return error_code; + } + + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: evaluating job %u on %u nodes", + job_ptr->job_id, bit_set_count(bitmap)); + } + + orig_map = bit_copy(bitmap); + avail_cores = _make_core_bitmap(bitmap); + + /* test to make sure that this job can succeed with all avail_cores + * if 'no' then return FAIL + * if 'yes' then we will seek the optimal placement for this job + * within avail_cores + */ + free_cores = bit_copy(avail_cores); + cpu_count = _select_nodes(job_ptr, bitmap, cr_node_cnt, free_cores, + node_usage, cr_type, test_only); + if (cpu_count == NULL) { + /* job cannot fit */ + FREE_NULL_BITMAP(orig_map); + FREE_NULL_BITMAP(free_cores); + FREE_NULL_BITMAP(avail_cores); + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: test 0 fail: " + "insufficient resources"); + } + return SLURM_ERROR; + } else if (test_only) { + FREE_NULL_BITMAP(orig_map); + FREE_NULL_BITMAP(free_cores); + FREE_NULL_BITMAP(avail_cores); + xfree(cpu_count); + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) + info("select/serial: cr_job_test: test 0 pass: " + "test_only"); + return SLURM_SUCCESS; + } + if (cr_type == CR_MEMORY) { + /* CR_MEMORY does not care about existing CPU allocations, + * so we can jump right to job allocation from here */ + goto alloc_job; + } + xfree(cpu_count); + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: test 0 pass - " + "job fits on given resources"); + } + + /* now that we know that this job can run with the given resources, + * let's factor in the existing allocations and seek the optimal set + * of resources for this job. Here is the procedure: + * + * Step 1: Seek idle CPUs across all partitions. If successful then + * place job and exit. If not successful, then continue. Two + * related items to note: + * 1. Jobs that don't share CPUs finish with step 1. + * 2. The remaining steps assume sharing or preemption. + * + * Step 2: Remove resources that are in use by higher-priority + * partitions, and test that job can still succeed. If not + * then exit. + * + * Step 3: Seek idle nodes among the partitions with the same + * priority as the job's partition. If successful then + * goto Step 6. If not then continue: + * + * Step 4: Seek placement within the job's partition. Search + * row-by-row. If no placement if found, then exit. If a row + * is found, then continue: + * + * Step 5: Place job and exit. FIXME! Here is where we need a + * placement algorithm that recognizes existing job + * boundaries and tries to "overlap jobs" as efficiently + * as possible. + * + * Step 6: Place job and exit. FIXME! here is we use a placement + * algorithm similar to Step 5 on jobs from lower-priority + * partitions. + */ + + + /*** Step 1 ***/ + bit_copybits(bitmap, orig_map); + bit_copybits(free_cores, avail_cores); + + /* remove all existing allocations from free_cores */ + tmpcore = bit_copy(free_cores); + for (p_ptr = cr_part_ptr; 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; + bit_copybits(tmpcore, p_ptr->row[i].row_bitmap); + bit_not(tmpcore); /* set bits now "free" resources */ + bit_and(free_cores, tmpcore); + } + } + cpu_count = _select_nodes(job_ptr, bitmap, cr_node_cnt, free_cores, + node_usage, cr_type, test_only); + if (cpu_count) { + /* job fits! We're done. */ + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: test 1 pass - " + "idle resources found"); + } + goto alloc_job; + } + + if (job_node_req == NODE_CR_ONE_ROW) { + /* This job CANNOT share CPUs regardless of priority, + * so we fail here. Note that Shared=EXCLUSIVE was already + * addressed in _verify_node_state() and job preemption + * removes jobs from simulated resource allocation map + * before this point. */ + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: test 1 fail - " + "no idle resources available"); + } + goto alloc_job; + } + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: test 1 fail - " + "not enough idle resources"); + } + + /*** Step 2 ***/ + bit_copybits(bitmap, orig_map); + bit_copybits(free_cores, avail_cores); + + for (jp_ptr = cr_part_ptr; jp_ptr; jp_ptr = jp_ptr->next) { + if (jp_ptr->part_ptr == job_ptr->part_ptr) + break; + } + if (!jp_ptr) { + fatal("select/serial: could not find partition for job %u", + job_ptr->job_id); + } + + /* 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) + continue; + if (!p_ptr->row) + continue; + for (i = 0; i < p_ptr->num_rows; i++) { + if (!p_ptr->row[i].row_bitmap) + continue; + bit_copybits(tmpcore, p_ptr->row[i].row_bitmap); + bit_not(tmpcore); /* set bits now "free" resources */ + bit_and(free_cores, tmpcore); + } + } + /* make these changes permanent */ + bit_copybits(avail_cores, free_cores); + cpu_count = _select_nodes(job_ptr, bitmap, cr_node_cnt, free_cores, + node_usage, cr_type, test_only); + if (!cpu_count) { + /* job needs resources that are currently in use by + * higher-priority jobs, so fail for now */ + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: test 2 fail - " + "resources busy with higher priority jobs"); + } + goto alloc_job; + } + xfree(cpu_count); + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: test 2 pass - " + "available resources for this priority"); + } + + /*** Step 3 ***/ + bit_copybits(bitmap, orig_map); + bit_copybits(free_cores, avail_cores); + + /* 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) + continue; + if (!p_ptr->row) + continue; + for (i = 0; i < p_ptr->num_rows; i++) { + if (!p_ptr->row[i].row_bitmap) + continue; + bit_copybits(tmpcore, p_ptr->row[i].row_bitmap); + bit_not(tmpcore); /* set bits now "free" resources */ + bit_and(free_cores, tmpcore); + } + } + cpu_count = _select_nodes(job_ptr, bitmap, cr_node_cnt, free_cores, + node_usage, cr_type, test_only); + if (cpu_count) { + /* jobs from low-priority partitions are the only thing left + * in our way. for now we'll ignore them, but FIXME: we need + * a good placement algorithm here that optimizes "job overlap" + * between this job (in these idle nodes) and the low-priority + * jobs */ + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: test 3 pass - " + "found resources"); + } + goto alloc_job; + } + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: test 3 fail - " + "not enough idle resources in same priority"); + } + + + /*** Step 4 ***/ + /* try to fit the job into an existing row + * + * tmpcore = worker core_bitmap + * free_cores = core_bitmap to be built + * avail_cores = static core_bitmap of all available cores + */ + + if (jp_ptr->row == NULL) { + /* there's no existing jobs in this partition, so place + * the job in avail_cores. FIXME: still need a good + * placement algorithm here that optimizes "job overlap" + * between this job (in these idle nodes) and existing + * jobs in the other partitions with <= priority to + * this partition */ + bit_copybits(bitmap, orig_map); + bit_copybits(free_cores, avail_cores); + cpu_count = _select_nodes(job_ptr, bitmap, cr_node_cnt, + free_cores, node_usage, cr_type, + test_only); + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: test 4 pass - " + "first row found"); + } + goto alloc_job; + } + + cr_sort_part_rows(jp_ptr); + c = jp_ptr->num_rows; + if (job_node_req != NODE_CR_AVAILABLE) + c = 1; + for (i = 0; i < c; i++) { + if (!jp_ptr->row[i].row_bitmap) + break; + bit_copybits(bitmap, orig_map); + bit_copybits(free_cores, avail_cores); + bit_copybits(tmpcore, jp_ptr->row[i].row_bitmap); + bit_not(tmpcore); + bit_and(free_cores, tmpcore); + cpu_count = _select_nodes(job_ptr, bitmap, cr_node_cnt, + free_cores, node_usage, cr_type, + test_only); + if (cpu_count) { + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: " + "test 4 pass - row %i", i); + } + break; + } + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: " + "test 4 fail - row %i", i); + } + } + + if ((i < c) && !jp_ptr->row[i].row_bitmap) { + /* we've found an empty row, so use it */ + bit_copybits(bitmap, orig_map); + bit_copybits(free_cores, avail_cores); + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: " + "test 4 trying empty row %i",i); + } + cpu_count = _select_nodes(job_ptr, bitmap, cr_node_cnt, + free_cores, node_usage, cr_type, + test_only); + } + + if (!cpu_count) { + /* job can't fit into any row, so exit */ + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: test 4 fail - " + "busy partition"); + } + goto alloc_job; + + } + + /*** CONSTRUCTION ZONE FOR STEPs 5 AND 6 *** + * Note that while the job may have fit into a row, it should + * still be run through a good placement algorithm here that + * optimizes "job overlap" between this job (in these idle nodes) + * and existing jobs in the other partitions with <= priority to + * this partition */ + +alloc_job: + /* at this point we've found a good set of + * bits to allocate to this job: + * - bitmap is the set of nodes to allocate + * - free_cores is the set of allocated cores + * - cpu_count is the number of cpus per allocated node + * + * Next steps are to cleanup the worker variables, + * create the job_resources struct, + * distribute the job on the bits, and exit + */ + FREE_NULL_BITMAP(orig_map); + FREE_NULL_BITMAP(avail_cores); + FREE_NULL_BITMAP(tmpcore); + if (!cpu_count) { + /* we were sent here to cleanup and exit */ + FREE_NULL_BITMAP(free_cores); + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: exiting cr_job_test with no " + "allocation"); + } + return SLURM_ERROR; + } + + /* At this point we have: + * - a bitmap of selected nodes + * - a free_cores bitmap of usable cores on each selected node + * - a per-alloc-node cpu_count array + */ + + if ((mode != SELECT_MODE_WILL_RUN) && (job_ptr->part_ptr == NULL)) + error_code = EINVAL; + if ((error_code == SLURM_SUCCESS) && (mode == SELECT_MODE_WILL_RUN)) + job_ptr->total_cpus = 1; + if ((error_code != SLURM_SUCCESS) || (mode != SELECT_MODE_RUN_NOW)) { + FREE_NULL_BITMAP(free_cores); + xfree(cpu_count); + return error_code; + } + + n = bit_ffs(bitmap); + if (n < 0) { + FREE_NULL_BITMAP(free_cores); + xfree(cpu_count); + return error_code; + } + + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: distributing job %u", + job_ptr->job_id); + } + + /** create the struct_job_res **/ + job_res = create_job_resources(); + job_res->node_bitmap = bit_copy(bitmap); + job_res->nodes = bitmap2node_name(bitmap); + if (job_res->node_bitmap == NULL) + fatal("bit_copy malloc failure"); + job_res->nhosts = bit_set_count(bitmap); + job_res->ncpus = job_res->nhosts; + if (job_ptr->details->ntasks_per_node) + job_res->ncpus *= details_ptr->ntasks_per_node; + job_res->ncpus = MAX(job_res->ncpus, + details_ptr->min_cpus); + job_res->ncpus = MAX(job_res->ncpus, + details_ptr->pn_min_cpus); + job_res->node_req = job_node_req; + job_res->cpus = cpu_count; + job_res->cpus_used = xmalloc(job_res->nhosts * + sizeof(uint16_t)); + job_res->memory_allocated = xmalloc(job_res->nhosts * + sizeof(uint32_t)); + job_res->memory_used = xmalloc(job_res->nhosts * + sizeof(uint32_t)); + + /* store the hardware data for the selected nodes */ + error_code = build_job_resources(job_res, node_record_table_ptr, + select_fast_schedule); + if (error_code != SLURM_SUCCESS) { + free_job_resources(&job_res); + FREE_NULL_BITMAP(free_cores); + return error_code; + } + + c = 0; + csize = bit_size(job_res->core_bitmap); + j = cr_get_coremap_offset(n); + k = cr_get_coremap_offset(n + 1); + for (; j < k; j++, c++) { + if (!bit_test(free_cores, j)) + continue; + if (c >= csize) { + error("select/serial: cr_job_test " + "core_bitmap index error on node %s", + select_node_record[n].node_ptr->name); + drain_nodes(select_node_record[n].node_ptr->name, + "Bad core count", getuid()); + free_job_resources(&job_res); + FREE_NULL_BITMAP(free_cores); + return SLURM_ERROR; + } + bit_set(job_res->core_bitmap, c); + break; + } + + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: cr_job_test: job %u ncpus %u cbits %u/%d " + "nbits %u", job_ptr->job_id, + job_res->ncpus, bit_set_count(free_cores), 1, + job_res->nhosts); + } + FREE_NULL_BITMAP(free_cores); + + /* distribute the tasks and clear any unused cores */ + job_ptr->job_resrcs = job_res; + error_code = cr_dist(job_ptr, cr_type); + if (error_code != SLURM_SUCCESS) { + free_job_resources(&job_ptr->job_resrcs); + return error_code; + } + + /* translate job_res->cpus array into format with rep count */ + job_ptr->total_cpus = build_job_resources_cpu_array(job_res); + + if (!(cr_type & CR_MEMORY)) + return error_code; + + /* load memory allocated array */ + save_mem = details_ptr->pn_min_memory; + if (save_mem & MEM_PER_CPU) { + /* memory is per-cpu */ + save_mem &= (~MEM_PER_CPU); + job_res->memory_allocated[0] = job_res->cpus[0] * save_mem; + } else { + /* memory is per-node */ + job_res->memory_allocated[0] = save_mem; + } + return error_code; +} diff --git a/src/plugins/select/serial/job_test.h b/src/plugins/select/serial/job_test.h new file mode 100644 index 0000000000000000000000000000000000000000..6cf9e73edd09f36e864e8370fc722f16c76d4f8f --- /dev/null +++ b/src/plugins/select/serial/job_test.h @@ -0,0 +1,65 @@ +/*****************************************************************************\ + * job_test.h + ***************************************************************************** + * Copyright (C) 2006 Hewlett-Packard Development Company, L.P. + * Written by Susanne M. Balle, + * CODE-OCEC-09-009. All rights reserved. + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 _SERIAL_JOB_TEST_H +#define _SERIAL_JOB_TEST_H + +#include +#include +#include + +#include "slurm/slurm.h" +#include "slurm/slurm_errno.h" + +#include "src/common/list.h" +#include "src/common/log.h" +#include "src/common/node_select.h" +#include "src/common/pack.h" +#include "src/common/slurm_protocol_api.h" +#include "src/common/xassert.h" +#include "src/common/xmalloc.h" +#include "src/common/xstring.h" +#include "src/common/slurm_resource_info.h" +#include "src/slurmctld/slurmctld.h" + +int cr_job_test(struct job_record *job_ptr, bitstr_t *bitmap, + int mode, uint16_t cr_type, + enum node_cr_state job_node_req, uint32_t cr_node_cnt, + struct part_res_record *cr_part_ptr, + struct node_use_record *node_usage); + +#endif /* !_SERIAL_JOB_TEST_H */ diff --git a/src/plugins/select/serial/select_serial.c b/src/plugins/select/serial/select_serial.c new file mode 100644 index 0000000000000000000000000000000000000000..ed25f5df5637ad574d01f60fb3662a6d9e11c979 --- /dev/null +++ b/src/plugins/select/serial/select_serial.c @@ -0,0 +1,2179 @@ +/*****************************************************************************\ + * select_serial.c - resource selection plugin supporting serial (since CPU) + * job allocations. + ***************************************************************************** + * This file is part of SLURM, a resource management program. + * For details, see . + * 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" +# if HAVE_STDINT_H +# include +# endif +# if HAVE_INTTYPES_H +# include +# endif +#endif + +#include "src/common/slurm_xlator.h" +#include "select_serial.h" +#include "dist_tasks.h" +#include "job_test.h" + + +#define NODEINFO_MAGIC 0x82aa + +/* 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__) +slurm_ctl_conf_t slurmctld_conf __attribute__((weak_import)); +struct node_record *node_record_table_ptr __attribute__((weak_import)); +List part_list __attribute__((weak_import)); +List job_list __attribute__((weak_import)); +int node_record_count __attribute__((weak_import)); +time_t last_node_update __attribute__((weak_import)); +struct switch_record *switch_record_table __attribute__((weak_import)); +int switch_record_cnt __attribute__((weak_import)); +bitstr_t *avail_node_bitmap __attribute__((weak_import)); +bitstr_t *idle_node_bitmap __attribute__((weak_import)); +#else +slurm_ctl_conf_t slurmctld_conf; +struct node_record *node_record_table_ptr; +List part_list; +List job_list; +int node_record_count; +time_t last_node_update; +struct switch_record *switch_record_table; +int switch_record_cnt; +bitstr_t *avail_node_bitmap; +bitstr_t *idle_node_bitmap; +#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 + * + * / + * + * where is a description of the intended application of + * the plugin (e.g., "select" for SLURM node selection) and + * is a description of how this plugin satisfies that application. SLURM will + * only load select plugins if the plugin_type string has a + * prefix of "select/". + * + * 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 the node selection API matures. + */ +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_version = 100; +const uint32_t pstate_version = 7; /* version control on saved state */ + +uint16_t cr_type = CR_CPU; /* cr_type is overwritten in init() */ + +uint32_t select_debug_flags; +uint16_t select_fast_schedule; + +uint16_t *cr_node_num_cores = NULL; +uint32_t *cr_node_cores_offset = NULL; +struct part_res_record *select_part_record = NULL; +struct node_res_record *select_node_record = NULL; +struct node_use_record *select_node_usage = NULL; +static bool select_state_initializing = true; +static int select_node_cnt = 0; +static bool job_preemption_enabled = false; +static bool job_preemption_killing = false; +static bool job_preemption_tested = false; + +struct select_nodeinfo { + uint16_t magic; /* magic number */ + uint16_t alloc_cpus; +}; + +extern select_nodeinfo_t *select_p_select_nodeinfo_alloc(void); +extern int select_p_select_nodeinfo_free(select_nodeinfo_t *nodeinfo); + +/* Procedure Declarations */ +static int _add_job_to_res(struct job_record *job_ptr, int action); +static int _rm_job_from_res(struct part_res_record *part_record_ptr, + struct node_use_record *node_usage, + struct job_record *job_ptr, int action); +static int _run_now(struct job_record *job_ptr, bitstr_t *bitmap, + uint16_t job_node_share, + List preemptee_candidates, List *preemptee_job_list); +static int _sort_usable_nodes_dec(struct job_record *job_a, + struct job_record *job_b); +static int _test_only(struct job_record *job_ptr, bitstr_t *bitmap, + uint16_t job_node_share); +static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, + uint16_t job_node_req, + List preemptee_candidates, List *preemptee_job_list); + +static void _dump_job_res(struct job_resources *job) { + char str[64]; + + if (job->core_bitmap) + bit_fmt(str, sizeof(str), job->core_bitmap); + else + sprintf(str, "[no core_bitmap]"); + info("DEBUG: Dump job_resources: nhosts %u cb %s", job->nhosts, str); +} + +static void _dump_nodes(void) +{ + struct node_record *node_ptr; + List gres_list; + int i; + + for (i=0; iname, + select_node_record[i].cpus, + select_node_record[i].cores, + select_node_record[i].sockets, + select_node_record[i].vpus, + select_node_record[i].real_memory, + select_node_usage[i].alloc_memory, + select_node_usage[i].node_state); + + if (select_node_usage[i].gres_list) + gres_list = select_node_usage[i].gres_list; + else + gres_list = node_ptr->gres_list; + if (gres_list) + gres_plugin_node_state_log(gres_list, node_ptr->name); + } +} + +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); + if (!p_ptr->row) + return; + + for (i = 0; i < p_ptr->num_rows; i++) { + char str[64]; /* print first 64 bits of bitmaps */ + if (p_ptr->row[i].row_bitmap) { + bit_fmt(str, sizeof(str), p_ptr->row[i].row_bitmap); + } else { + sprintf(str, "[no row_bitmap]"); + } + info(" row%u: num_jobs %u: bitmap: %s", i, + p_ptr->row[i].num_jobs, str); + } +} + +static void _dump_state(struct part_res_record *p_ptr) +{ + _dump_nodes(); + + /* dump partition data */ + for (; p_ptr; p_ptr = p_ptr->next) { + _dump_part(p_ptr); + } + return; +} + +/* (re)set cr_node_num_cores arrays */ +static void _init_global_core_data(struct node_record *node_ptr, int node_cnt) +{ + uint32_t n; + + xfree(cr_node_num_cores); + cr_node_num_cores = xmalloc(node_cnt * sizeof(uint16_t)); + + xfree(cr_node_cores_offset); + cr_node_cores_offset = xmalloc((node_cnt+1) * sizeof(uint32_t)); + + for (n = 0; n < node_cnt; n++) { + uint16_t cores; + if (select_fast_schedule) { + cores = node_ptr[n].config_ptr->cores; + cores *= node_ptr[n].config_ptr->sockets; + } else { + cores = node_ptr[n].cores; + cores *= node_ptr[n].sockets; + } + cr_node_num_cores[n] = cores; + if (n > 0) { + cr_node_cores_offset[n] = cr_node_cores_offset[n-1] + + cr_node_num_cores[n-1] ; + } else + cr_node_cores_offset[0] = 0; + } + + /* an extra value is added to get the total number of cores */ + /* as cr_get_coremap_offset is sometimes used to get the total */ + /* number of cores in the cluster */ + cr_node_cores_offset[node_cnt] = cr_node_cores_offset[node_cnt-1] + + cr_node_num_cores[node_cnt-1] ; + +} + + +/* return the coremap index to the first core of the given node */ +extern uint32_t cr_get_coremap_offset(uint32_t node_index) +{ + return cr_node_cores_offset[node_index]; +} + + +/* Helper function for _dup_part_data: create a duplicate part_row_data array */ +static struct part_row_data *_dup_row_data(struct part_row_data *orig_row, + uint16_t num_rows) +{ + struct part_row_data *new_row; + int i, j; + + if (num_rows == 0 || !orig_row) + return NULL; + + new_row = xmalloc(num_rows * sizeof(struct part_row_data)); + for (i = 0; i < num_rows; i++) { + new_row[i].num_jobs = orig_row[i].num_jobs; + new_row[i].job_list_size = orig_row[i].job_list_size; + if (orig_row[i].row_bitmap) + new_row[i].row_bitmap= bit_copy(orig_row[i]. + row_bitmap); + if (new_row[i].job_list_size == 0) + continue; + /* copy the job list */ + new_row[i].job_list = xmalloc(new_row[i].job_list_size * + sizeof(bitstr_t *)); + for (j = 0; j < new_row[i].num_jobs; j++) { + new_row[i].job_list[j] = orig_row[i].job_list[j]; + } + } + return new_row; +} + + +/* Create a duplicate part_res_record list */ +static struct part_res_record *_dup_part_data(struct part_res_record *orig_ptr) +{ + struct part_res_record *new_part_ptr, *new_ptr; + + if (orig_ptr == NULL) + return NULL; + + new_part_ptr = xmalloc(sizeof(struct part_res_record)); + new_ptr = new_part_ptr; + + while (orig_ptr) { + new_ptr->part_ptr = orig_ptr->part_ptr; + new_ptr->num_rows = orig_ptr->num_rows; + new_ptr->row = _dup_row_data(orig_ptr->row, + orig_ptr->num_rows); + if (orig_ptr->next) { + new_ptr->next = xmalloc(sizeof(struct part_res_record)); + new_ptr = new_ptr->next; + } + orig_ptr = orig_ptr->next; + } + return new_part_ptr; +} + + +/* Create a duplicate part_res_record list */ +static struct node_use_record *_dup_node_usage(struct node_use_record *orig_ptr) +{ + struct node_use_record *new_use_ptr, *new_ptr; + List gres_list; + uint32_t i; + + if (orig_ptr == NULL) + return NULL; + + new_use_ptr = xmalloc(select_node_cnt * sizeof(struct node_use_record)); + new_ptr = new_use_ptr; + + for (i = 0; i < select_node_cnt; i++) { + new_ptr[i].node_state = orig_ptr[i].node_state; + new_ptr[i].alloc_memory = orig_ptr[i].alloc_memory; + if (orig_ptr[i].gres_list) + gres_list = orig_ptr[i].gres_list; + else + gres_list = node_record_table_ptr[i].gres_list; + new_ptr[i].gres_list = gres_plugin_node_state_dup(gres_list); + } + return new_use_ptr; +} + +/* delete the given row data */ +static void _destroy_row_data(struct part_row_data *row, uint16_t num_rows) { + uint16_t i; + for (i = 0; i < num_rows; i++) { + FREE_NULL_BITMAP(row[i].row_bitmap); + if (row[i].job_list) { + uint32_t j; + for (j = 0; j < row[i].num_jobs; j++) + row[i].job_list[j] = NULL; + xfree(row[i].job_list); + } + } + xfree(row); +} + +/* delete the given list of partition data */ +static void _destroy_part_data(struct part_res_record *this_ptr) +{ + while (this_ptr) { + struct part_res_record *tmp = this_ptr; + this_ptr = this_ptr->next; + tmp->part_ptr = NULL; + + if (tmp->row) { + _destroy_row_data(tmp->row, tmp->num_rows); + tmp->row = NULL; + } + xfree(tmp); + } +} + + +/* (re)create the global select_part_record array */ +static void _create_part_data(void) +{ + ListIterator part_iterator; + struct part_record *p_ptr; + struct part_res_record *this_ptr; + int num_parts; + + _destroy_part_data(select_part_record); + select_part_record = NULL; + + num_parts = list_count(part_list); + if (!num_parts) + return; + info("cons_res: preparing for %d partitions", num_parts); + + select_part_record = xmalloc(sizeof(struct part_res_record)); + this_ptr = select_part_record; + + part_iterator = list_iterator_create(part_list); + if (part_iterator == NULL) + fatal ("memory allocation failure"); + + while ((p_ptr = (struct part_record *) list_next(part_iterator))) { + this_ptr->part_ptr = p_ptr; + this_ptr->num_rows = p_ptr->max_share; + if (this_ptr->num_rows & SHARED_FORCE) + this_ptr->num_rows &= (~SHARED_FORCE); + /* SHARED=EXCLUSIVE sets max_share = 0 */ + if (this_ptr->num_rows < 1) + this_ptr->num_rows = 1; + /* we'll leave the 'row' array blank for now */ + this_ptr->row = NULL; + num_parts--; + if (num_parts) { + this_ptr->next =xmalloc(sizeof(struct part_res_record)); + this_ptr = this_ptr->next; + } + } + list_iterator_destroy(part_iterator); + + /* should we sort the select_part_record list by priority here? */ +} + + +/* List sort function: sort by the job's expected end time */ +static int _cr_job_list_sort(void *x, void *y) +{ + struct job_record *job1_ptr = (struct job_record *) x; + struct job_record *job2_ptr = (struct job_record *) y; + return (int) difftime(job1_ptr->end_time, job2_ptr->end_time); +} + + +/* delete the given select_node_record and select_node_usage arrays */ +static void _destroy_node_data(struct node_use_record *node_usage, + struct node_res_record *node_data) +{ + int i; + + xfree(node_data); + if (node_usage) { + for (i = 0; i < select_node_cnt; i++) { + if (node_usage[i].gres_list) { + list_destroy(node_usage[i].gres_list); + } + } + xfree(node_usage); + } +} + + +static void _add_job_to_row(struct job_resources *job, + struct part_row_data *r_ptr) +{ + /* add the job to the row_bitmap */ + if (r_ptr->row_bitmap && r_ptr->num_jobs == 0) { + /* if no jobs, clear the existing row_bitmap first */ + uint32_t size = bit_size(r_ptr->row_bitmap); + bit_nclear(r_ptr->row_bitmap, 0, size-1); + } + add_job_to_cores(job, &(r_ptr->row_bitmap), cr_node_num_cores); + + /* add the job to the job_list */ + if (r_ptr->num_jobs >= r_ptr->job_list_size) { + r_ptr->job_list_size += 8; + xrealloc(r_ptr->job_list, r_ptr->job_list_size * + sizeof(struct job_resources *)); + } + r_ptr->job_list[r_ptr->num_jobs++] = job; +} + + +/* test for conflicting core_bitmap bits */ +static int _can_job_fit_in_row(struct job_resources *job, + struct part_row_data *r_ptr) +{ + if ((r_ptr->num_jobs == 0) || !r_ptr->row_bitmap) + return 1; + + return job_fits_into_cores(job, r_ptr->row_bitmap, cr_node_num_cores); +} + + +/* helper script for cr_sort_part_rows() */ +static void _swap_rows(struct part_row_data *a, struct part_row_data *b) +{ + struct part_row_data tmprow; + + tmprow.row_bitmap = a->row_bitmap; + tmprow.num_jobs = a->num_jobs; + tmprow.job_list = a->job_list; + tmprow.job_list_size = a->job_list_size; + + a->row_bitmap = b->row_bitmap; + a->num_jobs = b->num_jobs; + a->job_list = b->job_list; + a->job_list_size = b->job_list_size; + + b->row_bitmap = tmprow.row_bitmap; + b->num_jobs = tmprow.num_jobs; + b->job_list = tmprow.job_list; + b->job_list_size = tmprow.job_list_size; + + return; +} + + +/* sort the rows of a partition from "most allocated" to "least allocated" */ +extern void cr_sort_part_rows(struct part_res_record *p_ptr) +{ + uint32_t i, j, a, b; + + if (!p_ptr->row) + return; + + for (i = 0; i < p_ptr->num_rows; i++) { + if (p_ptr->row[i].row_bitmap) + a = bit_set_count(p_ptr->row[i].row_bitmap); + else + a = 0; + for (j = i+1; j < p_ptr->num_rows; j++) { + if (!p_ptr->row[j].row_bitmap) + continue; + b = bit_set_count(p_ptr->row[j].row_bitmap); + if (b > a) { + _swap_rows(&(p_ptr->row[i]), &(p_ptr->row[j])); + } + } + } + return; +} + + +/* + * _build_row_bitmaps: A job has been removed from the given partition, + * so the row_bitmap(s) need to be reconstructed. + * Optimize the jobs into the least number of rows, + * and make the lower rows as dense as possible. + * + * IN/OUT: p_ptr - the partition that has jobs to be optimized + */ +static void _build_row_bitmaps(struct part_res_record *p_ptr, + struct job_record *job_ptr) +{ + uint32_t i, j, num_jobs, size; + int x, *jstart; + struct part_row_data *this_row, *orig_row; + struct job_resources **tmpjobs, *job; + + if (!p_ptr->row) + return; + + if (p_ptr->num_rows == 1) { + this_row = &(p_ptr->row[0]); + if (this_row->num_jobs == 0) { + if (this_row->row_bitmap) { + size = bit_size(this_row->row_bitmap); + bit_nclear(this_row->row_bitmap, 0, size-1); + } + } else { + xassert(job_ptr); + xassert(job_ptr->job_resrcs); + remove_job_from_cores(job_ptr->job_resrcs, + &this_row->row_bitmap, + cr_node_num_cores); + } + return; + } + + /* gather data */ + num_jobs = 0; + for (i = 0; i < p_ptr->num_rows; i++) { + if (p_ptr->row[i].num_jobs) { + num_jobs += p_ptr->row[i].num_jobs; + } + } + if (num_jobs == 0) { + size = bit_size(p_ptr->row[0].row_bitmap); + for (i = 0; i < p_ptr->num_rows; i++) { + if (p_ptr->row[i].row_bitmap) { + bit_nclear(p_ptr->row[i].row_bitmap, 0, + size-1); + } + } + return; + } + + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("DEBUG: _build_row_bitmaps (before):"); + _dump_part(p_ptr); + } + debug3("cons_res: build_row_bitmaps reshuffling %u jobs", num_jobs); + + /* make a copy, in case we cannot do better than this */ + orig_row = _dup_row_data(p_ptr->row, p_ptr->num_rows); + if (orig_row == NULL) + return; + + /* get row_bitmap size from first row (we can safely assume that the + * first row_bitmap exists because there exists at least one job. */ + size = bit_size(p_ptr->row[0].row_bitmap); + + /* create a master job list and clear out ALL row data */ + tmpjobs = xmalloc(num_jobs * sizeof(struct job_resources *)); + jstart = xmalloc(num_jobs * sizeof(int)); + x = 0; + for (i = 0; i < p_ptr->num_rows; i++) { + for (j = 0; j < p_ptr->row[i].num_jobs; j++) { + tmpjobs[x] = p_ptr->row[i].job_list[j]; + p_ptr->row[i].job_list[j] = NULL; + jstart[x] = bit_ffs(tmpjobs[x]->node_bitmap); + jstart[x] = cr_get_coremap_offset(jstart[x]); + jstart[x] += bit_ffs(tmpjobs[x]->core_bitmap); + x++; + } + p_ptr->row[i].num_jobs = 0; + if (p_ptr->row[i].row_bitmap) { + bit_nclear(p_ptr->row[i].row_bitmap, 0, size-1); + } + } + + /* VERY difficult: Optimal placement of jobs in the matrix + * - how to order jobs to be added to the matrix? + * - "by size" does not guarantee optimal placement + * + * - for now, try sorting jobs by first bit set + * - if job allocations stay "in blocks", then this should work OK + * - may still get scenarios where jobs should switch rows + * - fixme: JOB SHUFFLING BETWEEN ROWS NEEDS TESTING + */ + for (i = 0; i < num_jobs; i++) { + for (j = i+1; j < num_jobs; j++) { + if (jstart[j] < jstart[i] + || (jstart[j] == jstart[i] && + tmpjobs[j]->ncpus > tmpjobs[i]->ncpus)) { + x = jstart[i]; + jstart[i] = jstart[j]; + jstart[j] = x; + job = tmpjobs[i]; + tmpjobs[i] = tmpjobs[j]; + tmpjobs[j] = job; + } + } + } + + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + for (i = 0; i < num_jobs; i++) { + char cstr[64], nstr[64]; + if (tmpjobs[i]->core_bitmap) { + bit_fmt(cstr, (sizeof(cstr)-1) , + tmpjobs[i]->core_bitmap); + } else + sprintf(cstr, "[no core_bitmap]"); + if (tmpjobs[i]->node_bitmap) { + bit_fmt(nstr, (sizeof(nstr)-1), + tmpjobs[i]->node_bitmap); + } else + sprintf(nstr, "[no node_bitmap]"); + info("DEBUG: jstart %d job nb %s cb %s", jstart[i], + nstr, cstr); + } + } + + /* add jobs to the rows */ + for (j = 0; j < num_jobs; j++) { + for (i = 0; i < p_ptr->num_rows; i++) { + if (_can_job_fit_in_row(tmpjobs[j], &(p_ptr->row[i]))) { + /* job fits in row, so add it */ + _add_job_to_row(tmpjobs[j], &(p_ptr->row[i])); + tmpjobs[j] = NULL; + break; + } + } + /* job should have been added, so shuffle the rows */ + cr_sort_part_rows(p_ptr); + } + + /* test for dangling jobs */ + for (j = 0; j < num_jobs; j++) { + if (tmpjobs[j]) + break; + } + if (j < num_jobs) { + /* we found a dangling job, which means our packing + * algorithm couldn't improve apon the existing layout. + * Thus, we'll restore the original layout here */ + debug3("cons_res: build_row_bitmap: dangling job found"); + + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("DEBUG: _build_row_bitmaps (post-algorithm):"); + _dump_part(p_ptr); + } + + _destroy_row_data(p_ptr->row, p_ptr->num_rows); + p_ptr->row = orig_row; + orig_row = NULL; + + /* still need to rebuild row_bitmaps */ + for (i = 0; i < p_ptr->num_rows; i++) { + if (p_ptr->row[i].row_bitmap) + bit_nclear(p_ptr->row[i].row_bitmap, 0, + size-1); + if (p_ptr->row[i].num_jobs == 0) + continue; + for (j = 0; j < p_ptr->row[i].num_jobs; j++) { + add_job_to_cores(p_ptr->row[i].job_list[j], + &(p_ptr->row[i].row_bitmap), + cr_node_num_cores); + } + } + } + + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("DEBUG: _build_row_bitmaps (after):"); + _dump_part(p_ptr); + } + + if (orig_row) + _destroy_row_data(orig_row, p_ptr->num_rows); + xfree(tmpjobs); + xfree(jstart); + return; + + /* LEFTOVER DESIGN THOUGHTS, PRESERVED HERE */ + + /* 1. sort jobs by size + * 2. only load core bitmaps with largest jobs that conflict + * 3. sort rows by set count + * 4. add remaining jobs, starting with fullest rows + * 5. compute set count: if disparity between rows got closer, then + * switch non-conflicting jobs that were added + */ + + /* + * Step 1: remove empty rows between non-empty rows + * Step 2: try to collapse rows + * Step 3: sort rows by size + * Step 4: try to swap jobs from different rows to pack rows + */ + + /* WORK IN PROGRESS - more optimization should go here, such as: + * + * - try collapsing jobs from higher rows to lower rows + * + * - produce a load array to identify cores with less load. Test + * to see if those cores are in the lower row. If not, try to swap + * those jobs with jobs in the lower row. If the job can be swapped + * AND the lower row set_count increases, then SUCCESS! else swap + * back. The goal is to pack the lower rows and "bubble up" clear + * bits to the higher rows. + */ +} + + +/* allocate resources to the given job + * - add 'struct job_resources' resources to 'struct part_res_record' + * - add job's memory requirements to 'struct node_res_record' + * + * if action = 0 then add cores and memory (starting new job) + * if action = 1 then only add memory (adding suspended job) + * if action = 2 then only add cores (suspended job is resumed) + */ +static int _add_job_to_res(struct job_record *job_ptr, int action) +{ + struct job_resources *job = job_ptr->job_resrcs; + struct node_record *node_ptr; + struct part_res_record *p_ptr; + List gres_list; + int i, n; + int i_first, i_last; + bitstr_t *core_bitmap; + + if (!job || !job->core_bitmap) { + error("select/serial: job %u has no select data", + job_ptr->job_id); + return SLURM_ERROR; + } + + debug3("select/serial: _add_job_to_res: job %u act %d ", + job_ptr->job_id, action); + + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) + _dump_job_res(job); + + i_first = bit_ffs(job->node_bitmap); + if (i_first == -1) { + error("select/serial: job %u allocated no nodes", + job_ptr->job_id); + i_last = -2; + } else { + i_last = bit_fls(job->node_bitmap); + if (i_first != i_last) { + error("select/serial: job %u allocated more than one " + "node", job_ptr->job_id); + } + } + + for (i = i_first, n = -1; i <= i_last; i++) { + if (!bit_test(job->node_bitmap, i)) + continue; + n++; + + node_ptr = select_node_record[i].node_ptr; + if (action != 2) { + if (select_node_usage[i].gres_list) + gres_list = select_node_usage[i].gres_list; + else + gres_list = node_ptr->gres_list; + core_bitmap = copy_job_resources_node(job, n); + gres_plugin_job_alloc(job_ptr->gres_list, gres_list, + job->nhosts, n, job->cpus[n], + job_ptr->job_id, node_ptr->name, + core_bitmap); + gres_plugin_node_state_log(gres_list, node_ptr->name); + FREE_NULL_BITMAP(core_bitmap); + } + + if (action != 2) { + if (job->memory_allocated[n] == 0) + continue; /* node lost by job resizing */ + select_node_usage[i].alloc_memory += + job->memory_allocated[n]; + if ((select_node_usage[i].alloc_memory > + select_node_record[i].real_memory)) { + error("select/serial: node %s memory is " + "overallocated (%u) for job %u", + node_ptr->name, + select_node_usage[i].alloc_memory, + job_ptr->job_id); + } + } + } + + /* add cores */ + if (action != 1) { + for (p_ptr = select_part_record; p_ptr; p_ptr = p_ptr->next) { + if (p_ptr->part_ptr == job_ptr->part_ptr) + break; + } + if (!p_ptr) { + error("select/serial: could not find cr partition %s", + job_ptr->part_ptr->name); + return SLURM_ERROR; + } + if (!p_ptr->row) { + p_ptr->row = xmalloc(p_ptr->num_rows * + sizeof(struct part_row_data)); + } + + /* find a row to add this job */ + for (i = 0; i < p_ptr->num_rows; i++) { + if (!_can_job_fit_in_row(job, &(p_ptr->row[i]))) + continue; + debug3("select/serial: adding job %u to part %s row %u", + job_ptr->job_id, p_ptr->part_ptr->name, i); + _add_job_to_row(job, &(p_ptr->row[i])); + break; + } + if (i >= p_ptr->num_rows) { + /* ERROR: could not find a row for this job */ + error("select/serial: job overflow: " + "could not find row for job"); + /* just add the job to the last row for now */ + _add_job_to_row(job, &(p_ptr->row[p_ptr->num_rows-1])); + } + /* update the node state */ + for (i = i_first; i < i_last; i++) { + if (bit_test(job->node_bitmap, i)) + select_node_usage[i].node_state += + job->node_req; + } + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: _add_job_to_res (after):"); + _dump_part(p_ptr); + } + } + + return SLURM_SUCCESS; +} + +/* deallocate resources previously allocated to the given job + * - subtract 'struct job_resources' resources from 'struct part_res_record' + * - subtract job's memory requirements from 'struct node_res_record' + * + * if action = 0 then subtract cores and memory (running job was terminated) + * if action = 1 then only subtract memory (suspended job was terminated) + * if action = 2 then only subtract cores (job is suspended) + * + */ +static int _rm_job_from_res(struct part_res_record *part_record_ptr, + struct node_use_record *node_usage, + struct job_record *job_ptr, int action) +{ + struct job_resources *job = job_ptr->job_resrcs; + struct node_record *node_ptr; + int i_first, i_last; + int i, n; + List gres_list; + + + if (select_state_initializing) { + /* Ignore job removal until select/cons_res data structures + * values are set by select_p_reconfigure() */ + return SLURM_SUCCESS; + } + if (!job || !job->core_bitmap) { + error("select/serial: job %u has no select data", + job_ptr->job_id); + return SLURM_ERROR; + } + + debug3("select/serial: _rm_job_from_res: job %u action %d", + job_ptr->job_id, action); + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) + _dump_job_res(job); + + i_first = bit_ffs(job->node_bitmap); + if (i_first == -1) { + error("select/serial: job %u allocated no nodes", + job_ptr->job_id); + i_last = -2; + } else + i_last = bit_fls(job->node_bitmap); + for (i = i_first, n = -1; i <= i_last; i++) { + if (!bit_test(job->node_bitmap, i)) + continue; + n++; + + node_ptr = node_record_table_ptr + i; + if (action != 2) { + if (node_usage[i].gres_list) + gres_list = node_usage[i].gres_list; + else + gres_list = node_ptr->gres_list; + gres_plugin_job_dealloc(job_ptr->gres_list, gres_list, + n, job_ptr->job_id, + node_ptr->name); + gres_plugin_node_state_log(gres_list, node_ptr->name); + } + + if (action != 2) { + if (job->memory_allocated[n] == 0) + continue; /* no memory allocated */ + if (node_usage[i].alloc_memory < + job->memory_allocated[n]) { + error("select/serial: node %s memory is " + "under-allocated (%u<%u) for job %u", + node_ptr->name, + node_usage[i].alloc_memory, + job->memory_allocated[n], + job_ptr->job_id); + node_usage[i].alloc_memory = 0; + } else { + node_usage[i].alloc_memory -= + job->memory_allocated[n]; + } + } + } + + /* subtract cores */ + if (action != 1) { + /* reconstruct rows with remaining jobs */ + struct part_res_record *p_ptr; + + if (!job_ptr->part_ptr) { + error("select/serial: removed job %u does not have a " + "partition assigned", + job_ptr->job_id); + return SLURM_ERROR; + } + + for (p_ptr = part_record_ptr; p_ptr; p_ptr = p_ptr->next) { + if (p_ptr->part_ptr == job_ptr->part_ptr) + break; + } + if (!p_ptr) { + error("select/serial: removed job %u could not find " + "part %s", + job_ptr->job_id, job_ptr->part_ptr->name); + return SLURM_ERROR; + } + + if (!p_ptr->row) + return SLURM_SUCCESS; + + /* remove the job from the job_list */ + n = 0; + for (i = 0; i < p_ptr->num_rows; i++) { + uint32_t j; + for (j = 0; j < p_ptr->row[i].num_jobs; j++) { + if (p_ptr->row[i].job_list[j] != job) + continue; + debug3("select/serial: removed job %u from " + "part %s row %u", + job_ptr->job_id, + p_ptr->part_ptr->name, i); + for (; j < p_ptr->row[i].num_jobs-1; j++) { + p_ptr->row[i].job_list[j] = + p_ptr->row[i].job_list[j+1]; + } + p_ptr->row[i].job_list[j] = NULL; + p_ptr->row[i].num_jobs -= 1; + /* found job - we're done */ + n = 1; + i = p_ptr->num_rows; + break; + } + } + + if (n) { + /* job was found and removed, so refresh the bitmaps */ + _build_row_bitmaps(p_ptr, job_ptr); + + /* Adjust the node_state of all nodes affected by + * the removal of this job. If all cores are now + * available, set node_state = NODE_CR_AVAILABLE + */ + for (i = i_first, n = -1; i < i_last; i++) { + if (bit_test(job->node_bitmap, i) == 0) + continue; + n++; + if (job->cpus[n] == 0) + continue; /* node lost by job resize */ + if (node_usage[i].node_state >= + job->node_req) { + node_usage[i].node_state -= + job->node_req; + } else { + error("select/serial: _rm_job_from_res:" + " node_state mis-count"); + node_usage[i].node_state = + NODE_CR_AVAILABLE; + } + } + } + } + + return SLURM_SUCCESS; +} + +/* Determine the node requirements for the job: + * - does the job need exclusive nodes? (NODE_CR_RESERVED) + * - can the job run on shared nodes? (NODE_CR_ONE_ROW) + * - can the job run on overcommitted resources? (NODE_CR_AVAILABLE) + */ +static uint16_t _get_job_node_share(struct job_record *job_ptr) +{ + int max_share = job_ptr->part_ptr->max_share; + + if (max_share == 0) /* Partition Shared=EXCLUSIVE */ + return NODE_CR_RESERVED; + + /* Partition is Shared=FORCE */ + if (max_share & SHARED_FORCE) + return NODE_CR_AVAILABLE; + + /* Partition is Shared=NO or Shared=YES */ + if (job_ptr->details->shared == 0) + /* user has requested exclusive nodes */ + return NODE_CR_RESERVED; + + if ((max_share > 1) && (job_ptr->details->shared == 1)) + /* part allows sharing, and the user has requested it */ + return NODE_CR_AVAILABLE; + + return NODE_CR_ONE_ROW; +} + +static int _find_job (void *x, void *key) +{ + struct job_record *job_ptr = (struct job_record *) x; + if (job_ptr == (struct job_record *) key) + return 1; + return 0; +} + +static bool _is_preemptable(struct job_record *job_ptr, + List preemptee_candidates) +{ + if (!preemptee_candidates) + return false; + if (list_find_first(preemptee_candidates, _find_job, job_ptr)) + return true; + return false; +} + +/* Determine if a job can ever run */ +static int _test_only(struct job_record *job_ptr, bitstr_t *bitmap, + uint16_t job_node_share) +{ + int rc; + + rc = cr_job_test(job_ptr, bitmap, + SELECT_MODE_TEST_ONLY, cr_type, job_node_share, + select_node_cnt, select_part_record, + select_node_usage); + return rc; +} + +/* + * Sort the usable_node element to put jobs in the correct + * preemption order. + */ +static int _sort_usable_nodes_dec(struct job_record *job_a, + struct job_record *job_b) +{ + if (job_a->details->usable_nodes > job_b->details->usable_nodes) + return -1; + else if (job_a->details->usable_nodes < job_b->details->usable_nodes) + return 1; + + return 0; +} + +/* Allocate resources for a job now, if possible */ +static int _run_now(struct job_record *job_ptr, bitstr_t *bitmap, + uint16_t job_node_share, + List preemptee_candidates, List *preemptee_job_list) +{ + int rc; + bitstr_t *orig_map = NULL, *save_bitmap; + struct job_record *tmp_job_ptr; + ListIterator job_iterator, preemptee_iterator; + struct part_res_record *future_part; + struct node_use_record *future_usage; + bool remove_some_jobs = false; + uint16_t pass_count = 0; + uint16_t mode; + + save_bitmap = bit_copy(bitmap); +top: orig_map = bit_copy(save_bitmap); + if (!orig_map) + fatal("bit_copy: malloc failure"); + + rc = cr_job_test(job_ptr, bitmap, + SELECT_MODE_RUN_NOW, cr_type, job_node_share, + select_node_cnt, select_part_record, + select_node_usage); + + if ((rc != SLURM_SUCCESS) && preemptee_candidates) { + /* Remove preemptable jobs from simulated environment */ + future_part = _dup_part_data(select_part_record); + if (future_part == NULL) { + FREE_NULL_BITMAP(orig_map); + FREE_NULL_BITMAP(save_bitmap); + return SLURM_ERROR; + } + future_usage = _dup_node_usage(select_node_usage); + if (future_usage == NULL) { + _destroy_part_data(future_part); + FREE_NULL_BITMAP(orig_map); + FREE_NULL_BITMAP(save_bitmap); + return SLURM_ERROR; + } + + job_iterator = list_iterator_create(preemptee_candidates); + if (job_iterator == NULL) + fatal ("memory allocation failure"); + while ((tmp_job_ptr = (struct job_record *) + list_next(job_iterator))) { + if (!IS_JOB_RUNNING(tmp_job_ptr) && + !IS_JOB_SUSPENDED(tmp_job_ptr)) + continue; + mode = slurm_job_preempt_mode(tmp_job_ptr); + if ((mode != PREEMPT_MODE_REQUEUE) && + (mode != PREEMPT_MODE_CHECKPOINT) && + (mode != PREEMPT_MODE_CANCEL)) + continue; /* can't remove job */ + /* Remove preemptable job now */ + _rm_job_from_res(future_part, future_usage, + tmp_job_ptr, 0); + bit_or(bitmap, orig_map); + rc = cr_job_test(job_ptr, bitmap, + SELECT_MODE_WILL_RUN, + cr_type, job_node_share, + select_node_cnt, + future_part, future_usage); + tmp_job_ptr->details->usable_nodes = 0; + /* + * If successful, set the last job's usable count to a + * large value so that it will be first after sorting. + * usable_nodes count set to zero above to eliminate + * values previously set to 9999. + * Note: usable_count is only used for sorting purposes + */ + if (rc == SLURM_SUCCESS) { + tmp_job_ptr->details->usable_nodes = 9999; + list_iterator_reset(job_iterator); + while ((tmp_job_ptr = (struct job_record *) + list_next(job_iterator))) { + if (tmp_job_ptr->details->usable_nodes + == 9999) + break; + tmp_job_ptr->details->usable_nodes = + bit_overlap(bitmap, + tmp_job_ptr-> + node_bitmap); + } + while ((tmp_job_ptr = (struct job_record *) + list_next(job_iterator))) { + tmp_job_ptr->details->usable_nodes = 0; + } + if (pass_count++ || + (list_count(preemptee_candidates) == 1)) + break; + list_sort(preemptee_candidates, + (ListCmpF)_sort_usable_nodes_dec); + FREE_NULL_BITMAP(orig_map); + list_iterator_destroy(job_iterator); + goto top; + } + } + list_iterator_destroy(job_iterator); + + if ((rc == SLURM_SUCCESS) && preemptee_job_list && + preemptee_candidates) { + /* Build list of preemptee jobs whose resources are + * actually used */ + if (*preemptee_job_list == NULL) { + *preemptee_job_list = list_create(NULL); + if (*preemptee_job_list == NULL) + fatal("list_create malloc failure"); + } + preemptee_iterator = list_iterator_create( + preemptee_candidates); + if (preemptee_iterator == NULL) + fatal ("memory allocation failure"); + while ((tmp_job_ptr = (struct job_record *) + list_next(preemptee_iterator))) { + mode = slurm_job_preempt_mode(tmp_job_ptr); + if ((mode != PREEMPT_MODE_REQUEUE) && + (mode != PREEMPT_MODE_CHECKPOINT) && + (mode != PREEMPT_MODE_CANCEL)) + continue; + if (tmp_job_ptr->details->usable_nodes == 0) + continue; + list_append(*preemptee_job_list, + tmp_job_ptr); + remove_some_jobs = true; + } + list_iterator_destroy(preemptee_iterator); + if (!remove_some_jobs) { + list_destroy(*preemptee_job_list); + *preemptee_job_list = NULL; + } + } + + _destroy_part_data(future_part); + _destroy_node_data(future_usage, NULL); + } + FREE_NULL_BITMAP(orig_map); + FREE_NULL_BITMAP(save_bitmap); + + return rc; +} + +/* _will_run_test - determine when and where a pending job can start, removes + * jobs from node table at termination time and run _test_job() after + * each one. Used by SLURM's sched/backfill plugin and Moab. */ +static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, + uint16_t job_node_share, + List preemptee_candidates, List *preemptee_job_list) +{ + struct part_res_record *future_part; + struct node_use_record *future_usage; + struct job_record *tmp_job_ptr; + List cr_job_list; + ListIterator job_iterator, preemptee_iterator; + bitstr_t *orig_map; + int action, rc = SLURM_ERROR; + time_t now = time(NULL); + + orig_map = bit_copy(bitmap); + if (!orig_map) + fatal("bit_copy: malloc failure"); + + /* Try to run with currently available nodes */ + rc = cr_job_test(job_ptr, bitmap, + SELECT_MODE_WILL_RUN, cr_type, job_node_share, + select_node_cnt, select_part_record, + select_node_usage); + if (rc == SLURM_SUCCESS) { + FREE_NULL_BITMAP(orig_map); + job_ptr->start_time = time(NULL); + return SLURM_SUCCESS; + } + + /* Job is still pending. Simulate termination of jobs one at a time + * to determine when and where the job can start. */ + future_part = _dup_part_data(select_part_record); + if (future_part == NULL) { + FREE_NULL_BITMAP(orig_map); + return SLURM_ERROR; + } + future_usage = _dup_node_usage(select_node_usage); + if (future_usage == NULL) { + _destroy_part_data(future_part); + FREE_NULL_BITMAP(orig_map); + return SLURM_ERROR; + } + + /* Build list of running and suspended jobs */ + cr_job_list = list_create(NULL); + if (!cr_job_list) + fatal("list_create: memory allocation error"); + job_iterator = list_iterator_create(job_list); + if (job_iterator == NULL) + fatal ("memory allocation failure"); + while ((tmp_job_ptr = (struct job_record *) list_next(job_iterator))) { + if (!IS_JOB_RUNNING(tmp_job_ptr) && + !IS_JOB_SUSPENDED(tmp_job_ptr)) + continue; + if (tmp_job_ptr->end_time == 0) { + error("Job %u has zero end_time", tmp_job_ptr->job_id); + continue; + } + if (_is_preemptable(tmp_job_ptr, preemptee_candidates)) { + uint16_t mode = slurm_job_preempt_mode(tmp_job_ptr); + if (mode == PREEMPT_MODE_OFF) + continue; + if (mode == PREEMPT_MODE_SUSPEND) + action = 2; /* remove cores, keep memory */ + else + action = 0; /* remove cores and memory */ + /* Remove preemptable job now */ + _rm_job_from_res(future_part, future_usage, + tmp_job_ptr, action); + } else + list_append(cr_job_list, tmp_job_ptr); + } + list_iterator_destroy(job_iterator); + + /* Test with all preemptable jobs gone */ + if (preemptee_candidates) { + bit_or(bitmap, orig_map); + rc = cr_job_test(job_ptr, bitmap, + SELECT_MODE_WILL_RUN, cr_type, + job_node_share, select_node_cnt, future_part, + future_usage); + if (rc == SLURM_SUCCESS) + job_ptr->start_time = now + 1; + } + + /* 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) { + list_sort(cr_job_list, _cr_job_list_sort); + job_iterator = list_iterator_create(cr_job_list); + if (job_iterator == NULL) + fatal ("memory allocation failure"); + while ((tmp_job_ptr = list_next(job_iterator))) { + int ovrlap; + bit_or(bitmap, orig_map); + ovrlap = bit_overlap(bitmap, tmp_job_ptr->node_bitmap); + if (ovrlap == 0) /* job has no usable nodes */ + continue; /* skip it */ + debug2("cons_res: _will_run_test, job %u: overlap=%d", + tmp_job_ptr->job_id, ovrlap); + _rm_job_from_res(future_part, future_usage, + tmp_job_ptr, 0); + rc = cr_job_test(job_ptr, bitmap, + SELECT_MODE_WILL_RUN, cr_type, + job_node_share, select_node_cnt, + future_part, future_usage); + if (rc == SLURM_SUCCESS) { + if (tmp_job_ptr->end_time <= now) + job_ptr->start_time = now + 1; + else + job_ptr->start_time = tmp_job_ptr-> + end_time; + break; + } + } + list_iterator_destroy(job_iterator); + } + + if ((rc == SLURM_SUCCESS) && preemptee_job_list && + preemptee_candidates) { + /* Build list of preemptee jobs whose resources are + * actually used. List returned even if not killed + * in selected plugin, but by Moab or something else. */ + if (*preemptee_job_list == NULL) { + *preemptee_job_list = list_create(NULL); + if (*preemptee_job_list == NULL) + fatal("list_create malloc failure"); + } + preemptee_iterator =list_iterator_create(preemptee_candidates); + if (preemptee_iterator == NULL) + fatal ("memory allocation failure"); + while ((tmp_job_ptr = (struct job_record *) + list_next(preemptee_iterator))) { + if (bit_overlap(bitmap, + tmp_job_ptr->node_bitmap) == 0) + continue; + list_append(*preemptee_job_list, tmp_job_ptr); + } + list_iterator_destroy(preemptee_iterator); + } + + list_destroy(cr_job_list); + _destroy_part_data(future_part); + _destroy_node_data(future_usage, NULL); + FREE_NULL_BITMAP(orig_map); + return rc; +} + +/* + * init() is called when the plugin is loaded, before any other functions + * are called. Put global initialization here. + */ +extern int init(void) +{ + cr_type = slurmctld_conf.select_type_param; + if (cr_type) + verbose("%s loaded with argument %u", plugin_name, cr_type); + select_debug_flags = slurm_get_debug_flags(); + + return SLURM_SUCCESS; +} + +extern int fini(void) +{ + _destroy_node_data(select_node_usage, select_node_record); + select_node_record = NULL; + select_node_usage = NULL; + _destroy_part_data(select_part_record); + select_part_record = NULL; + xfree(cr_node_num_cores); + xfree(cr_node_cores_offset); + + if (cr_type) + verbose("%s shutting down ...", plugin_name); + + return SLURM_SUCCESS; +} + +/* + * The remainder of this file implements the standard SLURM + * node selection API. + */ + +extern int select_p_state_save(char *dir_name) +{ + /* nothing to save */ + return SLURM_SUCCESS; +} + +/* This is Part 2 of a 4-part procedure which can be found in + * src/slurmctld/read_config.c. See select_p_node_init for the + * whole story. + */ +extern int select_p_state_restore(char *dir_name) +{ + /* nothing to restore */ + return SLURM_SUCCESS; +} + +/* This is Part 3 of a 4-part procedure which can be found in + * src/slurmctld/read_config.c. See select_p_node_init for the + * whole story. + */ +extern int select_p_job_init(List job_list) +{ + /* nothing to initialize for jobs */ + return SLURM_SUCCESS; +} + +/* This plugin does not generate a node ranking. */ +extern bool select_p_node_ranking(struct node_record *node_ptr, int node_cnt) +{ + return false; +} + +/* This is Part 1 of a 4-part procedure which can be found in + * src/slurmctld/read_config.c. The whole story goes like this: + * + * Step 1: select_g_node_init : initializes the global node arrays + * Step 2: select_g_state_restore : NO-OP - nothing to restore + * Step 3: select_g_job_init : NO-OP - nothing to initialize + * Step 4: select_g_select_nodeinfo_set: called from reset_job_bitmaps() with + * each valid recovered job_ptr AND from + * select_nodes(), this procedure adds + * job data to the 'select_part_record' + * global array + */ +extern int select_p_node_init(struct node_record *node_ptr, int node_cnt) +{ + int i, tot_core; + + info("cons_res: select_p_node_init"); + if ((cr_type & (CR_CPU | CR_CORE)) == 0) { + fatal("Invalid SelectTypeParameter: %s", + sched_param_type_string(cr_type)); + } + if (node_ptr == NULL) { + error("select_p_node_init: node_ptr == NULL"); + return SLURM_ERROR; + } + if (node_cnt < 0) { + error("select_p_node_init: node_cnt < 0"); + return SLURM_ERROR; + } + + /* initial global core data structures */ + select_state_initializing = true; + select_fast_schedule = slurm_get_fast_schedule(); + _init_global_core_data(node_ptr, node_cnt); + + _destroy_node_data(select_node_usage, select_node_record); + select_node_cnt = node_cnt; + select_node_record = xmalloc(node_cnt * + sizeof(struct node_res_record)); + select_node_usage = xmalloc(node_cnt * + sizeof(struct node_use_record)); + + for (i = 0; i < select_node_cnt; i++) { + select_node_record[i].node_ptr = &node_ptr[i]; + if (select_fast_schedule) { + struct config_record *config_ptr; + config_ptr = node_ptr[i].config_ptr; + select_node_record[i].cpus = config_ptr->cpus; + select_node_record[i].sockets = config_ptr->sockets; + select_node_record[i].cores = config_ptr->cores; + select_node_record[i].vpus = config_ptr->threads; + select_node_record[i].real_memory = config_ptr-> + real_memory; + } else { + select_node_record[i].cpus = node_ptr[i].cpus; + select_node_record[i].sockets = node_ptr[i].sockets; + select_node_record[i].cores = node_ptr[i].cores; + select_node_record[i].vpus = node_ptr[i].threads; + select_node_record[i].real_memory = node_ptr[i]. + real_memory; + } + tot_core = select_node_record[i].sockets * + select_node_record[i].cores; + if (tot_core >= select_node_record[i].cpus) + select_node_record[i].vpus = 1; + select_node_usage[i].node_state = NODE_CR_AVAILABLE; + gres_plugin_node_state_dealloc_all(select_node_record[i]. + node_ptr->gres_list); + } + _create_part_data(); + + return SLURM_SUCCESS; +} + +extern int select_p_block_init(List part_list) +{ + return SLURM_SUCCESS; +} + +static bool _is_job_spec_serial(struct job_record *job_ptr) +{ + struct job_details *details_ptr = job_ptr->details; + struct multi_core_data *mc_ptr = NULL; + + if (details_ptr) { + if ((details_ptr->cpus_per_task > 1) && + (details_ptr->cpus_per_task != (uint16_t) NO_VAL)) + return false; + if ((details_ptr->min_cpus > 1) && + (details_ptr->min_cpus != NO_VAL)) + return false; + if ((details_ptr->min_nodes > 1) && + (details_ptr->min_nodes != NO_VAL)) + return false; + details_ptr->max_nodes = 1; + if ((details_ptr->ntasks_per_node > 1) && + (details_ptr->ntasks_per_node != (uint16_t) NO_VAL)) + return false; + if ((details_ptr->num_tasks > 1) && + (details_ptr->num_tasks != NO_VAL)) + return false; + if (details_ptr->pn_min_cpus > 1) + return false; + if (details_ptr->req_node_bitmap && + (bit_set_count(details_ptr->req_node_bitmap) > 1)) + return false; + mc_ptr = details_ptr->mc_ptr; + } + + if (mc_ptr) { + /* If data structure exists then heck once and destroy it */ + if ((mc_ptr->cores_per_socket != (uint16_t) NO_VAL) && + (mc_ptr->cores_per_socket > 1)) + return false; + if ((mc_ptr->ntasks_per_core != (uint16_t) INFINITE) && + (mc_ptr->ntasks_per_core > 1)) + return false; + if ((mc_ptr->ntasks_per_socket != (uint16_t) INFINITE) && + (mc_ptr->ntasks_per_socket > 1)) + return false; + if ((mc_ptr->sockets_per_node != (uint16_t) NO_VAL) && + (mc_ptr->sockets_per_node > 1)) + return false; + if ((mc_ptr->threads_per_core != (uint16_t) NO_VAL) && + (mc_ptr->threads_per_core > 1)) + return false; + xfree(job_ptr->details->mc_ptr); + } + + return true; +} + +/* + * select_p_job_test - Given a specification of scheduling requirements, + * identify the nodes which "best" satisfy the request. + * "best" is defined as either a minimal number of consecutive nodes + * or if sharing resources then sharing them with a job of similar size. + * IN/OUT job_ptr - pointer to job being considered for initiation, + * set's start_time when job expected to start + * IN/OUT bitmap - usable nodes are set on input, nodes not required to + * satisfy the request are cleared, other left set + * IN min_nodes - minimum count of nodes + * IN req_nodes - requested (or desired) count of nodes + * IN max_nodes - maximum count of nodes (0==don't care) + * IN mode - SELECT_MODE_RUN_NOW: try to schedule job now + * SELECT_MODE_TEST_ONLY: test if job can ever run + * SELECT_MODE_WILL_RUN: determine when and where job can run + * IN preemptee_candidates - List of pointers to jobs which can be preempted. + * IN/OUT preemptee_job_list - Pointer to list of job pointers. These are the + * jobs to be preempted to initiate the pending job. Not set + * if mode=SELECT_MODE_TEST_ONLY or input pointer is NULL. + * RET zero on success, EINVAL otherwise + * globals (passed via select_p_node_init): + * node_record_count - count of nodes configured + * node_record_table_ptr - pointer to global node table + * NOTE: the job information that is considered for scheduling includes: + * req_node_bitmap: bitmap of specific nodes required by the job + * contiguous: allocated nodes must be sequentially located + * num_cpus: minimum number of processors required by the job + * NOTE: bitmap must be a superset of req_nodes at the time that + * select_p_job_test is called + */ +extern int select_p_job_test(struct job_record *job_ptr, bitstr_t * bitmap, + uint32_t min_nodes, uint32_t max_nodes, + uint32_t req_nodes, uint16_t mode, + List preemptee_candidates, + List *preemptee_job_list) +{ + int rc = EINVAL; + uint16_t job_node_share; + bool debug_cpu_bind = false, debug_check = false; + + xassert(bitmap); + + if (!debug_check) { + debug_check = true; + if (slurm_get_debug_flags() & DEBUG_FLAG_CPU_BIND) + debug_cpu_bind = true; + } + + if (!job_ptr->details) + return EINVAL; + if ((min_nodes > 1) || !_is_job_spec_serial(job_ptr)) { + info("select/serial: job %u not serial", job_ptr->job_id); + return SLURM_ERROR; + } + + job_node_share = _get_job_node_share(job_ptr); + + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + info("select/serial: select_p_job_test: job %u node_share %u " + "mode %d avail_n %u", + job_ptr->job_id, job_node_share, mode, + bit_set_count(bitmap)); + _dump_state(select_part_record); + } + if (mode == SELECT_MODE_WILL_RUN) { + rc = _will_run_test(job_ptr, bitmap, job_node_share, + preemptee_candidates, preemptee_job_list); + } else if (mode == SELECT_MODE_TEST_ONLY) { + rc = _test_only(job_ptr, bitmap, job_node_share); + } else if (mode == SELECT_MODE_RUN_NOW) { + rc = _run_now(job_ptr, bitmap, job_node_share, + preemptee_candidates, preemptee_job_list); + } else + fatal("select_p_job_test: Mode %d is invalid", mode); + + if (select_debug_flags & DEBUG_FLAG_CPU_BIND) { + if (job_ptr->job_resrcs) + log_job_resources(job_ptr->job_id, job_ptr->job_resrcs); + else { + info("no job_resources info for job %u", + job_ptr->job_id); + } + } else if (debug_cpu_bind && job_ptr->job_resrcs) { + log_job_resources(job_ptr->job_id, job_ptr->job_resrcs); + } + + return rc; +} + +extern int select_p_job_begin(struct job_record *job_ptr) +{ + return SLURM_SUCCESS; +} + +/* Determine if allocated nodes are usable (powered up) */ +extern int select_p_job_ready(struct job_record *job_ptr) +{ + int i, i_first, i_last; + struct node_record *node_ptr; + + if (!IS_JOB_RUNNING(job_ptr) && !IS_JOB_SUSPENDED(job_ptr)) { + /* Gang scheduling might suspend job immediately */ + return 0; + } + + if ((job_ptr->node_bitmap == NULL) || + ((i_first = bit_ffs(job_ptr->node_bitmap)) == -1)) + return READY_NODE_STATE; + i_last = bit_fls(job_ptr->node_bitmap); + + for (i=i_first; i<=i_last; i++) { + if (bit_test(job_ptr->node_bitmap, i) == 0) + continue; + node_ptr = node_record_table_ptr + i; + if (IS_NODE_POWER_SAVE(node_ptr) || IS_NODE_POWER_UP(node_ptr)) + return 0; + } + + return READY_NODE_STATE; +} + +extern int select_p_job_resized(struct job_record *job_ptr, + struct node_record *node_ptr) +{ + return SLURM_ERROR; +} + +extern bool select_p_job_expand_allow(void) +{ + return false; +} + +extern int select_p_job_expand(struct job_record *from_job_ptr, + struct job_record *to_job_ptr) +{ + return SLURM_ERROR; +} + +extern int select_p_job_signal(struct job_record *job_ptr, int signal) +{ + xassert(job_ptr); + xassert(job_ptr->magic == JOB_MAGIC); + + return SLURM_SUCCESS; +} + +extern int select_p_job_fini(struct job_record *job_ptr) +{ + xassert(job_ptr); + xassert(job_ptr->magic == JOB_MAGIC); + + _rm_job_from_res(select_part_record, select_node_usage, job_ptr, 0); + + return SLURM_SUCCESS; +} + +/* NOTE: This function is not called with gang scheduling because it + * needs to track how many jobs are running or suspended on each node. + * This sum is compared with the partition's Shared parameter */ +extern int select_p_job_suspend(struct job_record *job_ptr, bool indf_susp) +{ + xassert(job_ptr); + + if (!indf_susp) + return SLURM_SUCCESS; + + return _rm_job_from_res(select_part_record, select_node_usage, + job_ptr, 2); +} + +/* See NOTE with select_p_job_suspend above */ +extern int select_p_job_resume(struct job_record *job_ptr, bool indf_susp) +{ + xassert(job_ptr); + + if (!indf_susp) + return SLURM_SUCCESS; + + return _add_job_to_res(job_ptr, 2); +} + + +extern bitstr_t *select_p_step_pick_nodes(struct job_record *job_ptr, + select_jobinfo_t *jobinfo, + uint32_t node_count) +{ + return NULL; +} + +extern int select_p_step_finish(struct step_record *step_ptr) +{ + return SLURM_SUCCESS; +} + +extern int select_p_pack_select_info(time_t last_query_time, + uint16_t show_flags, Buf *buffer_ptr, + uint16_t protocol_version) +{ + /* This function is always invalid on normal Linux clusters */ + return SLURM_ERROR; +} + +extern int select_p_select_nodeinfo_pack(select_nodeinfo_t *nodeinfo, + Buf buffer, + uint16_t protocol_version) +{ + pack16(nodeinfo->alloc_cpus, buffer); + + return SLURM_SUCCESS; +} + +extern int select_p_select_nodeinfo_unpack(select_nodeinfo_t **nodeinfo, + Buf buffer, + uint16_t protocol_version) +{ + select_nodeinfo_t *nodeinfo_ptr = NULL; + + nodeinfo_ptr = select_p_select_nodeinfo_alloc(); + *nodeinfo = nodeinfo_ptr; + + safe_unpack16(&nodeinfo_ptr->alloc_cpus, buffer); + + return SLURM_SUCCESS; + +unpack_error: + error("select_nodeinfo_unpack: error unpacking here"); + select_p_select_nodeinfo_free(nodeinfo_ptr); + *nodeinfo = NULL; + + return SLURM_ERROR; +} + +extern select_nodeinfo_t *select_p_select_nodeinfo_alloc(void) +{ + select_nodeinfo_t *nodeinfo = xmalloc(sizeof(struct select_nodeinfo)); + + nodeinfo->magic = NODEINFO_MAGIC; + + return nodeinfo; +} + +extern int select_p_select_nodeinfo_free(select_nodeinfo_t *nodeinfo) +{ + if (nodeinfo) { + if (nodeinfo->magic != NODEINFO_MAGIC) { + error("select_p_select_nodeinfo_free: " + "nodeinfo magic bad"); + return EINVAL; + } + nodeinfo->magic = 0; + xfree(nodeinfo); + } + return SLURM_SUCCESS; +} + +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; + static time_t last_set_all = 0; + uint32_t node_threads, node_cpus; + select_nodeinfo_t *nodeinfo = NULL; + + /* only set this once when the last_node_update is newer than + the last time we set things up. */ + if (last_set_all && (last_node_update < last_set_all)) { + debug2("Node select info for set all hasn't " + "changed since %ld", + (long)last_set_all); + return SLURM_NO_CHANGE_IN_DATA; + } + last_set_all = last_node_update; + + 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 + * the correct data to work on. i.e. cray calls this + * plugin from within select/cray which has it's own + * struct. + */ + select_g_select_nodeinfo_get(node_ptr->select_nodeinfo, + SELECT_NODEDATA_PTR, 0, + (void *)&nodeinfo); + if (!nodeinfo) { + error("no nodeinfo returned from structure"); + continue; + } + + if (slurmctld_conf.fast_schedule) { + node_cpus = node_ptr->config_ptr->cpus; + node_threads = node_ptr->config_ptr->threads; + } else { + node_cpus = node_ptr->cpus; + node_threads = node_ptr->threads; + } + + 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; + } + } + + /* 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; + + nodeinfo->alloc_cpus = tmp_16; + } + + return SLURM_SUCCESS; +} + +extern int select_p_select_nodeinfo_set(struct job_record *job_ptr) +{ + int rc; + xassert(job_ptr); + xassert(job_ptr->magic == JOB_MAGIC); + + if (!IS_JOB_RUNNING(job_ptr) && !IS_JOB_SUSPENDED(job_ptr)) + return SLURM_SUCCESS; + + rc = _add_job_to_res(job_ptr, 0); + gres_plugin_job_state_log(job_ptr->gres_list, job_ptr->job_id); + + return rc; +} + +extern int select_p_select_nodeinfo_get(select_nodeinfo_t *nodeinfo, + enum select_nodedata_type dinfo, + enum node_states state, + void *data) +{ + int rc = SLURM_SUCCESS; + uint16_t *uint16 = (uint16_t *) data; + char **tmp_char = (char **) data; + select_nodeinfo_t **select_nodeinfo = (select_nodeinfo_t **) data; + + if (nodeinfo == NULL) { + error("get_nodeinfo: nodeinfo not set"); + return SLURM_ERROR; + } + + if (nodeinfo->magic != NODEINFO_MAGIC) { + error("get_nodeinfo: jobinfo magic bad"); + return SLURM_ERROR; + } + + switch (dinfo) { + case SELECT_NODEDATA_SUBGRP_SIZE: + *uint16 = 0; + break; + case SELECT_NODEDATA_SUBCNT: + if (state == NODE_STATE_ALLOCATED) + *uint16 = nodeinfo->alloc_cpus; + else + *uint16 = 0; + break; + case SELECT_NODEDATA_PTR: + *select_nodeinfo = nodeinfo; + break; + case SELECT_NODEDATA_RACK_MP: + case SELECT_NODEDATA_EXTRA_INFO: + *tmp_char = NULL; + break; + default: + error("Unsupported option %d for get_nodeinfo.", dinfo); + rc = SLURM_ERROR; + break; + } + return rc; +} + +extern int select_p_select_jobinfo_alloc(void) +{ + return SLURM_SUCCESS; +} + +extern int select_p_select_jobinfo_free(select_jobinfo_t *jobinfo) +{ + return SLURM_SUCCESS; +} + +extern int select_p_select_jobinfo_set(select_jobinfo_t *jobinfo, + enum select_jobdata_type data_type, + void *data) +{ + return SLURM_SUCCESS; +} + +extern int select_p_select_jobinfo_get(select_jobinfo_t *jobinfo, + enum select_jobdata_type data_type, + void *data) +{ + return SLURM_ERROR; +} + +extern select_jobinfo_t *select_p_select_jobinfo_copy( + select_jobinfo_t *jobinfo) +{ + return NULL; +} + +extern int select_p_select_jobinfo_pack(select_jobinfo_t *jobinfo, Buf buffer, + uint16_t protocol_version) +{ + return SLURM_SUCCESS; +} + +extern int select_p_select_jobinfo_unpack(select_jobinfo_t *jobinfo, + Buf buffer, + uint16_t protocol_version) +{ + return SLURM_SUCCESS; +} + +extern char *select_p_select_jobinfo_sprint(select_jobinfo_t *jobinfo, + char *buf, size_t size, int mode) +{ + if (buf && size) { + buf[0] = '\0'; + return buf; + } else + return NULL; +} + +extern char *select_p_select_jobinfo_xstrdup(select_jobinfo_t *jobinfo, + int mode) +{ + return NULL; +} + +extern int select_p_update_block(update_part_msg_t *part_desc_ptr) +{ + return SLURM_SUCCESS; +} + +extern int select_p_update_sub_node(update_part_msg_t *part_desc_ptr) +{ + return SLURM_SUCCESS; +} + +extern int select_p_fail_cnode(struct step_record *step_ptr) +{ + return SLURM_SUCCESS; +} + +extern int select_p_get_info_from_plugin(enum select_plugindata_info info, + struct job_record *job_ptr, + void *data) +{ + int rc = SLURM_SUCCESS; + uint32_t *tmp_32 = (uint32_t *) data; + List *tmp_list = (List *) data; + + switch (info) { + case SELECT_CR_PLUGIN: + /* Treat like select/cons_res with repect to allocating + * individual CPUs */ + *tmp_32 = 1; + break; + case SELECT_CONFIG_INFO: + *tmp_list = NULL; + break; + default: + error("select_p_get_info_from_plugin info %d invalid", info); + rc = SLURM_ERROR; + break; + } + return rc; +} + +/* For right now, we just update the node's memory size. In order to update + * socket, core, thread or cpu count, we would need to rebuild many bitmaps. */ +extern int select_p_update_node_config(int index) +{ + if (index >= select_node_cnt) { + error("select_p_update_node_config: index too large %d>%d", + index, select_node_cnt); + return SLURM_ERROR; + } + + if (select_fast_schedule) + return SLURM_SUCCESS; + + select_node_record[index].real_memory = select_node_record[index]. + node_ptr->real_memory; + return SLURM_SUCCESS; +} + +extern int select_p_update_node_state(struct node_record *node_ptr) +{ + return SLURM_SUCCESS; +} + +extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data) +{ + return SLURM_SUCCESS; +} + +extern int select_p_reconfigure(void) +{ + ListIterator job_iterator; + struct job_record *job_ptr; + int rc = SLURM_SUCCESS; + + info("cons_res: select_p_reconfigure"); + select_debug_flags = slurm_get_debug_flags(); + + /* Rebuild the global data structures */ + job_preemption_enabled = false; + job_preemption_killing = false; + job_preemption_tested = false; + rc = select_p_node_init(node_record_table_ptr, node_record_count); + if (rc != SLURM_SUCCESS) + return rc; + + /* reload job data */ + job_iterator = list_iterator_create(job_list); + if (job_iterator == NULL) + fatal ("memory allocation failure"); + while ((job_ptr = (struct job_record *) list_next(job_iterator))) { + if (IS_JOB_RUNNING(job_ptr)) { + /* add the job */ + _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, 2); + } + } + list_iterator_destroy(job_iterator); + select_state_initializing = false; + + return SLURM_SUCCESS; +} + +extern bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt) +{ + xassert(avail_bitmap); + return bit_pick_cnt(avail_bitmap, node_cnt); +} + +extern void select_p_ba_init(node_info_msg_t *node_info_ptr, bool sanity_check) +{ + return; +} +extern void select_p_ba_fini(void) +{ + return; +} + +extern int *select_p_ba_get_dims(void) +{ + return NULL; +} diff --git a/src/plugins/select/serial/select_serial.h b/src/plugins/select/serial/select_serial.h new file mode 100644 index 0000000000000000000000000000000000000000..90da1cc35db1c8a00a72036c65b54561116b6f11 --- /dev/null +++ b/src/plugins/select/serial/select_serial.h @@ -0,0 +1,132 @@ +/*****************************************************************************\ + * select_serial.n - resource selection plugin supporting serial (since CPU) + * job allocations. + ***************************************************************************** + * Copyright (C) 2006 Hewlett-Packard Development Company, L.P. +* Portions Copyright (C) 2010 SchedMD . + * Written by Susanne M. Balle, + * CODE-OCEC-09-009. All rights reserved. + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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_SERIAL_H +#define _SELECT_SERIAL_H + +#include +#include +#include + +#include "slurm/slurm.h" +#include "slurm/slurm_errno.h" + +#include "src/common/bitstring.h" +#include "src/common/gres.h" +#include "src/common/list.h" +#include "src/common/log.h" +#include "src/common/node_select.h" +#include "src/common/pack.h" +#include "src/common/slurm_protocol_api.h" +#include "src/common/xassert.h" +#include "src/common/xmalloc.h" +#include "src/common/xstring.h" +#include "src/common/slurm_resource_info.h" +#include "src/common/slurm_topology.h" +#include "src/slurmctld/preempt.h" +#include "src/slurmctld/slurmctld.h" + +#include "src/slurmd/slurmd/slurmd.h" + +/* + * node_res_record.node_state assists with the unique state of each node. + * When a job is allocated, these flags provide protection for nodes in a + * Shared=NO or Shared=EXCLUSIVE partition from other jobs. + * + * NOTES: + * - If node is in use by Shared=NO part, some CPUs/memory may be available + * - Caution with NODE_CR_AVAILABLE: a Sharing partition could be full. + * + * - these values are staggered so that they can be incremented as multiple + * jobs are allocated to each node. This is needed to be able to support + * preemption, which can override these protections. + */ +enum node_cr_state { + NODE_CR_AVAILABLE = 0, /* The node may be IDLE or IN USE (shared) */ + NODE_CR_ONE_ROW = 1, /* node is in use by Shared=NO part */ + NODE_CR_RESERVED = 10000, /* node is in use by Shared=EXCLUSIVE part */ +}; + +/* a partition's per-row CPU allocation data */ +struct part_row_data { + bitstr_t *row_bitmap; /* contains all jobs for this row */ + uint32_t num_jobs; /* Number of jobs in this row */ + struct job_resources **job_list;/* List of jobs in this row */ + uint32_t job_list_size; /* Size of job_list array */ +}; + +/* partition CPU allocation data */ +struct part_res_record { + struct part_res_record *next; /* Ptr to next part_res_record */ + uint16_t num_rows; /* Number of row_bitmaps */ + struct part_record *part_ptr; /* controller part record pointer */ + struct part_row_data *row; /* array of rows containing jobs */ +}; + +/* per-node resource data */ +struct node_res_record { + struct node_record *node_ptr; /* ptr to the actual node */ + uint16_t cpus; /* count of processors configured */ + uint16_t sockets; /* count of sockets configured */ + uint16_t cores; /* count of cores configured */ + uint16_t vpus; /* count of virtual cpus (hyperthreads) + * configured per core */ + uint32_t real_memory; /* MB of real memory configured */ +}; + +/* per-node resource usage record */ +struct node_use_record { + uint32_t alloc_memory; /* real memory reserved by already + * scheduled jobs */ + List gres_list; /* list of gres state info managed by + * plugins */ + uint16_t node_state; /* see node_cr_state comments */ +}; + +extern uint32_t select_debug_flags; +extern uint16_t select_fast_schedule; + +extern struct part_res_record *select_part_record; +extern struct node_res_record *select_node_record; +extern struct node_use_record *select_node_usage; + +extern void cr_sort_part_rows(struct part_res_record *p_ptr); +extern uint32_t cr_get_coremap_offset(uint32_t node_index); + +#endif /* !_SELECT_SERIAL_H */ diff --git a/src/plugins/switch/Makefile.am b/src/plugins/switch/Makefile.am index 1d9b5c93507618585cb8afb2c3bb67cc77c834e0..7610a2d2af51d4627b3976a50cb9aef8f34522e6 100644 --- a/src/plugins/switch/Makefile.am +++ b/src/plugins/switch/Makefile.am @@ -1,3 +1,3 @@ # Makefile for switch plugins -SUBDIRS = elan none federation +SUBDIRS = none nrt diff --git a/src/plugins/switch/Makefile.in b/src/plugins/switch/Makefile.in index 6a7c7c1ca82914f7b64c6800095a84d2e7ae9ad2..fb2cf171d59691909c1969fe0300f3bac457bb06 100644 --- a/src/plugins/switch/Makefile.in +++ b/src/plugins/switch/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -327,7 +326,7 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = elan none federation +SUBDIRS = none nrt all: all-recursive .SUFFIXES: @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/switch/elan/Makefile.am b/src/plugins/switch/elan/Makefile.am deleted file mode 100644 index 5717122e358c68fa8d2a7fc0cb8e7cf3ca735f4b..0000000000000000000000000000000000000000 --- a/src/plugins/switch/elan/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -# Makefile for switch/elan plugin - -AUTOMAKE_OPTIONS = foreign - -if HAVE_ELAN -elan_lib = switch_elan.la -else -elan_lib = -endif - -PLUGIN_FLAGS = -module -avoid-version --export-dynamic - -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common - -pkglib_LTLIBRARIES = $(elan_lib) - -if HAVE_ELAN -# Quadrics elan3 or elan4 switch plugin. -switch_elan_la_SOURCES = \ - switch_elan.c \ - qsw.c qsw.h - -# Add libslurm to switch_elan to provide some symbols that are not -# available in slurmctld (slurm_setenvpf) - -switch_elan_la_LIBADD = $(ELAN_LIBS) \ - $(top_builddir)/src/api/libslurm.la - -switch_elan_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) - -else -EXTRA_switch_elan_la_SOURCES = \ - switch_elan.c \ - qsw.c qsw.h -endif diff --git a/src/plugins/switch/elan/qsw.c b/src/plugins/switch/elan/qsw.c deleted file mode 100644 index 6516f2719b952fbfb15ffce2e3940b905ff4c6d8..0000000000000000000000000000000000000000 --- a/src/plugins/switch/elan/qsw.c +++ /dev/null @@ -1,1507 +0,0 @@ -/*****************************************************************************\ - * qsw.c - Library routines for initiating jobs on QsNet. - * $Id$ - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Jim Garlick - * CODE-OCEC-09-009. All rights reserved. - * - * This file is part of SLURM, a resource management program. - * For details, see . - * 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 - -#ifdef WITH_PTHREADS -# include -#endif /* WITH_PTHREADS */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* INT_MAX */ -#include - -#if HAVE_LIBELANCTRL -# include -# include - -/* These are taken from elan3/elanvp.h, which we don't - * want to include here since we are using the new - * version-nonspecific libelanctrl. - * (XXX: What is the equivalent in libelanctrl?) - * - * slurm/482: the elan USER context range is now split - * into two segments, regular user context and RMS - * context ranges. Do not allow a context range - * (lowcontext -- highcontext) to span these two segments, - * as this will generate and elan initialization error - * when MPI tries to attach to the capability. For now, - * restrict SLURM's range to the RMS one (starting at 0x400) - * - */ -# define ELAN_USER_BASE_CONTEXT_NUM 0x400 /* act. RMS_BASE_CONTEXT_NUM */ -# define ELAN_USER_TOP_CONTEXT_NUM 0x7ff - -# define Version cap_version -# define HighNode cap_highnode -# define LowNode cap_lownode -# define HighContext cap_highcontext -# define LowContext cap_lowcontext -# define MyContext cap_mycontext -# define Bitmap cap_bitmap -# define Type cap_type -# define UserKey cap_userkey -# define RailMask cap_railmask -# define Values key_values -#elif HAVE_LIBELAN3 -# include -# include -#else -# error "Must have either libelan3 or libelanctrl to compile this module!" -#endif /* HAVE_LIBELANCTRL */ - -#include -#include - -#include "slurm/slurm_errno.h" - -#include "src/common/slurm_xlator.h" - -#include "src/plugins/switch/elan/qsw.h" - -/* - * Definitions local to this module. - */ -#define _DEBUG 0 -#define QSW_JOBINFO_MAGIC 0xf00ff00e -#define QSW_LIBSTATE_MAGIC 0xf00ff00f - -/* we will allocate program descriptions in this range */ -/* XXX note: do not start at zero as libelan shifts to get unique shm id */ -#define QSW_PRG_START 1 -#define QSW_PRG_END INT_MAX -#define QSW_PRG_INVAL (-1) - -/* we allocate elan hardware context numbers in this range */ -#define QSW_CTX_START ELAN_USER_BASE_CONTEXT_NUM - -/* XXX: Temporary workaround for slurm/222 (qws sw-kernel/5478) - * (sys_validate_cap does not allow ELAN_USER_TOP_CONTEXT_NUM) - */ -#define QSW_CTX_END ELAN_USER_TOP_CONTEXT_NUM - 1 -#define QSW_CTX_INVAL (-1) - - -/* - * We are going to some trouble to keep these defs private so slurm - * hackers not interested in the interconnect details can just pass around - * the opaque types. All use of the data structure internals is local to this - * module. - */ -struct step_ctx { - uint32_t st_prognum; - uint32_t st_low; - uint32_t st_high; - uint16_t st_low_node; - uint16_t st_high_node; -}; - -struct qsw_libstate { - uint32_t ls_magic; - uint32_t ls_prognum; - List step_ctx_list; -}; - -struct qsw_jobinfo { - uint32_t j_magic; - uint32_t j_prognum; - ELAN_CAPABILITY j_cap; -}; - -/* Lock on library state */ -#define _lock_qsw() do { \ - int err; \ - err = pthread_mutex_lock(&qsw_lock); \ - assert(err == 0); \ -} while (0) -#define _unlock_qsw() do { \ - int err; \ - err = pthread_mutex_unlock(&qsw_lock); \ - assert(err == 0); \ -} while (0) - -/* - * Globals - */ -static inline void _dump_step_ctx(const char *head, - struct step_ctx *step_ctx_p); -static qsw_libstate_t qsw_internal_state = NULL; -static pthread_mutex_t qsw_lock = PTHREAD_MUTEX_INITIALIZER; -static elanhost_config_t elanconf = NULL; -static int shmid = -1; - - -static inline void _step_ctx_del(void *ptr) -{ - struct step_ctx *step_ctx_p = (struct step_ctx *) ptr; - - xfree(step_ctx_p); -} - -/* - * Allocate a qsw_libstate_t. - * lsp (IN) store pointer to new instantiation here - * RETURN 0 on success, -1 on failure (sets errno) - */ -int -qsw_alloc_libstate(qsw_libstate_t *lsp) -{ - qsw_libstate_t new; - - assert(lsp != NULL); - new = (qsw_libstate_t)xmalloc(sizeof(struct qsw_libstate)); - if (!new) - slurm_seterrno_ret(ENOMEM); - new->ls_magic = QSW_LIBSTATE_MAGIC; - new->step_ctx_list = list_create(_step_ctx_del); - if (!new->step_ctx_list) { - qsw_free_libstate(new); - slurm_seterrno_ret(ENOMEM); - } - *lsp = new; - return 0; -} - -/* - * Free a qsw_libstate_t. - * ls (IN) qsw_libstate_t to free - */ -void -qsw_free_libstate(qsw_libstate_t ls) -{ - assert(ls->ls_magic == QSW_LIBSTATE_MAGIC); - if (ls->step_ctx_list) - list_destroy(ls->step_ctx_list); - ls->ls_magic = 0; - xfree(ls); -} - -static inline void _dump_step_ctx(const char *head, struct step_ctx *step_ctx_p) -{ -#if _DEBUG - info("%s: prog:%u context:%u:%u nodes:%u:%u", head, - step_ctx_p->st_prognum, step_ctx_p->st_low, step_ctx_p->st_high, - step_ctx_p->st_low_node, step_ctx_p->st_high_node); -#endif -} - -static void -_pack_step_ctx(struct step_ctx *step_ctx_p, Buf buffer) -{ - _dump_step_ctx("_pack_step_ctx", step_ctx_p); - pack32(step_ctx_p->st_prognum, buffer); - pack32(step_ctx_p->st_low, buffer); - pack32(step_ctx_p->st_high, buffer); - pack16(step_ctx_p->st_low_node, buffer); - pack16(step_ctx_p->st_high_node,buffer); -} - -/* - * Pack libstate structure in a format that can be shipped over the - * network and unpacked on a different architecture. - * ls (IN) libstate structure to be packed - * buffer (IN/OUT) where to store packed data - * RETURN #bytes unused in 'data' - */ -int -qsw_pack_libstate(qsw_libstate_t ls, Buf buffer) -{ - int offset; - uint16_t step_ctx_cnt; - ListIterator iter; - struct step_ctx *step_ctx_p; - - assert(ls->ls_magic == QSW_LIBSTATE_MAGIC); - offset = get_buf_offset(buffer); - - pack32(ls->ls_magic, buffer); - pack32(ls->ls_prognum, buffer); - - if (ls->step_ctx_list) - step_ctx_cnt = list_count(ls->step_ctx_list); - else - step_ctx_cnt = 0; - pack16(step_ctx_cnt, buffer); - if (step_ctx_cnt) { - iter = list_iterator_create(ls->step_ctx_list); - while ((step_ctx_p = list_next(iter))) - _pack_step_ctx(step_ctx_p, buffer); - list_iterator_destroy(iter); - } - - return (get_buf_offset(buffer) - offset); -} - - -static int -_unpack_step_ctx(struct step_ctx *step_ctx_p, Buf buffer) -{ - safe_unpack32(&step_ctx_p->st_prognum, buffer); - safe_unpack32(&step_ctx_p->st_low, buffer); - safe_unpack32(&step_ctx_p->st_high, buffer); - safe_unpack16(&step_ctx_p->st_low_node, buffer); - safe_unpack16(&step_ctx_p->st_high_node, buffer); - _dump_step_ctx("_unpack_step_ctx", step_ctx_p); - return 0; -unpack_error: - return -1; -} - - -/* - * Unpack libstate packed by qsw_pack_libstate. - * ls (IN/OUT) where to put libstate structure - * buffer (IN/OUT) where to get packed data - * RETURN #bytes unused or -1 on error (sets errno) - */ -int -qsw_unpack_libstate(qsw_libstate_t ls, Buf buffer) -{ - int offset, i; - uint16_t step_ctx_cnt; - struct step_ctx *step_ctx_p; - - assert(ls->ls_magic == QSW_LIBSTATE_MAGIC); - offset = get_buf_offset(buffer); - - safe_unpack32(&ls->ls_magic, buffer); - safe_unpack32(&ls->ls_prognum, buffer); - safe_unpack16(&step_ctx_cnt, buffer); - - for (i=0; istep_ctx_list, step_ctx_p); - } - - if (ls->ls_magic != QSW_LIBSTATE_MAGIC) - goto unpack_error; - - return SLURM_SUCCESS; - - unpack_error: - slurm_seterrno_ret(EBADMAGIC_QSWLIBSTATE); /* corrupted libstate */ - return SLURM_ERROR; -} - -/* - * Seed the random number generator. This can be called multiple times, - * but srand48 will only be called once per program invocation. - */ -static void -_srand_if_needed(void) -{ - static int done = 0; - - if (!done) { - srand48(getpid()); - done = 1; - } -} - -static void -_copy_libstate(qsw_libstate_t dest, qsw_libstate_t src) -{ - ListIterator iter; - struct step_ctx *src_step_ctx_p, *dest_step_ctx_p; - - assert(src->ls_magic == QSW_LIBSTATE_MAGIC); - assert(dest->ls_magic == QSW_LIBSTATE_MAGIC); - dest->ls_prognum = src->ls_prognum; - iter = list_iterator_create(src->step_ctx_list); - while ((src_step_ctx_p = list_next(iter))) { - dest_step_ctx_p = xmalloc(sizeof(struct step_ctx)); - dest_step_ctx_p->st_prognum = src_step_ctx_p->st_prognum; - dest_step_ctx_p->st_low = src_step_ctx_p->st_low; - dest_step_ctx_p->st_high = src_step_ctx_p->st_high; - dest_step_ctx_p->st_low_node = src_step_ctx_p->st_low_node; - dest_step_ctx_p->st_high_node = src_step_ctx_p->st_high_node; - list_push(dest->step_ctx_list, dest_step_ctx_p); - } - list_iterator_destroy(iter); -} - -/* - * Initialize this library, optionally restoring a previously saved state. - * oldstate (IN) old state retrieved from qsw_fini() or NULL - * RETURN 0 on success, -1 on failure (sets errno) - */ -int -qsw_init(qsw_libstate_t oldstate) -{ - qsw_libstate_t new; - - assert(qsw_internal_state == NULL); - _srand_if_needed(); - if (qsw_alloc_libstate(&new) < 0) - return -1; /* errno set by qsw_alloc_libstate */ - if (oldstate) - _copy_libstate(new, oldstate); - else { - new->ls_prognum = QSW_PRG_START + - (lrand48() % (QSW_PRG_END - QSW_PRG_START + 1)); - } - qsw_internal_state = new; - return 0; -} - -/* - * Finalize use of this library. If 'savestate' is non-NULL, final - * state is copied there before it is destroyed. - * savestate (OUT) place to put state - */ -void -qsw_fini(qsw_libstate_t savestate) -{ - assert(qsw_internal_state != NULL); - _lock_qsw(); - if (savestate) - _copy_libstate(savestate, qsw_internal_state); - qsw_free_libstate(qsw_internal_state); - qsw_internal_state = NULL; - if (elanconf) { - elanhost_config_destroy(elanconf); - elanconf = NULL; - } - _unlock_qsw(); -} - -int -qsw_clear(void) -{ - int rc = 0; - - _lock_qsw(); - assert(qsw_internal_state); - assert(qsw_internal_state->ls_magic == QSW_LIBSTATE_MAGIC); - if (qsw_internal_state->step_ctx_list) - list_destroy(qsw_internal_state->step_ctx_list); - qsw_internal_state->step_ctx_list = list_create(_step_ctx_del); - if (elanconf) - elanhost_config_destroy(elanconf); - if (!(elanconf = elanhost_config_create ())) { - rc = -1; - goto done; - } - qsw_internal_state->ls_prognum = QSW_PRG_START + - (lrand48() % (QSW_PRG_END - QSW_PRG_START + 1)); -done: _unlock_qsw(); - return rc; -} - -/* - * Allocate a qsw_jobinfo_t. - * jp (IN) store pointer to new instantiation here - * RETURN 0 on success, -1 on failure (sets errno) - */ -int -qsw_alloc_jobinfo(qsw_jobinfo_t *jp) -{ - qsw_jobinfo_t new; - - assert(jp != NULL); - new = (qsw_jobinfo_t)xmalloc(sizeof(struct qsw_jobinfo)); - if (!new) - slurm_seterrno_ret(ENOMEM); - new->j_magic = QSW_JOBINFO_MAGIC; - - *jp = new; - return 0; -} - -/* - * Make a copy of a qsw_jobinfo_t. - * j (IN) qsw_jobinfo_t to be copied - * RETURN qsw_jobinfo_t on success, NULL on failure - */ -qsw_jobinfo_t -qsw_copy_jobinfo(qsw_jobinfo_t j) -{ - qsw_jobinfo_t new; - if (qsw_alloc_jobinfo(&new)) - return NULL; - memcpy(new, j, sizeof(struct qsw_jobinfo)); - - return new; -} - -/* - * Free a qsw_jobinfo_t. - * ls (IN) qsw_jobinfo_t to free - */ -void -qsw_free_jobinfo(qsw_jobinfo_t j) -{ - if (j == NULL) - return; - assert(j->j_magic == QSW_JOBINFO_MAGIC); - j->j_magic = 0; - xfree(j); -} - -/* - * Pack jobinfo structure in a format that can be shipped over the - * network and unpacked on a different architecture. - * j (IN) jobinfo structure to be packed - * buffer (OUT) where to store packed data - * RETURN #bytes unused in 'data' or -1 on error (sets errno) - * NOTE: Keep in sync with QSW_PACK_SIZE above - */ -int -qsw_pack_jobinfo(qsw_jobinfo_t j, Buf buffer) -{ - int i, offset; - - assert(j->j_magic == QSW_JOBINFO_MAGIC); - offset = get_buf_offset(buffer); - - pack32(j->j_magic, buffer); - pack32(j->j_prognum, buffer); - for (i = 0; i < 4; i++) - pack32(j->j_cap.UserKey.Values[i], buffer); - pack16(j->j_cap.Type, buffer); -#if HAVE_LIBELANCTRL -# ifdef ELAN_CAP_ELAN3 - pack16(j->j_cap.cap_elan_type, buffer); -# else - j->j_cap.cap_spare = ELAN_CAP_UNINITIALISED; - pack16(j->j_cap.cap_spare, buffer); -# endif -#endif -#if HAVE_LIBELAN3 - pack16(j->j_cap.padding, buffer); -#endif - pack32(j->j_cap.Version, buffer); - pack32(j->j_cap.LowContext, buffer); - pack32(j->j_cap.HighContext, buffer); - pack32(j->j_cap.MyContext, buffer); - pack32(j->j_cap.LowNode, buffer); - pack32(j->j_cap.HighNode, buffer); -#if HAVE_LIBELAN3 - pack32(j->j_cap.Entries, buffer); -#endif - pack32(j->j_cap.RailMask, buffer); - for (i = 0; i < ELAN_BITMAPSIZE; i++) - pack32(j->j_cap.Bitmap[i], buffer); - - return (get_buf_offset(buffer) - offset); -} - -/* - * Unpack jobinfo structure packed by qsw_pack_jobinfo. - * j (IN/OUT) where to store libstate structure - * buffer (OUT) where to load packed data - * RETURN #bytes unused in 'data' or -1 on error (sets errno) - */ -int -qsw_unpack_jobinfo(qsw_jobinfo_t j, Buf buffer) -{ - int i, offset; - - assert(j->j_magic == QSW_JOBINFO_MAGIC); - offset = get_buf_offset(buffer); - - safe_unpack32(&j->j_magic, buffer); - safe_unpack32(&j->j_prognum, buffer); - for (i = 0; i < 4; i++) - safe_unpack32(&j->j_cap.UserKey.Values[i], buffer); - safe_unpack16(&j->j_cap.Type, buffer); -#if HAVE_LIBELANCTRL -# ifdef ELAN_CAP_ELAN3 - safe_unpack16(&j->j_cap.cap_elan_type, buffer); -# else - safe_unpack16(&j->j_cap.cap_spare, buffer); -# endif -#endif -#if HAVE_LIBELAN3 - safe_unpack16(&j->j_cap.padding, buffer); -#endif -{ - uint32_t tmp32; - safe_unpack32(&tmp32, buffer); - j->j_cap.Version = (int) tmp32; - safe_unpack32(&tmp32, buffer); - j->j_cap.LowContext = (int) tmp32; - safe_unpack32(&tmp32, buffer); - j->j_cap.HighContext = (int) tmp32; - safe_unpack32(&tmp32, buffer); - j->j_cap.MyContext = (int) tmp32; - safe_unpack32(&tmp32, buffer); - j->j_cap.LowNode = (int) tmp32; - safe_unpack32(&tmp32, buffer); - j->j_cap.HighNode = (int) tmp32; -} -#if HAVE_LIBELAN3 - safe_unpack32(&j->j_cap.Entries, buffer); -#endif - safe_unpack32(&j->j_cap.RailMask, buffer); - for (i = 0; i < ELAN_BITMAPSIZE; i++) - safe_unpack32(&j->j_cap.Bitmap[i], buffer); - - if (j->j_magic != QSW_JOBINFO_MAGIC) - goto unpack_error; - - return SLURM_SUCCESS; - - unpack_error: - slurm_seterrno_ret(EBADMAGIC_QSWJOBINFO); - return SLURM_ERROR; -} - -/* - * Allocate a program description number. Program descriptions, which are the - * key abstraction maintained by the rms.o kernel module, must not be used - * more than once simultaneously on a single node. We allocate one to each - * parallel job which more than meets this requirement. A program description - * can be compared to a process group, except there is no way for a process to - * disassociate itself or its children from the program description. - * If the library is initialized, we allocate these consecutively, otherwise - * we generate a random one, assuming we are being called by a transient - * program like pdsh. Ref: rms_prgcreate(3). - */ -static int -_generate_prognum(void) -{ - int new; - - if (qsw_internal_state) { - _lock_qsw(); - new = qsw_internal_state->ls_prognum; - if (new == QSW_PRG_END) - qsw_internal_state->ls_prognum = QSW_PRG_START; - else - qsw_internal_state->ls_prognum++; - _unlock_qsw(); - } else { - _srand_if_needed(); - new = lrand48() % (QSW_PRG_END - QSW_PRG_START + 1); - new += QSW_PRG_START; - } - return new; -} - -/* - * Elan hardware context numbers are an adapter resource that must not be used - * more than once on a single node. One is allocated to each process on the - * node that will be communicating over Elan. In order for processes on the - * same node to communicate with one another and with other nodes across QsNet, - * they must use contexts in the hi-lo range of a common capability. - * If the library state is initialized, we allocate/free these, otherwise - * we generate a random one, assuming we are being called by a transient - * program like pdsh. Ref: rms_setcap(3). - * - * Returns -1 on allocation error. - */ -static int -_alloc_hwcontext(bitstr_t *nodeset, uint32_t prognum, int num) -{ - int new = -1; - static int seed = 0; - - assert(nodeset); - if (qsw_internal_state) { - bitoff_t bit; - ListIterator iter; - uint16_t low_node = bit_ffs(nodeset); - uint16_t high_node = bit_fls(nodeset); - struct step_ctx *step_ctx_p; - bitstr_t *busy_context = bit_alloc(QSW_CTX_END - - QSW_CTX_START + 1); - - assert(busy_context); - _lock_qsw(); - iter = list_iterator_create(qsw_internal_state->step_ctx_list); - while ((step_ctx_p = list_next(iter))) { - if ((high_node < step_ctx_p->st_low_node) - || (low_node > step_ctx_p->st_high_node)) - continue; - bit_nset(busy_context, step_ctx_p->st_low, - step_ctx_p->st_high); - } - list_iterator_destroy(iter); - bit = bit_noc(busy_context, num, seed); - if (bit != -1) { - seed = bit + num; - step_ctx_p = xmalloc(sizeof(struct step_ctx)); - step_ctx_p->st_prognum = prognum; - step_ctx_p->st_low = bit; - step_ctx_p->st_high = bit + num - 1; - step_ctx_p->st_low_node = low_node; - step_ctx_p->st_high_node = high_node; - _dump_step_ctx("_alloc_hwcontext", step_ctx_p); - list_push(qsw_internal_state->step_ctx_list, step_ctx_p); - new = bit + QSW_CTX_START; - } - _unlock_qsw(); - FREE_NULL_BITMAP(busy_context); - } else { - _srand_if_needed(); - new = lrand48() % - (QSW_CTX_END - (QSW_CTX_START + num - 1) - 1); - new += QSW_CTX_START; - } - assert(new == -1 || (new >= QSW_CTX_START && new <= QSW_CTX_END)); - return new; -} - -extern int qsw_restore_jobinfo(struct qsw_jobinfo *jobinfo) -{ - struct step_ctx *step_ctx_p; - ListIterator iter; - int duplicate = 0; - - assert(qsw_internal_state); - if (!jobinfo) - return 0; - - assert(jobinfo->j_magic == QSW_JOBINFO_MAGIC); - _lock_qsw(); - - /* check for duplicate */ - iter = list_iterator_create(qsw_internal_state->step_ctx_list); - while ((step_ctx_p = list_next(iter))) { - if (jobinfo->j_prognum == step_ctx_p->st_prognum) { - duplicate = 1; - break; - } - } - list_iterator_destroy(iter); - if (!duplicate) { /* need new record */ - step_ctx_p = xmalloc(sizeof(struct step_ctx)); - step_ctx_p->st_prognum = jobinfo->j_prognum; - } - step_ctx_p->st_low = jobinfo->j_cap.LowContext - QSW_CTX_START; - step_ctx_p->st_high = jobinfo->j_cap.HighContext - QSW_CTX_START; - step_ctx_p->st_low_node = jobinfo->j_cap.LowNode; - step_ctx_p->st_high_node = jobinfo->j_cap.HighNode; - _dump_step_ctx("qsw_restore_jobinfo", step_ctx_p); - if (!duplicate) - list_push(qsw_internal_state->step_ctx_list, step_ctx_p); - _unlock_qsw(); - return 0; -} - -static void -_free_hwcontext(uint32_t prog_num) -{ - ListIterator iter; - struct step_ctx *step_ctx_p; - - if (qsw_internal_state) { - _lock_qsw(); - iter = list_iterator_create(qsw_internal_state->step_ctx_list); - while ((step_ctx_p = list_next(iter))) { - if (prog_num != step_ctx_p->st_prognum) - continue; - _dump_step_ctx("_free_hwcontext", step_ctx_p); - list_delete_item(iter); - break; - } - if (!step_ctx_p) { - error("_free_hwcontext could not find prognum %u", - prog_num); - } - list_iterator_destroy(iter); - _unlock_qsw(); - } -} - -/* - * Initialize the elan capability for this job. - * Returns -1 on failure to allocate hw context. - */ -static int -_init_elan_capability(ELAN_CAPABILITY *cap, uint32_t prognum, int ntasks, - int nnodes, bitstr_t *nodeset, uint16_t *tasks_per_node, - int cyclic_alloc, int max_tasks_per_node) -{ - int i, node_index; - - _srand_if_needed(); - - /* start with a clean slate */ -#if HAVE_LIBELANCTRL - elan_nullcap(cap); -#else - elan3_nullcap(cap); -#endif - - /* initialize for single rail and either block or cyclic allocation */ - if (cyclic_alloc) - cap->Type = ELAN_CAP_TYPE_CYCLIC; - else - cap->Type = ELAN_CAP_TYPE_BLOCK; - cap->Type |= ELAN_CAP_TYPE_MULTI_RAIL; - cap->RailMask = 1; - -#if HAVE_LIBELANCTRL -# ifdef ELAN_CAP_ELAN3 - cap->cap_elan_type = ELAN_CAP_ELAN3; -# else - cap->cap_spare = ELAN_CAP_UNINITIALISED; -# endif -#endif - - /* UserKey is 128 bits of randomness which should be kept private */ - for (i = 0; i < 4; i++) - cap->UserKey.Values[i] = lrand48(); - - /* set up hardware context range */ - cap->LowContext = _alloc_hwcontext(nodeset, prognum, max_tasks_per_node); - if (cap->LowContext == -1) - return -1; - cap->HighContext = cap->LowContext + max_tasks_per_node - 1; - /* Note: not necessary to initialize cap->MyContext */ - - /* set the range of nodes to be used and number of processes */ - cap->LowNode = bit_ffs(nodeset); - assert(cap->LowNode != -1); - cap->HighNode = bit_fls(nodeset); - assert(cap->HighNode != -1); - -#if HAVE_LIBELAN3 - cap->Entries = ntasks; -#endif - -#if USE_OLD_LIBELAN - /* set the hw broadcast bit if consecutive nodes */ - if (abs(cap->HighNode - cap->LowNode) == nnodes - 1) - cap->Type |= ELAN_CAP_TYPE_BROADCASTABLE; -#else - /* set unconditionally per qsw gnat sw-elan/4334 */ - /* only time we don't want this is unsupported rev A hardware */ - cap->Type |= ELAN_CAP_TYPE_BROADCASTABLE; -#endif - /* - * Set up cap->Bitmap, which describes the mapping of processes to - * the nodes in the range of cap->LowNode - cap->Highnode. - * There are (ntasks * nnodes) significant bits in the mask, each - * representing a process slot. Bits are off for process slots - * corresponding to unallocated nodes. For example, if nodes 4 and 6 - * are running two processes per node, bits 0,1 (corresponding to the - * two processes on node 4) and bits 4,5 (corresponding to the two - * processes running on node 6) are set. - */ - node_index = 0; - for (i = cap->LowNode; i <= cap->HighNode; i++) { - if (bit_test(nodeset, i)) { - int j, bit, task_cnt; - task_cnt = tasks_per_node[node_index++]; - - for (j = 0; j < task_cnt; j++) { - if (cyclic_alloc) - bit = (i-cap->LowNode) + ( j * - (cap->HighNode - cap->LowNode + 1)); - else - bit = ((i-cap->LowNode) - * max_tasks_per_node) + j; - - assert(bit < (sizeof(cap->Bitmap) * 8)); - BT_SET(cap->Bitmap, bit); - } - } - } - - return 0; -} - -/* - * Create all the QsNet related information needed to set up a QsNet parallel - * program and store it in the qsw_jobinfo struct. - * Call this on the "client" process, e.g. pdsh, srun, slurmctld, etc.. - */ -int -qsw_setup_jobinfo(qsw_jobinfo_t j, int ntasks, bitstr_t *nodeset, - uint16_t *tasks_per_node, int cyclic_alloc) -{ - int i, max_tasks_per_node = 0; - int nnodes = bit_set_count(nodeset); - - assert(j != NULL); - assert(j->j_magic == QSW_JOBINFO_MAGIC); - assert(nodeset); - assert(tasks_per_node); - - /* sanity check on args */ - if ((ntasks <= 0) || (nnodes <= 0)) - slurm_seterrno_ret(EINVAL); - for (i = 0; i < nnodes; i++) { - if (tasks_per_node[i] > max_tasks_per_node) - max_tasks_per_node = tasks_per_node[i]; - } - /* Note: ELAN_MAX_VPS is 512 on "old" Elan driver, 16384 on new. */ - if ((max_tasks_per_node * nnodes) > ELAN_MAX_VPS) - slurm_seterrno_ret(EINVAL); - - /* initialize jobinfo */ - j->j_prognum = _generate_prognum(); - if (_init_elan_capability(&j->j_cap, j->j_prognum, ntasks, nnodes, - nodeset, tasks_per_node, cyclic_alloc, - max_tasks_per_node) == -1) { - slurm_seterrno_ret(EAGAIN); /* failed to allocate hw ctx */ - } - - return 0; -} - -void -qsw_teardown_jobinfo(qsw_jobinfo_t j) -{ - if (j) - _free_hwcontext(j->j_prognum); -} - -/* - * Here are the necessary steps to set up to run an Elan MPI parallel program - * (set of processes) on a node (possibly one of many allocated to the prog): - * - * Process 1 Process 2 | Process 3 - * read args | - * fork ------- rms_prgcreate | - * waitpid elan3_create | - * rms_prgaddcap | - * fork N procs ---+------ rms_setcap - * wait all | setup RMS_ env - * | setuid, etc. - * | exec mpi process - * | - * exit | - * rms_prgdestroy | - * exit | (one pair of processes per mpi proc!) - * - * - The first fork is required because rms_prgdestroy can't occur in the - * process that calls rms_prgcreate (since it is a member, ECHILD). - * - The second fork is required when running multiple processes per node - * because each process must announce its use of one of the hw contexts - * in the range allocated in the capability. - */ - -void -qsw_prog_fini(qsw_jobinfo_t jobinfo) -{ - if (shmid >= 0) { - debug2("qsw_prog_fini"); - shmctl (shmid, IPC_RMID, NULL); - debug2("qsw_prog_fini shmctl IPC_RMID complete"); - } - /* Do nothing... apparently this will be handled by - * callbacks in the kernel exit handlers ... - */ -#if 0 - if (jobinfo->j_ctx) { - elan3_control_close(jobinfo->j_ctx); - jobinfo->j_ctx = NULL; - } -#endif -} - -/* Key for Elan stats shared memory segment is the - * rms.o program description number, left shifted 9 less 1 - * to avoid conflicts with MPI shared memory - */ -static int elan_statkey (int prgid) -{ - return ((prgid << 9) - 1); -} - -/* - * Return the statkey to caller in keyp if shared memory was created - * Return -1 if shared memory creation failed. - */ -int qsw_statkey (qsw_jobinfo_t jobinfo, int *keyp) -{ - if (shmid < 0) - return (-1); - *keyp = elan_statkey (jobinfo->j_prognum); - return (0); -} - -/* - * Create shared memory segment for Elan stats use - * (ELAN_STATKEY env var is set in switch_elan.c) - */ -static int -_qsw_shmem_create (qsw_jobinfo_t jobinfo, uid_t uid) -{ - struct shmid_ds shm; - ELAN_CAPABILITY *cap = &jobinfo->j_cap; - key_t key = elan_statkey (jobinfo->j_prognum); - int maxLocal = cap->HighContext - cap->LowContext + 1; - int pgsize = getpagesize (); - - /* 8KB minimum stats page size */ - if (pgsize < 8192) - pgsize = 8192; - - if ((shmid = shmget (key, pgsize * (maxLocal + 1), IPC_CREAT|IPC_EXCL)) - < 0) - return (error ("Failed to create Elan state shmem: %m")); - - /* Ensure permissions on segment allow user read/write access - */ - shm.shm_perm.uid = uid; - shm.shm_perm.mode = 0600; - - if (shmctl (shmid, IPC_SET, &shm) < 0) - return (error ("Failed to set perms on Elan state shm: %m")); - - return (0); -} - - -static void -_close_all_fd_except(int fd) -{ - int openmax; - int i; - - openmax = sysconf(_SC_OPEN_MAX); - for (i = 0; i <= openmax; i++) { - if (i != fd) - close(i); - } -} - - -/* - * Process 1: After the fork, the child process is process 1, - * and will call rms_prgdestroy when the parent (slurmd job - * manager) exits. - */ -static int -_prg_destructor_fork() -{ - pid_t pid; - int fdpair[2]; - int prgid; - int i; - int dummy; - - if (pipe(fdpair) < 0) { - error("switch/elan: failed creating pipe"); - return -1; - } - - pid = fork(); - if (pid < 0) { - error("switch/elan: failed to fork program destructor"); - } else if (pid > 0) { - /* parent */ - close(fdpair[0]); - waitpid(pid, (int *)NULL, 0); - return fdpair[1]; - } - - /****************************************/ - /* - * fork again so the destructor process - * will not be a child of the slurmd - */ - pid = fork(); - if (pid < 0) { - error("switch/elan: second fork failed"); - } else if (pid > 0) { - exit(0); - } - - /* child */ - close(fdpair[1]); - - /* close librmscall's internal fd to /proc/rms/control */ - rmsmod_fini(); - - _close_all_fd_except(fdpair[0]); - /* Wait for the program description id from the child */ - if (read(fdpair[0], &prgid, sizeof(prgid)) != sizeof(prgid)) { - error("_prg_destructor_fork read failed: %m"); - exit(1); - } - - if (prgid == -1) - exit(1); - - /* - * Wait for the pipe to close, signalling that the parent - * has exited. - */ - while (read(fdpair[0], &dummy, sizeof(dummy)) > 0) {} - - /* - * Verify that program description is empty. If not, send a SIGKILL. - */ - for (i = 0; i < 30; i++) { - int maxids = 8; - pid_t pids[8]; - int nids = 0; - - if (rms_prginfo(prgid, maxids, pids, &nids) < 0) { - error("switch/elan: rms_prginfo: %m"); - } - if (nids == 0) - break; - if (rms_prgsignal(prgid, SIGKILL) < 0) { - error("switch/elan: rms_prgsignal: %m"); - } - sleep(1); - } - - if (rms_prgdestroy(prgid) < 0) { - error("rms_prgdestroy"); - } - exit(0); -} - - - -/* - * Send the prgid of the newly created program description to the process - * forked earlier by _prg_destructor_fork(), using the file descriptor - * "fd" which was returned by the call to _prg_destructor_fork(). - */ -static void -_prg_destructor_send(int fd, int prgid) -{ - debug3("_prg_destructor_send %d", prgid); - if (write (fd, &prgid, sizeof(prgid)) != sizeof(prgid)) { - error ("_prg_destructor_send failed: %m"); - } - /* Deliberately avoid closing fd. When this process exits, it - will close fd signalling to the child process that it is - time to call rms_prgdestroy */ - /*close(fd);*/ -} - -/* - * Process 2: Create the context and make capability available to children. - */ -int -qsw_prog_init(qsw_jobinfo_t jobinfo, uid_t uid) - -{ - int err; - int i, nrails; - int fd; - - if ((fd = _prg_destructor_fork()) == -1) - goto fail; -#if HAVE_LIBELANCTRL - nrails = elan_nrails(&jobinfo->j_cap); - - for (i = 0; i < nrails; i++) { - ELANCTRL_HANDLE handle; - /* - * Open up the Elan control device so we can create - * a new capability. - */ - if (elanctrl_open(&handle) != 0) { - slurm_seterrno(EELAN3CONTROL); - _prg_destructor_send(fd, -1); - goto fail; - } - - /* Push capability into device driver */ - if (elanctrl_create_cap(handle, &jobinfo->j_cap) < 0) { - error("elanctrl_create_cap: %m"); - slurm_seterrno(EELAN3CREATE); - /* elanctrl_close(handle); */ - _prg_destructor_send(fd, -1); - goto fail; - } - - /* elanctrl_close (handle); */ - } - -#else /* !HAVE_LIBELANCTRL */ - nrails = elan3_nrails(&jobinfo->j_cap); - - for (i = 0; i < nrails; i++) { - - ELAN3_CTX *ctx; - - /* see qsw gnat sw-elan/4334: elan3_control_open can ret -1 */ - if ((ctx = elan3_control_open(i)) == NULL - || ctx == (void *)-1) { - slurm_seterrno(EELAN3CONTROL); - _prg_destructor_send(fd, -1); - goto fail; - } - - - /* make cap known via rms_getcap/rms_ncaps to members - * of this prgnum */ - if (elan3_create(ctx, &jobinfo->j_cap) < 0) { - /* XXX masking errno value better than not knowing - * which function failed? */ - error("elan3_create(%d): %m", i); - slurm_seterrno(EELAN3CREATE); - _prg_destructor_send(fd, -1); - goto fail; - } - } -#endif - /* associate this process and its children with prgnum */ - if (rms_prgcreate(jobinfo->j_prognum, uid, 1) < 0) { - /* translate errno values to more descriptive ones */ - switch (errno) { - case EINVAL: - slurm_seterrno(EINVAL_PRGCREATE); - break; - default: - break; - } - _prg_destructor_send(fd, -1); - goto fail; - } - _prg_destructor_send(fd, jobinfo->j_prognum); - - if (rms_prgaddcap(jobinfo->j_prognum, 0, &jobinfo->j_cap) < 0) { - /* translate errno values to more descriptive ones */ - switch (errno) { - case ESRCH: - slurm_seterrno(ESRCH_PRGADDCAP); - break; - case EFAULT: - slurm_seterrno(EFAULT_PRGADDCAP); - break; - default: - break; - } - goto fail; - } - - - /* - * Create shared memory for libelan state - * Failure to create shared memory is not a fatal error. - */ - _qsw_shmem_create (jobinfo, uid); - - - /* note: _elan3_fini() destroys context and makes capability unavail */ - /* do it in qsw_prog_fini() after app terminates */ - return 0; -fail: - err = errno; /* presrve errno in case _elan3_fini touches it */ - qsw_prog_fini(jobinfo); - slurm_seterrno(err); - return -1; -} - -/* - * Process 3: Do the rms_setcap. - */ -int -qsw_setcap(qsw_jobinfo_t jobinfo, int procnum) -{ - /* - * Assign elan hardware context to current process. - * - arg1 (0 below) is an index into the kernel's list of caps for this - * program desc (added by rms_prgaddcap). There will be - * one per rail. - * - arg2 indexes the hw ctxt range in the capability - * [cap->LowContext, cap->HighContext] - */ - if (rms_setcap(0, procnum) < 0) { - /* translate errno values to more descriptive ones */ - switch (errno) { - case EINVAL: - slurm_seterrno(EINVAL_SETCAP); - break; - case EFAULT: - slurm_seterrno(EFAULT_SETCAP); - break; - default: - break; - } - return -1; - } - return 0; -} - - -/* - * Return the local elan address (for rail 0) or -1 on failure. - */ -int -qsw_getnodeid(void) -{ - int nodeid = -1; -#if HAVE_LIBELANCTRL - ELAN_DEV_IDX devidx = 0; - ELANCTRL_HANDLE handle; - ELAN_POSITION position; - - if (elanctrl_open(&handle) != 0) - slurm_seterrno_ret(EGETNODEID); - - if (elanctrl_get_position(handle, devidx, &position) != 0) { - elanctrl_close (handle); - slurm_seterrno_ret(EGETNODEID); - } - - nodeid = position.pos_nodeid; - - elanctrl_close (handle); -#else - ELAN3_CTX *ctx = _elan3_init(0); /* rail 0 */ - if (ctx) { - nodeid = ctx->devinfo.Position.NodeId; - elan3_control_close(ctx); - } -#endif - if (nodeid == -1) - slurm_seterrno(EGETNODEID); - return nodeid; - -} - -static int -_read_elanhost_config (void) -{ - int rc; - - if (!(elanconf = elanhost_config_create ())) - return (-1); - - if ((rc = elanhost_config_read (elanconf, NULL)) < 0) { - error ("Unable to read Elan config: %s", - elanhost_config_err (elanconf)); - elanhost_config_destroy (elanconf); - elanconf = NULL; - return (-1); - } - - return (0); -} - -int -qsw_maxnodeid(void) -{ - int maxid = -1; - - _lock_qsw(); - if (!elanconf && (_read_elanhost_config() < 0)) - goto done; - - maxid = elanhost_config_maxid (elanconf); - - done: - _unlock_qsw(); - return maxid; -} - -/* - * Given a hostname, return the elanid or -1 on error. - * Initializes the elanconfig from the default /etc/elanhosts - * config file. - */ -int -qsw_getnodeid_byhost(char *host) -{ - int id = -1; - - if (host == NULL) - return (-1); - - _lock_qsw(); - if (!elanconf && (_read_elanhost_config() < 0)) - goto done; - - xassert (elanconf != NULL); - - id = elanhost_host2elanid (elanconf, host); - - done: - _unlock_qsw(); - return id; -} - -/* - * Given an elanid, determine the hostname. Returns -1 on error or the number - * of characters copied on success. - * XXX - assumes RMS style hostnames (see above) - */ -int -qsw_gethost_bynodeid(char *buf, int len, int id) -{ - int rc = -1; - char *hostp; - - if (id < 0) slurm_seterrno_ret(EGETHOST_BYNODEID); - - _lock_qsw(); - if (!elanconf && (_read_elanhost_config() < 0)) - goto done; - - if (!(hostp = elanhost_elanid2host (elanconf, ELANHOST_EIP, id))) { - slurm_seterrno (EGETHOST_BYNODEID); - goto done; - } - - rc = slurm_strlcpy (buf, hostp, len); - - done: - _unlock_qsw(); - return (rc); -} - -/* - * Send the specified signal to all members of a program description. - * Returns -1 on failure and sets errno. Ref: rms_prgsignal(3). - */ -int -qsw_prgsignal(qsw_jobinfo_t jobinfo, int signum) -{ - if (rms_prgsignal(jobinfo->j_prognum, signum) < 0) { - /* translate errno values to more descriptive ones */ - switch (errno) { - case EINVAL: - slurm_seterrno(EINVAL_PRGSIGNAL); - break; - case ESRCH: - slurm_seterrno(ESRCH_PRGSIGNAL); - break; - default: - break; - } - return -1; - } - return 0; -} - -#define _USE_ELAN3_CAPABILITY_STRING 1 - -#ifndef _USE_ELAN3_CAPABILITY_STRING -#define TRUNC_BITMAP 1 -static void -_print_capbitmap(FILE *fp, ELAN_CAPABILITY *cap) -{ - int bit_max = sizeof(cap->Bitmap)*8 - 1; - int bit; -#if TRUNC_BITMAP - bit_max = bit_max >= 64 ? 64 : bit_max; -#endif - for (bit = bit_max; bit >= 0; bit--) - fprintf(fp, "%c", BT_TEST(cap->Bitmap, bit) ? '1' : '0'); - fprintf(fp, "\n"); -} -#endif /* !_USE_ELAN3_CAPABILITY_STRING */ - -char * -qsw_capability_string(struct qsw_jobinfo *j, char *buf, size_t size) -{ - ELAN_CAPABILITY *cap; - - assert(buf != NULL); - assert(j->j_magic == QSW_JOBINFO_MAGIC); - - cap = &j->j_cap; - -#if HAVE_LIBELANCTRL - snprintf(buf, size, "prg=%d ctx=%x.%x nodes=%d.%d", - j->j_prognum, cap->LowContext, cap->HighContext, - cap->LowNode, cap->HighNode); -#else - snprintf(buf, size, "prg=%d ctx=%x.%x nodes=%d.%d entries=%d", - j->j_prognum, cap->LowContext, cap->HighContext, - cap->LowNode, cap->HighNode, - cap->Entries); -#endif - - return buf; -} - -void -qsw_print_jobinfo(FILE *fp, struct qsw_jobinfo *jobinfo) -{ - ELAN_CAPABILITY *cap; - char str[8192]; - - assert(jobinfo->j_magic == QSW_JOBINFO_MAGIC); - - fprintf(fp, "__________________\n"); - fprintf(fp, "prognum=%d\n", jobinfo->j_prognum); - - cap = &jobinfo->j_cap; - /* use elan3_capability_string as a shorter alternative for now */ -#if _USE_ELAN3_CAPABILITY_STRING -# if HAVE_LIBELANCTRL - fprintf(fp, "%s\n", elan_capability_string(cap, str)); -# else - fprintf(fp, "%s\n", elan3_capability_string(cap, str)); -# endif -#else - fprintf(fp, "cap.UserKey=%8.8x.%8.8x.%8.8x.%8.8x\n", - cap->UserKey.Values[0], cap->UserKey.Values[1], - cap->UserKey.Values[2], cap->UserKey.Values[3]); - /*fprintf(fp, "cap.Version=%d\n", cap->Version);*/ - fprintf(fp, "cap.Type=0x%hx\n", cap->Type); - fprintf(fp, "cap.LowContext=%d\n", cap->LowContext); - fprintf(fp, "cap.HighContext=%d\n", cap->HighContext); - fprintf(fp, "cap.MyContext=%d\n", cap->MyContext); - fprintf(fp, "cap.LowNode=%d\n", cap->LowNode); - fprintf(fp, "cap.HighNode=%d\n", cap->HighNode); -#if HAVE_LIBELAN3 - fprintf(fp, "cap.padding=%hd\n", cap->padding); - fprintf(fp, "cap.Entries=%d\n", cap->Entries); -#endif - fprintf(fp, "cap.Railmask=0x%x\n", cap->RailMask); - fprintf(fp, "cap.Bitmap="); - _print_capbitmap(fp, cap); -#endif - fprintf(fp, "\n------------------\n"); -} diff --git a/src/plugins/switch/elan/qsw.h b/src/plugins/switch/elan/qsw.h deleted file mode 100644 index d488ec067473cb2502585f16c7b0cc0649633ad6..0000000000000000000000000000000000000000 --- a/src/plugins/switch/elan/qsw.h +++ /dev/null @@ -1,142 +0,0 @@ -/*****************************************************************************\ - * qsw.h - Library routines for initiating jobs on QsNet. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Jim Garlick - * CODE-OCEC-09-009. All rights reserved. - * - * This file is part of SLURM, a resource management program. - * For details, see . - * 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 -#include - -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include "src/common/slurm_xlator.h" - -#ifndef _QSW_INCLUDED -#define _QSW_INCLUDED - -#if HAVE_LIBELANCTRL -# include -#elif HAVE_LIBELAN3 -# include -#else -# error "Don't have either libelanctrl or libelan3!" -#endif - -/* opaque data structures - no peeking! */ -typedef struct qsw_libstate *qsw_libstate_t; -#ifndef __qsw_jobinfo_t_defined -# define __qsw_jobinfo_t_defined - typedef struct qsw_jobinfo *qsw_jobinfo_t; /* opaque data type */ -#endif - -#define QSW_LIBSTATE_PACK_MAX 12 -#define QSW_JOBINFO_PACK_MAX 120 -#define QSW_MAX_TASKS ELAN_MAX_VPS -#define QSW_PACK_SIZE (4 * (2+4+1+8+ELAN_BITMAPSIZE)) - -/* NOTE: error codes should be between ESLURM_SWITCH_MIN and - * ESLURM_SWITCH MAX as defined in slurm/slurm_errno.h */ -enum { - /* Quadrics Elan specific error codes */ - ENOSLURM = 3000, - EBADMAGIC_QSWLIBSTATE, - EBADMAGIC_QSWJOBINFO, - EINVAL_PRGCREATE, - ECHILD_PRGDESTROY, - EEXIST_PRGDESTROY, - EELAN3INIT, - EELAN3CONTROL, - EELAN3CREATE, - ESRCH_PRGADDCAP, - EFAULT_PRGADDCAP, - EINVAL_SETCAP, - EFAULT_SETCAP, - EGETNODEID, - EGETNODEID_BYHOST, - EGETHOST_BYNODEID, - ESRCH_PRGSIGNAL, - EINVAL_PRGSIGNAL -}; - -int qsw_alloc_libstate(qsw_libstate_t *lsp); -void qsw_free_libstate(qsw_libstate_t ls); - -int qsw_pack_libstate(qsw_libstate_t ls, Buf buffer); -int qsw_unpack_libstate(qsw_libstate_t ls, Buf buffer); - -int qsw_init(qsw_libstate_t restorestate); -void qsw_fini(qsw_libstate_t savestate); -int qsw_clear(void); - -int qsw_alloc_jobinfo(qsw_jobinfo_t *jp); -qsw_jobinfo_t qsw_copy_jobinfo(qsw_jobinfo_t j); -void qsw_free_jobinfo(qsw_jobinfo_t j); -int qsw_restore_jobinfo(struct qsw_jobinfo *jobinfo); - -int qsw_pack_jobinfo(qsw_jobinfo_t j, Buf buffer); -int qsw_unpack_jobinfo(qsw_jobinfo_t j, Buf buffer); - -int qsw_setup_jobinfo(qsw_jobinfo_t j, int ntasks, - bitstr_t *nodeset, uint16_t *tasks_per_node, - int cyclic_alloc); -void qsw_teardown_jobinfo(qsw_jobinfo_t j); - -int qsw_prog_init(qsw_jobinfo_t jobinfo, uid_t uid); -void qsw_prog_fini(qsw_jobinfo_t jobinfo); - -int qsw_prgdestroy(qsw_jobinfo_t jobinfo); /* was qsw_prog_reap */ - -int qsw_setcap(qsw_jobinfo_t jobinfo, int procnum); - /* was qsw_attach */ - -int qsw_prgsignal(qsw_jobinfo_t jobinfo, int signum); - /* was qsw_signal_job */ - - /* return max ElanID in configuration */ -int qsw_maxnodeid(void); - -int qsw_getnodeid(void); -int qsw_getnodeid_byhost(char *host); -int qsw_gethost_bynodeid(char *host, int len, int elanid); - -char * qsw_capability_string(qsw_jobinfo_t j, char *buf, size_t len); -void qsw_print_jobinfo(FILE *fp, struct qsw_jobinfo *jobinfo); - - /* Return Elan shared memory state key */ -int qsw_statkey (qsw_jobinfo_t jobinfo, int *keyp); - -#endif /* _QSW_INCLUDED */ diff --git a/src/plugins/switch/elan/switch_elan.c b/src/plugins/switch/elan/switch_elan.c deleted file mode 100644 index 8e1415aa41357bc0fa95b96f6ed67a6ac7e61929..0000000000000000000000000000000000000000 --- a/src/plugins/switch/elan/switch_elan.c +++ /dev/null @@ -1,841 +0,0 @@ -/*****************************************************************************\ - * switch_elan.c - Library routines for initiating jobs on QsNet. - ***************************************************************************** - * Copyright (C) 2003-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 Kevin Tew , et. al. - * CODE-OCEC-09-009. All rights reserved. - * - * This file is part of SLURM, a resource management program. - * For details, see . - * 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 - -#ifdef WITH_PTHREADS -# include -#endif /* WITH_PTHREADS */ - -#include -#include -#include -#include -#include -#include -#include - -#include "slurm/slurm_errno.h" - -#include "src/common/slurm_xlator.h" - -#include "src/plugins/switch/elan/qsw.h" - -#define BUFFER_SIZE 1024 -#define QSW_STATE_VERSION "VER001" - -/* - * Static prototypes for network error resolver creation: - */ -static int _set_elan_ids(void); -static void *_neterr_thr(void *arg); - -static int neterr_retval = 0; -static pthread_t neterr_tid = 0; -static pthread_mutex_t neterr_mutex = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t neterr_cond = PTHREAD_COND_INITIALIZER; - -/* Type for error string table entries */ -typedef struct { - int xe_number; - char *xe_message; -} slurm_errtab_t; - -static slurm_errtab_t slurm_errtab[] = { - {0, "No error"}, - {-1, "Unspecified error"}, - - /* Quadrics Elan routine error codes */ - - { ENOSLURM, /* oh no! */ - "Out of slurm" }, - { EBADMAGIC_QSWLIBSTATE, - "Bad magic in QSW libstate" }, - { EBADMAGIC_QSWJOBINFO, - "Bad magic in QSW jobinfo" }, - { EINVAL_PRGCREATE, - "Program identifier in use or CPU count invalid, try again" }, - { ECHILD_PRGDESTROY, - "Processes belonging to this program are still running" }, - { EEXIST_PRGDESTROY, - "Program identifier does not exist" }, - { EELAN3INIT, - "Too many processes using Elan or mapping failure" }, - { EELAN3CONTROL, - "Could not open elan3 control device" }, - { EELAN3CREATE, - "Could not create elan capability" }, - { ESRCH_PRGADDCAP, - "Program does not exist (addcap)" }, - { EFAULT_PRGADDCAP, - "Capability has invalid address (addcap)" }, - { EINVAL_SETCAP, - "Invalid context number (setcap)" }, - { EFAULT_SETCAP, - "Capability has invalid address (setcap)" }, - { EGETNODEID, - "Cannot determine local elan address" }, - { EGETNODEID_BYHOST, - "Cannot translate hostname to elan address" }, - { EGETHOST_BYNODEID, - "Cannot translate elan address to hostname" }, - { ESRCH_PRGSIGNAL, - "No such program identifier" }, - { EINVAL_PRGSIGNAL, - "Invalid signal number" } -}; - -/* - * 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 - * - * / - * - * where is a description of the intended application of - * the plugin (e.g., "switch" for SLURM switch) and 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[] = "switch Quadrics Elan3 or Elan4 plugin"; -const char plugin_type[] = "switch/elan"; -const uint32_t plugin_version = 90; - -/* - * init() is called when the plugin is loaded, before any other functions - * are called. Put global initialization here. - */ -int init ( void ) -{ -#ifdef HAVE_FRONT_END - fatal("Plugin switch/elan is incompatible with front-end configuration"); -#endif - verbose("%s loaded", plugin_name); - return SLURM_SUCCESS; -} - -int fini ( void ) -{ - return SLURM_SUCCESS; -} - -/* - * switch functions for global state save/restore - */ -int switch_p_libstate_save (char *dir_name) -{ - int error_code = SLURM_SUCCESS; - qsw_libstate_t old_state = NULL; - Buf buffer = NULL; - int state_fd; - char *file_name; - - if (qsw_alloc_libstate(&old_state)) - return SLURM_ERROR; - qsw_fini(old_state); - buffer = init_buf(1024); - packstr(QSW_STATE_VERSION, buffer); - (void) qsw_pack_libstate(old_state, buffer); - file_name = xstrdup(dir_name); - xstrcat(file_name, "/qsw_state"); - (void) unlink(file_name); - state_fd = creat (file_name, 0600); - if (state_fd < 0) { - error ("Can't save state, error creating file %s %m", - file_name); - error_code = SLURM_ERROR; - } else { - char *buf = get_buf_data(buffer); - size_t len = get_buf_offset(buffer); - while(1) { - int wrote = write (state_fd, buf, len); - if ((wrote < 0) && (errno == EINTR)) - continue; - if (wrote == 0) - break; - if (wrote < 0) { - error ("Can't save switch state: %m"); - error_code = SLURM_ERROR; - break; - } - buf += wrote; - len -= wrote; - } - close (state_fd); - } - xfree(file_name); - - if (buffer) - free_buf(buffer); - if (old_state) - qsw_free_libstate(old_state); - - return error_code; -} - -int switch_p_libstate_restore (char *dir_name, bool recover) -{ - char *data = NULL, *file_name; - qsw_libstate_t old_state = NULL; - Buf buffer = NULL; - int error_code = SLURM_SUCCESS; - int state_fd, data_allocated = 0, data_read = 0, data_size = 0; - char *ver_str = NULL; - uint32_t ver_str_len; - - if (!recover) /* clean start, no recovery */ - return qsw_init(NULL); - - file_name = xstrdup(dir_name); - xstrcat(file_name, "/qsw_state"); - state_fd = open (file_name, O_RDONLY); - if (state_fd >= 0) { - data_allocated = BUFFER_SIZE; - data = xmalloc(data_allocated); - while (1) { - data_read = read (state_fd, &data[data_size], - BUFFER_SIZE); - if ((data_read < 0) && (errno == EINTR)) - continue; - if (data_read < 0) { - error ("Read error on %s, %m", file_name); - error_code = SLURM_ERROR; - break; - } else if (data_read == 0) - break; - data_size += data_read; - data_allocated += data_read; - xrealloc(data, data_allocated); - } - close (state_fd); - xfree(file_name); - } else { - error("No %s file for QSW state recovery", file_name); - error("Starting QSW with clean state"); - xfree(file_name); - return qsw_init(NULL); - } - - if (error_code == SLURM_SUCCESS) { - buffer = create_buf (data, data_size); - data = NULL; /* now in buffer, don't xfree() */ - if (buffer && (size_buf(buffer) >= sizeof(uint32_t) + - strlen(QSW_STATE_VERSION))) { - char *ptr = get_buf_data(buffer); - - if (!memcmp(&ptr[sizeof(uint32_t)], - QSW_STATE_VERSION, 3)) { - unpackstr_xmalloc(&ver_str, &ver_str_len, - buffer); - debug3("qsw_state file version: %s", ver_str); - } - } - } - - if (ver_str && (strcmp(ver_str, QSW_STATE_VERSION) == 0)) { - if ((qsw_alloc_libstate(&old_state)) - || (qsw_unpack_libstate(old_state, buffer) < 0)) - error_code = SLURM_ERROR; - } else - error("qsw_state file is in an unsupported format, ignored"); - - if (buffer) - free_buf(buffer); - xfree(data); - xfree(ver_str); - - if (error_code == SLURM_SUCCESS) - error_code = qsw_init(old_state); - if (old_state) - qsw_free_libstate(old_state); - - return error_code; -} - -int switch_p_libstate_clear ( void ) -{ - return qsw_clear(); -} - -/* - * switch functions for job step specific credential - */ -int switch_p_alloc_jobinfo(switch_jobinfo_t **jp) -{ - return qsw_alloc_jobinfo((qsw_jobinfo_t *)jp); -} - -int switch_p_build_jobinfo ( switch_jobinfo_t *switch_job, char *nodelist, - uint16_t *tasks_per_node, int cyclic_alloc, char *network) -{ - int node_set_size = QSW_MAX_TASKS; /* overkill but safe */ - hostlist_t host_list; - char *this_node_name; - bitstr_t *nodeset; - int node_id, error_code = SLURM_SUCCESS; - int i, nnodes, ntasks = 0; - - if (!tasks_per_node) { - slurm_seterrno(ENOMEM); - return SLURM_ERROR; - } - - if ((host_list = hostlist_create(nodelist)) == NULL) - fatal("hostlist_create(%s): %m", nodelist); - - nnodes = hostlist_count(host_list); - for (i = 0; i < nnodes; i++) - ntasks += tasks_per_node[i]; - - if (ntasks > node_set_size) { - slurm_seterrno(ESLURM_BAD_TASK_COUNT); - hostlist_destroy(host_list); - return SLURM_ERROR; - } - - if ((nodeset = bit_alloc (node_set_size)) == NULL) - fatal("bit_alloc: %m"); - - while ((this_node_name = hostlist_shift(host_list))) { - node_id = qsw_getnodeid_byhost(this_node_name); - if (node_id >= 0) - bit_set(nodeset, node_id); - else { - error("qsw_getnodeid_byhost(%s) failure", - this_node_name); - slurm_seterrno(ESLURM_INTERCONNECT_FAILURE); - error_code = SLURM_ERROR; - } - free(this_node_name); - } - hostlist_destroy(host_list); - - if (error_code == SLURM_SUCCESS) { - qsw_jobinfo_t j = (qsw_jobinfo_t) switch_job; - error_code = qsw_setup_jobinfo(j, ntasks, nodeset, - tasks_per_node, cyclic_alloc); - /* allocs hw context */ - } - - FREE_NULL_BITMAP(nodeset); - return error_code; -} - -switch_jobinfo_t *switch_p_copy_jobinfo(switch_jobinfo_t *j) -{ - return (switch_jobinfo_t) qsw_copy_jobinfo((qsw_jobinfo_t) j); -} - -void switch_p_free_jobinfo(switch_jobinfo_t *k) -{ - qsw_free_jobinfo((qsw_jobinfo_t) k); -} - -int switch_p_pack_jobinfo(switch_jobinfo_t *k, Buf buffer) -{ - return qsw_pack_jobinfo((qsw_jobinfo_t) k, buffer); -} - -int switch_p_unpack_jobinfo(switch_jobinfo_t *k, Buf buffer) -{ - return qsw_unpack_jobinfo((qsw_jobinfo_t) k, buffer); -} - -void switch_p_print_jobinfo(FILE *fp, switch_jobinfo_t *jobinfo) -{ - qsw_print_jobinfo(fp, (qsw_jobinfo_t) jobinfo); -} - -char *switch_p_sprint_jobinfo(switch_jobinfo_t *switch_jobinfo, char *buf, - size_t size) -{ - return qsw_capability_string((struct qsw_jobinfo *) switch_jobinfo, - buf, size); -} - -/* - * switch functions for job initiation - */ - -static int _have_elan3 (void) -{ -#if HAVE_LIBELAN3 - return (1); -#else - struct stat st; - - if (stat ("/proc/qsnet/elan3/device0", &st) < 0) - return (0); - - return (1); -#endif /* HAVE_LIBELAN3 */ - return (0); -} - -/* Initialize node for use of the Elan interconnect by loading - * elanid/hostname pairs then spawning the Elan network error - * resolver thread. - * - * Main thread waits for neterr thread to successfully start before - * continuing. - */ -int switch_p_node_init ( void ) -{ - pthread_attr_t attr; - - /* - * Only need to run neterr resolver thread on Elan3 systems. - */ - if (!_have_elan3 ()) return SLURM_SUCCESS; - - /* - * Load neterr elanid/hostname values into kernel - */ - if (_set_elan_ids() < 0) - return SLURM_ERROR; - - slurm_attr_init(&attr); - if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)) - error("pthread_attr_setdetachstate: %m"); - - slurm_mutex_lock(&neterr_mutex); - - if (pthread_create(&neterr_tid, &attr, _neterr_thr, NULL)) { - error("pthread_create: %m"); - slurm_attr_destroy(&attr); - return SLURM_ERROR; - } - slurm_attr_destroy(&attr); - - /* - * Wait for successful startup of neterr thread before - * returning control to slurmd. - */ - pthread_cond_wait(&neterr_cond, &neterr_mutex); - pthread_mutex_unlock(&neterr_mutex); - - return neterr_retval; - - - return SLURM_SUCCESS; -} - -/* - * Use dlopen(3) for libelan3.so (when needed) - * This allows us to build a single version of the elan plugin - * for Elan3 and Elan4 on QsNetII systems. - */ -static void *elan3h = NULL; - -/* - * * Wrapper functions for needed libelan3 functions - * */ -static int _elan3_init_neterr_svc (int dbglvl) -{ - static int (*init_svc) (int); - - if (!(init_svc = dlsym (elan3h, "elan3_init_neterr_svc"))) - return (0); - - return (init_svc (dbglvl)); -} - - -static int _elan3_register_neterr_svc (void) -{ - static int (*reg_svc) (void); - - if (!(reg_svc = dlsym (elan3h, "elan3_register_neterr_svc"))) - return (0); - - return (reg_svc ()); -} - -static int _elan3_run_neterr_svc (void) -{ - static int (*run_svc) (); - - if (!(run_svc = dlsym (elan3h, "elan3_run_neterr_svc"))) - return (0); - - return (run_svc ()); -} - - -static int _elan3_load_neterr_svc (int i, char *host) -{ - static int (*load_svc) (int, char *); - - if (!(load_svc = dlsym (elan3h, "elan3_load_neterr_svc"))) - return (0); - - return (load_svc (i, host)); -} - -static void *_neterr_thr(void *arg) -{ - debug3("Starting Elan network error resolver thread"); - - if (!(elan3h = dlopen ("libelan3.so", RTLD_LAZY))) { - error ("Unable to open libelan3.so: %s", dlerror ()); - goto fail; - } - - if (!_elan3_init_neterr_svc(0)) { - error("elan3_init_neterr_svc: %m"); - goto fail; - } - - /* - * Attempt to register the neterr svc thread. If the address - * cannot be bound, then there is already a thread running, and - * we should just exit with success. - */ - if (!_elan3_register_neterr_svc()) { - if (errno != EADDRINUSE) { - error("elan3_register_neterr_svc: %m"); - goto fail; - } - info("Warning: Elan error resolver thread already running"); - } - - /* - * Signal main thread that we've successfully initialized - */ - slurm_mutex_lock(&neterr_mutex); - neterr_retval = 0; - pthread_cond_signal(&neterr_cond); - slurm_mutex_unlock(&neterr_mutex); - - /* - * Run the network error resolver thread. This should - * never return. If it does, there's not much we can do - * about it. - */ - _elan3_run_neterr_svc(); - - return NULL; - - fail: - slurm_mutex_lock(&neterr_mutex); - neterr_retval = SLURM_FAILURE; - pthread_cond_signal(&neterr_cond); - slurm_mutex_unlock(&neterr_mutex); - - return NULL; -} - -/* - * Called from slurmd just before termination. - * We don't really need to do anything special for Elan, but - * we'll call pthread_cancel() on the neterr resolver thread anyhow. - */ -extern int switch_p_node_fini ( void ) -{ -#if HAVE_LIBELAN3 - int i; - - if (!neterr_tid) - return SLURM_SUCCESS; - - for (i=0; i<4; i++) { - if (pthread_cancel(neterr_tid)) { - neterr_tid = 0; - return SLURM_SUCCESS; - } - usleep(1000); - } - error("Could not kill switch elan pthread"); - return SLURM_ERROR; -#else /* !HAVE_LIBELAN3 */ - - return SLURM_SUCCESS; -#endif /* HAVE_LIBELAN3 */ -} - -int switch_p_job_preinit ( switch_jobinfo_t *jobinfo ) -{ - return SLURM_SUCCESS; -} - -/* - * prepare node for interconnect use - */ -int switch_p_job_init ( switch_jobinfo_t *jobinfo, uid_t uid ) -{ - char buf[4096]; - - debug2("calling qsw_prog_init from process %lu", - (unsigned long) getpid()); - verbose("ELAN: %s", qsw_capability_string( - (qsw_jobinfo_t)jobinfo, buf, 4096)); - - if (qsw_prog_init((qsw_jobinfo_t)jobinfo, uid) < 0) { - /* - * Check for EBADF, which probably means the rms - * kernel module is not loaded. - */ - if (errno == EBADF) - error("Initializing interconnect: " - "is the rms kernel module loaded?"); - else - error ("qsw_prog_init: %m"); - - qsw_print_jobinfo(log_fp(), (qsw_jobinfo_t)jobinfo); - return SLURM_ERROR; - } - - return SLURM_SUCCESS; -} - -int switch_p_job_fini ( switch_jobinfo_t *jobinfo ) -{ - qsw_prog_fini((qsw_jobinfo_t)jobinfo); - return SLURM_SUCCESS; -} - -int switch_p_job_postfini ( switch_jobinfo_t *jobinfo, uid_t pgid, - uint32_t job_id, uint32_t step_id ) -{ - return SLURM_SUCCESS; -} - -int switch_p_job_attach ( switch_jobinfo_t *jobinfo, char ***env, - uint32_t nodeid, uint32_t procid, uint32_t nnodes, - uint32_t nprocs, uint32_t rank ) -{ - int id = -1; - debug3("nodeid=%lu nnodes=%lu procid=%lu nprocs=%lu rank=%lu", - (unsigned long) nodeid, (unsigned long) nnodes, - (unsigned long) procid, (unsigned long) nprocs, - (unsigned long) rank); - debug3("setting capability in process %lu", - (unsigned long) getpid()); - if (qsw_setcap((qsw_jobinfo_t) jobinfo, (int) procid) < 0) { - error("qsw_setcap: %m"); - return SLURM_ERROR; - } - - if (slurm_setenvpf(env, "RMS_RANK", "%lu", (unsigned long) rank ) - < 0) - return SLURM_ERROR; - if (slurm_setenvpf(env, "RMS_NODEID", "%lu", (unsigned long) nodeid) - < 0) - return SLURM_ERROR; - if (slurm_setenvpf(env, "RMS_PROCID", "%lu", (unsigned long) rank ) - < 0) - return SLURM_ERROR; - if (slurm_setenvpf(env, "RMS_NNODES", "%lu", (unsigned long) nnodes) - < 0) - return SLURM_ERROR; - if (slurm_setenvpf(env, "RMS_NPROCS", "%lu", (unsigned long) nprocs) - < 0) - return SLURM_ERROR; - - /* - * Tell libelan the key to use for Elan state shmem segment - */ - if (qsw_statkey ((qsw_jobinfo_t) jobinfo, &id) >= 0) - slurm_setenvpf (env, "ELAN_STATKEY", "%d", id); - - return SLURM_SUCCESS; -} - -extern int switch_p_get_jobinfo(switch_jobinfo_t *switch_job, - int key, void *resulting_data) -{ - slurm_seterrno(EINVAL); - return SLURM_ERROR; -} - -static int -_set_elan_ids(void) -{ - int i; - - for (i = 0; i <= qsw_maxnodeid(); i++) { - char host[256]; - if (qsw_gethost_bynodeid(host, 256, i) < 0) - continue; - - if (_elan3_load_neterr_svc(i, host) < 0) - error("elan3_load_neterr_svc(%d, %s): %m", i, host); - } - - return SLURM_SUCCESS; -} - - -/* - * Linear search through table of errno values and strings, - * returns NULL on error, string on success. - */ -static char *_lookup_slurm_api_errtab(int errnum) -{ - char *res = NULL; - int i; - - for (i = 0; i < sizeof(slurm_errtab) / sizeof(slurm_errtab_t); i++) { - if (slurm_errtab[i].xe_number == errnum) { - res = slurm_errtab[i].xe_message; - break; - } - } - return res; -} - -extern int switch_p_get_errno(void) -{ - int err = slurm_get_errno(); - - if ((err >= ESLURM_SWITCH_MIN) && (err <= ESLURM_SWITCH_MAX)) - return err; - - return SLURM_SUCCESS; -} - -extern char *switch_p_strerror(int errnum) -{ - char *res = _lookup_slurm_api_errtab(errnum); - return (res ? res : strerror(errnum)); -} - -/* - * node switch state monitoring functions - * required for IBM Federation switch - */ -extern int switch_p_clear_node_state(void) -{ - return SLURM_SUCCESS; -} - -extern int switch_p_alloc_node_info(switch_node_info_t *switch_node) -{ - return SLURM_SUCCESS; -} - -extern int switch_p_build_node_info(switch_node_info_t switch_node) -{ - return SLURM_SUCCESS; -} - -extern int switch_p_pack_node_info(switch_node_info_t switch_node, - Buf buffer) -{ - return SLURM_SUCCESS; -} - -extern int switch_p_unpack_node_info(switch_node_info_t switch_node, - Buf buffer) -{ - return SLURM_SUCCESS; -} - -extern int switch_p_free_node_info(switch_node_info_t *switch_node) -{ - return SLURM_SUCCESS; -} - -extern char*switch_p_sprintf_node_info(switch_node_info_t switch_node, - char *buf, size_t size) -{ - if ((buf != NULL) && size) { - buf[0] = '\0'; - return buf; - } - - return NULL; -} - -extern int switch_p_job_step_complete(switch_jobinfo_t *jobinfo, - char *nodelist) -{ - qsw_teardown_jobinfo((qsw_jobinfo_t) jobinfo); /* frees hw context */ - - return SLURM_SUCCESS; -} - -extern int switch_p_job_step_part_comp(switch_jobinfo_t *jobinfo, - char *nodelist) -{ - return SLURM_SUCCESS; -} - -extern bool switch_p_part_comp(void) -{ - return false; -} - -extern int switch_p_job_step_allocated(switch_jobinfo_t *jobinfo, - char *nodelist) -{ - return qsw_restore_jobinfo((qsw_jobinfo_t) jobinfo); -} - -extern int switch_p_slurmctld_init( void ) -{ - return SLURM_SUCCESS; -} - -extern int switch_p_slurmd_init( void ) -{ - return SLURM_SUCCESS; -} - -extern int switch_p_slurmd_step_init( void ) -{ - return SLURM_SUCCESS; -} diff --git a/src/plugins/switch/federation/Makefile.am b/src/plugins/switch/federation/Makefile.am deleted file mode 100644 index 1d166c8e20cc2cc211353c867b0e29b62ad77b81..0000000000000000000000000000000000000000 --- a/src/plugins/switch/federation/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -# Makefile for switch/federation plugin - -AM_CPPFLAGS = -DFEDERATION_CONFIG_FILE=\"$(sysconfdir)/federation.conf\" -AUTOMAKE_OPTIONS = foreign - -if HAVE_FEDERATION -federation_lib = switch_federation.la -else -federation_lib = -endif - -PLUGIN_FLAGS = -module -avoid-version --export-dynamic - -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common - -pkglib_LTLIBRARIES = $(federation_lib) - -if HAVE_FEDERATION -# Federation switch plugin. -switch_federation_la_SOURCES = \ - federation.c federation.h \ - federation_keys.h \ - switch_federation.c -switch_federation_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) \ - $(FEDERATION_LDFLAGS) - -else -EXTRA_switch_federation_la_SOURCES = \ - federation.c federation.h \ - federation_keys.h \ - switch_federation.c -endif diff --git a/src/plugins/switch/federation/federation.c b/src/plugins/switch/federation/federation.c deleted file mode 100644 index 749b4469dfbbe8453d5408437bb3f863ea7e96c9..0000000000000000000000000000000000000000 --- a/src/plugins/switch/federation/federation.c +++ /dev/null @@ -1,2629 +0,0 @@ -/*****************************************************************************\ - * federation.c - Library routines for initiating jobs on IBM Federation - ***************************************************************************** - * Copyright (C) 2004-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 Jason King - * CODE-OCEC-09-009. All rights reserved. - * - * This file is part of SLURM, a resource management program. - * For details, see . - * 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 -#include -#include - -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#if HAVE_LIBNTBL -# include -#else -# error "Must have libntbl to compile this module!" -#endif - -#include - -#include "slurm/slurm_errno.h" -#include "src/common/slurm_xlator.h" -#include "src/common/read_config.h" -#include "src/plugins/switch/federation/federation.h" -#include "src/plugins/switch/federation/federation_keys.h" - -/* - * Definitions local to this module - */ -#define FED_NODEINFO_MAGIC 0xc00cc00d -#define FED_JOBINFO_MAGIC 0xc00cc00e -#define FED_LIBSTATE_MAGIC 0xc00cc00f - -#define FED_ADAPTERNAME_LEN 5 -#define FED_HOSTLEN 20 -#define FED_VERBOSE_PRINT 0 -#define FED_NODECOUNT 128 -#define FED_HASHCOUNT 128 -#define FED_AUTO_WINMEM 0 -#define FED_MAX_WIN 15 -#define FED_MIN_WIN 0 -#define FED_DEBUG 0 - -#define BUFSIZE 4096 - -char* fed_conf = NULL; -extern bool fed_need_state_save; - -mode_t fed_umask; - -/* - * Data structures specific to Federation - * - * We are going to some trouble to keep these defs private so slurm - * hackers not interested in the interconnect details can just pass around - * the opaque types. All use of the data structure internals is local to this - * module. - */ - -typedef struct fed_window { - uint16_t id; - uint32_t status; - uint16_t job_key; -} fed_window_t; - -typedef struct fed_adapter { - char name[FED_ADAPTERNAME_LEN]; - uint16_t lid; - uint16_t network_id; - uint32_t max_winmem; - uint32_t min_winmem; - uint32_t avail_mem; - uint32_t window_count; - fed_window_t *window_list; -} fed_adapter_t; - -struct fed_nodeinfo { - uint32_t magic; - char name[FED_HOSTLEN]; - uint32_t adapter_count; - fed_adapter_t *adapter_list; - struct fed_nodeinfo *next; -}; - -struct fed_libstate { - uint32_t magic; - uint32_t node_count; - uint32_t node_max; - fed_nodeinfo_t *node_list; - uint32_t hash_max; - fed_nodeinfo_t **hash_table; - uint16_t key_index; -}; - -struct fed_jobinfo { - uint32_t magic; - /* version from ntbl_version() */ - /* adapter from lid in table */ - /* network_id from lid in table */ - /* uid from getuid() */ - /* pid from getpid() */ - uint16_t job_key; - char job_desc[DESCLEN]; - uint32_t window_memory; - uint8_t bulk_xfer; /* flag */ - uint16_t tables_per_task; - fed_tableinfo_t *tableinfo; - - hostlist_t nodenames; - int num_tasks; -}; - -typedef struct { - int status_number; - char *status_msg; -} fed_status_t; - -typedef struct { - char name[FED_ADAPTERNAME_LEN]; - uint16_t lid; - uint16_t network_id; -} fed_cache_entry_t; - -/* - * Globals - */ -fed_libstate_t *fed_state = NULL; -pthread_mutex_t global_lock = PTHREAD_MUTEX_INITIALIZER; - -/* slurmd/slurmstepd global variables */ -hostlist_t adapter_list; -static fed_cache_entry_t lid_cache[FED_MAXADAPTERS]; - - -#define FED_STATUS_UNKNOWN 99 -static fed_status_t fed_status_tab[]= { - {0, "NTBL_SUCCESS"}, - {1, "NTBL_EINVAL"}, - {2, "NTBL_EPERM"}, - {3, "NTBL_EIOCTL"}, - {4, "NTBL_EADAPTER"}, - {5, "NTBL_ESYSTEM"}, - {6, "NTBL_EMEM"}, - {7, "NTBL_ELID"}, - {8, "NTBL_EIO"}, - {9, "NTBL_UNLOADED_STATE"}, - {10, "NTBL_LOADED_STATE"}, - {11, "NTBL_DISABLED_STATE"}, - {12, "NTBL_ACTIVE_STATE"}, - {13, "NTBL_BUSY_STATE"}, - {14, "NTBL_NO_RDMA_AVAIL"}, - {FED_STATUS_UNKNOWN, "UNKNOWN_RESULT_CODE"} -}; - -static void _hash_rebuild(fed_libstate_t *state); -static int _set_up_adapter(fed_adapter_t *fed_adapter, char *adapter_name); -static int _parse_fed_file(hostlist_t *adapter_list); -static void _init_adapter_cache(void); -static int _fill_in_adapter_cache(void); - -/* The _lock() and _unlock() functions are used to lock/unlock a - * global mutex. Used to serialize access to the global library - * state variable fed_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); - } -} - -int -fed_slurmctld_init(void) -{ - return SLURM_SUCCESS; -} - -int -fed_slurmd_init(void) -{ - /* - * This is a work-around for the ntbl_* functions calling umask(0) - */ - fed_umask = umask(0077); - umask(fed_umask); - - /*_init_adapter_cache();*/ - - adapter_list = hostlist_create(NULL); - if (_parse_fed_file(&adapter_list) != SLURM_SUCCESS) - return SLURM_FAILURE; - assert(hostlist_count(adapter_list) <= FED_MAXADAPTERS); - return SLURM_SUCCESS; -} - -int -fed_slurmd_step_init(void) -{ - /* - * This is a work-around for the ntbl_* functions calling umask(0) - */ - fed_umask = umask(0077); - umask(fed_umask); - - _init_adapter_cache(); - - adapter_list = hostlist_create(NULL); - if (_parse_fed_file(&adapter_list) != SLURM_SUCCESS) - return SLURM_FAILURE; - assert(hostlist_count(adapter_list) <= FED_MAXADAPTERS); - - _fill_in_adapter_cache(); - - return SLURM_SUCCESS; -} - -static char * -_lookup_fed_status_tab(int status) -{ - char *res = NULL; - int i; - - for(i = 0; i < sizeof(fed_status_tab) / sizeof(fed_status_t); i++) { - if(fed_status_tab[i].status_number == status) { - res = fed_status_tab[i].status_msg; - break; - } - } - - if(!res) - res = fed_status_tab[FED_STATUS_UNKNOWN].status_msg; - - return res; -} - -/* Used by: slurmd, slurmctld */ -void fed_print_jobinfo(FILE *fp, fed_jobinfo_t *jobinfo) -{ - assert(jobinfo->magic == FED_JOBINFO_MAGIC); - - /* stubbed out */ -} - -/* Used by: slurmd, slurmctld */ -char *fed_sprint_jobinfo(fed_jobinfo_t *j, char *buf, - size_t size) -{ - int count; - char *tmp = buf; - int remaining = size; - - assert(buf); - assert(j); - assert(j->magic == FED_JOBINFO_MAGIC); - - count = snprintf(tmp, remaining, - "--Begin Jobinfo--\n" - " job_key: %u\n" - " job_desc: %s\n" - " window_memory: %u\n" - " table_size: %u\n" - "--End Jobinfo--\n", - j->job_key, - j->job_desc, - j->window_memory, - j->tables_per_task); - if(count < 0) - return buf; - remaining -= count; - tmp += count; - if(remaining < 1) - return buf; - - return buf; -} - -/* The lid caching functions were created to avoid unnecessary - * function calls each time we need to load network tables on a node. - * _init_cache() simply initializes the cache to sane values and - * needs to be called before any other cache functions are called. - * - * Used by: slurmd/slurmstepd - */ -static void -_init_adapter_cache(void) -{ - int i; - - for(i = 0; i < FED_MAXADAPTERS; i++) { - lid_cache[i].name[0] = 0; - lid_cache[i].lid = -1; - lid_cache[i].network_id = -1; - } -} - -/* Use ntbl_adapter_resources to cache information about local adapters. - * - * Used by: slurmstepd - */ -static int -_fill_in_adapter_cache(void) -{ - hostlist_iterator_t adapters; - char *adapter_name = NULL; - ADAPTER_RESOURCES res; - int num; - int rc; - int i; - - adapters = hostlist_iterator_create(adapter_list); - for (i = 0; (adapter_name = hostlist_next(adapters)); i++) { - rc = ntbl_adapter_resources(NTBL_VERSION, adapter_name, &res); - if (rc != NTBL_SUCCESS) - return SLURM_ERROR; - - num = adapter_name[3] - (int)'0'; - assert(num < FED_MAXADAPTERS); - lid_cache[num].lid = res.lid; - lid_cache[num].network_id = res.network_id; - strncpy(lid_cache[num].name, adapter_name, FED_ADAPTERNAME_LEN); - - free(res.window_list); - free(adapter_name); - } - hostlist_iterator_destroy(adapters); - umask(fed_umask); - - return SLURM_SUCCESS; -} - - -/* Cache the lid and network_id of a given adapter. Ex: sni0 with lid 10 - * gets cached in array index 0 with a lid = 10 and a name = sni0. - * - * Used by: slurmd - */ -static void -_cache_lid(fed_adapter_t *ap) -{ - assert(ap); - - int adapter_num = ap->name[3] - (int) '0'; - - lid_cache[adapter_num].lid = ap->lid; - lid_cache[adapter_num].network_id = ap->network_id; - strncpy(lid_cache[adapter_num].name, ap->name, FED_ADAPTERNAME_LEN); -} - - -/* Check lid cache for an adapter name and return the network id. - * - * Used by: slurmd - */ -static uint16_t -_get_network_id_from_adapter(char *adapter_name) -{ - int i; - - for (i = 0; i < FED_MAXADAPTERS; i++) { - if (!strncmp(adapter_name, lid_cache[i].name, - FED_ADAPTERNAME_LEN)) - return lid_cache[i].network_id; - } - - return (uint16_t) -1; -} - - -/* Check lid cache for an adapter name and return the lid. - * - * Used by: slurmd - */ -static uint16_t -_get_lid_from_adapter(char *adapter_name) -{ - int i; - - for (i = 0; i < FED_MAXADAPTERS; i++) { - if (!strncmp(adapter_name, lid_cache[i].name, - FED_ADAPTERNAME_LEN)) - return lid_cache[i].lid; - } - - return (uint16_t) -1; -} - - -static int _set_up_adapter(fed_adapter_t *fed_adapter, char *adapter_name) -{ - ADAPTER_RESOURCES res; - struct NTBL_STATUS *status = NULL; - struct NTBL_STATUS *old = NULL; - fed_window_t *tmp_winlist = NULL; - int win_count = 0, i; - int error_code; - - info("adapter_name is %s", adapter_name); - - error_code = ntbl_adapter_resources(NTBL_VERSION, - adapter_name, - &res); - if(error_code != NTBL_SUCCESS) - return SLURM_ERROR; - strncpy(fed_adapter->name, - adapter_name, - FED_ADAPTERNAME_LEN); - fed_adapter->lid = res.lid; - fed_adapter->network_id = res.network_id; - /* FUTURE: check that we don't lose information when converting - * from 64 to 32 bit unsigned ints in the next three assignments. - */ - fed_adapter->max_winmem = res.max_window_memory; - fed_adapter->min_winmem = res.min_window_memory; - fed_adapter->avail_mem = res.avail_adapter_memory; - fed_adapter->window_count = res.window_count; - free(res.window_list); - _cache_lid(fed_adapter); - error_code = ntbl_status_adapter(NTBL_VERSION, - adapter_name, - &win_count, - &status); - umask(fed_umask); - if(error_code) - slurm_seterrno_ret(ESTATUS); - tmp_winlist = (fed_window_t *)xmalloc(sizeof(fed_window_t) * - res.window_count); - if(!tmp_winlist) - slurm_seterrno_ret(ENOMEM); - for(i = 0; i < res.window_count; i++) { - tmp_winlist[i].id = status->window_id; - tmp_winlist[i].status = status->rc; - old = status; - status = status->next; - free(old); - } - fed_adapter->window_list = tmp_winlist; - return SLURM_SUCCESS; -} - -static char *_get_fed_conf(void) -{ - char *val = getenv("SLURM_CONF"); - char *rc; - int i; - - if (!val) - return xstrdup(FEDERATION_CONFIG_FILE); - - /* Replace file name on end of path */ - i = strlen(val) - strlen("slurm.conf") + strlen("federation.conf") + 1; - rc = xmalloc(i); - strcpy(rc, val); - val = strrchr(rc, (int)'/'); - if (val) /* absolute path */ - val++; - else /* not absolute path */ - val = rc; - strcpy(val, "federation.conf"); - return rc; -} - -static int _parse_fed_file(hostlist_t *adapter_list) -{ - s_p_options_t options[] = {{"AdapterName", S_P_STRING}, {NULL}}; - s_p_hashtbl_t *tbl; - char *adapter_name; - - debug("Reading the federation.conf file"); - if (!fed_conf) - fed_conf = _get_fed_conf(); - - tbl = s_p_hashtbl_create(options); - if(s_p_parse_file(tbl, NULL, fed_conf, false) == SLURM_ERROR) - fatal("something wrong with opening/reading federation " - "conf file"); - - if (s_p_get_string(&adapter_name, "AdapterName", tbl)) { - int rc; - rc = hostlist_push(*adapter_list, adapter_name); - if (rc == 0) - error("Adapter name format is incorrect."); - xfree(adapter_name); - } - - s_p_hashtbl_destroy(tbl); - - return SLURM_SUCCESS; -} - -/* Check for existence of sniX, where X is from 0 to FED_MAXADAPTERS. - * For all that exist, record vital adapter info plus status for all windows - * available on that adapter. Cache lid to adapter name mapping locally. - * - * Used by: slurmd - */ -static int -_get_adapters(fed_adapter_t *list, int *count) -{ - hostlist_iterator_t adapter_iter; - char *adapter = NULL; - int i; - - assert(list != NULL); - assert(adapter_list != NULL); - - adapter_iter = hostlist_iterator_create(adapter_list); - for (i = 0; (adapter = hostlist_next(adapter_iter)); i++) { - if(_set_up_adapter(list + i, adapter) == SLURM_ERROR) - fatal("Failed to set up adapter %s.", adapter); - free(adapter); - } - hostlist_iterator_destroy(adapter_iter); - - assert(i > 0); - *count = i; - info("Number of adapters is = %d", *count); - - if(!*count) - slurm_seterrno_ret(ENOADAPTER); - - return 0; -} - -/* Used by: slurmd, slurmctld */ -int -fed_alloc_jobinfo(fed_jobinfo_t **j) -{ - fed_jobinfo_t *new; - - assert(j != NULL); - new = (fed_jobinfo_t *)xmalloc(sizeof(fed_jobinfo_t)); - if (!new) - slurm_seterrno_ret(ENOMEM); - new->magic = FED_JOBINFO_MAGIC; - new->job_key = -1; - new->window_memory = 0; - new->tables_per_task = 0; - new->tableinfo = NULL; - *j = new; - - return 0; -} - -/* Used by: slurmd, slurmctld */ -int -fed_alloc_nodeinfo(fed_nodeinfo_t **n) -{ - fed_nodeinfo_t *new; - - assert(n); - - new = (fed_nodeinfo_t *)xmalloc(sizeof(fed_nodeinfo_t)); - if(!new) - slurm_seterrno_ret(ENOMEM); - new->adapter_list = (fed_adapter_t *)xmalloc(sizeof(fed_adapter_t) - * FED_MAXADAPTERS); - if(!new->adapter_list) { - xfree(new); - slurm_seterrno_ret(ENOMEM); - } - new->magic = FED_NODEINFO_MAGIC; - new->adapter_count = 0; - new->next = NULL; - - *n = new; - - return 0; -} - -/* Assumes a pre-allocated nodeinfo structure and uses _get_adapters - * to do the dirty work. We probably collect more information about - * the adapters on a give node than we need to but it was done - * in the interest of being prepared for future requirements. - * - * Used by: slurmd - */ -int -fed_build_nodeinfo(fed_nodeinfo_t *n, char *name) -{ - int count; - int err; - - assert(n); - assert(n->magic == FED_NODEINFO_MAGIC); - assert(name); - - strncpy(n->name, name, FED_HOSTLEN); - _lock(); - err = _get_adapters(n->adapter_list, &count); - _unlock(); - if(err != 0) - return err; - n->adapter_count = count; - return 0; -} -#if FED_DEBUG -static int -_print_adapter_resources(ADAPTER_RESOURCES *r, char *buf, size_t size) -{ - int count; - - assert(r); - assert(buf); - assert(size > 0); - - count = snprintf(buf, size, - "--Begin Adapter Resources--\n" - " device_type = %x\n" - " lid = %d\n" - " network_id = %d\n" - " max_window_memory = %lld\n" - " min_window_memory = %lld\n" - " avail_adapter_memory = %lld\n" - " fifo_slot_size = %lld\n" - " window_count = %d\n" - " window_list = %d\n" -#if NTBL_VERSION == 120 - " reserved = %lld\n" -#else - " rcontext_block_count = %lld\n" -#endif - "--End Adapter Resources--\n", - r->device_type, - r->lid, - r->network_id, - r->max_window_memory, - r->min_window_memory, - r->avail_adapter_memory, - r->fifo_slot_size, - r->window_count, - r->window_list[0], -#if NTBL_VERSION == 120 - r->reserved); -#else - r->rcontext_block_count); -#endif - - return count; -} - -static int -_print_window_status(struct NTBL_STATUS *s, char *buf, size_t size) -{ - int count; - - assert(s); - assert(buf); - assert(size > 0); - - switch(s->rc) { - case NTBL_UNLOADED_STATE: - count = snprintf(buf, size, -#if FED_VERBOSE_PRINT - "--Begin NTBL Status For Window %d on %s--\n" - " window_id = %u\n" - " adapter = %s\n" - " return code = %s\n" - "--End NTBL Status For Window %d on %s--\n", - s->window_id, s->adapter, - s->window_id, - s->adapter, - _lookup_fed_status_tab(s->rc), - s->window_id, s->adapter); -#else - "window %u on %s: %s\n", - s->window_id, s->adapter, - _lookup_fed_status_tab(s->rc)); -#endif - break; - case NTBL_LOADED_STATE: - case NTBL_DISABLED_STATE: - case NTBL_ACTIVE_STATE: - case NTBL_BUSY_STATE: - count = snprintf(buf, size, -#if FED_VERBOSE_PRINT - "--Begin NTBL Status For Window %d on %s--\n" - " user_name = %s\n" - " client_pid = %d\n" - " uid = %d\n" - " window_id = %u\n" - " adapter = %s\n" - " memory_requested = %llu\n" - " memory_allocated = %llu\n" - " time_loaded = %s\n" - " description = %s\n" - " return code = %s\n" - "--End NTBL Status For Window %d on %s--\n", - s->window_id, s->adapter, - s->user_name, - s->client_pid, - s->uid, - s->window_id, - s->adapter, - s->memory_requested, - s->memory_allocated, - s->time_loaded, - s->description, - _lookup_fed_status_tab(s->rc), - s->window_id, s->adapter); -#else - "window %u on %s: %s\n", - s->window_id, s->adapter, - _lookup_fed_status_tab(s->rc)); -#endif - break; - default: - count = snprintf(buf, size, - "Uknown NTBL Return Code For Window %d: %s\n", - s->window_id, - _lookup_fed_status_tab(s->rc)); - } - - return count; -} -#endif -static int -_print_window_struct(fed_window_t *w, char *buf, size_t size) -{ - int count; - - assert(w); - assert(buf); - assert(size > 0); - - - count = snprintf(buf, size, - " Window %u: %s\n", - w->id, - _lookup_fed_status_tab(w->status)); - - return count; -} - -/* Writes out nodeinfo structure to a buffer. Maintains the - * snprintf semantics by only filling the buffer up to the value - * of size. If FED_VERBOSE_PRINT is defined this function will - * dump the entire structure, otherwise only the "useful" part. - * - * Used by: slurmd, slurmctld - */ -char * -fed_print_nodeinfo(fed_nodeinfo_t *n, char *buf, size_t size) -{ - fed_adapter_t *a; - int i,j; - fed_window_t *w; - int remaining = size; - int count; - char *tmp = buf; - - assert(n); - assert(buf); - assert(size > 0); - assert(n->magic == FED_NODEINFO_MAGIC); - - count = snprintf(tmp, remaining, - "Node: %s\n", - n->name); - if(count < 0) - return buf; - remaining -= count; - tmp += count; - if(remaining < 1) - return buf; - for(i = 0; i < n->adapter_count; i++) { - a = n->adapter_list + i; - count = snprintf(tmp, remaining, -#if FED_VERBOSE_PRINT - " Adapter: %s\n" - " lid: %u\n" - " network_id: %u\n" - " max_window_memory: %u\n" - " min_window_memory: %u\n" - " avail_adapter_memory: %u\n" - " window_count: %u\n", - a->name, - a->lid, - a->network_id, - a->max_winmem, - a->min_winmem, - a->avail_mem, - a->window_count); -#else - " Adapter: %s\n" - " Window count: %d\n" - " Active windows:\n", - a->name, - a->window_count); -#endif - if(count < 0) - return buf; - remaining -= count; - tmp += count; - if(remaining < 1) - return buf; - - w = a->window_list; - for(j = 0; j < a->window_count; j++) { -#if FED_VERBOSE_PRINT - count = _print_window_struct(&w[j], tmp, remaining); -#else - - if(w[j].status != NTBL_UNLOADED_STATE) - count = _print_window_struct(&w[j], tmp, - remaining); - else - count = 0; -#endif - if(count < 0) - return buf; - remaining -= count; - tmp += count; - if(remaining < 1) - return buf; - } - } - - return buf; -} - -/* Note that when collecting max_winmem, min_winmem and avail_mem - * we convert these values from 64 to 32 bit unisgned integers. This - * was to make the pack/unpack implementation easier. I am taking a - * chance here that IBM will not release Federation adapters with more - * than 4GB of memory. - * - * Used by: all - */ -int -fed_pack_nodeinfo(fed_nodeinfo_t *n, Buf buf) -{ - int i,j; - fed_adapter_t *a; - int offset; - - assert(n); - assert(n->magic == FED_NODEINFO_MAGIC); - assert(buf); - - offset = get_buf_offset(buf); - pack32(n->magic, buf); - packmem(n->name, FED_HOSTLEN, buf); - pack32(n->adapter_count, buf); - for(i = 0; i < n->adapter_count; i++) { - a = n->adapter_list + i; - packmem(a->name, FED_ADAPTERNAME_LEN, buf); - pack16(a->lid, buf); - pack16(a->network_id, buf); - pack32(a->max_winmem, buf); - pack32(a->min_winmem, buf); - pack32(a->avail_mem, buf); - pack32(a->window_count, buf); - for(j = 0; j < a->window_count; j++) { - pack16(a->window_list[j].id, buf); - pack32(a->window_list[j].status, buf); - pack16(a->window_list[j].job_key, buf); - } - } - - return(get_buf_offset(buf) - offset); -} - -/* Used by: all */ -static int -_copy_node(fed_nodeinfo_t *dest, fed_nodeinfo_t *src) -{ - int i,j; - fed_adapter_t *sa = NULL; - fed_adapter_t *da = NULL; - - assert(dest); - assert(src); - assert(dest->magic == FED_NODEINFO_MAGIC); - assert(src->magic == FED_NODEINFO_MAGIC); - - strncpy(dest->name, src->name, FED_HOSTLEN); - dest->adapter_count = src->adapter_count; - for(i = 0; i < dest->adapter_count; i++) { - sa = src->adapter_list + i; - da = dest->adapter_list +i; - strncpy(da->name, sa->name, FED_ADAPTERNAME_LEN); - da->lid = sa->lid; - da->network_id = sa->network_id; - da->max_winmem = sa->max_winmem; - da->min_winmem = sa->min_winmem; - da->avail_mem = sa->avail_mem; - da->window_count = sa->window_count; - da->window_list = (fed_window_t *)xmalloc(sizeof(fed_window_t) * - da->window_count); - if(!da->window_list) { - slurm_seterrno_ret(ENOMEM); - } - for(j = 0; j < da->window_count; j++) - da->window_list[j] = sa->window_list[j]; - } - - return SLURM_SUCCESS; -} - -/* The idea behind keeping the hash table was to avoid a linear - * search of the node list each time we want to retrieve or - * modify a node's data. The _hash_index function translates - * a node name to an index into the hash table. - * - * Used by: slurmctld - */ -static int -_hash_index (char *name) -{ - int index = 0; - int j; - - assert(name); - - /* Multiply each character by its numerical position in the - * name string to add a bit of entropy, because host names such - * as cluster[0001-1000] can cause excessive index collisions. - */ - for (j = 1; *name; name++, j++) - index += (int)*name * j; - index %= fed_state->hash_max; - - return index; -} - -/* Tries to find a node fast using the hash table - * - * Used by: slurmctld - */ -static fed_nodeinfo_t * -_find_node(fed_libstate_t *lp, char *name) -{ - int i; - fed_nodeinfo_t *n; - - assert(name); - assert(lp); - - if (lp->node_count == 0) - return NULL; - - if (lp->hash_table) { - i = _hash_index(name); - n = lp->hash_table[i]; - while(n) { - assert(n->magic == FED_NODEINFO_MAGIC); - if(!strncmp(n->name, name, FED_HOSTLEN)) - return n; - n = n->next; - } - } - - return NULL; -} - -/* Add the hash entry for a newly created fed_nodeinfo_t - */ -static void -_hash_add_nodeinfo(fed_libstate_t *state, fed_nodeinfo_t *node) -{ - int index; - - assert(state); - assert(state->hash_table); - assert(state->hash_max >= state->node_count); - if(!strlen(node->name)) - return; - index = _hash_index(node->name); - node->next = state->hash_table[index]; - state->hash_table[index] = node; -} - -/* Recreates the hash table for the node list. - * - * Used by: slurmctld - */ -static void -_hash_rebuild(fed_libstate_t *state) -{ - int i; - - assert(state); - - if(state->hash_table) - xfree(state->hash_table); - if (state->node_count > state->hash_max || state->hash_max == 0) - state->hash_max += FED_HASHCOUNT; - state->hash_table = (fed_nodeinfo_t **) - xmalloc(sizeof(fed_nodeinfo_t *) * state->hash_max); - memset(state->hash_table, 0, - sizeof(fed_nodeinfo_t *) * state->hash_max); - for(i = 0; i < state->node_count; i++) - _hash_add_nodeinfo(state, &(state->node_list[i])); -} - -/* If the node is already in the node list then simply return - * a pointer to it, otherwise dynamically allocate memory to the - * node list if necessary. - * - * Used by: slurmctld - */ -static fed_nodeinfo_t * -_alloc_node(fed_libstate_t *lp, char *name) -{ - fed_nodeinfo_t *n = NULL; - int new_bufsize; - bool need_hash_rebuild = false; - - assert(lp); - - if(name != NULL) { - n = _find_node(lp, name); - if(n != NULL) - return n; - } - - fed_need_state_save = true; - - if(lp->node_count >= lp->node_max) { - lp->node_max += FED_NODECOUNT; - new_bufsize = lp->node_max * sizeof(fed_nodeinfo_t); - if(lp->node_list == NULL) - lp->node_list = (fed_nodeinfo_t *)xmalloc(new_bufsize); - else - lp->node_list = (fed_nodeinfo_t *)xrealloc(lp->node_list, - new_bufsize); - need_hash_rebuild = true; - } - if(lp->node_list == NULL) { - slurm_seterrno(ENOMEM); - return NULL; - } - - n = lp->node_list + (lp->node_count++); - n->magic = FED_NODEINFO_MAGIC; - n->name[0] = '\0'; - n->adapter_list = (fed_adapter_t *)xmalloc(FED_MAXADAPTERS * - sizeof(fed_adapter_t)); - - if(name != NULL) { - strncpy(n->name, name, FED_HOSTLEN); - if (need_hash_rebuild || lp->node_count > lp->hash_max) - _hash_rebuild(lp); - else - _hash_add_nodeinfo(lp, n); - } - - return n; -} -#if FED_DEBUG -/* Used by: slurmctld */ -static void -_print_libstate(const fed_libstate_t *l) -{ - int i; - char buf[3000]; - - assert(l); - - printf("--Begin libstate--\n"); - printf(" magic = %u\n", l->magic); - printf(" node_count = %u\n", l->node_count); - printf(" node_max = %u\n", l->node_max); - printf(" hash_max = %u\n", l->hash_max); - for(i = 0; i < l->node_count; i++) { - memset(buf, 0, 3000); - fed_print_nodeinfo(&l->node_list[i], buf, 3000); - printf("%s", buf); - } - printf("--End libstate--\n"); -} -#endif - - -/* Throw away adapter portion of the nodeinfo. - * - * Used by: _unpack_nodeinfo - */ -static int _fake_unpack_adapters(Buf buf) -{ - uint32_t adapter_count; - uint32_t window_count; - uint32_t dummy32; - uint16_t dummy16; - char *dummyptr; - int i, j; - - safe_unpack32(&adapter_count, buf); - for (i = 0; i < adapter_count; i++) { - /* no copy, just advances buf counters */ - safe_unpackmem_ptr(&dummyptr, &dummy32, buf); - if (dummy32 != FED_ADAPTERNAME_LEN) - goto unpack_error; - safe_unpack16(&dummy16, buf); - safe_unpack16(&dummy16, buf); - safe_unpack32(&dummy32, buf); - safe_unpack32(&dummy32, buf); - safe_unpack32(&dummy32, buf); - safe_unpack32(&window_count, buf); - for (j = 0; j < window_count; j++) { - safe_unpack16(&dummy16, buf); - safe_unpack32(&dummy32, buf); - safe_unpack16(&dummy16, buf); - } - } - - return SLURM_SUCCESS; - -unpack_error: - return SLURM_ERROR; -} - - -/* Unpack nodeinfo and update persistent libstate. - * - * If believe_window_status is true, we honor the window status variables - * from the packed fed_nodeinfo_t. If it is false we set the status of - * all windows to NTBL_UNLOADED_STATE. - * - * Used by: slurmctld - */ -static int -_unpack_nodeinfo(fed_nodeinfo_t *n, Buf buf, bool believe_window_status) -{ - int i, j; - fed_adapter_t *tmp_a = NULL; - fed_window_t *tmp_w = NULL; - uint32_t size; - fed_nodeinfo_t *tmp_n = NULL; - char *name_ptr, name[FED_HOSTLEN]; - int magic; - - /* NOTE! We don't care at this point whether n is valid. - * If it's NULL, we will just forego the copy at the end. - */ - assert(buf); - - /* Extract node name from buffer - */ - safe_unpack32(&magic, buf); - if(magic != FED_NODEINFO_MAGIC) - slurm_seterrno_ret(EBADMAGIC_FEDNODEINFO); - safe_unpackmem_ptr(&name_ptr, &size, buf); - if(size != FED_HOSTLEN) - goto unpack_error; - memcpy(name, name_ptr, size); - - /* When the slurmctld is in normal operating mode (NOT backup mode), - * the global fed_state structure should NEVER be NULL at the time that - * this function is called. Therefore, if fed_state is NULL here, - * we assume that the controller is in backup mode. In backup mode, - * the slurmctld only unpacks RPCs to find out their identity. - * Most of the RPCs, including the one calling this function, are - * simply ignored. - * - * So, here we just do a fake unpack to advance the buffer pointer. - */ - if (fed_state == NULL) { - if (_fake_unpack_adapters(buf) != SLURM_SUCCESS) { - slurm_seterrno_ret(EUNPACK); - } else { - return SLURM_SUCCESS; - } - } - - /* If we already have nodeinfo for this node, we ignore this message. - * The slurmctld's view of window allocation is always better than - * the slurmd's view. We only need the slurmd's view if the slurmctld - * has no nodeinfo at all for that node. - */ - if (name != NULL) { - tmp_n = _find_node(fed_state, name); - if (tmp_n != NULL) { - if (_fake_unpack_adapters(buf) != SLURM_SUCCESS) { - slurm_seterrno_ret(EUNPACK); - } else { - goto copy_node; - } - } - } - - /* Update global libstate with this nodes' info. - */ - tmp_n = _alloc_node(fed_state, name); - if(tmp_n == NULL) - return SLURM_ERROR; - tmp_n->magic = magic; - safe_unpack32(&tmp_n->adapter_count, buf); - for(i = 0; i < tmp_n->adapter_count; i++) { - tmp_a = tmp_n->adapter_list + i; - safe_unpackmem_ptr(&name_ptr, &size, buf); - if(size != FED_ADAPTERNAME_LEN) - goto unpack_error; - memcpy(tmp_a->name, name_ptr, size); - safe_unpack16(&tmp_a->lid, buf); - safe_unpack16(&tmp_a->network_id, buf); - safe_unpack32(&tmp_a->max_winmem, buf); - safe_unpack32(&tmp_a->min_winmem, buf); - safe_unpack32(&tmp_a->avail_mem, buf); - safe_unpack32(&tmp_a->window_count, buf); - tmp_w = (fed_window_t *)xmalloc(sizeof(fed_window_t) * - tmp_a->window_count); - if(!tmp_w) - slurm_seterrno_ret(ENOMEM); - for(j = 0; j < tmp_a->window_count; j++) { - safe_unpack16(&tmp_w[j].id, buf); - safe_unpack32(&tmp_w[j].status, buf); - safe_unpack16(&tmp_w[j].job_key, buf); - if (!believe_window_status) { - tmp_w[j].status = NTBL_UNLOADED_STATE; - tmp_w[j].job_key = 0; - } - } - tmp_a->window_list = tmp_w; - tmp_w = NULL; /* don't free on unpack error of next adapter */ - } - -copy_node: - /* Only copy the node_info structure if the caller wants it */ - if(n != NULL) - if(_copy_node(n, tmp_n) != SLURM_SUCCESS) - return SLURM_ERROR; - -#if FED_DEBUG - _print_libstate(fed_state); -#endif - - return SLURM_SUCCESS; - -unpack_error: - xfree(tmp_w); - slurm_seterrno_ret(EUNPACK); -} - -/* Unpack nodeinfo and update persistent libstate. - * - * Used by: slurmctld - */ -int -fed_unpack_nodeinfo(fed_nodeinfo_t *n, Buf buf) -{ - int rc; - - _lock(); - rc = _unpack_nodeinfo(n, buf, false); - _unlock(); - return rc; -} - - -/* Used by: slurmd, slurmctld */ -void -fed_free_nodeinfo(fed_nodeinfo_t *n, bool ptr_into_array) -{ - fed_adapter_t *adapter; - int i; - - if(!n) - return; - - assert(n->magic == FED_NODEINFO_MAGIC); - - if(n->adapter_list) { - adapter = n->adapter_list; - for (i = 0; i < n->adapter_count; i++) { - xfree(adapter[i].window_list); - } - xfree(n->adapter_list); - } - if (!ptr_into_array) - xfree(n); -} - -/* Assign a unique key to each job. The key is used later to - * gain access to the network table loaded on each node of a job. - * - * Federation documentation states that the job key must be greater - * than 0 and less than 0xFFF0. - * - * Used by: slurmctld - */ -static uint16_t -_next_key(void) -{ - uint16_t key; - - assert(fed_state); - - _lock(); - key = fed_state->key_index % 0xFFF0; - if (key == 0) - key++; - fed_state->key_index = key + 1; - _unlock(); - - return key; -} - -/* FIXME - this could be a little smarter than walking the whole list each time */ -static fed_window_t * -_find_free_window(fed_adapter_t *adapter) { - int i; - fed_window_t *window; - - for (i = FED_MIN_WIN; i < adapter->window_count; i++) { - window = &adapter->window_list[i]; - if (window->status == NTBL_UNLOADED_STATE) - return window; - } - - return (fed_window_t *) NULL; -} - - -static fed_window_t * -_find_window(fed_adapter_t *adapter, int window_id) { - int i; - fed_window_t *window; - - for (i = FED_MIN_WIN; i < adapter->window_count; i++) { - window = &adapter->window_list[i]; - if (window->id == window_id) - return window; - } - - debug3("Unable to _find_window %d on adapter %s", - window_id, adapter->name); - return (fed_window_t *) NULL; -} - - -/* For a given process, fill out an NTBL - * struct (an array of these makes up the network table loaded - * for each job). Assign adapters, lids and switch windows to - * each task in a job. - * - * Used by: slurmctld - */ -static int -_allocate_windows_all(int adapter_cnt, fed_tableinfo_t *tableinfo, - char *hostname, int task_id, uint16_t job_key) -{ - fed_nodeinfo_t *node; - fed_adapter_t *adapter; - fed_window_t *window; - NTBL *table; - int i; - - assert(tableinfo); - assert(hostname); - - node = _find_node(fed_state, hostname); - if(node == NULL) { - error("Failed to find node in node_list: %s", hostname); - return SLURM_ERROR; - } - - /* Reserve a window on each adapter for this task */ - for (i = 0; i < adapter_cnt; i++) { - adapter = &node->adapter_list[i]; - window = _find_free_window(adapter); - if (window == NULL) { - error("No free windows on node %s adapter %s", - node->name, adapter->name); - return SLURM_ERROR; - } - window->status = NTBL_LOADED_STATE; - window->job_key = job_key; - - table = tableinfo[i].table[task_id]; - table->task_id = task_id; - table->lid = adapter->lid; - table->window_id = window->id; - - strncpy(tableinfo[i].adapter_name, adapter->name, - FED_ADAPTERNAME_LEN); - } - - return SLURM_SUCCESS; -} - - -/* For a given process, fill out an NTBL - * struct (an array of these makes up the network table loaded - * for each job). Assign a single adapter, lid and switch window to - * a task in a job. - * - * Used by: slurmctld - */ -static int -_allocate_window_single(char *adapter_name, fed_tableinfo_t *tableinfo, - char *hostname, int task_id, uint16_t job_key) -{ - fed_nodeinfo_t *node; - fed_adapter_t *adapter = NULL; - fed_window_t *window; - NTBL *table; - int i; - - assert(tableinfo); - assert(hostname); - - debug("in _allocate_window_single"); - node = _find_node(fed_state, hostname); - if(node == NULL) { - error("Failed to find node in node_list: %s", hostname); - return SLURM_ERROR; - } - - /* find the adapter */ - for (i = 0; i < node->adapter_count; i++) { - debug("adapter %s at index %d", node->adapter_list[i].name, i); - if (strcasecmp(node->adapter_list[i].name, adapter_name) - == 0) { - adapter = &node->adapter_list[i]; - debug("Found adapter %s", adapter_name); - break; - } - } - if (adapter == NULL) { - error("Failed to find adapter %s on node %s", - adapter_name, hostname); - return SLURM_ERROR; - } - - /* Reserve a window on the adapter for this task */ - window = _find_free_window(adapter); - if (window == NULL) { - error("No free windows on node %s adapter %s", - node->name, adapter->name); - return SLURM_ERROR; - } - window->status = NTBL_LOADED_STATE; - window->job_key = job_key; - - table = tableinfo[0].table[task_id]; - table->task_id = task_id; - table->lid = adapter->lid; - table->window_id = window->id; - - strncpy(tableinfo[0].adapter_name, adapter_name, - FED_ADAPTERNAME_LEN); - - return SLURM_SUCCESS; -} - - -/* Find the correct NTBL structs and set the state - * of the switch windows for the specified task_id. - * - * Used by: slurmctld - */ -static int -_window_state_set(int adapter_cnt, fed_tableinfo_t *tableinfo, - char *hostname, int task_id, enum NTBL_RC state, - uint16_t job_key) -{ - fed_nodeinfo_t *node = NULL; - fed_adapter_t *adapter = NULL; - fed_window_t *window = NULL; - NTBL *table = NULL; - int i, j; - bool adapter_found; - - assert(tableinfo); - assert(hostname); - assert(adapter_cnt <= FED_MAXADAPTERS); - - node = _find_node(fed_state, hostname); - if (node == NULL) { - error("Failed to find node in node_list: %s", hostname); - return SLURM_ERROR; - } - if (node->adapter_list == NULL) { - error("Found node, but adapter_list is NULL"); - return SLURM_ERROR; - } - - for (i = 0; i < adapter_cnt; i++) { - if (tableinfo[i].table == NULL) { - error("tableinfo[%d].table is NULL", i); - return SLURM_ERROR; - } - table = tableinfo[i].table[task_id]; - if (table == NULL) { - error("tableinfo[%d].table[%d] is NULL", i, task_id); - return SLURM_ERROR; - } - - adapter_found = false; - /* 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->name, - tableinfo[i].adapter_name) == 0 - && adapter->lid == table->lid) { - adapter_found = true; - break; - } - } - if (!adapter_found) { - if (table->lid != 0) - error("Did not find the correct adapter: " - "%hu vs. %hu", - adapter->lid, table->lid); - return SLURM_ERROR; - } - - debug3("Setting status %s adapter %s, " - "lid %hu, window %hu for task %d", - state == NTBL_UNLOADED_STATE ? "UNLOADED" : "LOADED", - adapter->name, - table->lid, table->window_id, task_id); - window = _find_window(adapter, table->window_id); - if (window) { - window->status = state; - window->job_key = - (state == NTBL_UNLOADED_STATE) ? 0 : job_key; - } - } - - return SLURM_SUCCESS; -} - - -#if FED_DEBUG -/* Used by: all */ -static void -_print_table(NTBL **table, int size) -{ - int i; - - assert(table); - assert(size > 0); - - printf("--Begin NTBL table--\n"); - for(i = 0; i < size; i++) { - printf(" task_id: %u\n", table[i]->task_id); - printf(" window_id: %u\n", table[i]->window_id); - printf(" lid: %u\n", table[i]->lid); - } - printf("--End NTBL table--\n"); -} - -/* Used by: all */ -static void -_print_index(char *index, int size) -{ - int i; - - assert(index); - assert(size > 0); - - printf("--Begin lid index--\n"); - for(i = 0; i < size; i++) { - printf(" task_id: %u\n", i); - printf(" name: %s\n", index + (i * FED_ADAPTERNAME_LEN)); - } - printf("--End lid index--\n"); -} -#endif - - -/* Find all of the windows used by this job step and set their - * status to "state". - * - * Used by: slurmctld - */ -static int -_job_step_window_state(fed_jobinfo_t *jp, hostlist_t hl, enum NTBL_RC state) -{ - hostlist_iterator_t hi; - char *host; - int proc_cnt; - int nprocs; - int nnodes; - int i, j; - int rc; - int task_cnt; - int full_node_cnt; - int min_procs_per_node; - int max_procs_per_node; - - xassert(!hostlist_is_empty(hl)); - xassert(jp); - xassert(jp->magic == FED_JOBINFO_MAGIC); - - if ((jp == NULL) - || (jp->magic != FED_JOBINFO_MAGIC) - || (hostlist_is_empty(hl))) - return SLURM_ERROR; - - if ((jp->tables_per_task == 0) - || !jp->tableinfo - || (jp->tableinfo[0].table_length == 0)) - return SLURM_SUCCESS; - - debug3("jp->tables_per_task = %d", jp->tables_per_task); - nprocs = jp->tableinfo[0].table_length; - hi = hostlist_iterator_create(hl); - - debug("Finding windows"); - nnodes = hostlist_count(hl); - full_node_cnt = nprocs % nnodes; - min_procs_per_node = nprocs / nnodes; - max_procs_per_node = (nprocs + nnodes - 1) / nnodes; - - proc_cnt = 0; - _lock(); - for (i = 0; i < nnodes; i++) { - host = hostlist_next(hi); - if(!host) - error("Failed to get next host"); - - if(i < full_node_cnt) - task_cnt = max_procs_per_node; - else - task_cnt = min_procs_per_node; - - for (j = 0; j < task_cnt; j++) { - rc = _window_state_set(jp->tables_per_task, - jp->tableinfo, - host, proc_cnt, - state, jp->job_key); - proc_cnt++; - } - free(host); - } - _unlock(); - - hostlist_iterator_destroy(hi); - return SLURM_SUCCESS; -} - -/* - * For one node, free all of the windows belonging to a particular - * job step (as identified by the job_key). - */ -static void inline -_free_windows_by_job_key(uint16_t job_key, char *nodename) -{ - fed_nodeinfo_t *node; - fed_adapter_t *adapter; - fed_window_t *window; - int i, j; - - /* debug3("_free_windows_by_job_key(%hu, %s)", job_key, nodename); */ - if ((node = _find_node(fed_state, nodename)) == NULL) - return; - - if (node->adapter_list == NULL) { - error("_free_windows_by_job_key, " - "adapter_list NULL for node %s", nodename); - return; - } - for (i = 0; i < node->adapter_count; i++) { - adapter = &node->adapter_list[i]; - if (adapter->window_list == NULL) { - error("_free_windows_by_job_key, " - "window_list NULL for node %s adapter %s", - nodename, adapter->name); - continue; - } - /* We could check here to see if this adapter's name - * is in the fed_jobinfo tablinfo list to avoid the next - * loop if the adapter isn't in use by the job step. - * However, the added searching and string comparisons - * probably aren't worth it, especially since MOST job - * steps will use all of the adapters. - */ - for (j = 0; j < adapter->window_count; j++) { - window = &adapter->window_list[j]; - - if (window->job_key == job_key) { - /* debug3("Freeing adapter %s window %d", - adapter->name, window->id); */ - window->status = NTBL_UNLOADED_STATE; - window->job_key = 0; - } - } - } -} - -/* Find all of the windows used by job step "jp" on the hosts - * designated in hostlist "hl" and mark their state NTBL_UNLOADED_STATE. - * - * Used by: slurmctld - */ -int -fed_job_step_complete(fed_jobinfo_t *jp, hostlist_t hl) -{ - hostlist_t uniq_hl; - hostlist_iterator_t hi; - char *nodename; - - xassert(!hostlist_is_empty(hl)); - xassert(jp); - xassert(jp->magic == FED_JOBINFO_MAGIC); - - if ((jp == NULL) - || (jp->magic != FED_JOBINFO_MAGIC) - || (hostlist_is_empty(hl))) - return SLURM_ERROR; - - if ((jp->tables_per_task == 0) - || !jp->tableinfo - || (jp->tableinfo[0].table_length == 0)) - return SLURM_SUCCESS; - - /* The hl hostlist may contain duplicate nodenames (poe -hostfile - * triggers duplicates in the hostlist). Since there - * is no reason to call _free_windows_by_job_key more than once - * per nodename, we create a new unique hostlist. - */ - uniq_hl = hostlist_copy(hl); - hostlist_uniq(uniq_hl); - hi = hostlist_iterator_create(uniq_hl); - - _lock(); - if (fed_state != NULL) { - while((nodename = hostlist_next(hi)) != NULL) { - _free_windows_by_job_key(jp->job_key, nodename); - free(nodename); - } - } else { /* fed_state == NULL */ - /* If there is no state at all, the job is already cleaned - * up. :) This should really only happen when the backup - * controller is calling job_fini() just before it takes over - * the role of active controller. - */ - debug("fed_job_step_complete called when fed_state == NULL"); - } - _unlock(); - - hostlist_iterator_destroy(hi); - hostlist_destroy(uniq_hl); - return SLURM_SUCCESS; -} - - -/* Find all of the windows used by job step "jp" and mark their - * state NTBL_LOADED_STATE. - * - * Used by the slurmctld at startup time to restore the allocation - * status of any job steps that were running at the time the previous - * slurmctld was shutdown. Also used to restore the allocation - * status after a call to switch_clear(). - */ -int -fed_job_step_allocated(fed_jobinfo_t *jp, hostlist_t hl) -{ - return _job_step_window_state(jp, hl, NTBL_LOADED_STATE); -} - - - -/* Setup everything for the job. Assign tasks across - * nodes based on the hostlist given and create the network table used - * on all nodes of the job. - * - * Used by: slurmctld - */ -int -fed_build_jobinfo(fed_jobinfo_t *jp, hostlist_t hl, int nprocs, - bool sn_all, char *adapter_name, int bulk_xfer) -{ - int nnodes; - hostlist_iterator_t hi; - char *host = NULL; - int proc_cnt = 0; - int i, j; - fed_nodeinfo_t *node; - int rc; - int task_cnt; - int full_node_cnt; - int min_procs_per_node; - int max_procs_per_node; - - assert(jp); - assert(jp->magic == FED_JOBINFO_MAGIC); - assert(!hostlist_is_empty(hl)); - - if(nprocs <= 0) - slurm_seterrno_ret(EINVAL); - - jp->bulk_xfer = (uint8_t) bulk_xfer; - jp->job_key = _next_key(); - snprintf(jp->job_desc, DESCLEN, - "slurm federation driver key=%d", jp->job_key); - jp->window_memory = FED_AUTO_WINMEM; - - hi = hostlist_iterator_create(hl); - - if (sn_all) { - /* - * Peek at the first host to figure out tables_per_task. - * This driver assumes that all nodes have the same number - * of adapters per node. Bad Things will happen if this - * assumption is incorrect. - */ - host = hostlist_next(hi); - _lock(); - node = _find_node(fed_state, host); - jp->tables_per_task = node ? node->adapter_count : 0; - _unlock(); - if (host != NULL) - free(host); - hostlist_iterator_reset(hi); - } else { - jp->tables_per_task = 1; - } - - /* Allocate memory for each fed_tableinfo_t */ - jp->tableinfo = (fed_tableinfo_t *) xmalloc(jp->tables_per_task - * sizeof(fed_tableinfo_t)); - for (i = 0; i < jp->tables_per_task; i++) { - jp->tableinfo[i].table_length = nprocs; - jp->tableinfo[i].table = (NTBL **) xmalloc(nprocs - * sizeof(NTBL *)); - for (j = 0; j < nprocs; j++) { - jp->tableinfo[i].table[j] = - (NTBL *) xmalloc(sizeof(NTBL)); - } - } - - debug("Allocating windows"); - nnodes = hostlist_count(hl); - full_node_cnt = nprocs % nnodes; - min_procs_per_node = nprocs / nnodes; - max_procs_per_node = (nprocs + nnodes - 1) / nnodes; - proc_cnt = 0; - _lock(); - for (i = 0; i < nnodes; i++) { - host = hostlist_next(hi); - if(!host) - error("Failed to get next host"); - - if(i < full_node_cnt) - task_cnt = max_procs_per_node; - else - task_cnt = min_procs_per_node; - - for (j = 0; j < task_cnt; j++) { - if (adapter_name == NULL) { - rc = _allocate_windows_all(jp->tables_per_task, - jp->tableinfo, - host, proc_cnt, - jp->job_key); - } else { - rc = _allocate_window_single(adapter_name, - jp->tableinfo, - host, proc_cnt, - jp->job_key); - } - if (rc != SLURM_SUCCESS) { - _unlock(); - goto fail; - } - proc_cnt++; - } - free(host); - } - _unlock(); - - -#if FED_DEBUG - _print_table(jp->tableinfo[i].table, jp->tableinfo[i].table_length); -#endif - - hostlist_iterator_destroy(hi); - return SLURM_SUCCESS; - -fail: - free(host); - hostlist_iterator_destroy(hi); - /* slurmctld will call fed_free_jobinfo on jp */ - return SLURM_FAILURE; -} - -void -_pack_tableinfo(fed_tableinfo_t *tableinfo, Buf buf) -{ - int i; - - pack32(tableinfo->table_length, buf); - for (i = 0; i < tableinfo->table_length; i++) { - pack16(tableinfo->table[i]->task_id, buf); - pack16(tableinfo->table[i]->lid, buf); - pack16(tableinfo->table[i]->window_id, buf); - } - packmem(tableinfo->adapter_name, FED_ADAPTERNAME_LEN, buf); -} - -/* Used by: all */ -int -fed_pack_jobinfo(fed_jobinfo_t *j, Buf buf) -{ - int i; - - assert(j); - assert(j->magic == FED_JOBINFO_MAGIC); - assert(buf); - - pack32(j->magic, buf); - pack16(j->job_key, buf); - packmem(j->job_desc, DESCLEN, buf); - pack32(j->window_memory, buf); - pack8(j->bulk_xfer, buf); - pack16(j->tables_per_task, buf); - for (i = 0; i < j->tables_per_task; i++) { - _pack_tableinfo(&j->tableinfo[i], buf); - } - - return SLURM_SUCCESS; -} - -/* return 0 on success, -1 on failure */ -static int -_unpack_tableinfo(fed_tableinfo_t *tableinfo, Buf buf) -{ - uint32_t size; - char *name_ptr; - int i; - - safe_unpack32(&tableinfo->table_length, buf); - tableinfo->table = (NTBL **) xmalloc(tableinfo->table_length - * sizeof(NTBL *)); - for (i = 0; i < tableinfo->table_length; i++) { - tableinfo->table[i] = (NTBL *) xmalloc(sizeof(NTBL)); - - safe_unpack16(&tableinfo->table[i]->task_id, buf); - safe_unpack16(&tableinfo->table[i]->lid, buf); - safe_unpack16(&tableinfo->table[i]->window_id, buf); - } - safe_unpackmem_ptr(&name_ptr, &size, buf); - if (size != FED_ADAPTERNAME_LEN) - goto unpack_error; - memcpy(tableinfo->adapter_name, name_ptr, size); - return 0; - -unpack_error: /* safe_unpackXX are macros which jump to unpack_error */ - error("unpack error in _unpack_tableinfo"); - return -1; -} - -/* Used by: all */ -int -fed_unpack_jobinfo(fed_jobinfo_t *j, Buf buf) -{ - uint32_t size; - int i, k; - - assert(j); - assert(j->magic == FED_JOBINFO_MAGIC); - assert(buf); - - safe_unpack32(&j->magic, buf); - assert(j->magic == FED_JOBINFO_MAGIC); - safe_unpack16(&j->job_key, buf); - safe_unpackmem(j->job_desc, &size, buf); - if(size != DESCLEN) - goto unpack_error; - safe_unpack32(&j->window_memory, buf); - safe_unpack8(&j->bulk_xfer, buf); - safe_unpack16(&j->tables_per_task, buf); - - j->tableinfo = (fed_tableinfo_t *) xmalloc(j->tables_per_task - * sizeof(fed_tableinfo_t)); - if(!j->tableinfo) - slurm_seterrno_ret(ENOMEM); - for (i = 0; i < j->tables_per_task; i++) { - if (_unpack_tableinfo(&j->tableinfo[i], buf) != 0) - goto unpack_error; - } - - return SLURM_SUCCESS; - -unpack_error: - error("fed_unpack_jobinfo error"); - if (j->tableinfo) { - for (i = 0; i < j->tables_per_task; i++) { - for (k=0; ktableinfo[i].table_length; k++) - xfree(j->tableinfo[i].table[k]); - xfree(j->tableinfo[i].table); - } - xfree(j->tableinfo); - } - slurm_seterrno_ret(EUNPACK); - return SLURM_ERROR; -} - -/* Used by: all */ -fed_jobinfo_t * -fed_copy_jobinfo(fed_jobinfo_t *job) -{ - fed_jobinfo_t *new; - int i, k; - - assert(job); - assert(job->magic == FED_JOBINFO_MAGIC); - - if(fed_alloc_jobinfo(&new)) { - debug("fed_alloc_jobinfo failed"); - goto cleanup1; - } - memcpy(new, job, sizeof(fed_jobinfo_t)); - /* table will be empty (and table_size == 0) when the network string - * from poe does not contain "us". - * (See man poe: -euilib or MP_EUILIB) - */ - if (job->tables_per_task > 0) { - /* Allocate memory for each fed_tableinfo_t */ - new->tableinfo = (fed_tableinfo_t *)xmalloc( - job->tables_per_task * sizeof(fed_tableinfo_t)); - if (new->tableinfo == NULL) - goto cleanup2; - memcpy(new->tableinfo, job->tableinfo, - sizeof(fed_tableinfo_t) * job->tables_per_task); - - for (i = 0; i < job->tables_per_task; i++) { - new->tableinfo[i].table = - (NTBL **) xmalloc(job->tableinfo[i].table_length - * sizeof(NTBL *)); - if (new->tableinfo[i].table == NULL) - goto cleanup3; - - for (k = 0; k < new->tableinfo[i].table_length; k++) { - new->tableinfo[i].table[k] = - (NTBL *) xmalloc(sizeof(NTBL)); - if (new->tableinfo[i].table[k] == NULL) - goto cleanup4; - memcpy(new->tableinfo[i].table[k], - job->tableinfo[i].table[k], - sizeof(fed_tableinfo_t)); - } - - - } - } - - return new; - -cleanup4: - k--; - for ( ; k >= 0; k--) - xfree(new->tableinfo[i].table[k]); -cleanup3: - i--; - for ( ; i >= 0; i--) { - for (k = 0; k < new->tableinfo[i].table_length; k++) - xfree(new->tableinfo[i].table[k]); - xfree(new->tableinfo[i].table); - } - xfree(new->tableinfo); -cleanup2: - fed_free_jobinfo(new); -cleanup1: - error("Allocating new jobinfo"); - slurm_seterrno(ENOMEM); - return NULL; -} - -/* Used by: all */ -void -fed_free_jobinfo(fed_jobinfo_t *jp) -{ - int i, j; - fed_tableinfo_t *tableinfo; - - if (!jp) { - return; - } - - if (jp->magic != FED_JOBINFO_MAGIC) { - error("jp is not a switch/federation fed_jobinfo_t"); - return; - } - - jp->magic = 0; - if (jp->tables_per_task > 0 && jp->tableinfo != NULL) { - for (i = 0; i < jp->tables_per_task; i++) { - tableinfo = &jp->tableinfo[i]; - if (tableinfo->table == NULL) - continue; - for (j = 0; j < tableinfo->table_length; j++) { - if (tableinfo->table[j] == NULL) - continue; - xfree(tableinfo->table[j]); - } - xfree(tableinfo->table); - } - xfree(jp->tableinfo); - } - - xfree(jp); - jp = NULL; - - return; -} - -/* Return data to code for whom jobinfo is an opaque type. - * - * Used by: all - */ -int -fed_get_jobinfo(fed_jobinfo_t *jp, int key, void *data) -{ - fed_tableinfo_t **tableinfo = (fed_tableinfo_t **)data; - int *tables_per = (int *)data; - int *job_key = (int *)data; - - assert(jp); - assert(jp->magic == FED_JOBINFO_MAGIC); - - switch(key) { - case FED_JOBINFO_TABLEINFO: - *tableinfo = jp->tableinfo; - break; - case FED_JOBINFO_TABLESPERTASK: - *tables_per = jp->tables_per_task; - break; - case FED_JOBINFO_KEY: - *job_key = jp->job_key; - break; - default: - slurm_seterrno_ret(EINVAL); - } - - return SLURM_SUCCESS; -} - - -/* - * Check up to "retry" times for "window_id" on "adapter_name" - * to switch to the NTBL_UNLOADED_STATE. Sleep one second between - * each retry. - * - * Used by: slurmd - */ -static int -_wait_for_window_unloaded(char *adapter_name, unsigned short window_id, - int retry) -{ - int status; - int i; - - for (i = 0; i < retry; i++) { - ntbl_query_window(NTBL_VERSION, adapter_name, - window_id, &status); - if (status == NTBL_UNLOADED_STATE) - break; - debug2("Window %hu adapter %s is in use, sleeping 1 second", - window_id, adapter_name); - sleep(1); - } - - if (status != NTBL_UNLOADED_STATE) - return SLURM_ERROR; - - return SLURM_SUCCESS; -} - - -/* - * Look through the table and find all of the NTBL that are for an adapter on - * this node. Wait until the window from each local NTBL is in the - * NTBL_UNLOADED_STATE. - * - * Used by: slurmd - */ -static int -_wait_for_all_windows(fed_tableinfo_t *tableinfo) -{ - uint16_t lid; - int i; - int err; - int rc = SLURM_SUCCESS; - int retry = 15; - - lid = _get_lid_from_adapter(tableinfo->adapter_name); - - for (i = 0; i < tableinfo->table_length; i++) { - if (tableinfo->table[i]->lid == lid) { - err = _wait_for_window_unloaded( - tableinfo->adapter_name, - tableinfo->table[i]->window_id, - retry); - if (err != SLURM_SUCCESS) { - error("Window %hu adapter %s did not become" - " free within %d seconds", - tableinfo->table[i]->window_id, - tableinfo->adapter_name, - retry); - rc = err; - retry = 2; - } - } - } - - return rc; -} - - -static int -_check_rdma_job_count(char *adapter) -{ - unsigned int job_count; - unsigned int *job_keys; - int rc, z; - - rc = ntbl_rdma_jobs(NTBL_VERSION, adapter, - &job_count, &job_keys); - if (rc != NTBL_SUCCESS) { - error("ntbl_rdma_jobs(): %d", rc); - return SLURM_ERROR; - } - - debug3("Adapter %s, RDMA job_count = %u", - adapter, job_count); - for (z = 0; z < job_count; z++) - debug3(" job key = %u", job_keys[z]); - free(job_keys); - if (job_count >= 4) { - error("RDMA job_count is too high: %u", job_count); - return SLURM_ERROR; - } - - return SLURM_SUCCESS; -} - - -/* Load a network table on node. If table contains more than - * one window for a given adapter, load the table only once for that - * adapter. - * - * Used by: slurmd - */ -int -fed_load_table(fed_jobinfo_t *jp, int uid, int pid) -{ - int i; - int err; - unsigned long long winmem; - char *adapter; - uint16_t network_id; -/* ADAPTER_RESOURCES res; */ - int rc; - -#if FED_DEBUG - char buf[2000]; -#endif - assert(jp); - assert(jp->magic == FED_JOBINFO_MAGIC); - - for(i = 0; i < jp->tables_per_task; i++) { -#if FED_DEBUG - _print_table(jp->tableinfo[i].table, jp->tableinfo[i].table_length); - printf("%s", fed_sprint_jobinfo(jp, buf, 2000)); -#endif - adapter = jp->tableinfo[i].adapter_name; - network_id = _get_network_id_from_adapter(adapter); - - rc = _wait_for_all_windows(&jp->tableinfo[i]); - if (rc != SLURM_SUCCESS) - return rc; - - if(adapter == NULL) - continue; - winmem = jp->window_memory; - if(jp->bulk_xfer) { - if (i == 0) { - rc = _check_rdma_job_count(adapter); - if (rc != SLURM_SUCCESS) - return rc; - } - - err = ntbl_load_table_rdma( - NTBL_VERSION, - adapter, - network_id, - uid, - pid, - jp->job_key, - jp->job_desc, - jp->bulk_xfer, - 0, /* rcontext_blocks */ - jp->tableinfo[i].table_length, - jp->tableinfo[i].table); - } else { - err = ntbl_load_table( - NTBL_VERSION, - adapter, - network_id, - uid, - pid, - jp->job_key, - jp->job_desc, - &winmem, - jp->tableinfo[i].table_length, - jp->tableinfo[i].table); - } - if(err != NTBL_SUCCESS) { - error("unable to load table: [%d] %s", - err, _lookup_fed_status_tab(err)); - return SLURM_ERROR; - } - } - umask(fed_umask); - - return SLURM_SUCCESS; -} - - -/* - * Try up to "retry" times to unload a window. - */ -static int -_unload_window(char *adapter, unsigned short job_key, unsigned short window_id, - int retry) -{ - int i; - int err; - - for (i = 0; i < retry; i++) { - err = ntbl_unload_window(NTBL_VERSION, adapter, - job_key, window_id); - if (err == NTBL_SUCCESS) - return SLURM_SUCCESS; - debug("Unable to unload window %hu adapter %s job_key %hu: %s", - window_id, adapter, job_key, _lookup_fed_status_tab(err)); - - err = ntbl_clean_window(NTBL_VERSION, adapter, - ALWAYS_KILL, window_id); - if (err == NTBL_SUCCESS) - return SLURM_SUCCESS; - error("Unable to clean window %hu adapter %s job_key %hu: %s", - window_id, adapter, job_key, _lookup_fed_status_tab(err)); - - sleep(1); - } - - return SLURM_FAILURE; -} - - -/* Assumes that, on error, new switch state information will be - * read from node. - * - * Used by: slurmd - */ -int -fed_unload_table(fed_jobinfo_t *jp) -{ - int i, j; - int err; - char *adapter_name; - NTBL **table; - uint32_t table_length; - int local_lid; - int rc = SLURM_SUCCESS; - int retry = 15; - - assert(jp); - assert(jp->magic == FED_JOBINFO_MAGIC); - for (i = 0; i < jp->tables_per_task; i++) { - table = jp->tableinfo[i].table; - table_length = jp->tableinfo[i].table_length; - adapter_name = jp->tableinfo[i].adapter_name; - local_lid = _get_lid_from_adapter(adapter_name); - - for(j = 0; j < table_length; j++) { - if(table[j]->lid != local_lid) - continue; - debug3("freeing adapter %s lid %d window %d job_key %d", - adapter_name, table[j]->lid, - table[j]->window_id, jp->job_key); - err = _unload_window(adapter_name, - jp->job_key, - table[j]->window_id, - retry); - if(err != SLURM_SUCCESS) { - rc = err; - slurm_seterrno(EUNLOAD); - retry = 2; - } - } - } - return rc; -} - -static fed_libstate_t * -_alloc_libstate(void) -{ - fed_libstate_t *tmp; - - tmp = (fed_libstate_t *)xmalloc(sizeof(fed_libstate_t)); - if(!tmp) { - slurm_seterrno(ENOMEM); - return NULL; - } - tmp->magic = FED_LIBSTATE_MAGIC; - tmp->node_count = 0; - tmp->node_max = 0; - tmp->node_list = NULL; - tmp->hash_max = 0; - tmp->hash_table = NULL; - tmp->key_index = 1; - - return tmp; -} - -/* Allocate and initialize memory for the persistent libstate. - * - * Used by: slurmctld - */ -int -fed_init(void) -{ - fed_libstate_t *tmp; - - tmp = _alloc_libstate(); - if(!tmp) - return SLURM_FAILURE; - _lock(); - assert(!fed_state); - fed_state = tmp; - _unlock(); - - return SLURM_SUCCESS; -} - -static void -_free_libstate(fed_libstate_t *lp) -{ - int i; - - if (!lp) - return; - if (lp->node_list != NULL) { - for (i = 0; i < lp->node_count; i++) - fed_free_nodeinfo(&lp->node_list[i], true); - xfree(lp->node_list); - } - xfree(lp->hash_table); - xfree(lp); -} - -int -fed_fini(void) -{ - xfree(fed_conf); - return SLURM_SUCCESS; -} - -/* Used by: slurmctld */ -static int -_pack_libstate(fed_libstate_t *lp, Buf buffer) -{ - int offset; - int i; - - assert(lp); - assert(lp->magic == FED_LIBSTATE_MAGIC); - - offset = get_buf_offset(buffer); - pack32(lp->magic, buffer); - pack32(lp->node_count, buffer); - for(i = 0; i < lp->node_count; i++) - (void)fed_pack_nodeinfo(&lp->node_list[i], buffer); - /* don't pack hash_table, we'll just rebuild on restore */ - pack16(lp->key_index, buffer); - - return(get_buf_offset(buffer) - offset); -} - -/* Used by: slurmctld */ -void -fed_libstate_save(Buf buffer, bool free_flag) -{ - _lock(); - - if (fed_state != NULL) - _pack_libstate(fed_state, buffer); - - /* Clean up fed_state since backup slurmctld can repeatedly - * save and restore state */ - if (free_flag) { - _free_libstate(fed_state); - fed_state = NULL; /* freed above */ - } - _unlock(); -} - -/* Used by: slurmctld */ -static int -_unpack_libstate(fed_libstate_t *lp, Buf buffer) -{ - int offset; - int node_count; - int i; - - assert(lp->magic == FED_LIBSTATE_MAGIC); - - offset = get_buf_offset(buffer); - - safe_unpack32(&lp->magic, buffer); - safe_unpack32(&node_count, buffer); - for(i = 0; i < node_count; i++) { - if (_unpack_nodeinfo(NULL, buffer, false) != SLURM_SUCCESS) - goto unpack_error; - } - if(lp->node_count != node_count) { - error("Failed to recover switch state of all nodes (%d of %u)", - lp->node_count, node_count); - return SLURM_ERROR; - } - safe_unpack16(&lp->key_index, buffer); - - return SLURM_SUCCESS; - -unpack_error: - error("unpack error in _unpack_libstate"); - slurm_seterrno_ret(EBADMAGIC_FEDLIBSTATE); - return SLURM_ERROR; -} - -/* Used by: slurmctld */ -int -fed_libstate_restore(Buf buffer) -{ - _lock(); - assert(!fed_state); - - fed_state = _alloc_libstate(); - if(!fed_state) { - error("fed_libstate_restore fed_state is NULL"); - _unlock(); - return SLURM_FAILURE; - } - _unpack_libstate(fed_state, buffer); - _unlock(); - - return SLURM_SUCCESS; -} - -int -fed_libstate_clear(void) -{ - int i, j, k; - struct fed_nodeinfo *node; - struct fed_adapter *adapter; - struct fed_window *window; - - debug3("Clearing state on all windows in global fed state"); - _lock(); - if (!fed_state || !fed_state->node_list) { - error("fed_state or node_list not initialized!"); - _unlock(); - return SLURM_ERROR; - } - - for (i = 0; i < fed_state->node_count; i++) { - node = &fed_state->node_list[i]; - if (!node->adapter_list) - continue; - for (j = 0; j < node->adapter_count; j++) { - adapter = &node->adapter_list[i]; - if (!adapter || !adapter->window_list) - continue; - for (k = 0; k < adapter->window_count; k++) { - window = &adapter->window_list[k]; - if (!window) - continue; - window->status = NTBL_UNLOADED_STATE; - } - } - } - _unlock(); - - return SLURM_SUCCESS; -} diff --git a/src/plugins/switch/federation/federation.h b/src/plugins/switch/federation/federation.h deleted file mode 100644 index d9e3e084964da3652e91fe9420ed04d9b12b1f3e..0000000000000000000000000000000000000000 --- a/src/plugins/switch/federation/federation.h +++ /dev/null @@ -1,112 +0,0 @@ -/*****************************************************************************\ - ** federation.h - Library routines for initiating jobs on IBM Federation - ** $Id$ - ***************************************************************************** - * Copyright (C) 2004 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Jason King - * CODE-OCEC-09-009. All rights reserved. - * - * This file is part of SLURM, a resource management program. - * For details, see . - * 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 "src/common/slurm_xlator.h" - -#ifndef _FEDERATION_INCLUDED -#define _FEDERATION_INCLUDED - -#if HAVE_LIBNTBL -# include -#else -# error "Don't have required libntbl!" -#endif - -/* opaque data structures - no peeking! */ -typedef struct fed_libstate fed_libstate_t; -typedef struct fed_jobinfo fed_jobinfo_t; -typedef struct fed_nodeinfo fed_nodeinfo_t; - -/* NOTE: error codes should be between ESLURM_SWITCH_MIN and - * ESLURM_SWITCH MAX as defined in slurm/slurm_errno.h */ -enum { - /* Federation specific error codes */ - ESTATUS = 3000, - EADAPTER, - ENOADAPTER, - EBADMAGIC_FEDNODEINFO, - EBADMAGIC_FEDJOBINFO, - EBADMAGIC_FEDLIBSTATE, - EUNPACK, - EHOSTNAME, - ENOTSUPPORTED, - EVERSION, - EWINDOW, - EUNLOAD -}; - -#define FED_MAXADAPTERS 2 -#define FED_LIBSTATE_LEN (1024 * 1024 * 1) - -int fed_slurmctld_init(void); -int fed_slurmd_init(void); -int fed_slurmd_step_init(void); -int fed_alloc_nodeinfo(fed_nodeinfo_t **nh); -int fed_build_nodeinfo(fed_nodeinfo_t *np, char *hostname); -char *fed_print_nodeinfo(fed_nodeinfo_t *np, char *buf, size_t size); -int fed_pack_nodeinfo(fed_nodeinfo_t *np, Buf buf); -int fed_unpack_nodeinfo(fed_nodeinfo_t *np, Buf buf); -void fed_free_nodeinfo(fed_nodeinfo_t *np, bool ptr_into_array); -int fed_alloc_jobinfo(fed_jobinfo_t **jh); -int fed_build_jobinfo(fed_jobinfo_t *jp, hostlist_t hl, int nprocs, - bool sn_all, char *adapter_name, int bulk_xfer); -int fed_pack_jobinfo(fed_jobinfo_t *jp, Buf buf); -int fed_unpack_jobinfo(fed_jobinfo_t *jp, Buf buf); -fed_jobinfo_t *fed_copy_jobinfo(fed_jobinfo_t *jp); -void fed_free_jobinfo(fed_jobinfo_t *jp); -int fed_load_table(fed_jobinfo_t *jp, int uid, int pid); -int fed_init(void); -int fed_fini(void); -int fed_unload_table(fed_jobinfo_t *jp); -int fed_unpack_libstate(fed_libstate_t *lp, Buf buffer); -int fed_get_jobinfo(fed_jobinfo_t *jp, int key, void *data); -void fed_libstate_save(Buf buffer, bool free_flag); -int fed_libstate_restore(Buf buffer); -int fed_job_step_complete(fed_jobinfo_t *jp, hostlist_t hl); -int fed_job_step_allocated(fed_jobinfo_t *jp, hostlist_t hl); -int fed_libstate_clear(void); -int fed_slurmctld_init(void); -int fed_slurmd_init(void); -int fed_slurmd_step_init(void); - -#endif /* _FEDERATION_INCLUDED */ diff --git a/src/plugins/switch/federation/switch_federation.c b/src/plugins/switch/federation/switch_federation.c deleted file mode 100644 index 6a794f566b6c31c7edf84821d08bb0bea28d90fd..0000000000000000000000000000000000000000 --- a/src/plugins/switch/federation/switch_federation.c +++ /dev/null @@ -1,673 +0,0 @@ -/***************************************************************************** \ - * switch_federation.c - Library routines for initiating jobs on IBM - * Federation - ***************************************************************************** - * Copyright (C) 2004-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 Jason King - * CODE-OCEC-09-009. All rights reserved. - * - * This file is part of SLURM, a resource management program. - * For details, see . - * 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 -#include -#include -#include -#include -#include - -#include "slurm/slurm_errno.h" -#include "src/common/macros.h" -#include "src/common/slurm_xlator.h" -#include "src/plugins/switch/federation/federation.h" - -#define FED_BUF_SIZE 4096 - -bool fed_need_state_save = false; - -static void _spawn_state_save_thread(char *dir); -static int _switch_p_libstate_save(char * dir_name, bool free_flag); - -/* Type for error string table entries */ -typedef struct { - int xe_number; - char *xe_message; -} slurm_errtab_t; - -static slurm_errtab_t slurm_errtab[] = { - {0, "No error"}, - {-1, "Unspecified error"}, - - /* Federation routine error codes */ - - { ESTATUS, - "Cannot get adapter status" }, - { EADAPTER, - "Open of adapter failed" }, - { ENOADAPTER, - "No adapters found" }, - { EBADMAGIC_FEDNODEINFO, - "Bad magic in Federation nodeinfo" }, - { EBADMAGIC_FEDJOBINFO, - "Bad magic in Federation jobinfo" }, - { EBADMAGIC_FEDLIBSTATE, - "Bad magic in Federation libstate" }, - { EUNPACK, - "Error during unpack" }, - { EHOSTNAME, - "Cannot get hostname" }, - { ENOTSUPPORTED, - "This feature not currently supported" }, - { EVERSION, - "Header/library version mismatch" }, - { EWINDOW, - "Error allocating switch window" }, - { EUNLOAD, - "Error unloading switch window table" } -}; - -/* - * 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 - * - * / - * - * where is a description of the intended application of - * the plugin (e.g., "switch" for SLURM switch) and 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[] = "switch FEDERATION plugin"; -const char plugin_type[] = "switch/federation"; -const uint32_t plugin_version = 100; - -/* - * init() is called when the plugin is loaded, before any other functions - * are called. Put global initialization here. - */ -int init ( void ) -{ - verbose("%s loaded", plugin_name); - - return SLURM_SUCCESS; -} - -int fini ( void ) -{ - return fed_fini(); -} - -int switch_p_slurmctld_init( void ) -{ - return fed_slurmctld_init(); -} - -int switch_p_slurmd_init( void ) -{ - return fed_slurmd_init(); -} - -int switch_p_slurmd_step_init( void ) -{ - return fed_slurmd_step_init(); -} - -/* - * Switch functions for global state save - * NOTE: Clears current switch state as needed for backup - * controller to repeatedly assume control primary server - */ -int switch_p_libstate_save ( char * dir_name ) -{ - return _switch_p_libstate_save(dir_name, true); -} - -/* save and purge the libstate if free_flag is true */ -static int _switch_p_libstate_save ( char * dir_name, bool free_flag ) -{ - Buf buffer; - char *file_name; - int ret = SLURM_SUCCESS; - int state_fd; - - buffer = init_buf(FED_LIBSTATE_LEN); - (void)fed_libstate_save(buffer, free_flag); - file_name = xstrdup(dir_name); - xstrcat(file_name, "/fed_state"); - (void)unlink(file_name); - state_fd = creat(file_name, 0600); - if(state_fd < 0) { - error ("Can't save state, error creating file %s %m", - file_name); - ret = SLURM_ERROR; - } else { - char *buf = get_buf_data(buffer); - size_t len =get_buf_offset(buffer); - while(1) { - int wrote = write (state_fd, buf, len); - if ((wrote < 0) && (errno == EINTR)) - continue; - if (wrote == 0) - break; - if (wrote < 0) { - error ("Can't save switch state: %m"); - ret = SLURM_ERROR; - break; - } - buf += wrote; - len -= wrote; - } - close(state_fd); - } - xfree(file_name); - - if(buffer) - free_buf(buffer); - - return ret; -} - - -/* - * Restore global nodeinfo from a file. - * - * NOTE: switch_p_libstate_restore is only called by slurmctld, and only - * once at start-up. We exploit (abuse?) this fact to spawn a pthread to - * periodically call _switch_p_libstate_save(). - */ -int switch_p_libstate_restore ( char * dir_name, bool recover ) -{ - char *data = NULL, *file_name; - Buf buffer = NULL; - int error_code = SLURM_SUCCESS; - int state_fd, data_allocated = 0, data_read = 0, data_size = 0; - - xassert(dir_name != NULL); - - _spawn_state_save_thread(xstrdup(dir_name)); - if (!recover) /* clean start, no recovery */ - return fed_init(); - - file_name = xstrdup(dir_name); - xstrcat(file_name, "/fed_state"); - state_fd = open (file_name, O_RDONLY); - if (state_fd >= 0) { - data_allocated = FED_BUF_SIZE; - data = xmalloc(data_allocated); - while (1) { - data_read = read (state_fd, &data[data_size], - FED_BUF_SIZE); - if ((data_read < 0) && (errno == EINTR)) - continue; - if (data_read < 0) { - error ("Read error on %s, %m", file_name); - error_code = SLURM_ERROR; - break; - } else if (data_read == 0) - break; - data_size += data_read; - data_allocated += data_read; - xrealloc(data, data_allocated); - } - close (state_fd); - xfree(file_name); - } else { - error("No %s file for Federation state recovery", file_name); - error("Starting Federation with clean state"); - xfree(file_name); - return fed_init(); - } - - if (error_code == SLURM_SUCCESS) { - buffer = create_buf (data, data_size); - data = NULL; /* now in buffer, don't xfree() */ - if (fed_libstate_restore(buffer) < 0) - error_code = SLURM_ERROR; - } - - if (buffer) - free_buf(buffer); - xfree(data); - - return error_code; -} - -int switch_p_libstate_clear(void) -{ - return fed_libstate_clear(); -} - -/* - * switch state monitoring functions - */ -/* NOTE: we assume that once the switch state is cleared, - * notification of this will be forwarded to slurmctld. We do not - * enforce that in this function. - */ -/* FIX ME! - should use adapter name from federation.conf file now that - * we have that file support. - */ -#define ZERO 48 -int switch_p_clear_node_state(void) -{ - int i, j; - ADAPTER_RESOURCES res; - char name[] = "sniN"; - int err; - - for(i = 0; i < FED_MAXADAPTERS; i++) { - name[3] = i + ZERO; - err = ntbl_adapter_resources(NTBL_VERSION, name, &res); - if(err != NTBL_SUCCESS) - continue; - for(j = 0; j < res.window_count; j++) - ntbl_clean_window(NTBL_VERSION, name, - ALWAYS_KILL, res.window_list[j]); - free(res.window_list); - } - - return SLURM_SUCCESS; -} - -int switch_p_alloc_node_info(switch_node_info_t **switch_node) -{ - return fed_alloc_nodeinfo((fed_nodeinfo_t **)switch_node); -} - -int switch_p_build_node_info(switch_node_info_t *switch_node) -{ - char hostname[256]; - char *tmp; - - if(gethostname(hostname, 256) < 0) - slurm_seterrno_ret(EHOSTNAME); - /* remove the domain portion, if necessary */ - tmp = strstr(hostname, "."); - if(tmp) - *tmp = '\0'; - return fed_build_nodeinfo((fed_nodeinfo_t *)switch_node, hostname); -} - -int switch_p_pack_node_info(switch_node_info_t *switch_node, Buf buffer) -{ - return fed_pack_nodeinfo((fed_nodeinfo_t *)switch_node, buffer); -} - -int switch_p_unpack_node_info(switch_node_info_t *switch_node, Buf buffer) -{ - return fed_unpack_nodeinfo((fed_nodeinfo_t *)switch_node, buffer); -} - -void switch_p_free_node_info(switch_node_info_t **switch_node) -{ - if(switch_node) - fed_free_nodeinfo((fed_nodeinfo_t *)*switch_node, false); -} - -char * switch_p_sprintf_node_info(switch_node_info_t *switch_node, - char *buf, size_t size) -{ - return fed_print_nodeinfo((fed_nodeinfo_t *)switch_node, buf, size); -} - -/* - * switch functions for job step specific credential - */ -int switch_p_alloc_jobinfo(switch_jobinfo_t **switch_job) -{ - return fed_alloc_jobinfo((fed_jobinfo_t **)switch_job); -} - -static char *adapter_name_check(char *network) -{ - regex_t re; - char *pattern = "(sni[[:digit:]])"; - size_t nmatch = 5; - regmatch_t pmatch[5]; - char *name; - - if (regcomp(&re, pattern, REG_EXTENDED) != 0) { - error("sockname regex compilation failed"); - return NULL; - } - memset(pmatch, 0, sizeof(regmatch_t)*nmatch); - if (regexec(&re, network, nmatch, pmatch, 0) == REG_NOMATCH) { - return NULL; - } - name = strndup(network + pmatch[1].rm_so, - (size_t)(pmatch[1].rm_eo - pmatch[1].rm_so)); - regfree(&re); - - return name; -} - -int switch_p_build_jobinfo(switch_jobinfo_t *switch_job, char *nodelist, - uint16_t *tasks_per_node, int cyclic_alloc, - char *network) -{ - hostlist_t list = NULL; - bool sn_all; - int i, err, nprocs = 0; - int bulk_xfer = 0; - char *adapter_name = NULL; - - debug3("network = \"%s\"", network); - if(strstr(network, "ip") || strstr(network, "IP")) { - debug2("federation: \"ip\" found in network string, " - "no network tables allocated"); - return SLURM_SUCCESS; - } else { - if (strstr(network, "sn_all") - || strstr(network, "SN_ALL")) { - debug3("Found sn_all in network string"); - sn_all = true; - } else if (strstr(network, "sn_single") - || strstr(network, "SN_SINGLE")) { - debug3("Found sn_single in network string"); - sn_all = false; - } else if ((adapter_name = adapter_name_check(network))) { - debug3("Found adapter %s in network string", - adapter_name); - sn_all = false; - } else { - /* default to sn_all */ - sn_all = true; - } - - list = hostlist_create(nodelist); - if(!list) - fatal("hostlist_create(%s): %m", nodelist); - for (i = 0; i < hostlist_count(list); i++) - nprocs += tasks_per_node[i]; - - if (strstr(network, "bulk_xfer") - || strstr(network, "BULK_XFER")) - bulk_xfer = 1; - err = fed_build_jobinfo((fed_jobinfo_t *)switch_job, list, - nprocs, sn_all, adapter_name, - bulk_xfer); - hostlist_destroy(list); - if (adapter_name) - free(adapter_name); - - return err; - } -} - -switch_jobinfo_t *switch_p_copy_jobinfo(switch_jobinfo_t *switch_job) -{ - switch_jobinfo_t *j; - - j = (switch_jobinfo_t *)fed_copy_jobinfo((fed_jobinfo_t *)switch_job); - if (!j) - error("fed_copy_jobinfo failed"); - - return j; -} - -void switch_p_free_jobinfo(switch_jobinfo_t *switch_job) -{ - return fed_free_jobinfo((fed_jobinfo_t *)switch_job); -} - -int switch_p_pack_jobinfo(switch_jobinfo_t *switch_job, Buf buffer) -{ - return fed_pack_jobinfo((fed_jobinfo_t *)switch_job, buffer); -} - -int switch_p_unpack_jobinfo(switch_jobinfo_t *switch_job, Buf buffer) -{ - return fed_unpack_jobinfo((fed_jobinfo_t *)switch_job, buffer); -} - -extern int switch_p_get_jobinfo(switch_jobinfo_t *switch_job, int key, - void *resulting_data) -{ - return fed_get_jobinfo((fed_jobinfo_t *)switch_job, key, - resulting_data); -} - -static inline int _make_step_comp(switch_jobinfo_t *jobinfo, char *nodelist) -{ - hostlist_t list = NULL; - int rc; - - list = hostlist_create(nodelist); - rc = fed_job_step_complete((fed_jobinfo_t *)jobinfo, list); - hostlist_destroy(list); - - return rc; -} - -extern int switch_p_job_step_complete(switch_jobinfo_t *jobinfo, char *nodelist) -{ - return _make_step_comp(jobinfo, nodelist); -} - -extern int switch_p_job_step_part_comp(switch_jobinfo_t *jobinfo, - char *nodelist) -{ - return _make_step_comp(jobinfo, nodelist); -} - -extern bool switch_p_part_comp(void) -{ - return true; -} - -extern int switch_p_job_step_allocated(switch_jobinfo_t *jobinfo, char *nodelist) -{ - hostlist_t list = NULL; - int rc; - - list = hostlist_create(nodelist); - rc = fed_job_step_allocated((fed_jobinfo_t *)jobinfo, list); - hostlist_destroy(list); - - return rc; -} - -void switch_p_print_jobinfo(FILE *fp, switch_jobinfo_t *jobinfo) -{ - return; -} - -char *switch_p_sprint_jobinfo(switch_jobinfo_t *switch_jobinfo, char *buf, - size_t size) -{ - return NULL; -} - -/* - * switch functions for job initiation - */ -static int _ntbl_version_ok(void) -{ - return((ntbl_version() == NTBL_VERSION) ? 1 : 0); -} - -int switch_p_node_init(void) -{ - /* check to make sure the version of the library we compiled with - * matches the one dynamically linked - */ - if(!_ntbl_version_ok()) { - slurm_seterrno_ret(EVERSION); - } - - return SLURM_SUCCESS; -} - -int switch_p_node_fini(void) -{ - return SLURM_SUCCESS; -} - -int switch_p_job_preinit(switch_jobinfo_t *jobinfo) -{ - return SLURM_SUCCESS; -} - -int switch_p_job_init (switch_jobinfo_t *jobinfo, uid_t uid) -{ - pid_t pid; - - pid = getpid(); - return fed_load_table((fed_jobinfo_t *)jobinfo, uid, pid); -} - -int switch_p_job_fini (switch_jobinfo_t *jobinfo) -{ - return SLURM_SUCCESS; -} - -int switch_p_job_postfini(switch_jobinfo_t *jobinfo, uid_t pgid, - uint32_t job_id, uint32_t step_id) -{ - int err; - - /* - * Kill all processes in the job's session - */ - if(pgid) { - debug2("Sending SIGKILL to pgid %lu", - (unsigned long) pgid); - kill(-pgid, SIGKILL); - } else - debug("Job %u.%u: Bad pid valud %lu", job_id, - step_id, (unsigned long) pgid); - - err = fed_unload_table((fed_jobinfo_t *)jobinfo); - if(err != SLURM_SUCCESS) - return SLURM_ERROR; - - return SLURM_SUCCESS; -} - -int switch_p_job_attach(switch_jobinfo_t *jobinfo, char ***env, - uint32_t nodeid, uint32_t procid, uint32_t nnodes, - uint32_t nprocs, uint32_t rank) -{ -#if 0 - printf("nodeid = %u\n", nodeid); - printf("procid = %u\n", procid); - printf("nnodes = %u\n", nnodes); - printf("nprocs = %u\n", nprocs); - printf("rank = %u\n", rank); -#endif - return SLURM_SUCCESS; -} - -/* - * switch functions for other purposes - */ - -/* - * Linear search through table of errno values and strings, - * returns NULL on error, string on success. - */ -static char *_lookup_slurm_api_errtab(int errnum) -{ - char *res = NULL; - int i; - - for (i = 0; i < sizeof(slurm_errtab) / sizeof(slurm_errtab_t); i++) { - if (slurm_errtab[i].xe_number == errnum) { - res = slurm_errtab[i].xe_message; - break; - } - } - return res; -} - -extern int switch_p_get_errno(void) -{ - int err = slurm_get_errno(); - - if ((err >= ESLURM_SWITCH_MIN) && (err <= ESLURM_SWITCH_MAX)) - return err; - - return SLURM_SUCCESS; -} - -char *switch_p_strerror(int errnum) -{ - char *res = _lookup_slurm_api_errtab(errnum); - return (res ? res : strerror(errnum)); -} - - -static void *_state_save_thread(void *arg) -{ - char *dir_name = (char *)arg; - - while (1) { - sleep(300); - if (fed_need_state_save) { - fed_need_state_save = false; - _switch_p_libstate_save(dir_name, false); - } - } -} - -static void _spawn_state_save_thread(char *dir) -{ - pthread_attr_t attr; - pthread_t id; - - slurm_attr_init(&attr); - - if (pthread_create(&id, &attr, &_state_save_thread, (void *)dir) != 0) - error("Could not start federation state saving pthread"); - - slurm_attr_destroy(&attr); -} diff --git a/src/plugins/switch/none/Makefile.in b/src/plugins/switch/none/Makefile.in index 21cb332c5bdd6450552b552eaa8fa46c00e9fead..8815668f7ddf65e5ec5c7b7aa0f1349dd5ea1fc3 100644 --- a/src/plugins/switch/none/Makefile.in +++ b/src/plugins/switch/none/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) switch_none_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -switch_none.la: $(switch_none_la_OBJECTS) $(switch_none_la_DEPENDENCIES) +switch_none.la: $(switch_none_la_OBJECTS) $(switch_none_la_DEPENDENCIES) $(EXTRA_switch_none_la_DEPENDENCIES) $(switch_none_la_LINK) -rpath $(pkglibdir) $(switch_none_la_OBJECTS) $(switch_none_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/switch/none/switch_none.c b/src/plugins/switch/none/switch_none.c index 1194b3600d1873120a1c8a719fd8fc150daee195..ff055341580969e2f7b0059ae0babb7169414990 100644 --- a/src/plugins/switch/none/switch_none.c +++ b/src/plugins/switch/none/switch_none.c @@ -93,6 +93,11 @@ int fini ( void ) return SLURM_SUCCESS; } +extern int switch_p_reconfig ( void ) +{ + return SLURM_SUCCESS; +} + /* * switch functions for global state save/restore */ @@ -120,7 +125,7 @@ int switch_p_alloc_jobinfo ( switch_jobinfo_t **switch_job ) } int switch_p_build_jobinfo ( switch_jobinfo_t *switch_job, char *nodelist, - uint16_t *tasks_per_node, int cyclic_alloc, char *network) + uint16_t *tasks_per_node, uint32_t **tids, char *network ) { return SLURM_SUCCESS; } @@ -179,7 +184,8 @@ int switch_p_job_preinit ( switch_jobinfo_t *jobinfo ) return SLURM_SUCCESS; } -int switch_p_job_init ( switch_jobinfo_t *jobinfo, uid_t uid ) +extern int switch_p_job_init (switch_jobinfo_t *jobinfo, uid_t uid, + char *job_name) { return SLURM_SUCCESS; } diff --git a/src/plugins/switch/nrt/Makefile.am b/src/plugins/switch/nrt/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..295f3b21a3c24953724f839d38eb9e42fa915e2f --- /dev/null +++ b/src/plugins/switch/nrt/Makefile.am @@ -0,0 +1,28 @@ +# Makefile for switch/nrt plugin (NRT = IBM's Network Routing Table) + +AUTOMAKE_OPTIONS = foreign + +PLUGIN_FLAGS = -module -avoid-version --export-dynamic + +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common $(NRT_CPPFLAGS) + + +SWITCH_NRT_LA_SOURCES = \ + nrt.c \ + nrt_keys.h \ + slurm_nrt.h \ + switch_nrt.c + +if HAVE_NRT + +SUBDIRS = libpermapi + +pkglib_LTLIBRARIES = switch_nrt.la + +switch_nrt_la_SOURCES = $(SWITCH_NRT_LA_SOURCES) +switch_nrt_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) $(NRT_LDFLAGS) + +else +pkglib_LTLIBRARIES = +EXTRA_switch_nrt_la_SOURCES = $(SWITCH_NRT_LA_SOURCES) +endif diff --git a/src/plugins/switch/nrt/Makefile.in b/src/plugins/switch/nrt/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..89ccb3921e10ce940979bfaa86c1dbcbf0a8beee --- /dev/null +++ b/src/plugins/switch/nrt/Makefile.in @@ -0,0 +1,828 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 switch/nrt plugin (NRT = IBM's Network Routing Table) + +VPATH = @srcdir@ +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/switch/nrt +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_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_cflags.m4 \ + $(top_srcdir)/auxdir/x_ac_cray.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_gpl_licensed.m4 \ + $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ + $(top_srcdir)/auxdir/x_ac_iso.m4 \ + $(top_srcdir)/auxdir/x_ac_lua.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_nrt.m4 \ + $(top_srcdir)/auxdir/x_ac_pam.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_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)/auxdir/x_ac_srun.m4 \ + $(top_srcdir)/auxdir/x_ac_sun_const.m4 \ + $(top_srcdir)/auxdir/x_ac_xcpu.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +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) +switch_nrt_la_LIBADD = +am__switch_nrt_la_SOURCES_DIST = nrt.c nrt_keys.h slurm_nrt.h \ + switch_nrt.c +am__objects_1 = nrt.lo switch_nrt.lo +@HAVE_NRT_TRUE@am_switch_nrt_la_OBJECTS = $(am__objects_1) +am__EXTRA_switch_nrt_la_SOURCES_DIST = nrt.c nrt_keys.h slurm_nrt.h \ + switch_nrt.c +switch_nrt_la_OBJECTS = $(am_switch_nrt_la_OBJECTS) +switch_nrt_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(switch_nrt_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_NRT_TRUE@am_switch_nrt_la_rpath = -rpath $(pkglibdir) +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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(switch_nrt_la_SOURCES) $(EXTRA_switch_nrt_la_SOURCES) +DIST_SOURCES = $(am__switch_nrt_la_SOURCES_DIST) \ + $(am__EXTRA_switch_nrt_la_SOURCES_DIST) +RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = libpermapi +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@ +AR = @AR@ +AUTHD_CFLAGS = @AUTHD_CFLAGS@ +AUTHD_LIBS = @AUTHD_LIBS@ +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@ +CMD_LDFLAGS = @CMD_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +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@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ +HAVEPGCONFIG = @HAVEPGCONFIG@ +HAVE_AIX = @HAVE_AIX@ +HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ +HAVE_OPENSSL = @HAVE_OPENSSL@ +HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ +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@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_LDFLAGS = @LIB_LDFLAGS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@ +MUNGE_LDFLAGS = @MUNGE_LDFLAGS@ +MUNGE_LIBS = @MUNGE_LIBS@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +NCURSES = @NCURSES@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ +NUMA_LIBS = @NUMA_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +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@ +PGSQL_CFLAGS = @PGSQL_CFLAGS@ +PGSQL_LIBS = @PGSQL_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +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@ +RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ +SED = @SED@ +SEMAPHORE_LIBS = @SEMAPHORE_LIBS@ +SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +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@ +UTIL_LIBS = @UTIL_LIBS@ +VERSION = @VERSION@ +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@ +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@ +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 +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common $(NRT_CPPFLAGS) +SWITCH_NRT_LA_SOURCES = \ + nrt.c \ + nrt_keys.h \ + slurm_nrt.h \ + switch_nrt.c + +@HAVE_NRT_TRUE@SUBDIRS = libpermapi +@HAVE_NRT_FALSE@pkglib_LTLIBRARIES = +@HAVE_NRT_TRUE@pkglib_LTLIBRARIES = switch_nrt.la +@HAVE_NRT_TRUE@switch_nrt_la_SOURCES = $(SWITCH_NRT_LA_SOURCES) +@HAVE_NRT_TRUE@switch_nrt_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) $(NRT_LDFLAGS) +@HAVE_NRT_FALSE@EXTRA_switch_nrt_la_SOURCES = $(SWITCH_NRT_LA_SOURCES) +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 \ + *$$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/switch/nrt/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/plugins/switch/nrt/Makefile +.PRECIOUS: 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) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @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 " $(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)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +switch_nrt.la: $(switch_nrt_la_OBJECTS) $(switch_nrt_la_DEPENDENCIES) $(EXTRA_switch_nrt_la_DEPENDENCIES) + $(switch_nrt_la_LINK) $(am_switch_nrt_la_rpath) $(switch_nrt_la_OBJECTS) $(switch_nrt_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nrt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/switch_nrt.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +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. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; 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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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" + +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 \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + 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 $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +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 clean-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile 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-pkglibLTLIBRARIES + +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 -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pkglibLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + clean-pkglibLTLIBRARIES ctags ctags-recursive 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 installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-pkglibLTLIBRARIES + + +# 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/switch/nrt/README b/src/plugins/switch/nrt/README new file mode 100644 index 0000000000000000000000000000000000000000..a1c44db46c03e01c691c7f8c9515f2f01fd67ea3 --- /dev/null +++ b/src/plugins/switch/nrt/README @@ -0,0 +1,26 @@ +Sample tests + +./srun -N2 --network="sn_all,devtype=ib" hostname +./srun -N2 --network="sn_all,devtype=iponly" hostname +./srun -N2 --network="sn_single,devtype=ib" hostname +./srun -N2 --network="sn_single,devtype=ib,us" hostname +./srun -N2 --network="sn_single,devtype=iponly,ipv4" hostname +./srun -N2 --network="sn_single,devtype=iponly,ipv6" hostname +./srun -N2 --network="sn_all,ipv6" hostname +./srun -N2 --network="mlx4_0" hostname +./srun -N2 --network="eth0" hostname +./srun -N2 --network="mlx4_0,mpi,lapi" hostname +./srun -N2 --network="mlx4_0,mpi,lapi,us" hostname +./srun -N2 --network="mlx4_0,mpi,lapi,instances=3" hostname +./srun -N2 -n4 --network="mlx4_0,mpi,lapi,us,instances=3" hostname +./srun -N2 --network="sn_all" hostname +./srun -N2 --network="sn_all,mpi,lapi" hostname +./srun -N2 --network="sn_all,mpi,lapi" hostname +./srun -N2 -n4 --network="sn_all,mpi,lapi,instances=2" hostname +./srun -N2 -n4 --network="sn_all,mpi,lapi,instances=3,us" hostname +./srun -N2 --network="mlx4_0,bulk_xfer=1000,us" hostname + +FAILURES +./srun -N2 --network="sn_all,devtype=hfi" hostname +./srun -N2 --network="sn_single,devtype=hfi" hostname +./srun -N2 --network="sn_single,devtype=iponly,us" hostname diff --git a/src/plugins/switch/nrt/libpermapi/Makefile.am b/src/plugins/switch/nrt/libpermapi/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..50614fff15f412e108c0073af15edeafc82b6642 --- /dev/null +++ b/src/plugins/switch/nrt/libpermapi/Makefile.am @@ -0,0 +1,25 @@ +# Makefile.am for libpermapi for poe to interface with + +AUTOMAKE_OPTIONS = foreign + +PLUGIN_FLAGS = -module -avoid-version --export-dynamic + +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common \ + -I$(top_srcdir)/src/srun/libsrun + +# making a .la + +pkglib_LTLIBRARIES = libpermapi.la + +CPPFLAGS = -DMYSELF_SO=\"$(libdir)/slurm/libpermapi.so\" + +libpermapi_la_SOURCES = shr_64.c + +libpermapi_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) $(DL_LIBS) + +libpermapi_la_LIBADD = $(top_builddir)/src/srun/libsrun/libsrun.la \ + $(top_builddir)/src/api/libslurmhelper.la + +force: +$(libpermapi_la_LIBADD) : force + @cd `dirname $@` && $(MAKE) `basename $@` diff --git a/src/plugins/switch/nrt/libpermapi/Makefile.in b/src/plugins/switch/nrt/libpermapi/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..3200a4e5bab9705731fdd7c7f621742d110f8ae6 --- /dev/null +++ b/src/plugins/switch/nrt/libpermapi/Makefile.in @@ -0,0 +1,671 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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.am for libpermapi for poe to interface with + +VPATH = @srcdir@ +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/switch/nrt/libpermapi +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_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_cflags.m4 \ + $(top_srcdir)/auxdir/x_ac_cray.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_gpl_licensed.m4 \ + $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ + $(top_srcdir)/auxdir/x_ac_iso.m4 \ + $(top_srcdir)/auxdir/x_ac_lua.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_nrt.m4 \ + $(top_srcdir)/auxdir/x_ac_pam.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_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)/auxdir/x_ac_srun.m4 \ + $(top_srcdir)/auxdir/x_ac_sun_const.m4 \ + $(top_srcdir)/auxdir/x_ac_xcpu.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +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) +libpermapi_la_DEPENDENCIES = \ + $(top_builddir)/src/srun/libsrun/libsrun.la \ + $(top_builddir)/src/api/libslurmhelper.la +am_libpermapi_la_OBJECTS = shr_64.lo +libpermapi_la_OBJECTS = $(am_libpermapi_la_OBJECTS) +libpermapi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libpermapi_la_LDFLAGS) $(LDFLAGS) -o $@ +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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libpermapi_la_SOURCES) +DIST_SOURCES = $(libpermapi_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTHD_CFLAGS = @AUTHD_CFLAGS@ +AUTHD_LIBS = @AUTHD_LIBS@ +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@ +CMD_LDFLAGS = @CMD_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = -DMYSELF_SO=\"$(libdir)/slurm/libpermapi.so\" +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +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@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ +HAVEPGCONFIG = @HAVEPGCONFIG@ +HAVE_AIX = @HAVE_AIX@ +HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ +HAVE_OPENSSL = @HAVE_OPENSSL@ +HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ +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@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_LDFLAGS = @LIB_LDFLAGS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@ +MUNGE_LDFLAGS = @MUNGE_LDFLAGS@ +MUNGE_LIBS = @MUNGE_LIBS@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +NCURSES = @NCURSES@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ +NUMA_LIBS = @NUMA_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +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@ +PGSQL_CFLAGS = @PGSQL_CFLAGS@ +PGSQL_LIBS = @PGSQL_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +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@ +RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ +SED = @SED@ +SEMAPHORE_LIBS = @SEMAPHORE_LIBS@ +SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +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@ +UTIL_LIBS = @UTIL_LIBS@ +VERSION = @VERSION@ +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@ +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@ +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 +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common \ + -I$(top_srcdir)/src/srun/libsrun + + +# making a .la +pkglib_LTLIBRARIES = libpermapi.la +libpermapi_la_SOURCES = shr_64.c +libpermapi_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) $(DL_LIBS) +libpermapi_la_LIBADD = $(top_builddir)/src/srun/libsrun/libsrun.la \ + $(top_builddir)/src/api/libslurmhelper.la + +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/switch/nrt/libpermapi/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/plugins/switch/nrt/libpermapi/Makefile +.PRECIOUS: 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) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @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 " $(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)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libpermapi.la: $(libpermapi_la_OBJECTS) $(libpermapi_la_DEPENDENCIES) $(EXTRA_libpermapi_la_DEPENDENCIES) + $(libpermapi_la_LINK) -rpath $(pkglibdir) $(libpermapi_la_OBJECTS) $(libpermapi_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shr_64.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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" + +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 all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags 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 uninstall uninstall-am uninstall-pkglibLTLIBRARIES + + +force: +$(libpermapi_la_LIBADD) : 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/src/plugins/switch/nrt/libpermapi/shr_64.c b/src/plugins/switch/nrt/libpermapi/shr_64.c new file mode 100644 index 0000000000000000000000000000000000000000..5103934d0561df7be2919204d54cf342e0a70da5 --- /dev/null +++ b/src/plugins/switch/nrt/libpermapi/shr_64.c @@ -0,0 +1,692 @@ +/*****************************************************************************\ + * shr_64.c - This plug is used by POE to interact with SLURM. + * + ***************************************************************************** + * Copyright (C) 2012 SchedMD LLC. + * Written by Danny Auble et. al. + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 +#include +#include +#include +#include +#include + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "slurm/slurm.h" +#include "slurm/slurm_errno.h" + +#include "src/common/xmalloc.h" +#include "src/common/xstring.h" +#include "src/common/list.h" +#include "src/common/hostlist.h" +#include "src/common/plugstack.h" + +#include "src/srun/libsrun/srun_job.h" +#include "src/srun/libsrun/opt.h" +#include "src/srun/libsrun/allocate.h" +#include "src/srun/libsrun/launch.h" +#include "src/plugins/switch/nrt/nrt_keys.h" + +bool srun_max_timer = false; +bool srun_shutdown = false; + +static void *my_handle = NULL; +static srun_job_t *job = NULL; +static int debug_level = 0; +static bool got_alloc = false; +static bool slurm_started = false; +static log_options_t log_opts = LOG_OPTS_INITIALIZER; + +int sig_array[] = { + SIGINT, SIGQUIT, SIGCONT, SIGTERM, SIGHUP, + SIGALRM, SIGUSR1, SIGUSR2, SIGPIPE, 0 }; + +extern char **environ; + +/* IBM internal definitions to get information on how and who is + * calling us. + */ +#define PM_POE 0 +#define PM_PMD 1 +extern int pm_type; +extern int pmdlog; +extern FILE *pmd_lfp; + +#define PMD_LOG(fmt, args...) \ + if (pmdlog) { \ + const char *f_name = strrchr(__FILE__, '/'); \ + fprintf(pmd_lfp, "[%d@%s]: " fmt , __LINE__, f_name!=NULL?(f_name+1):__FILE__, ##args); \ + fflush(pmd_lfp); \ + } +/************************************/ + +static nrt_job_key_t _get_nrt_job_key(srun_job_t *job) +{ + job_step_create_response_msg_t *resp; + nrt_job_key_t job_key; + + if (!job || !job->step_ctx) + return NO_VAL; + + slurm_step_ctx_get(job->step_ctx, SLURM_STEP_CTX_RESP, &resp); + if (!resp) + return NO_VAL; + slurm_jobinfo_ctx_get(resp->switch_job, NRT_JOBINFO_KEY, &job_key); + return job_key; +} + +/* The connection communicates information to and from the resource + * manager, so that the resource manager can start the parallel task + * manager, and is available for the caller to communicate directly + * with the parallel task manager. + * IN resource_mgr - The resource manager handle returned by pe_rm_init. + * IN connect_param - Input parameter structure (rm_connect_param) + * that contains the following: + * machine_count: The count of hosts/machines. + * machine_name: The array of machine names on which to connect. + * executable: The name of the executable to be started. + * IN rm_timeout - The integer value that defines a connection timeout + * value. This value is defined by the MP_RM_TIMEOUT + * environment variable. A value less than zero indicates there + * is no timeout. A value equal to zero means to immediately + * return with no wait or retry. A value greater than zero + * means to wait the specified amount of time (in seconds). + * OUT rm_sockfds - An array of socket file descriptors, that are + * allocated by the caller, to be returned as output, of the connection. + * OUT error_msg - An error message that explains the error. + * RET 0 - SUCCESS, nonzero on failure. + */ +extern int pe_rm_connect(rmhandle_t resource_mgr, + rm_connect_param *connect_param, + int *rm_sockfds, int rm_timeout, char **error_msg) +{ +// srun_job_t *job = *(srun_job_t **)resource_mgr; + int my_argc = 1; + char *my_argv[2] = { connect_param->executable, NULL }; +// char *my_argv[2] = { "/bin/hostname", NULL }; + slurm_step_io_fds_t cio_fds = SLURM_STEP_IO_FDS_INITIALIZER; + uint32_t global_rc = 0; + int i, rc, fd_cnt; + int *ctx_sockfds = NULL; + + if (pm_type == PM_PMD) { + /* If the PMD calls this and it didn't launch anything we need + * to not do anything here or PMD will crap out on it. */ + PMD_LOG("got pe_rm_connect called from PMD, " + "we don't handle this yet\n"); + return -1; + } else if (pm_type != PM_POE) { + error("pe_rm_connect: unknown caller"); + return -1; + } + + xassert(job); + + debug("got pe_rm_connect called"); + + opt.argc = my_argc; + opt.argv = my_argv; + opt.user_managed_io = true; + + launch_common_set_stdio_fds(job, &cio_fds); + if (slurm_step_ctx_daemon_per_node_hack(job->step_ctx, + connect_param->machine_name, + connect_param->machine_count) + != SLURM_SUCCESS) { + *error_msg = xstrdup_printf( + "pe_rm_connect: problem with hack"); + error("%s", *error_msg); + return -1; + } + + if (launch_g_step_launch(job, &cio_fds, &global_rc)) { + *error_msg = xstrdup_printf( + "pe_rm_connect: problem with launch"); + error("%s", *error_msg); + return -1; + } + + rc = slurm_step_ctx_get(job->step_ctx, + SLURM_STEP_CTX_USER_MANAGED_SOCKETS, + &fd_cnt, &ctx_sockfds); + if (ctx_sockfds == NULL) { + *error_msg = xstrdup_printf( + "pe_rm_connect: Unable to get pmd IO socket array %d", + rc); + error("%s", *error_msg); + return -1; + } + if (fd_cnt != connect_param->machine_count) { + *error_msg = xstrdup_printf( + "pe_rm_connect: looking for %d sockets but got back %d", + connect_param->machine_count, fd_cnt); + error("%s", *error_msg); + return -1; + } + + for (i=0; istep_ctx); + if (launch_g_step_wait(job, got_alloc) != -1) { + /* We are at the end so don't worry about freeing the + srun_job_t pointer */ + fini_srun(job, got_alloc, &rc, 0, slurm_started); + } + + *resource_mgr = NULL; + dlclose(my_handle); +} + +/* The memory that is allocated to events generated by the resource + * manager is released. pe_rm_free_event must be called for every + * event that is received from the resource manager by calling the + * pe_rm_get_event function. + * IN resource_mgr + * IN job_event - The pointer to a job event. The event must have been + * built by calling the pe_rm_get_event function. + * RET 0 - SUCCESS, nonzero on failure. + */ +extern int pe_rm_free_event(rmhandle_t resource_mgr, job_event_t ** job_event) +{ + if (pm_type == PM_PMD) { + PMD_LOG("pe_rm_free_event called\n"); + return 0; + } else if (pm_type != PM_POE) { + error("pe_rm_free_event: unknown caller"); + return -1; + } + + debug("got pe_rm_free_event called"); + if (job_event) { + xfree(*job_event); + } + return 0; +} + +/* This resource management interface is called to return job event + * information. The pe_rm_get_event function is only called in + * interactive mode. + * + * With interactive jobs, this function reads or selects on the listen + * socket created by the pe_rm_init call. If the listen socket is not + * ready to read, this function selects and waits. POE processes + * should monitor this socket at all times for event notification from + * the resource manager after the job has started running. + * + * This function returns a pointer to the event that was updated by + * the transaction. + * The valid events are: + * JOB_ERROR_EVENT + * Job error messages occurred. In this case, POE displays the + * error and terminates. + * JOB_STATE_EVENT + * A job status change occurred, which results in one of the + * following job states. In this case, the caller may need to take + * appropriate action. + * JOB_STATE_RUNNING + * Indicates that the job has started. POE uses the + * pe_rm_get_job_info function to return the job + * information. When a job state of JOB_STATE_RUNNING has been + * returned, the job has started running and POE can obtain the + * job information by way of the pe_rm_get_job_info function call. + * JOB_STATE_NOTRUN + * Indicates that the job was not run, and POE will terminate. + * JOB_STATE_PREEMPTED + * Indicates that the job was preempted. + * JOB_STATE_RESUMED + * Indicates that the job has resumed. + * JOB_TIMER_EVENT + * Indicates that no events occurred during the period + * specified by pe_rm_timeout. + * + * IN resource_mgr + * OUT job_event - The address of the pointer to the job_event_t + * type. If an event is generated successfully by the resource + * manager, that event is saved at the location specified, and + * pe_rm_get_event returns 0 (or a nonzero value, if the event + * is not generated successfully). Based on the event type that is + * returned, the appropriate event of the type job_event_t can + * be accessed. After the event is processed, it should be + * freed by calling pe_rm_free_event. + * OUT error_msg - The address of a character string at which the + * error message that is generated by pe_rm_get_event is + * stored. The memory for this error message is allocated by + * the malloc API call. After the error message is processed, + * the memory allocated should be freed by a calling free function. + * IN rm_timeout - The integer value that defines a connection timeout + * value. This value is defined by the MP_RETRY environment + * variable. A value less than zero indicates there is no + * timeout. A value equal to zero means to immediately return + * with no wait or retry. A value greater than zero means to + * wait the specified amount of time (in seconds). + * RET 0 - SUCCESS, nonzero on failure. + */ +extern int pe_rm_get_event(rmhandle_t resource_mgr, job_event_t **job_event, + int rm_timeout, char ** error_msg) +{ + job_event_t *ret_event = NULL; + int *state; + if (pm_type == PM_PMD) { + PMD_LOG("pe_rm_get_event called\n"); + return 0; + } else if (pm_type != PM_POE) { + error("pe_rm_get_event: unknown caller"); + return -1; + } + + debug("got pe_rm_get_event called %d %p %p", + rm_timeout, job_event, *job_event); + + ret_event = xmalloc(sizeof(job_event_t)); + *job_event = ret_event; + ret_event->event = JOB_STATE_EVENT; + state = xmalloc(sizeof(int)); + *state = JOB_STATE_RUNNING; + ret_event->event_data = (void *)state; + + return 0; +} + +/* The pe_rm_get_job_info function is called to return job + * information, after a job has been started. It can be called in + * either batch or interactive mode. For interactive jobs, it should + * be called when pe_rm_get_event returns with the JOB_STATE_EVENT + * event type, indicating the JOB_STATE_RUNNING + * state. pe_rm_get_job_info provides the job information data values, + * as defined by the job_info_t structure. It returns with an error if + * the job is not in a running state. For batch jobs, POE calls + * pe_rm_get_job_info immediately because, in batch mode, POE is + * started only after the job has been started. The pe_rm_get_job_info + * function must be capable of being called multiple times from the + * same process or a different process, and the same job data must be + * returned each time. When called from a different process, the + * environment of that process is guaranteed to be the same as the + * environment of the process that originally called the function. + * + * IN resource_mgr + * OUT job_info - The address of the pointer to the job_info_t + * type. The job_info_t type contains the job information + * returned by the resource manager for the handle that is + * specified. The caller itself must free the data areas that + * are returned. + * OUT error_msg - The address of a character string at which the + * error message that is generated by pe_rm_get_job_info is + * stored. The memory for this error message is allocated by the + * malloc API call. After the error message is processed, the memory + * allocated should be freed by a calling free function. + * RET 0 - SUCCESS, nonzero on failure. + */ +extern int pe_rm_get_job_info(rmhandle_t resource_mgr, job_info_t **job_info, + char ** error_msg) +{ + job_info_t *ret_info = xmalloc(sizeof(job_info_t)); + int i, j, task_id = 0; + slurm_step_layout_t *step_layout; + hostlist_t hl; + char *host; + host_usage_t *host_ptr; + + if (pm_type == PM_PMD) { + PMD_LOG("pe_rm_get_job_info called\n"); + return 0; + } else if (pm_type != PM_POE) { + error("pe_rm_get_job_info: unknown caller"); + return -1; + } + + debug("got pe_rm_get_job_info called %p %p", job_info, *job_info); + + *job_info = ret_info; + + ret_info->job_name = xstrdup(opt.job_name); + ret_info->rm_id = NULL; + ret_info->procs = job->ntasks; + ret_info->max_instances = 1; + ret_info->job_key = _get_nrt_job_key(job); + ret_info->check_pointable = 0; + ret_info->protocol = xmalloc(sizeof(char *)*2); + ret_info->protocol[0] = xstrdup(opt.mpi_type); + ret_info->mode = xmalloc(sizeof(char *)*2); + ret_info->mode[0] = xstrdup(opt.network); + ret_info->instance = xmalloc(sizeof(int)*3); + ret_info->instance[0] = 1; + ret_info->instance[1] = -1; +/* FIXME: not sure how to handle devicename yet */ + ret_info->devicename = xmalloc(sizeof(char *)*2); + ret_info->devicename[0] = xstrdup("mlx4_0"); + ret_info->num_network = 1; + ret_info->host_count = job->nhosts; + + step_layout = launch_common_get_slurm_step_layout(job); + + ret_info->hosts = xmalloc(sizeof(host_usage_t) * ret_info->host_count); + host_ptr = ret_info->hosts; + i=0; + hl = hostlist_create(step_layout->node_list); + while ((host = hostlist_shift(hl))) { + slurm_addr_t addr; + host_ptr->host_name = host; +/* FIXME: not sure how to handle host_address yet we are guessing the + * below will do what we need. */ + /* host_ptr->host_address = */ + /* xstrdup_printf("10.0.0.5%d", i+1); */ + slurm_conf_get_addr(host, &addr); + host_ptr->host_address = xstrdup(inet_ntoa(addr.sin_addr)); + host_ptr->task_count = step_layout->tasks[i]; + host_ptr->task_ids = + xmalloc(sizeof(int) * host_ptr->task_count); + for (j=0; jtask_count; j++) + host_ptr->task_ids[j] = task_id++; + debug3("%s = %s %d tasks", + host_ptr->host_name, host_ptr->host_address, + host_ptr->task_count); + i++; + if (i > ret_info->host_count) { + error("we have more nodes that we bargined for."); + break; + } + host_ptr++; + } + hostlist_destroy(hl); + + return 0; +} + +/* The handle to the resource manager is returned to the calling + * function. The calling process needs to use the resource manager + * handle in subsequent resource manager API calls. + * + * A version will be returned as output in the rmapi_version + * parameter, after POE supplies it as input. The resource manager + * returns the version value that is installed and running as output. + * + * A resource manager ID can be specified that defines a job that is + * currently running, and for which POE is initializing the resource + * manager. When the resource manager ID is null, a value for the + * resource manager ID is included with the job information that is + * returned by the pe_rm_get_job_info function. When pe_rm_init is + * called more than once with a null resource manager ID value, it + * returns the same ID value on the subsequent pe_rm_get_job_info + * function call. + * + * The resource manager can be initialized in either + * batch or interactive mode. The resource manager must export the + * environment variable PE_RM_BATCH=yes when in batch mode. + * + * By default, the resource manager error messages and any debugging + * messages that are generated by this function, or any subsequent + * resource manager API calls, should be written to STDERR. Errors are + * returned by way of the error message string parameter. + * + * When the resource manager is successfully instantiated and + * initialized, it returns with a file descriptor for a listen socket, + * which is used by the resource manager daemon to communicate with + * the calling process. If a resource manager wants to send + * information to the calling process, it builds an appropriate event + * that corresponds to the information and sends that event over the + * socket to the calling process. The calling process could monitor + * the socket using the select API and read the event when it is ready. + * + * IN/OUT rmapi_version - The resource manager API version level. The + * value of RM_API_VERSION is defined in permapi.h. Initially, + * POE provides this as input, and the resource manager will + * return its version level as output. + * OUT resource_mgr - Pointer to the rmhandle_t handle returned by the + * pe_rm_init function. This handle should be used by all other + * resource manager API calls. + * IN rm_id - Pointer to a character string that defines a + * resource manager ID, for checkpoint and restart cases. This + * pointer can be set to NULL, which means there is no previous + * resource manager session or job running. When it is set to a + * value, the resource manager uses the specified ID for + * returning the proper job information to a subsequent + * pe_rm_get_job_info function call. + * OUT error_msg - The address of a character string at which the + * error messages generated by this function are stored. The + * memory for this error message is allocated by the malloc API + * call. After the error message is processed, the memory + * allocated should be freed by a calling free function. + * RET - Non-negative integer representing a valid file descriptor + * number for the socket that will be used by the resource + * manager to communicate with the calling process. - SUCCESS + * integer less than 0 - FAILURE + */ +extern int pe_rm_init(int *rmapi_version, rmhandle_t *resource_mgr, char *rm_id, + char** error_msg) +{ + char *srun_debug = NULL; + + /* SLURM was originally written against 1300, so we will + * return that, no matter what comes in so we always work. + */ + *rmapi_version = 1300; + *resource_mgr = (void *)&job; +#ifdef MYSELF_SO + /* Since POE opens this lib without + RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND + we just open ourself again with those options and bada bing + bada boom we are good to go with the symbols we need. + */ + my_handle = dlopen(MYSELF_SO, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND); + if (!my_handle) { + debug("%s", dlerror()); + return 1; + } +#else + fatal("I haven't been told where I am. This should never happen."); +#endif + if (pm_type == PM_PMD) { + PMD_LOG("pe_rm_init called\n"); + return 0; + } else if (pm_type != PM_POE) { + error("pe_rm_init: unknown caller"); + return -1; + } + + debug("got pe_rm_init called %s", rm_id); + + if (slurm_select_init(1) != SLURM_SUCCESS ) + fatal( "failed to initialize node selection plugin" ); + + /* Set up slurmctld message handler */ + slurmctld_msg_init(); + slurm_set_launch_type("launch/slurm"); + + if ((srun_debug = getenv("SRUN_DEBUG"))) + debug_level = atoi(srun_debug); + if (debug_level) { + log_opts.stderr_level = debug_level; + log_opts.logfile_level = debug_level; + log_opts.syslog_level = debug_level; + + log_alter(log_opts, LOG_DAEMON, "/dev/null"); + } + + /* This will be used later in the code to set the _verbose level. */ + if (debug_level >= LOG_LEVEL_INFO) + debug_level -= LOG_LEVEL_INFO; + + return 0; +} + +/* Used to inform the resource manager that a checkpoint is in + * progress or has completed. POE calls pe_rm_send_event to provide + * the resource manager with information about the checkpointed job. + * + * IN resource_mgr + * IN job_event - The address of the pointer to the job_info_t type + * that indicates if a checkpoint is in progress (with a type + * of JOB_CKPT_IN_PROGRESS) or has completed (with a type of + * JOB_CKPT_COMPLETE). + * OUT error_msg - The address of a character string at which the + * error message that is generated by pe_rm_send_event is + * stored. The memory for this error message is allocated by the + * malloc API call. After the error message is processed, the + * memory allocated should be freed by a calling free function. + * RET 0 - SUCCESS, nonzero on failure. + */ +extern int pe_rm_send_event(rmhandle_t resource_mgr, job_event_t *job_event, + char ** error_msg) +{ + if (pm_type == PM_PMD) { + PMD_LOG("pe_rm_send_event called\n"); + return 0; + } else if (pm_type != PM_POE) { + error("pe_rm_send_event: unknown caller"); + return -1; + } + + debug("got pe_rm_send_event called"); + return 0; +} + +/* This function is used to submit an interactive job to the resource + * manager. The job request is either an object or a file (JCL format) + * that contains information needed by a job to run by way of the + * resource manager. + * + * IN resource_mgr + * IN job_cmd - The job request (JCL format), either as an object or a file. + * OUT error_msg - The address of a character string at which the + * error messages generated by this function are stored. The + * memory for this error message is allocated by the malloc API + * call. After the error message is processed, the memory + * allocated should be freed by a calling free function. + * RET 0 - SUCCESS, nonzero on failure. + */ +int pe_rm_submit_job(rmhandle_t resource_mgr, job_command_t job_cmd, + char** error_msg) +{ + job_request_t *pe_job_req = NULL; + char *myargv[3] = { "poe", "poe", NULL }; + + if (getenv("SLURM_STARTED_STEP")) + slurm_started = true; + + if (pm_type == PM_PMD) { + PMD_LOG("pe_rm_submit_job called\n"); + return 0; + } else if (pm_type != PM_POE) { + error("pe_rm_submit_job: unknown caller"); + return -1; + } + + debug("got pe_rm_submit_job called %d", job_cmd.job_format); + if (job_cmd.job_format != 1) { + /* We don't handle files */ + error("SLURM doesn't handle files to submit_job"); + return -1; + } + + init_srun(2, myargv, &log_opts, debug_level, 1); + + pe_job_req = (job_request_t *)job_cmd.job_command; + debug2("num_nodes\t= %d", pe_job_req->num_nodes); + debug2("tasks_per_node\t= %d", pe_job_req->tasks_per_node); + debug2("total_tasks\t= %d", pe_job_req->total_tasks); + debug2("usage_mode\t= %d", pe_job_req->node_usage); + debug2("network_usage protocols\t= %s", + pe_job_req->network_usage.protocols); + debug2("network_usage adapter_usage\t= %s", + pe_job_req->network_usage.adapter_usage); + debug2("network_usage adapter_type\t= %s", + pe_job_req->network_usage.adapter_type); + debug2("network_usage mode\t= %s", pe_job_req->network_usage.mode); + debug2("network_usage instance\t= %s", + pe_job_req->network_usage.instances); + debug2("network_usage dev_type\t= %s", + pe_job_req->network_usage.dev_type); + debug2("check_pointable\t= %d", pe_job_req->check_pointable); + debug2("check_dir\t= %s", pe_job_req->check_dir); + debug2("task_affinity\t= %s", pe_job_req->task_affinity); + debug2("pthreads\t= %d", pe_job_req->parallel_threads); + debug2("save_job\t= %s", pe_job_req->save_job_file); + debug2("require\t= %s", pe_job_req->requirements); + debug2("node_topology\t= %s", pe_job_req->node_topology); + debug2("pool\t= %s", pe_job_req->pool); + + if (pe_job_req->num_nodes != -1) + opt.max_nodes = opt.min_nodes = pe_job_req->num_nodes; + + if (pe_job_req->tasks_per_node != -1) + opt.ntasks_per_node = pe_job_req->tasks_per_node; + + if (pe_job_req->total_tasks != -1) { + opt.ntasks_set = true; + opt.ntasks = pe_job_req->total_tasks; + } + + xfree(opt.mpi_type); + opt.mpi_type = xstrdup(pe_job_req->network_usage.protocols); + xfree(opt.network); + opt.network = xstrdup(pe_job_req->network_usage.mode); + + create_srun_job(&job, &got_alloc, slurm_started); + return 0; +} diff --git a/src/plugins/switch/nrt/nrt.c b/src/plugins/switch/nrt/nrt.c new file mode 100644 index 0000000000000000000000000000000000000000..f8b302666028c63e0576e28536e584e88da8f0eb --- /dev/null +++ b/src/plugins/switch/nrt/nrt.c @@ -0,0 +1,4117 @@ +/*****************************************************************************\ + * nrt.c - Library routines for initiating jobs using IBM's NRT (Network + * Routing Table) + ***************************************************************************** + * Copyright (C) 2004-2007 The Regents of the University of California. + * Copyright (C) 2008 Lawrence Livermore National Security. + * Copyright (C) 2011-2012 SchedMD LLC. + * Original switch/federation plugin written by Jason King + * Largely re-written for NRT support by Morris Jette + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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. + ***************************************************************************** + * NOTE: The NRT API communicates with IBM's Protocol Network Services Deamon + * (PNSD). PNSD logs are written to /tmp/serverlog. +\*****************************************************************************/ + +#include +#include +#include + +#if HAVE_CONFIG_H +# include "config.h" +#endif + +#if HAVE_LIBNRT +# include +#else +# error "Must have libnrt to compile this module!" +#endif + +#include +#include +#include +#include + +#include "slurm/slurm_errno.h" +#include "src/common/slurm_xlator.h" +#include "src/common/read_config.h" +#include "src/plugins/switch/nrt/nrt_keys.h" +#include "src/plugins/switch/nrt/slurm_nrt.h" + +/* + * Definitions local to this module + */ +#define NRT_NODEINFO_MAGIC 0xc00cc00a +#define NRT_JOBINFO_MAGIC 0xc00cc00b +#define NRT_LIBSTATE_MAGIC 0xc00cc00c +#define NRT_HOSTLEN 20 +#define NRT_NODECOUNT 128 +#define NRT_HASHCOUNT 128 +#define NRT_MAX_ADAPTERS (NRT_MAX_ADAPTERS_PER_TYPE * NRT_MAX_ADAPTER_TYPES) +#define NRT_MAX_PROTO_CNT 20 + +/* Change NRT_STATE_VERSION value when changing the state save format */ +#define NRT_STATE_VERSION "VER001" + +pthread_mutex_t global_lock = PTHREAD_MUTEX_INITIALIZER; +extern bool nrt_need_state_save; +slurm_nrt_libstate_t * nrt_state = NULL; +mode_t nrt_umask; + +/* + * Data structures specific to switch/nrt + * + * We are going to some trouble to keep these defs private so slurm + * hackers not interested in the interconnect details can just pass around + * the opaque types. All use of the data structure internals is local to this + * module. + */ + +/* Notes about job_key: + * - It must be unique for every job step. + * - It is a 32-bit quantity. + * - We might use the bottom 16-bits of job ID an step ID, but that could + * result in conflicts for long-lived jobs or job steps. + */ +typedef struct slurm_nrt_window { + nrt_window_id_t window_id; + win_state_t state; + nrt_job_key_t job_key; +} slurm_nrt_window_t; + +typedef struct slurm_nrt_block { + uint32_t rcontext_block_use; /* RDMA context blocks used */ + nrt_job_key_t job_key; +} slurm_nrt_block_t; + +typedef struct slurm_nrt_adapter { + char adapter_name[NRT_MAX_ADAPTER_NAME_LEN]; + nrt_adapter_t adapter_type; + nrt_cau_index_t cau_indexes_avail; + nrt_cau_index_t cau_indexes_used; + nrt_imm_send_slot_t immed_slots_avail; + nrt_imm_send_slot_t immed_slots_used; + in_addr_t ipv4_addr; + struct in6_addr ipv6_addr; + nrt_logical_id_t lid; + nrt_network_id_t network_id; + nrt_port_id_t port_id; + uint64_t rcontext_block_count; /* # of RDMA context blocks */ + uint64_t rcontext_block_used; /* # of RDMA context blocks used */ + uint16_t block_count; + slurm_nrt_block_t *block_list; + uint64_t special; + nrt_window_id_t window_count; + slurm_nrt_window_t *window_list; +} slurm_nrt_adapter_t; + +struct slurm_nrt_nodeinfo { + uint32_t magic; + char name[NRT_HOSTLEN]; + uint32_t adapter_count; + slurm_nrt_adapter_t *adapter_list; + struct slurm_nrt_nodeinfo *next; + nrt_node_number_t node_number; +}; + +struct slurm_nrt_libstate { + uint32_t magic; + uint32_t node_count; + uint32_t node_max; + slurm_nrt_nodeinfo_t *node_list; + uint32_t hash_max; + slurm_nrt_nodeinfo_t **hash_table; + nrt_job_key_t key_index; +}; + +struct slurm_nrt_jobinfo { + uint32_t magic; + /* version from nrt_version() */ + /* adapter from lid in table */ + /* uid from getuid() */ + /* pid from getpid() */ + nrt_job_key_t job_key; + uint8_t bulk_xfer; /* flag */ + uint32_t bulk_xfer_resources; + uint16_t cau_indexes; + uint16_t immed_slots; + uint8_t ip_v4; /* flag */ + uint8_t user_space; /* flag */ + uint16_t tables_per_task; + nrt_tableinfo_t *tableinfo; + + hostlist_t nodenames; + uint32_t num_tasks; +}; + +typedef struct { + char adapter_name[NRT_MAX_ADAPTER_NAME_LEN]; + nrt_adapter_t adapter_type; +} nrt_cache_entry_t; + + +typedef struct nrt_protocol_info { + char protocol_name[NRT_MAX_PROTO_NAME_LEN]; +} nrt_protocol_info_t; +typedef struct nrt_protocol_table { + nrt_protocol_info_t protocol_table[NRT_MAX_PROTO_CNT]; + int protocol_table_cnt; /* Count of entries in protocol_table */ +} nrt_protocol_table_t; + +static int lid_cache_size = 0; +static nrt_cache_entry_t lid_cache[NRT_MAX_ADAPTERS]; + + +/* Local functions */ +static char * _adapter_type_str(nrt_adapter_t type); +static int _add_block_use(slurm_nrt_jobinfo_t *jp, + slurm_nrt_adapter_t *adapter); +static int _allocate_windows_all(slurm_nrt_jobinfo_t *jp, char *hostname, + uint32_t node_id, nrt_task_id_t task_id, + nrt_adapter_t adapter_type, int network_id, + nrt_protocol_table_t *protocol_table, int instances); +static int _allocate_window_single(char *adapter_name, + slurm_nrt_jobinfo_t *jp, char *hostname, + uint32_t node_id, nrt_task_id_t task_id, + nrt_adapter_t adapter_type, int network_id, + nrt_protocol_table_t *protocol_table, int instances); +static slurm_nrt_libstate_t *_alloc_libstate(void); +static slurm_nrt_nodeinfo_t *_alloc_node(slurm_nrt_libstate_t *lp, char *name); +static int _copy_node(slurm_nrt_nodeinfo_t *dest, + slurm_nrt_nodeinfo_t *src); +static int _fake_unpack_adapters(Buf buf, slurm_nrt_nodeinfo_t *n); +static int _fill_in_adapter_cache(void); +static slurm_nrt_nodeinfo_t * + _find_node(slurm_nrt_libstate_t *lp, char *name); +static slurm_nrt_window_t * + _find_window(slurm_nrt_adapter_t *adapter, uint16_t window_id); +static slurm_nrt_window_t *_find_free_window(slurm_nrt_adapter_t *adapter); +static slurm_nrt_nodeinfo_t *_find_node(slurm_nrt_libstate_t *lp, char *name); +static bool _free_block_use(slurm_nrt_jobinfo_t *jp, + slurm_nrt_adapter_t *adapter); +static void _free_libstate(slurm_nrt_libstate_t *lp); +static int _get_adapters(slurm_nrt_nodeinfo_t *n); +static void _hash_add_nodeinfo(slurm_nrt_libstate_t *state, + slurm_nrt_nodeinfo_t *node); +static int _hash_index(char *name); +static void _hash_rebuild(slurm_nrt_libstate_t *state); +static void _init_adapter_cache(void); +static int _job_step_window_state(slurm_nrt_jobinfo_t *jp, + hostlist_t hl, win_state_t state); +static void _lock(void); +static nrt_job_key_t _next_key(void); +static int _pack_libstate(slurm_nrt_libstate_t *lp, Buf buffer); +static void _pack_tableinfo(nrt_tableinfo_t *tableinfo, Buf buf, + slurm_nrt_jobinfo_t *jp); +static char * _state_str(win_state_t state); +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); +static int _unpack_tableinfo(nrt_tableinfo_t *tableinfo, + Buf buf, slurm_nrt_jobinfo_t *jp); +static int _wait_for_all_windows(nrt_tableinfo_t *tableinfo); +static int _wait_for_window_unloaded(char *adapter_name, + nrt_adapter_t adapter_type, + nrt_window_id_t window_id, int retry, + unsigned int max_windows); +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. + * _init_cache() simply initializes the cache to save values and + * needs to be called before any other cache functions are called. + * + * Used by: slurmd/slurmstepd + */ +static void +_init_adapter_cache(void) +{ + lid_cache_size = 0; +} + +/* Use nrt_adapter_resources to cache information about local adapters. + * + * Used by: slurmstepd + */ +static int +_fill_in_adapter_cache(void) +{ + int err, i, j, rc = SLURM_SUCCESS; + nrt_cmd_query_adapter_types_t adapter_types; + unsigned int num_adapter_types; + nrt_adapter_t adapter_type[NRT_MAX_ADAPTER_TYPES]; + nrt_cmd_query_adapter_names_t adapter_names; + unsigned int max_windows, num_adapter_names; + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("_fill_in_adapter_cache: begin"); + + adapter_types.num_adapter_types = &num_adapter_types; + adapter_types.adapter_types = adapter_type; + for (i = 0; i < 2; i++) { + err = nrt_command(NRT_VERSION, NRT_CMD_QUERY_ADAPTER_TYPES, + &adapter_types); + if (err != NRT_EAGAIN) + break; + error("nrt_command(adapter_types): %s", nrt_err_str(err)); + error("Is pnsd daemon started? Retrying..."); + /* Run "/opt/ibmhpc/pecurrent/ppe.pami/pnsd/pnsd -A" */ + sleep(5); + } + if (err != NRT_SUCCESS) { + error("nrt_command(adapter_types): %s", nrt_err_str(err)); + return SLURM_ERROR; + } + + for (i = 0; i < num_adapter_types; i++) { + if (debug_flags & DEBUG_FLAG_SWITCH) + info("adapter_type[%d]: %u", i, adapter_type[i]); + + adapter_names.adapter_type = adapter_type[i]; + adapter_names.num_adapter_names = &num_adapter_names; + adapter_names.max_windows = &max_windows; + err = nrt_command(NRT_VERSION, NRT_CMD_QUERY_ADAPTER_NAMES, + &adapter_names); + if (err != NRT_SUCCESS) { + error("nrt_command(adapter_names, %u): %s", + adapter_names.adapter_type, nrt_err_str(err)); + rc = SLURM_ERROR; + continue; + } + for (j = 0; j < num_adapter_names; j++) { + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("adapter_names[%d]: %s", + j, adapter_names.adapter_names[j]); + } + lid_cache[lid_cache_size].adapter_type = adapter_names. + adapter_type; + strncpy(lid_cache[lid_cache_size].adapter_name, + adapter_names.adapter_names[j], + NRT_MAX_ADAPTER_NAME_LEN); + lid_cache_size++; + } + } + if (debug_flags & DEBUG_FLAG_SWITCH) + info("_fill_in_adapter_cache: complete: %d", rc); + + return rc; +} + +/* The idea behind keeping the hash table was to avoid a linear + * search of the node list each time we want to retrieve or + * modify a node's data. The _hash_index function translates + * a node name to an index into the hash table. + * + * Used by: slurmctld + */ +static int +_hash_index(char *name) +{ + int index = 0; + int j; + + assert(name); + + /* Multiply each character by its numerical position in the + * name string to add a bit of entropy, because host names such + * as cluster[0001-1000] can cause excessive index collisions. + */ + for (j = 1; *name; name++, j++) + index += (int)*name * j; + index %= nrt_state->hash_max; + + return index; +} + +/* Tries to find a node fast using the hash table + * + * Used by: slurmctld + */ +static slurm_nrt_nodeinfo_t * +_find_node(slurm_nrt_libstate_t *lp, char *name) +{ + int i; + slurm_nrt_nodeinfo_t *n; + + assert(name); + assert(lp); + + if (lp->node_count == 0) + return NULL; + + if (lp->hash_table) { + i = _hash_index(name); + n = lp->hash_table[i]; + while (n) { + assert(n->magic == NRT_NODEINFO_MAGIC); + if (!strncmp(n->name, name, NRT_HOSTLEN)) + return n; + n = n->next; + } + } + + return NULL; +} + +/* Add the hash entry for a newly created slurm_nrt_nodeinfo_t + */ +static void +_hash_add_nodeinfo(slurm_nrt_libstate_t *state, slurm_nrt_nodeinfo_t *node) +{ + int index; + + assert(state); + assert(state->hash_table); + assert(state->hash_max >= state->node_count); + if (!node->name[0]) + return; + index = _hash_index(node->name); + node->next = state->hash_table[index]; + state->hash_table[index] = node; +} + +/* Recreates the hash table for the node list. + * + * Used by: slurmctld + */ +static void +_hash_rebuild(slurm_nrt_libstate_t *state) +{ + int i; + + assert(state); + + if (state->hash_table) + xfree(state->hash_table); + if ((state->node_count > state->hash_max) || (state->hash_max == 0)) + state->hash_max += NRT_HASHCOUNT; + state->hash_table = (slurm_nrt_nodeinfo_t **) + xmalloc(sizeof(slurm_nrt_nodeinfo_t *) * + state->hash_max); + for (i = 0; i < state->node_count; i++) + _hash_add_nodeinfo(state, &(state->node_list[i])); +} + +static slurm_nrt_window_t * +_find_window(slurm_nrt_adapter_t *adapter, uint16_t window_id) +{ + int i; + slurm_nrt_window_t *window; + + for (i = 0; i < adapter->window_count; i++) { + window = &adapter->window_list[i]; + if (window->window_id == window_id) + return window; + } + + debug3("Unable to _find_window %hu on adapter %s", + window_id, adapter->adapter_name); + return (slurm_nrt_window_t *) NULL; +} + +/* + * For one node, free all of the RDMA blocks and windows belonging to a + * particular job step (as identified by the job_key). + */ +static void +_free_resources_by_job(slurm_nrt_jobinfo_t *jp, char *node_name) +{ + slurm_nrt_nodeinfo_t *node; + slurm_nrt_adapter_t *adapter; + slurm_nrt_window_t *window; + int i, j; + + /* debug3("_free_resources_by_job_key(%u, %s)", jp->job_key, node_name); */ + if ((node = _find_node(nrt_state, node_name)) == NULL) + return; + + if (node->adapter_list == NULL) { + error("switch/nrt: _free_resources_by_job, " + "adapter_list NULL for node %s", node_name); + return; + } + for (i = 0; i < node->adapter_count; i++) { + adapter = &node->adapter_list[i]; + + (void) _free_block_use(jp, adapter); + if (adapter->window_list == NULL) { + error("switch/nrt: _free_resources_by_job, " + "window_list NULL for node %s adapter %s", + node->name, adapter->adapter_name); + continue; + } + /* We could check here to see if this adapter's name + * is in the nrt_jobinfo tablinfo list to avoid the next + * loop if the adapter isn't in use by the job step. + * However, the added searching and string comparisons + * probably aren't worth it, especially since MOST job + * steps will use all of the adapters. + */ + for (j = 0; j < adapter->window_count; j++) { + window = &adapter->window_list[j]; + + if (window->job_key == jp->job_key) { + /* debug3("Freeing adapter %s window %d", + adapter->name, window->id); */ + window->state = NRT_WIN_AVAILABLE; + window->job_key = 0; + if (jp->immed_slots > + adapter->immed_slots_used) { + error("switch/nrt: immed_slots_used " + "underflow"); + adapter->immed_slots_used = 0; + } else { + adapter->immed_slots_used -= + jp->immed_slots; + } + } + } + } +} + +/* + * Find all of the windows used by this job step and set their + * status to "state". + * + * Used by: slurmctld + */ +static int +_job_step_window_state(slurm_nrt_jobinfo_t *jp, hostlist_t hl, + win_state_t state) +{ + hostlist_iterator_t hi; + char *host; + int err, rc = SLURM_SUCCESS; + + xassert(!hostlist_is_empty(hl)); + xassert(jp); + xassert(jp->magic == NRT_JOBINFO_MAGIC); + + if ((jp == NULL) || (hostlist_is_empty(hl))) + return SLURM_ERROR; + + if ((jp->tables_per_task == 0) || (jp->tableinfo == NULL) || + (jp->tableinfo[0].table_length == 0)) + return SLURM_SUCCESS; + + hi = hostlist_iterator_create(hl); + _lock(); + while ((host = hostlist_next(hi))) { + err = _window_state_set(jp, host, state); + rc = MAX(rc, err); + free(host); + } + _unlock(); + hostlist_iterator_destroy(hi); + + return rc; +} + +static char *_state_str(win_state_t state) +{ + if (state == NRT_WIN_UNAVAILABLE) + return "Unavailable"; + if (state == NRT_WIN_INVALID) + return "Invalid"; + if (state == NRT_WIN_AVAILABLE) + return "Available"; + if (state == NRT_WIN_RESERVED) + return "Reserved"; + if (state == NRT_WIN_READY) + return "Ready"; + if (state == NRT_WIN_RUNNING) + return "Running"; + return "Unknown"; +} + +/* Find the correct NRT structs and set the state + * of the switch windows for the specified task_id. + * + * Used by: slurmctld + */ +static int +_window_state_set(slurm_nrt_jobinfo_t *jp, char *hostname, win_state_t state) +{ + slurm_nrt_nodeinfo_t *node = NULL; + slurm_nrt_adapter_t *adapter = NULL; + slurm_nrt_window_t *window = NULL; + int i, j; + int rc = SLURM_SUCCESS; + bool adapter_found; + uint16_t win_id = 0; + nrt_job_key_t job_key = jp->job_key; + nrt_table_id_t table_cnt = jp->tables_per_task; + nrt_tableinfo_t *tableinfo = jp->tableinfo; + nrt_task_id_t task_id; + + assert(tableinfo); + assert(hostname); + + node = _find_node(nrt_state, hostname); + if (node == NULL) { + error("Failed to find node in node_list: %s", hostname); + return SLURM_ERROR; + } + if (node->adapter_list == NULL) { + error("Found node, but adapter_list is NULL"); + return SLURM_ERROR; + } + + for (i = 0; i < table_cnt; i++) { + if (tableinfo[i].table == NULL) { + error("tableinfo[%d].table is NULL", i); + rc = SLURM_ERROR; + continue; + } + + adapter_found = false; + /* 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)) + continue; + for (task_id = 0; task_id < tableinfo[i].table_length; + task_id++) { + if (adapter->adapter_type == NRT_IB) { + nrt_ib_task_info_t *ib_tbl_ptr; + ib_tbl_ptr = tableinfo[i].table; + ib_tbl_ptr += task_id; + if (ib_tbl_ptr == NULL) { + error("tableinfo[%d].table[%d]" + " is NULL", i, task_id); + rc = SLURM_ERROR; + continue; + } + if (adapter->lid == + ib_tbl_ptr->base_lid) { + adapter_found = true; + win_id = ib_tbl_ptr->win_id; + debug3("Setting status %s " + "adapter %s lid %hu " + "window %hu for task %d", + _state_str(state), + adapter->adapter_name, + ib_tbl_ptr->base_lid, + ib_tbl_ptr->win_id, + task_id); + } + } else if (adapter->adapter_type == NRT_HFI) { + nrt_hfi_task_info_t *hfi_tbl_ptr; + hfi_tbl_ptr = tableinfo[i].table; + hfi_tbl_ptr += task_id; + if (hfi_tbl_ptr == NULL) { + error("tableinfo[%d].table[%d]" + " is NULL", i, task_id); + rc = SLURM_ERROR; + continue; + } + if (adapter->lid == hfi_tbl_ptr->lid) { + adapter_found = true; + win_id = hfi_tbl_ptr->win_id; + debug3("Setting status %s " + "adapter %s lid %hu " + "window %hu for task %d", + _state_str(state), + adapter->adapter_name, + hfi_tbl_ptr->lid, + hfi_tbl_ptr->win_id, + task_id); + } + } else if ((adapter->adapter_type==NRT_HPCE) || + (adapter->adapter_type==NRT_KMUX)) { + nrt_hpce_task_info_t *hpce_tbl_ptr; + hpce_tbl_ptr = tableinfo[i].table; + hpce_tbl_ptr += task_id; + if (hpce_tbl_ptr == NULL) { + error("tableinfo[%d].table[%d]" + " is NULL", i, task_id); + rc = SLURM_ERROR; + continue; + } + if (adapter->network_id == + tableinfo[i].network_id) { + adapter_found = true; + win_id = hpce_tbl_ptr->win_id; + debug3("Setting status %s " + "adapter %s window %hu " + "for task %d", + _state_str(state), + adapter->adapter_name, + hpce_tbl_ptr->win_id, + task_id); + } + } else { + error("_window_state_set: Missing " + "support for adapter type %s", + _adapter_type_str(adapter-> + adapter_type)); + + } + + window = _find_window(adapter, win_id); + if (window) { + window->state = state; + if (state == NRT_WIN_UNAVAILABLE) { + window->job_key = job_key; + adapter->immed_slots_used += + jp->immed_slots; + } else + window->job_key = 0; + } + } /* for each task */ + if (adapter_found) { + _add_block_use(jp, adapter); + } else { + error("switch/nrt: Did not find adapter %s of " + "type %s with lid %hu ", + adapter->adapter_name, + _adapter_type_str(adapter->adapter_type), + adapter->lid); + rc = SLURM_ERROR; + continue; + } + } /* for each adapter */ + } /* for each table */ + + return rc; +} + +/* If the node is already in the node list then simply return + * a pointer to it, otherwise dynamically allocate memory to the + * node list if necessary. + * + * Used by: slurmctld + */ +static slurm_nrt_nodeinfo_t * +_alloc_node(slurm_nrt_libstate_t *lp, char *name) +{ + slurm_nrt_nodeinfo_t *n = NULL; + int new_bufsize; + bool need_hash_rebuild = false; + + assert(lp); + + if (name != NULL) { + n = _find_node(lp, name); + if (n != NULL) + return n; + } + + nrt_need_state_save = true; + + if (lp->node_count >= lp->node_max) { + lp->node_max += NRT_NODECOUNT; + new_bufsize = lp->node_max * sizeof(slurm_nrt_nodeinfo_t); + if (lp->node_list == NULL) { + lp->node_list = (slurm_nrt_nodeinfo_t *) + xmalloc(new_bufsize); + } else { + lp->node_list = (slurm_nrt_nodeinfo_t *) + xrealloc(lp->node_list, new_bufsize); + } + need_hash_rebuild = true; + } + if (lp->node_list == NULL) { + slurm_seterrno(ENOMEM); + return NULL; + } + + n = lp->node_list + (lp->node_count++); + n->magic = NRT_NODEINFO_MAGIC; + n->name[0] = '\0'; + n->adapter_list = (slurm_nrt_adapter_t *) + xmalloc(NRT_MAXADAPTERS * + sizeof(struct slurm_nrt_adapter)); + + if (name != NULL) { + strncpy(n->name, name, NRT_HOSTLEN); + if (need_hash_rebuild || (lp->node_count > lp->hash_max)) + _hash_rebuild(lp); + else + _hash_add_nodeinfo(lp, n); + } + + return n; +} + +static slurm_nrt_window_t * +_find_free_window(slurm_nrt_adapter_t *adapter) +{ + int i; + slurm_nrt_window_t *window; + + for (i = 0; i < adapter->window_count; i++) { + window = &adapter->window_list[i]; + if (window->state == NRT_WIN_AVAILABLE) + return window; + } + + return (slurm_nrt_window_t *) NULL; +} + +static void _table_alloc(nrt_tableinfo_t *tableinfo, int table_inx, + nrt_adapter_t adapter_type) +{ + int table_size; + + if (tableinfo[table_inx].table) + return; + if (adapter_type == NRT_IB) + table_size = sizeof(nrt_ib_task_info_t); + else if (adapter_type == NRT_HFI) + table_size = sizeof(nrt_hfi_task_info_t); + else if (adapter_type == NRT_IPONLY) + table_size = sizeof(nrt_ip_task_info_t); + else if ((adapter_type == NRT_HPCE) || (adapter_type == NRT_KMUX)) + table_size = sizeof(nrt_hpce_task_info_t); + else { + error("Missing support for adapter type %s", + _adapter_type_str(adapter_type)); + return; + } + tableinfo[table_inx].table = xmalloc(table_size * + tableinfo[table_inx]. + table_length); + return; +} + +/* Track RDMA or CAU resources allocated to a job on each adapter */ +static int +_add_block_use(slurm_nrt_jobinfo_t *jp, slurm_nrt_adapter_t *adapter) +{ + int i; + slurm_nrt_block_t *block_ptr, *free_block; + nrt_cau_index_t new_cau_count = 0; + uint64_t new_rcontext_blocks = 0; + + /* Validate sufficient CAU resources */ + if (jp->cau_indexes) { + new_cau_count = adapter->cau_indexes_used + jp->cau_indexes; + if (adapter->cau_indexes_avail < new_cau_count) { + info("switch/nrt: Insufficient cau_indexes resources " + "on adapter %s (%hu < %hu)", + adapter->adapter_name, adapter->cau_indexes_avail, + new_cau_count); + return SLURM_ERROR; + } + } + + /* Validate sufficient RDMA resources */ + if (jp->bulk_xfer && jp->bulk_xfer_resources) { + new_rcontext_blocks = adapter->rcontext_block_used + + jp->bulk_xfer_resources; + if (adapter->rcontext_block_count < new_rcontext_blocks) { + info("switch/nrt: Insufficient bulk_xfer resources on " + "adapter %s (%"PRIu64" < %"PRIu64")", + adapter->adapter_name, + adapter->rcontext_block_count, + new_rcontext_blocks); + return SLURM_ERROR; + } + } else { + jp->bulk_xfer_resources = 0; /* match jp->bulk_xfer */ + } + + if ((new_cau_count == 0) && (new_rcontext_blocks == 0)) + return SLURM_SUCCESS; /* No work */ + + /* Add job_key to our table and update the resource used information */ + free_block = NULL; + block_ptr = adapter->block_list; + for (i = 0; i < adapter->block_count; i++, block_ptr++) { + if (block_ptr->job_key == jp->job_key) { + free_block = block_ptr; + break; + } else if ((block_ptr->job_key == 0) && (free_block == 0)) { + free_block = block_ptr; + } + } + if (free_block == NULL) { + xrealloc(adapter->block_list, + sizeof(slurm_nrt_block_t) * + (adapter->block_count + 8)); + free_block = adapter->block_list + adapter->block_count; + adapter->block_count += 8; + } + + free_block->job_key = jp->job_key; + free_block->rcontext_block_use = jp->bulk_xfer_resources; + if (new_cau_count) + adapter->cau_indexes_used = new_cau_count; + if (new_rcontext_blocks) + adapter->rcontext_block_used = new_rcontext_blocks; + +#if 0 + block_ptr = adapter->block_list; + for (i = 0; i < adapter->block_count; i++, block_ptr++) { + if (block_ptr->job_key) { + info("adapter:%s block:%d job_key:%u blocks:%u", + adapter->adapter_name, i, block_ptr->job_key, + free_block->rcontext_block_use); + } + } +#endif + return SLURM_SUCCESS; +} +static bool +_free_block_use(slurm_nrt_jobinfo_t *jp, slurm_nrt_adapter_t *adapter) +{ + slurm_nrt_block_t *block_ptr; + bool found_job = false; + int i; + + if ((jp->bulk_xfer && jp->bulk_xfer_resources) || jp->cau_indexes) { + block_ptr = adapter->block_list; + for (i = 0; i < adapter->block_count; i++, block_ptr++) { + if (block_ptr->job_key != jp->job_key) + continue; + + if (jp->cau_indexes > adapter->cau_indexes_used) { + error("switch/nrt: cau_indexes_used underflow"); + adapter->cau_indexes_used = 0; + } else { + adapter->cau_indexes_used -= jp->cau_indexes; + } + + if (block_ptr->rcontext_block_use > + adapter->rcontext_block_used) { + error("switch/nrt: rcontext_block_used " + "underflow"); + adapter->rcontext_block_used = 0; + } else { + adapter->rcontext_block_used -= + block_ptr->rcontext_block_use; + } + block_ptr->job_key = 0; + block_ptr->rcontext_block_use = 0; + found_job = true; + break; + } + } + + return found_job; +} + +/* For a given process, fill out an nrt_creator_per_task_input_t + * struct (an array of these makes up the network table loaded + * for each job). Assign adapters, lids and switch windows to + * each task in a job. + * + * Used by: slurmctld + */ +static int +_allocate_windows_all(slurm_nrt_jobinfo_t *jp, char *hostname, + uint32_t node_id, nrt_task_id_t task_id, + nrt_adapter_t adapter_type, int network_id, + nrt_protocol_table_t *protocol_table, int instances) +{ + nrt_tableinfo_t *tableinfo = jp->tableinfo; + nrt_job_key_t job_key = jp->job_key; + bool ip_v4 = jp->ip_v4; + bool user_space = jp->user_space; + nrt_node_number_t node_number; + slurm_nrt_nodeinfo_t *node; + slurm_nrt_adapter_t *adapter; + slurm_nrt_window_t *window; + nrt_context_id_t context_id; + nrt_table_id_t table_id; + int i, j, table_inx; + + assert(tableinfo); + assert(hostname); + + debug("in _allocate_windows_all"); + node = _find_node(nrt_state, hostname); + if (node == NULL) { + error("Failed to find node in node_list: %s", hostname); + return SLURM_ERROR; + } + + /* From Bill LePera, IBM, 4/18/2012: + * The node_number field is normally set to the 32-bit IPv4 address + * of the local node's host name. */ + node_number = node->node_number; + + /* Reserve a window on each adapter for this task */ + table_inx = -1; + for (context_id = 0; context_id < protocol_table->protocol_table_cnt; + context_id++) { + table_id = -1; + for (i = 0; i < node->adapter_count; i++) { + adapter = &node->adapter_list[i]; + if ((adapter_type != NRT_MAX_ADAPTER_TYPES) && + (adapter->adapter_type != adapter_type)) + continue; + if ((network_id >= 0) && + (adapter->network_id != network_id)) + continue; + if (user_space && + (adapter->adapter_type == NRT_IPONLY)) + continue; + if (context_id == 0) { + if (_add_block_use(jp, adapter)) + return SLURM_ERROR; + } + for (j = 0; j < instances; j++) { + table_id++; + table_inx++; + if (table_inx >= jp->tables_per_task) { + error("switch/nrt: table count bad"); + return SLURM_ERROR; + } + if (user_space) { + window = _find_free_window(adapter); + if (window == NULL) { + info("switch/nrt: " + "No free windows on " + "node %s adapter %s", + node->name, + adapter->adapter_name); + return SLURM_ERROR; + } + adapter->immed_slots_used += + jp->immed_slots; + if (adapter->immed_slots_used > + adapter->immed_slots_avail) { + info("switch/nrt: " + "No free immediate slots " + "on node %s adapter %s", + node->name, + adapter->adapter_name); + adapter->immed_slots_used -= + jp->immed_slots; + return SLURM_ERROR; + } + window->state = NRT_WIN_UNAVAILABLE; + window->job_key = job_key; + } + + if (!user_space) { + nrt_ip_task_info_t *ip_table; + _table_alloc(tableinfo, table_inx, + NRT_IPONLY); + ip_table = (nrt_ip_task_info_t *) + tableinfo[table_inx].table; + ip_table += task_id; + ip_table->node_number = node_number; + ip_table->task_id = task_id; + if (ip_v4) { + memcpy(&ip_table->ip.ipv4_addr, + &adapter->ipv4_addr, + sizeof(in_addr_t)); + } else { + memcpy(&ip_table->ip.ipv6_addr, + &adapter->ipv6_addr, + sizeof(struct in6_addr)); + } + } else if (adapter->adapter_type == NRT_IB) { + nrt_ib_task_info_t *ib_table; + _table_alloc(tableinfo, table_inx, + adapter->adapter_type); + ib_table = (nrt_ib_task_info_t *) + tableinfo[table_inx].table; + ib_table += task_id; + strncpy(ib_table->device_name, + adapter->adapter_name, + NRT_MAX_DEVICENAME_SIZE); + ib_table->base_lid = adapter->lid; + ib_table->port_id = 1; + ib_table->lmc = 0; + ib_table->node_number = node_number; + ib_table->task_id = task_id; + ib_table->win_id = window->window_id; + } else if (adapter->adapter_type == NRT_HFI) { + nrt_hfi_task_info_t *hfi_table; + _table_alloc(tableinfo, table_inx, + adapter->adapter_type); + hfi_table = (nrt_hfi_task_info_t *) + tableinfo[table_inx].table; + hfi_table += task_id; + hfi_table->task_id = task_id; + hfi_table->win_id = window->window_id; + } else if ((adapter->adapter_type == NRT_HPCE)|| + (adapter->adapter_type == NRT_KMUX)){ + nrt_hpce_task_info_t *hpce_table; + _table_alloc(tableinfo, table_inx, + adapter->adapter_type); + hpce_table = (nrt_hpce_task_info_t *) + tableinfo[table_inx].table; + hpce_table += task_id; + hpce_table->task_id = task_id; + hpce_table->win_id = window->window_id; + } else { + error("switch/nrt: Missing support " + "for adapter type %s", + _adapter_type_str(adapter-> + adapter_type)); + return SLURM_ERROR; + } + + strncpy(tableinfo[table_inx].adapter_name, + adapter->adapter_name, + NRT_MAX_ADAPTER_NAME_LEN); + tableinfo[table_inx].adapter_type = adapter-> + adapter_type; + tableinfo[table_inx].network_id = adapter-> + network_id; + strncpy(tableinfo[table_inx].protocol_name, + protocol_table-> + protocol_table[context_id]. + protocol_name, + NRT_MAX_PROTO_NAME_LEN); + tableinfo[table_inx].context_id = context_id; + tableinfo[table_inx].table_id = table_id; + } /* for each table */ + } /* for each context */ + } /* for each adapter */ + + return SLURM_SUCCESS; +} + + +/* For a given process, fill out an nrt_creator_per_task_input_t + * struct (an array of these makes up the network table loaded + * for each job). Assign a single adapter, lid and switch window to + * a task in a job. + * + * Used by: slurmctld + */ +static int +_allocate_window_single(char *adapter_name, slurm_nrt_jobinfo_t *jp, + char *hostname, uint32_t node_id, + nrt_task_id_t task_id, nrt_adapter_t adapter_type, + int network_id, nrt_protocol_table_t *protocol_table, + int instances) +{ + nrt_tableinfo_t *tableinfo = jp->tableinfo; + nrt_job_key_t job_key = jp->job_key; + bool ip_v4 = jp->ip_v4; + bool user_space = jp->user_space; + nrt_node_number_t node_number; + slurm_nrt_nodeinfo_t *node; + slurm_nrt_adapter_t *adapter = NULL; + slurm_nrt_window_t *window; + int i, table_inx; + nrt_context_id_t context_id; + nrt_table_id_t table_id; + + assert(tableinfo); + assert(hostname); + + node = _find_node(nrt_state, hostname); + if (node == NULL) { + error("switch/nrt: Failed to find node in node_list: %s", + hostname); + return SLURM_ERROR; + } + + /* From Bill LePera, IBM, 4/18/2012: + * The node_number field is normally set to the 32-bit IPv4 address + * of the local node's host name. */ + node_number = node->node_number; + + /* find the adapter */ + for (i = 0; i < node->adapter_count; i++) { + debug("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)) { + adapter = &node->adapter_list[i]; + break; + } + continue; + } + if ((network_id >= 0) && (adapter->network_id != network_id)) + continue; + if ((adapter_type != NRT_MAX_ADAPTER_TYPES) && + (adapter->adapter_type == adapter_type)) { + adapter = &node->adapter_list[i]; + break; + } + } + if (adapter == NULL) { + info("switch/nrt: Failed to find adapter %s of type %s on " + "node %s", + adapter_name, _adapter_type_str(adapter_type), hostname); + return SLURM_ERROR; + } + + table_inx = -1; + for (context_id = 0; context_id < protocol_table->protocol_table_cnt; + context_id++) { + if (context_id == 0) { + if (_add_block_use(jp, adapter)) + return SLURM_ERROR; + } + for (table_id = 0; table_id < instances; table_id++) { + table_inx++; + if (user_space) { + /* Reserve a window on the adapter for task */ + window = _find_free_window(adapter); + if (window == NULL) { + info("switch/nrt: No free windows " + "on node %s adapter %s", + node->name, + adapter->adapter_name); + return SLURM_ERROR; + } + adapter->immed_slots_used += jp->immed_slots; + if (adapter->immed_slots_used > + adapter->immed_slots_avail) { + info("switch/nrt: No free immediate " + "slots on node %s adapter %s", + node->name, + adapter->adapter_name); + adapter->immed_slots_used -= + jp->immed_slots; + return SLURM_ERROR; + } + window->state = NRT_WIN_UNAVAILABLE; + window->job_key = job_key; + } + + if (!user_space) { + nrt_ip_task_info_t *ip_table; + _table_alloc(tableinfo, table_inx, NRT_IPONLY); + ip_table = (nrt_ip_task_info_t *) + tableinfo[table_inx].table; + ip_table += task_id; + ip_table->node_number = node_number; + ip_table->task_id = task_id; + if (ip_v4) { + memcpy(&ip_table->ip.ipv4_addr, + &adapter->ipv4_addr, + sizeof(in_addr_t)); + } else { + memcpy(&ip_table->ip.ipv6_addr, + &adapter->ipv6_addr, + sizeof(struct in6_addr)); + } + } else if (adapter_type == NRT_IB) { + nrt_ib_task_info_t *ib_table; + _table_alloc(tableinfo, table_inx, + adapter_type); + ib_table = (nrt_ib_task_info_t *) + tableinfo[table_inx].table; + ib_table += task_id; + strncpy(ib_table->device_name, adapter_name, + NRT_MAX_DEVICENAME_SIZE); + ib_table->base_lid = adapter->lid; + ib_table->port_id = 1; + ib_table->lmc = 0; + ib_table->node_number = node_number; + ib_table->task_id = task_id; + ib_table->win_id = window->window_id; + } else if (adapter_type == NRT_HFI) { + nrt_hfi_task_info_t *hfi_table; + _table_alloc(tableinfo, table_inx, + adapter_type); + hfi_table = (nrt_hfi_task_info_t *) + tableinfo[table_inx].table; + hfi_table += task_id; + hfi_table->lid = adapter->lid; + hfi_table->task_id = task_id; + hfi_table->win_id = window->window_id; + } else if ((adapter_type == NRT_HPCE) || + (adapter_type == NRT_KMUX)) { + nrt_hpce_task_info_t *hpce_table; + _table_alloc(tableinfo, table_inx, + adapter_type); + hpce_table = (nrt_hpce_task_info_t *) + tableinfo[table_inx].table; + hpce_table += task_id; + hpce_table->task_id = task_id; + hpce_table->win_id = window->window_id; + } else { + error("Missing support for adapter type %s", + _adapter_type_str(adapter_type)); + return SLURM_ERROR; + } + + strncpy(tableinfo[table_inx].adapter_name, adapter_name, + NRT_MAX_ADAPTER_NAME_LEN); + tableinfo[table_inx].adapter_type = adapter-> + adapter_type; + tableinfo[table_inx].network_id = adapter->network_id; + strncpy(tableinfo[table_inx].protocol_name, + protocol_table->protocol_table[context_id]. + protocol_name, + NRT_MAX_PROTO_NAME_LEN); + tableinfo[table_inx].context_id = context_id; + tableinfo[table_inx].table_id = table_id; + } /* for each table */ + } /* for each context */ + + return SLURM_SUCCESS; +} + +static char * +_win_state_str(win_state_t state) +{ + if (state == NRT_WIN_UNAVAILABLE) + return "Unavailable"; + else if (state == NRT_WIN_INVALID) + return "Invalid"; + else if (state == NRT_WIN_AVAILABLE) + return "Available"; + else if (state == NRT_WIN_RESERVED) + return "Reserved"; + else if (state == NRT_WIN_READY) + return "Ready"; + else if (state == NRT_WIN_RUNNING) + return "Running"; + else { + static char buf[16]; + snprintf(buf, sizeof(buf), "%d", state); + return buf; + } +} + +static char * +_adapter_type_str(nrt_adapter_t type) +{ + static char buf[10]; + + switch (type) { + case NRT_IB: + return "IB"; + case NRT_HFI: + return "HFI"; + case NRT_IPONLY: + return "IP_ONLY"; + case NRT_HPCE: + return "HPC_Ethernet"; + case NRT_KMUX: + return "Kernel_Emulated_HPCE"; + default: + snprintf(buf, sizeof(buf), "%d", type); + return buf; + } + + return NULL; /* Never used */ +} + +static char * +_port_status_str(nrt_port_status_t status) +{ + if (status == 0) + return "Down"; + else if (status == 1) + return "Up"; + else if (status == 2) + return "Unconfig"; + else { + static char buf[16]; + snprintf(buf, sizeof(buf), "%d", status); + return buf; + } +} + +/* Used by: slurmd */ +static void +_print_adapter_info(nrt_adapter_info_t *adapter_info) +{ + char addr_v4_str[128], addr_v6_str[128]; + int i; + + if (!adapter_info) { + error("_print_adapter_info with NULL adapter_info"); + return; + } + + info("--Begin Adapter Info--"); + info(" adapter_name: %s", adapter_info->adapter_name); + info(" adapter_type: %s", + _adapter_type_str(adapter_info->adapter_type)); + info(" cau_indexes_avail: %hu", adapter_info->cau_indexes_avail); + info(" immed_slots_avail: %hu", adapter_info->immed_slots_avail); + inet_ntop(AF_INET, &adapter_info->node_number, + addr_v4_str, sizeof(addr_v4_str)); + info(" node_number: %s", addr_v4_str); + info(" num_ports: %hu", adapter_info->num_ports); + info(" rcontext_block_count: %"PRIu64"", + adapter_info->rcontext_block_count); + info(" window_count: %hu", adapter_info->window_count); + for (i = 0; i < adapter_info->num_ports; i++) { + inet_ntop(AF_INET, + &adapter_info->port[i].ipv4_addr, + addr_v4_str, sizeof(addr_v4_str)); + inet_ntop(AF_INET6, + &adapter_info->port[i].ipv6_addr, + addr_v6_str, sizeof(addr_v6_str)); + info(" port_id:%hu status:%s lid:%u " + "network_id:%lu special:%lu " + "ipv4_addr:%s ipv6_addr:%s/%hu", + adapter_info->port[i].port_id, + _port_status_str(adapter_info->port[i].status), + adapter_info->port[i].lid, + adapter_info->port[i].network_id, + adapter_info->port[i].special, + addr_v4_str, addr_v6_str, + adapter_info->port[i].ipv6_prefix_len); + } +#if 0 + /* This always seems to count up from 0 to window_count-1 */ + for (i = 0; i < adapter_info->window_count; i++) + info(" window_id: %u", adapter_info->window_list[i]); +#endif + info("--End Adapter Info--"); +} + +/* Used by: slurmd */ +static void +_print_adapter_status(nrt_cmd_status_adapter_t *status_adapter) +{ + int i; + nrt_window_id_t window_cnt; + nrt_status_t *status = *(status_adapter->status_array); + char window_str[128]; + hostset_t hs; + + hs = hostset_create(""); + if (hs == NULL) + fatal("hostset_create malloc failure"); + info("--Begin Adapter Status--"); + info(" adapter_name: %s", status_adapter->adapter_name); + info(" adapter_type: %s", + _adapter_type_str(status_adapter->adapter_type)); + window_cnt = *(status_adapter->window_count); + info(" window_count: %hu", window_cnt); + info(" --------"); + for (i = 0; i < window_cnt; i++) { + if ((status[i].state == NRT_WIN_AVAILABLE) && + (i >= NRT_DEBUG_CNT)) { + snprintf(window_str, sizeof(window_str), "%d", + status[i].window_id); + hostset_insert(hs, window_str); + continue; + } + info(" window_id: %hu", status[i].window_id); + info(" state: %s", _win_state_str(status[i].state)); + if (status[i].state >= NRT_WIN_RESERVED) { + info(" bulk_xfer: %hu", status[i].bulk_transfer); + info(" client_pid: %u", + (uint32_t)status[i].client_pid); + info(" rcontext_blocks: %u", + status[i].rcontext_blocks); + info(" uid: %u", (uint32_t) status[i].uid); + } + info(" --------"); + } + if (hostset_count(hs) > 0) { + hostset_ranged_string(hs, sizeof(window_str), window_str); + info(" suppress data for available windows %s", window_str); + info(" --------"); + } + info("--End Adapter Status--"); + hostset_destroy(hs); +} + +/* Used by: slurmd, slurmctld */ +static void +_print_nodeinfo(slurm_nrt_nodeinfo_t *n) +{ + int i, j; + slurm_nrt_adapter_t *a; + slurm_nrt_window_t *w; + char addr_str[128]; + char window_str[128]; + hostset_t hs; + + assert(n); + assert(n->magic == NRT_NODEINFO_MAGIC); + + info("--Begin Node Info--"); + info(" node: %s", n->name); + inet_ntop(AF_INET, &n->node_number, addr_str,sizeof(addr_str)); + info(" node_number: %s", addr_str); + info(" adapter_count: %u", n->adapter_count); + for (i = 0; i < n->adapter_count; i++) { + a = n->adapter_list + i; + info(" adapter_name: %s", a->adapter_name); + info(" adapter_type: %s", + _adapter_type_str(a->adapter_type)); + info(" cau_indexes_avail: %hu", a->cau_indexes_avail); + info(" cau_indexes_used: %hu", a->cau_indexes_used); + info(" immed_slots_avail: %hu", a->immed_slots_avail); + info(" immed_slots_used: %hu", a->immed_slots_used); + inet_ntop(AF_INET, &a->ipv4_addr, addr_str, sizeof(addr_str)); + info(" ipv4_addr: %s", addr_str); + inet_ntop(AF_INET6, &a->ipv6_addr, addr_str, sizeof(addr_str)); + info(" ipv6_addr: %s", addr_str); + info(" lid: %u", a->lid); + info(" network_id: %lu", a->network_id); + + info(" port_id: %hu", a->port_id); + info(" rcontext_block_count: %"PRIu64"", + a->rcontext_block_count); + info(" rcontext_block_used: %"PRIu64"", + a->rcontext_block_used); + info(" special: %lu", a->special); + + info(" window_count: %hu", a->window_count); + hs = hostset_create(""); + if (hs == NULL) + fatal("hostset_create malloc failure"); + w = a->window_list; + for (j = 0; j < a->window_count; j++) { + if ((w[j].state == NRT_WIN_AVAILABLE) && + (j >= NRT_DEBUG_CNT)) { + snprintf(window_str, sizeof(window_str), "%d", + w[j].window_id); + hostset_insert(hs, window_str); + continue; + } + info(" window: %hu", w[j].window_id); + info(" state: %s", _win_state_str(w[j].state)); + info(" job_key: %u", w[j].job_key); + info(" -------- "); + } + if (hostset_count(hs) > 0) { + hostset_ranged_string(hs, sizeof(window_str), + window_str); + info(" suppress data for available windows %s", + window_str); + info(" -------- "); + } + hostset_destroy(hs); + + info(" block_count: %hu", a->block_count); + for (j = 0; j < a->block_count; j++) { + if (a->block_list[j].job_key) { + info(" job_key[%d]: %u", + j, a->block_list[j].job_key); + } + } + } + info("--End Node Info--"); +} + +/* Used by: slurmctld */ +static void +_print_libstate(const slurm_nrt_libstate_t *l) +{ + int i; + + assert(l); + assert(l->magic == NRT_LIBSTATE_MAGIC); + + info("--Begin libstate--"); + info(" node_count = %u", l->node_count); + info(" node_max = %u", l->node_max); + info(" hash_max = %u", l->hash_max); + info(" key_index = %u", l->key_index); + for (i = 0; i < l->node_count; i++) { + _print_nodeinfo(&l->node_list[i]); + } + info("--End libstate--"); +} +/* Used by: all */ +static void +_print_table(void *table, int size, nrt_adapter_t adapter_type, bool ip_v4) +{ + char addr_str[128]; + int i; + + assert(table); + assert(size > 0); + + info("--Begin NRT table--"); + for (i = 0; i < size; i++) { + if (adapter_type == NRT_IB) { + nrt_ib_task_info_t *ib_tbl_ptr; + ib_tbl_ptr = table; + ib_tbl_ptr += i; + info(" task_id: %u", ib_tbl_ptr->task_id); + info(" win_id: %hu", ib_tbl_ptr->win_id); + inet_ntop(AF_INET, &ib_tbl_ptr->node_number, addr_str, + sizeof(addr_str)); + info(" node_number: %s", addr_str); +/* info(" node_number: %u", ib_tbl_ptr->node_number); */ + info(" device_name: %s", ib_tbl_ptr->device_name); + info(" base_lid: %u", ib_tbl_ptr->base_lid); + info(" port_id: %hu", ib_tbl_ptr->port_id); + info(" lmc: %hu", ib_tbl_ptr->lmc); + info(" port_status: %hu", ib_tbl_ptr->port_status); + } else if (adapter_type == NRT_HFI) { + nrt_hfi_task_info_t *hfi_tbl_ptr; + hfi_tbl_ptr = table; + hfi_tbl_ptr += i; + info(" task_id: %u", hfi_tbl_ptr->task_id); + info(" lpar_id: %u", hfi_tbl_ptr->lpar_id); + info(" lid: %u", hfi_tbl_ptr->lid); + info(" win_id: %hu", hfi_tbl_ptr->win_id); + } else if ((adapter_type == NRT_HPCE) || + (adapter_type == NRT_KMUX)) { + nrt_hpce_task_info_t *hpce_tbl_ptr; + hpce_tbl_ptr = table; + hpce_tbl_ptr += i; + info(" task_id: %u", hpce_tbl_ptr->task_id); + info(" win_id: %hu", hpce_tbl_ptr->win_id); + inet_ntop(AF_INET, &hpce_tbl_ptr->node_number, + addr_str, sizeof(addr_str)); + info(" node_number: %s", addr_str); +/* info(" node_number: %u", hpce_tbl_ptr->node_number); */ + info(" device_name: %s", hpce_tbl_ptr->device_name); + } else if (adapter_type == NRT_IPONLY) { + nrt_ip_task_info_t *ip_tbl_ptr; + char addr_str[128]; + ip_tbl_ptr = table; + ip_tbl_ptr += i; + info(" task_id: %u", ip_tbl_ptr->task_id); + inet_ntop(AF_INET, &ip_tbl_ptr->node_number, addr_str, + sizeof(addr_str)); + info(" node_number: %s", addr_str); +/* info(" node_number: %u", ip_tbl_ptr->node_number); */ + if (ip_v4) { + inet_ntop(AF_INET, &ip_tbl_ptr->ip.ipv4_addr, + addr_str, sizeof(addr_str)); + info(" ipv4_addr: %s", addr_str); + } else { + inet_ntop(AF_INET6, &ip_tbl_ptr->ip.ipv6_addr, + addr_str, sizeof(addr_str)); + info(" ipv6_addr: %s", addr_str); + } + } else { + error("Unsupported adapter_type: %s", + _adapter_type_str(adapter_type)); + } + info(" ------"); + } + info("--End NRT table--"); +} + +/* Used by: slurmd, slurmctld */ +static void +_print_jobinfo(slurm_nrt_jobinfo_t *j) +{ + int i; + char buf[128]; + nrt_adapter_t adapter_type; + + assert(j); + assert(j->magic == NRT_JOBINFO_MAGIC); + + info("--Begin Jobinfo--"); + info(" job_key: %u", j->job_key); + info(" bulk_xfer: %hu", j->bulk_xfer); + info(" bulk_xfer_resources: %u", j->bulk_xfer_resources); + info(" cau_indexes: %hu", j->cau_indexes); + info(" immed_slots: %hu", j->immed_slots); + info(" ip_v4: %hu", j->ip_v4); + info(" user_space: %hu", j->user_space); + info(" tables_per_task: %hu", j->tables_per_task); + if (j->nodenames) + hostlist_ranged_string(j->nodenames, sizeof(buf), buf); + else + strcpy(buf, "(NULL)"); + info(" nodenames: %s (slurmctld internal use only)", buf); + info(" num_tasks: %d", j->num_tasks); + for (i = 0; i < j->tables_per_task; i++) { + info("--Header NRT table--"); + info(" adapter_name: %s", j->tableinfo[i].adapter_name); + info(" adapter_type: %s", + _adapter_type_str(j->tableinfo[i].adapter_type)); + info(" context_id: %u", j->tableinfo[i].context_id); + info(" network_id: %lu", j->tableinfo[i].network_id); + info(" protocol_name: %s", j->tableinfo[i].protocol_name); + info(" table_id: %u", j->tableinfo[i].table_id); + if (j->user_space) + adapter_type = j->tableinfo[i].adapter_type; + else + adapter_type = NRT_IPONLY; + _print_table(j->tableinfo[i].table, + j->tableinfo[i].table_length, adapter_type, + j->ip_v4); + } + info("--End Jobinfo--"); +} + +static void +_print_load_table(nrt_cmd_load_table_t *load_table) +{ + nrt_table_info_t *table_info = load_table->table_info; + nrt_adapter_t adapter_type; + + info("--- Begin load table ---"); + info(" num_tasks: %u", table_info->num_tasks); + info(" job_key: %u", table_info->job_key); + info(" uid: %u", (uint32_t)table_info->uid); + info(" pid: %u", (uint32_t)table_info->pid); + info(" network_id: %lu", table_info->network_id); + info(" adapter_type: %s",_adapter_type_str(table_info->adapter_type)); + info(" is_user_space: %d", (int)table_info->is_user_space); + info(" is_ipv4: %hu", (int)table_info->is_ipv4); + info(" context_id: %u", table_info->context_id); + info(" table_id: %u", table_info->table_id); + info(" job_name: %s", table_info->job_name); + info(" protocol_name: %s", table_info->protocol_name); + info(" use_bulk_transfer: %hu", (int)table_info->use_bulk_transfer); + info(" bulk_transfer_resources: %u", + table_info->bulk_transfer_resources); + info(" immed_send_slots_per_win: %u", + table_info->immed_send_slots_per_win); + info(" num_cau_indexes: %u", table_info->num_cau_indexes); + if (table_info->is_user_space) + adapter_type = table_info->adapter_type; + else + adapter_type = NRT_IPONLY; + _print_table(load_table->per_task_input, table_info->num_tasks, + adapter_type, table_info->is_ipv4); + info("--- End load table ---"); +} + +static slurm_nrt_libstate_t * +_alloc_libstate(void) +{ + slurm_nrt_libstate_t *tmp; + + tmp = (slurm_nrt_libstate_t *) xmalloc(sizeof(slurm_nrt_libstate_t)); + tmp->magic = NRT_LIBSTATE_MAGIC; + tmp->node_count = 0; + tmp->node_max = 0; + tmp->node_list = NULL; + tmp->hash_max = 0; + tmp->hash_table = NULL; + /* Start key from random point, old key values are cached, + * which seems to prevent re-use for a while */ + tmp->key_index = (nrt_job_key_t) time(NULL); + + return tmp; +} + +/* Allocate and initialize memory for the persistent libstate. + * + * Used by: slurmctld + */ +extern int +nrt_init(void) +{ + slurm_nrt_libstate_t *tmp; + + tmp = _alloc_libstate(); + _lock(); + assert(!nrt_state); + nrt_state = tmp; + _unlock(); + + return SLURM_SUCCESS; +} + +extern int +nrt_slurmctld_init(void) +{ + /* No op */ + return SLURM_SUCCESS; +} + +extern int +nrt_slurmd_init(void) +{ + /* + * This is a work-around for the nrt_* functions calling umask(0) + */ + nrt_umask = umask(0077); + umask(nrt_umask); + + return SLURM_SUCCESS; +} + +extern int +nrt_slurmd_step_init(void) +{ + /* + * This is a work-around for the nrt_* functions calling umask(0) + */ + nrt_umask = umask(0077); + umask(nrt_umask); + + _init_adapter_cache(); + _fill_in_adapter_cache(); + + return SLURM_SUCCESS; +} + +/* Used by: slurmd, slurmctld */ +extern int +nrt_alloc_jobinfo(slurm_nrt_jobinfo_t **j) +{ + slurm_nrt_jobinfo_t *new; + + assert(j != NULL); + new = (slurm_nrt_jobinfo_t *) xmalloc(sizeof(slurm_nrt_jobinfo_t)); + new->magic = NRT_JOBINFO_MAGIC; + new->job_key = (nrt_job_key_t) -1; + *j = new; + + return 0; +} + +/* Used by: slurmd, slurmctld */ +extern int +nrt_alloc_nodeinfo(slurm_nrt_nodeinfo_t **n) +{ + slurm_nrt_nodeinfo_t *new; + + assert(n); + + new = (slurm_nrt_nodeinfo_t *) xmalloc(sizeof(slurm_nrt_nodeinfo_t)); + new->adapter_list = (slurm_nrt_adapter_t *) + xmalloc(sizeof(slurm_nrt_adapter_t) * + NRT_MAX_ADAPTER_TYPES * NRT_MAX_ADAPTERS_PER_TYPE); + new->magic = NRT_NODEINFO_MAGIC; + new->adapter_count = 0; + new->next = NULL; + + *n = new; + + return 0; +} + +static int +_get_adapters(slurm_nrt_nodeinfo_t *n) +{ + int err, i, j, k, rc = SLURM_SUCCESS; + nrt_cmd_query_adapter_types_t adapter_types; + unsigned int num_adapter_types; + nrt_adapter_t adapter_type[NRT_MAX_ADAPTER_TYPES]; + nrt_cmd_query_adapter_names_t adapter_names; + unsigned int max_windows, num_adapter_names; + nrt_cmd_status_adapter_t adapter_status; + nrt_cmd_query_adapter_info_t query_adapter_info; + nrt_adapter_info_t adapter_info; + nrt_status_t *status_array = NULL; + nrt_window_id_t window_count; + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("_get_adapters: begin"); + + adapter_types.num_adapter_types = &num_adapter_types; + adapter_types.adapter_types = adapter_type; + adapter_info.window_list = NULL; + for (i = 0; i < 2; i++) { + err = nrt_command(NRT_VERSION, NRT_CMD_QUERY_ADAPTER_TYPES, + &adapter_types); + if (err != NRT_EAGAIN) + break; + error("nrt_command(adapter_types): %s", nrt_err_str(err)); + error("Is PNSD daemon started? Retrying..."); + /* Run "/opt/ibmhpc/pecurrent/ppe.pami/pnsd/pnsd -A" */ + sleep(5); + } + if (err != NRT_SUCCESS) { + error("nrt_command(adapter_types): %s", nrt_err_str(err)); + return SLURM_ERROR; + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + for (i = 0; i < num_adapter_types; i++) { + info("nrt_command(adapter_types): %s", + _adapter_type_str(adapter_types.adapter_types[i])); + } + } + + for (i = 0; i < num_adapter_types; i++) { + adapter_names.adapter_type = adapter_type[i]; + adapter_names.num_adapter_names = &num_adapter_names; + adapter_names.max_windows = &max_windows; + err = nrt_command(NRT_VERSION, NRT_CMD_QUERY_ADAPTER_NAMES, + &adapter_names); + if (err != NRT_SUCCESS) { + error("nrt_command(adapter_names, %s): %s", + _adapter_type_str(adapter_names.adapter_type), + nrt_err_str(err)); + rc = SLURM_ERROR; + continue; + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + for (j = 0; j < num_adapter_names; j++) { + info("nrt_command(adapter_names, %s, %s) " + "max_windows: %hu", + adapter_names.adapter_names[j], + _adapter_type_str(adapter_names. + adapter_type), + max_windows); + } + } + for (j = 0; j < num_adapter_names; j++) { + slurm_nrt_adapter_t *adapter_ptr; + if (status_array) { + free(status_array); + status_array = NULL; + } + adapter_status.adapter_name = adapter_names. + adapter_names[j]; + adapter_status.adapter_type = adapter_names. + adapter_type; + adapter_status.status_array = &status_array; + adapter_status.window_count = &window_count; + err = nrt_command(NRT_VERSION, NRT_CMD_STATUS_ADAPTER, + &adapter_status); + if (err != NRT_SUCCESS) { + error("nrt_command(status_adapter, %s, %s): %s", + adapter_status.adapter_name, + _adapter_type_str(adapter_status. + adapter_type), + nrt_err_str(err)); + rc = SLURM_ERROR; + continue; + } + if (window_count > max_windows) { + /* This happens if IP_ONLY devices are + * allocated with tables_per_task > 0 */ + error("nrt_command(status_adapter, %s, %s): " + "window_count > max_windows (%u > %hu)", + adapter_status.adapter_name, + _adapter_type_str(adapter_status. + adapter_type), + window_count, max_windows); + /* Reset value to avoid logging bad data */ + window_count = max_windows; + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_command(status_adapter, %s, %s)", + adapter_status.adapter_name, + _adapter_type_str(adapter_status. + adapter_type)); + _print_adapter_status(&adapter_status); + } + adapter_ptr = &n->adapter_list[n->adapter_count]; + strncpy(adapter_ptr->adapter_name, + adapter_status.adapter_name, + NRT_MAX_ADAPTER_NAME_LEN); + adapter_ptr->adapter_type = adapter_status. + adapter_type; + adapter_ptr->window_count = adapter_status. + window_count[0]; + adapter_ptr->window_list = + xmalloc(sizeof(slurm_nrt_window_t) * + window_count); + n->adapter_count++; + for (k = 0; k < window_count; k++) { + slurm_nrt_window_t *window_ptr; + window_ptr = adapter_ptr->window_list + k; + window_ptr->window_id = status_array[k]. + window_id; + window_ptr->state = status_array[k].state; + /* window_ptr->job_key = Not_Available */ + } + + /* Now get adapter info (port_id, network_id, etc.) */ + query_adapter_info.adapter_name = adapter_names. + adapter_names[j]; + query_adapter_info.adapter_type = adapter_names. + adapter_type; + query_adapter_info.adapter_info = &adapter_info; + adapter_info.window_list = xmalloc(max_windows * + sizeof(nrt_window_id_t)); + err = nrt_command(NRT_VERSION, + NRT_CMD_QUERY_ADAPTER_INFO, + &query_adapter_info); + if (err != NRT_SUCCESS) { + error("nrt_command(adapter_into, %s, %s): %s", + query_adapter_info.adapter_name, + _adapter_type_str(query_adapter_info. + adapter_type), + nrt_err_str(err)); + rc = SLURM_ERROR; + continue; + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_command(adapter_info, %s, %s)", + query_adapter_info.adapter_name, + _adapter_type_str(query_adapter_info. + adapter_type)); + _print_adapter_info(&adapter_info); + } + if (adapter_info.node_number != 0) + n->node_number = adapter_info.node_number; + adapter_ptr->cau_indexes_avail = + adapter_info.cau_indexes_avail; + adapter_ptr->immed_slots_avail = + adapter_info.immed_slots_avail; + adapter_ptr->rcontext_block_count = + adapter_info.rcontext_block_count; + for (k = 0; k < adapter_info.num_ports; k++) { + if (adapter_info.port[k].status != 1) + continue; + adapter_ptr->ipv4_addr = adapter_info.port[k]. + ipv4_addr; + adapter_ptr->ipv6_addr = adapter_info.port[k]. + ipv6_addr; + adapter_ptr->lid = adapter_info.port[k].lid; + adapter_ptr->network_id = adapter_info.port[k]. + network_id; + adapter_ptr->port_id = adapter_info.port[k]. + port_id; + adapter_ptr->special = adapter_info.port[k]. + special; + break; + } + if ((adapter_ptr->ipv4_addr == 0) && + (adapter_info.num_ports > 0)) { + adapter_ptr->ipv4_addr = adapter_info.port[0]. + ipv4_addr; + adapter_ptr->ipv6_addr = adapter_info.port[0]. + ipv6_addr; + } + } + xfree(adapter_info.window_list); + } + if (status_array) + free(status_array); + if (debug_flags & DEBUG_FLAG_SWITCH) { + _print_nodeinfo(n); + info("_get_adapters: complete: %d", rc); + } + return rc; +} + +/* Assumes a pre-allocated nodeinfo structure and uses _get_adapters + * to do the dirty work. We probably collect more information about + * the adapters on a give node than we need to, but it was done + * in the interest of being prepared for future requirements. + * + * Used by: slurmd + */ +extern int +nrt_build_nodeinfo(slurm_nrt_nodeinfo_t *n, char *name) +{ + int err; + + assert(n); + assert(n->magic == NRT_NODEINFO_MAGIC); + assert(name); + + strncpy(n->name, name, NRT_HOSTLEN); + _lock(); + err = _get_adapters(n); + _unlock(); + + return err; +} + +/* Used by: all */ +extern int +nrt_pack_nodeinfo(slurm_nrt_nodeinfo_t *n, Buf buf) +{ + slurm_nrt_adapter_t *a; + uint16_t dummy16; + int i, j, offset; + + assert(n); + assert(n->magic == NRT_NODEINFO_MAGIC); + assert(buf); + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_pack_nodeinfo():"); + _print_nodeinfo(n); + } + offset = get_buf_offset(buf); + pack32(n->magic, buf); + packmem(n->name, NRT_HOSTLEN, buf); + pack32(n->node_number, buf); + pack32(n->adapter_count, buf); + for (i = 0; i < n->adapter_count; i++) { + a = n->adapter_list + i; + packmem(a->adapter_name, NRT_MAX_ADAPTER_NAME_LEN, buf); + dummy16 = a->adapter_type; + pack16(dummy16, buf); /* adapter_type is an int */ + pack16(a->cau_indexes_avail, buf); + pack16(a->immed_slots_avail, buf); + pack32(a->ipv4_addr, buf); + for (j = 0; j < 16; j++) + pack8(a->ipv6_addr.s6_addr[j], buf); + pack32(a->lid, buf); + pack64(a->network_id, buf); + pack8(a->port_id, buf); + pack64(a->rcontext_block_count, buf); + pack64(a->special, buf); + pack16(a->window_count, buf); + for (j = 0; j < a->window_count; j++) { + uint32_t state = a->window_list[j].state; + pack16(a->window_list[j].window_id, buf); + pack32(state, buf); + pack32(a->window_list[j].job_key, buf); + } + } + + return(get_buf_offset(buf) - offset); +} + +/* Used by: all */ +static int +_copy_node(slurm_nrt_nodeinfo_t *dest, slurm_nrt_nodeinfo_t *src) +{ + int i, j; + slurm_nrt_adapter_t *sa = NULL; + slurm_nrt_adapter_t *da = NULL; + + assert(dest); + assert(src); + assert(dest->magic == NRT_NODEINFO_MAGIC); + assert(src->magic == NRT_NODEINFO_MAGIC); + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("_copy_node():"); + _print_nodeinfo(src); + } + + strncpy(dest->name, src->name, NRT_HOSTLEN); + dest->node_number = src->node_number; + dest->adapter_count = src->adapter_count; + for (i = 0; i < dest->adapter_count; i++) { + sa = src->adapter_list + i; + da = dest->adapter_list +i; + strncpy(da->adapter_name, sa->adapter_name, + NRT_MAX_ADAPTER_NAME_LEN); + da->adapter_type = sa->adapter_type; + da->cau_indexes_avail = sa->cau_indexes_avail; + da->immed_slots_avail = sa->immed_slots_avail; + da->ipv4_addr = sa->ipv4_addr; + da->ipv6_addr = sa->ipv6_addr; + da->lid = sa->lid; + da->network_id = sa->network_id; + da->port_id = sa->port_id; + da->rcontext_block_count = sa->rcontext_block_count; + da->special = sa->special; + da->window_count = sa->window_count; + da->window_list = (slurm_nrt_window_t *) + xmalloc(sizeof(slurm_nrt_window_t) * + da->window_count); + for (j = 0; j < da->window_count; j++) { + da->window_list[j].window_id = sa->window_list[j]. + window_id; + da->window_list[j].state = sa->window_list[j].state; + da->window_list[j].job_key = sa->window_list[j]. + job_key; + } + } + + return SLURM_SUCCESS; +} + +static int +_cmp_ipv6(struct in6_addr *addr1, struct in6_addr *addr2) +{ + int i; + + for (i = 0; i < 16; i++) { + if (addr1->s6_addr[i] != addr2->s6_addr[i]) + return 1; + } + + return 0; +} + +/* Throw away adapter window portion of the nodeinfo. + * + * Used by: _unpack_nodeinfo + */ +static int +_fake_unpack_adapters(Buf buf, slurm_nrt_nodeinfo_t *n) +{ + slurm_nrt_adapter_t *tmp_a = NULL; + uint16_t dummy16; + uint32_t dummy32; + char *name_ptr; + uint8_t port_id; + uint16_t adapter_type, cau_indexes_avail, immed_slots_avail; + uint16_t window_count; + uint32_t adapter_count, ipv4_addr, lid; + uint64_t network_id, rcontext_block_count, special; + struct in6_addr ipv6_addr; + int i, j, k; + + safe_unpack32(&adapter_count, buf); + for (i = 0; i < adapter_count; i++) { + safe_unpackmem_ptr(&name_ptr, &dummy32, buf); + if (dummy32 != NRT_MAX_ADAPTER_NAME_LEN) + goto unpack_error; + safe_unpack16(&adapter_type, buf); + safe_unpack16(&cau_indexes_avail, buf); + safe_unpack16(&immed_slots_avail, buf); + safe_unpack32(&ipv4_addr, buf); + for (j = 0; j < 16; j++) + safe_unpack8(&ipv6_addr.s6_addr[j], buf); + safe_unpack32(&lid, buf); + safe_unpack64(&network_id, buf); + safe_unpack8 (&port_id, buf); + safe_unpack64(&rcontext_block_count, buf); + safe_unpack64(&special, buf); + safe_unpack16(&window_count, buf); + + /* no copy, just advances buf counters */ + for (j = 0; j < window_count; j++) { + safe_unpack16(&dummy16, buf); + safe_unpack32(&dummy32, buf); + safe_unpack32(&dummy32, buf); + } + + for (j = 0; j < n->adapter_count; j++) { + tmp_a = n->adapter_list + j; + if (strcmp(tmp_a->adapter_name, name_ptr)) + continue; + if (tmp_a->cau_indexes_avail != cau_indexes_avail) { + info("switch/nrt: resetting cau_indexes_avail " + "on node %s adapter %s", + n->name, tmp_a->adapter_name); + tmp_a->cau_indexes_avail = cau_indexes_avail; + } + if (tmp_a->immed_slots_avail != immed_slots_avail) { + info("switch/nrt: resetting immed_slots_avail " + "on node %s adapter %s", + n->name, tmp_a->adapter_name); + tmp_a->immed_slots_avail = immed_slots_avail; + } + if (tmp_a->ipv4_addr != ipv4_addr) { + info("switch/nrt: resetting ipv4_addr " + "on node %s adapter %s", + n->name, tmp_a->adapter_name); + tmp_a->ipv4_addr = ipv4_addr; + } + if (_cmp_ipv6(&tmp_a->ipv6_addr, &ipv6_addr) != 0) { + info("switch/nrt: resetting ipv6_addr " + "on node %s adapter %s", + n->name, tmp_a->adapter_name); + for (k = 0; k < 16; k++) { + tmp_a->ipv6_addr.s6_addr[k] = + ipv6_addr.s6_addr[k]; + } + } + if (tmp_a->lid != lid) { + info("switch/nrt: resetting lid " + "on node %s adapter %s", + n->name, tmp_a->adapter_name); + tmp_a->lid = lid; + } + if (tmp_a->network_id != network_id) { + info("switch/nrt: resetting network_id " + "on node %s adapter %s", + n->name, tmp_a->adapter_name); + tmp_a->network_id = network_id; + } + if (tmp_a->port_id != port_id) { + info("switch/nrt: resetting port_id " + "on node %s adapter %s", + n->name, tmp_a->adapter_name); + tmp_a->port_id = port_id; + } + if (tmp_a->rcontext_block_count != + rcontext_block_count) { + info("switch/nrt: resetting " + "rcontext_block_count on node %s " + "adapter %s", + n->name, tmp_a->adapter_name); + tmp_a->rcontext_block_count = + rcontext_block_count; + } + break; + } + } + + return SLURM_SUCCESS; + +unpack_error: + return SLURM_ERROR; +} + + +/* Unpack nodeinfo and update persistent libstate. + * + * If believe_window_status is true, we honor the window status variables + * from the packed nrt_nodeinfo_t. If it is false we set the status of + * all windows to NRT_WIN_AVAILABLE. + * + * Used by: slurmctld + */ +static int +_unpack_nodeinfo(slurm_nrt_nodeinfo_t *n, Buf buf, bool believe_window_status) +{ + int i, j, rc = SLURM_SUCCESS; + slurm_nrt_adapter_t *tmp_a = NULL; + slurm_nrt_window_t *tmp_w = NULL; + nrt_node_number_t node_number; + uint32_t size; + slurm_nrt_nodeinfo_t *tmp_n = NULL; + char *name_ptr, name[NRT_HOSTLEN]; + uint32_t magic; + uint16_t dummy16; + + /* NOTE! We don't care at this point whether n is valid. + * If it's NULL, we will just forego the copy at the end. + */ + assert(buf); + + /* Extract node name from buffer + */ + safe_unpack32(&magic, buf); + if (magic != NRT_NODEINFO_MAGIC) + slurm_seterrno_ret(EBADMAGIC_NRT_NODEINFO); + safe_unpackmem_ptr(&name_ptr, &size, buf); + if (size != NRT_HOSTLEN) + goto unpack_error; + memcpy(name, name_ptr, size); + safe_unpack32(&node_number, buf); + + /* When the slurmctld is in normal operating mode (NOT backup mode), + * the global nrt_state structure should NEVER be NULL at the time that + * this function is called. Therefore, if nrt_state is NULL here, + * we assume that the controller is in backup mode. In backup mode, + * the slurmctld only unpacks RPCs to find out their identity. + * Most of the RPCs, including the one calling this function, are + * simply ignored. + * + * So, here we just do a fake unpack to advance the buffer pointer. + */ + if (nrt_state == NULL) { + if (_fake_unpack_adapters(buf, NULL) != SLURM_SUCCESS) { + slurm_seterrno_ret(EUNPACK); + } else { + return SLURM_SUCCESS; + } + } + + /* If we already have nodeinfo for this node, we ignore this message. + * The slurmctld's view of window allocation is always better than + * the slurmd's view. We only need the slurmd's view if the slurmctld + * has no nodeinfo at all for that node. + */ + if (name != NULL) { + tmp_n = _find_node(nrt_state, name); + if (tmp_n != NULL) { + tmp_n->node_number = node_number; + if (_fake_unpack_adapters(buf, tmp_n) != + SLURM_SUCCESS) { + slurm_seterrno_ret(EUNPACK); + } else { + goto copy_node; + } + } + } + + /* + * Update global libstate with this nodes' info. + */ + tmp_n = _alloc_node(nrt_state, name); + if (tmp_n == NULL) + return SLURM_ERROR; + tmp_n->magic = magic; + tmp_n->node_number = node_number; + safe_unpack32(&tmp_n->adapter_count, buf); + if (tmp_n->adapter_count > NRT_MAXADAPTERS) { + error("switch/nrt: More adapters found on node %s than " + "supported. Increase NRT_MAXADAPTERS and rebuild slurm", + name); + tmp_n->adapter_count = NRT_MAXADAPTERS; + } + for (i = 0; i < tmp_n->adapter_count; i++) { + tmp_a = tmp_n->adapter_list + i; + safe_unpackmem_ptr(&name_ptr, &size, buf); + if (size != NRT_MAX_ADAPTER_NAME_LEN) + goto unpack_error; + memcpy(tmp_a->adapter_name, name_ptr, size); + safe_unpack16(&dummy16, buf); + tmp_a->adapter_type = dummy16; /* adapter_type is an int */ + safe_unpack16(&tmp_a->cau_indexes_avail, buf); + safe_unpack16(&tmp_a->immed_slots_avail, buf); + safe_unpack32(&tmp_a->ipv4_addr, buf); + for (j = 0; j < 16; j++) { + safe_unpack8(&tmp_a->ipv6_addr.s6_addr[j], buf); + } + safe_unpack32(&tmp_a->lid, buf); + safe_unpack64(&tmp_a->network_id, buf); + safe_unpack8(&tmp_a->port_id, buf); + safe_unpack64(&tmp_a->rcontext_block_count, buf); + safe_unpack64(&tmp_a->special, buf); + safe_unpack16(&tmp_a->window_count, buf); + tmp_w = (slurm_nrt_window_t *) + xmalloc(sizeof(slurm_nrt_window_t) * + tmp_a->window_count); + for (j = 0; j < tmp_a->window_count; j++) { + safe_unpack16(&tmp_w[j].window_id, buf); + safe_unpack32(&tmp_w[j].state, buf); + safe_unpack32(&tmp_w[j].job_key, buf); + if (!believe_window_status) { + tmp_w[j].state = NRT_WIN_AVAILABLE; + tmp_w[j].job_key = 0; + } + } + tmp_a->window_list = tmp_w; + tmp_w = NULL; /* don't free if unpack error on next adapter */ + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("_unpack_nodeinfo"); + _print_nodeinfo(tmp_n); + } + +copy_node: + /* Only copy the node_info structure if the caller wants it */ + if ((n != NULL) && (_copy_node(n, tmp_n) != SLURM_SUCCESS)) + rc = SLURM_ERROR; + return rc; + +unpack_error: + xfree(tmp_w); + slurm_seterrno_ret(EUNPACK); +} + +/* Unpack nodeinfo and update persistent libstate. + * + * Used by: slurmctld + */ +extern int +nrt_unpack_nodeinfo(slurm_nrt_nodeinfo_t *n, Buf buf) +{ + int rc; + + _lock(); + rc = _unpack_nodeinfo(n, buf, false); + _unlock(); + return rc; +} + +/* Used by: slurmd, slurmctld */ +extern void +nrt_free_nodeinfo(slurm_nrt_nodeinfo_t *n, bool ptr_into_array) +{ + slurm_nrt_adapter_t *adapter; + int i; + + if (!n) + return; + + assert(n->magic == NRT_NODEINFO_MAGIC); + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_free_nodeinfo"); + _print_nodeinfo(n); + } + + if (n->adapter_list) { + adapter = n->adapter_list; + for (i = 0; i < n->adapter_count; i++) + xfree(adapter[i].window_list); + xfree(n->adapter_list); + } + if (!ptr_into_array) + xfree(n); +} + +/* Find all of the windows used by job step "jp" on the hosts + * designated in hostlist "hl" and mark their state NRT_WIN_AVAILABLE. + * + * Used by: slurmctld + */ +extern int +nrt_job_step_complete(slurm_nrt_jobinfo_t *jp, hostlist_t hl) +{ + hostlist_t uniq_hl; + hostlist_iterator_t hi; + char *node_name; + + xassert(!hostlist_is_empty(hl)); + xassert(jp); + xassert(jp->magic == NRT_JOBINFO_MAGIC); + + if ((jp == NULL) || (hostlist_is_empty(hl))) + return SLURM_ERROR; + + if ((jp->tables_per_task == 0) || (jp->tableinfo == NULL) || + (jp->tableinfo[0].table_length == 0)) + return SLURM_SUCCESS; + + /* The hl hostlist may contain duplicate node_names (poe -hostfile + * triggers duplicates in the hostlist). Since there + * is no reason to call _free_resources_by_job more than once + * per node_name, we create a new unique hostlist. + */ + uniq_hl = hostlist_copy(hl); + hostlist_uniq(uniq_hl); + hi = hostlist_iterator_create(uniq_hl); + + _lock(); + if (nrt_state != NULL) { + while ((node_name = hostlist_next(hi)) != NULL) { + _free_resources_by_job(jp, node_name); + free(node_name); + } + } else { /* nrt_state == NULL */ + /* If there is no state at all, the job is already cleaned + * up. :) This should really only happen when the backup + * controller is calling job_fini() just before it takes over + * the role of active controller. + */ + debug("nrt_job_step_complete called when nrt_state == NULL"); + } + _unlock(); + + hostlist_iterator_destroy(hi); + hostlist_destroy(uniq_hl); + return SLURM_SUCCESS; +} + +/* Find all of the windows used by job step "jp" and mark their + * state NRT_WIN_UNAVAILABLE. + * + * Used by the slurmctld at startup time to restore the allocation + * status of any job steps that were running at the time the previous + * slurmctld was shutdown. Also used to restore the allocation + * status after a call to switch_clear(). + */ +extern int +nrt_job_step_allocated(slurm_nrt_jobinfo_t *jp, hostlist_t hl) +{ + int rc; + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_job_step_allocated: resetting window state"); + _print_jobinfo(jp); + } + + rc = _job_step_window_state(jp, hl, NRT_WIN_UNAVAILABLE); + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_job_step_allocated: window state reset complete"); + _print_libstate(nrt_state); + } + + return rc; +} + +/* Assign a unique key to each job. The key is used later to + * gain access to the network table loaded on each node of a job. + * + * Used by: slurmctld + */ +static nrt_job_key_t +_next_key(void) +{ + nrt_job_key_t key; + + assert(nrt_state); + + _lock(); + key = nrt_state->key_index; + if (key == 0) + key++; + nrt_state->key_index = (nrt_job_key_t) (key + 1); + _unlock(); + + return key; +} + +/* Translate a protocol string (e.g. "lapi,mpi" into a table. + * Caller must free returned value. */ +static nrt_protocol_table_t *_get_protocol_table(char *protocol) +{ + nrt_protocol_table_t *protocol_table; + char *protocol_str, *save_ptr = NULL, *token; + int i; + + protocol_table = xmalloc(sizeof(nrt_protocol_table_t)); + + if (!protocol) + protocol = "mpi"; + protocol_str = xstrdup(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)) + break; + } + if ((i >= protocol_table->protocol_table_cnt) && + (i < NRT_MAX_PROTO_CNT)) { + /* Need to add new protocol type */ + strncpy(protocol_table->protocol_table[i].protocol_name, + token, NRT_MAX_PROTO_NAME_LEN); + protocol_table->protocol_table_cnt++; + } + token = strtok_r(NULL, ",", &save_ptr); + } + xfree(protocol_str); + + return protocol_table; +} + +/* For an adapter type, return it's relative priority to use as a default */ +static inline int +_adapter_type_pref(nrt_adapter_t adapter_type) +{ + if (adapter_type == NRT_IPONLY) + return 9; + if (adapter_type == NRT_HFI) + return 8; + if (adapter_type == NRT_IB) + return 7; + if (adapter_type == NRT_HPCE) + return 6; + if (adapter_type == NRT_KMUX) + return 5; + return 0; +} + +/* Setup everything for the job. Assign tasks across + * nodes based on the hostlist given and create the network table used + * on all nodes of the job. + * + * Used by: slurmctld + */ +extern int +nrt_build_jobinfo(slurm_nrt_jobinfo_t *jp, hostlist_t hl, + uint16_t *tasks_per_node, uint32_t **tids, bool sn_all, + char *adapter_name, nrt_adapter_t dev_type, + bool bulk_xfer, uint32_t bulk_xfer_resources, + bool ip_v4, bool user_space, char *protocol, int instances, + int cau, int immed) +{ + int nnodes, nprocs = 0; + hostlist_iterator_t hi; + char *host = NULL; + int i, j; + slurm_nrt_nodeinfo_t *node; + int rc; + nrt_adapter_t adapter_type = NRT_MAX_ADAPTER_TYPES; + int network_id = -1; + nrt_protocol_table_t *protocol_table = NULL; + nrt_adapter_t def_adapter_type = NRT_ADAP_UNSUPPORTED; + int def_adapter_count = 0; + int def_adapter_inx = -1; + + assert(jp); + assert(jp->magic == NRT_JOBINFO_MAGIC); + assert(tasks_per_node); + + if (dev_type != NRT_MAX_ADAPTER_TYPES) + adapter_type = dev_type; + + nnodes = hostlist_count(hl); + for (i = 0; i < nnodes; i++) + nprocs += tasks_per_node[i]; + + if ((nnodes <= 0) || (nprocs <= 0)) + slurm_seterrno_ret(EINVAL); + + jp->bulk_xfer = (uint8_t) bulk_xfer; + jp->bulk_xfer_resources = bulk_xfer_resources; + jp->cau_indexes = (uint16_t) cau; + jp->immed_slots = (uint16_t) immed; + jp->ip_v4 = (uint8_t) ip_v4; + jp->job_key = _next_key(); + jp->nodenames = hostlist_copy(hl); + jp->num_tasks = nprocs; + jp->user_space = (uint8_t) user_space; + + /* + * Peek at the first host to figure out tables_per_task and adapter + * type. This driver assumes that all nodes have the same number of + * adapters per node. Bad things will happen if this assumption is + * incorrect. + */ + hi = hostlist_iterator_create(hl); + host = hostlist_next(hi); + _lock(); + node = _find_node(nrt_state, host); + if (host != NULL) + free(host); + if (node && node->adapter_list) { + for (i = 0; i < node->adapter_count; i++) { + nrt_adapter_t ad_type; + /* Match specific adapter name */ + if (adapter_name && + strcmp(adapter_name, + node->adapter_list[i].adapter_name)) { + continue; + } + /* Match specific adapter type (IB, HFI, etc) */ + ad_type = node->adapter_list[i].adapter_type; + if ((adapter_type != NRT_MAX_ADAPTER_TYPES) && + (adapter_type != ad_type)) + continue; + if (jp->user_space && (ad_type == NRT_IPONLY)) + continue; + + /* Identify highest-priority adapter type */ + if (_adapter_type_pref(def_adapter_type) < + _adapter_type_pref(ad_type)) { + def_adapter_type = ad_type; + def_adapter_count = 1; + def_adapter_inx = i; + } else if (_adapter_type_pref(def_adapter_type) == + _adapter_type_pref(ad_type)) { + def_adapter_count++; + } + } + if (!sn_all && (def_adapter_count > 0)) { + if (!adapter_name) { + adapter_name = node-> + adapter_list[def_adapter_inx]. + adapter_name; + } + network_id = node->adapter_list[def_adapter_inx]. + network_id; + def_adapter_count = 1; + } + if ((adapter_type == NRT_MAX_ADAPTER_TYPES) && + (def_adapter_count > 0)) + adapter_type = def_adapter_type; + } + if (def_adapter_count >= 1) { + jp->tables_per_task = def_adapter_count; + } else { + jp->tables_per_task = 0; + info("switch/nrt: no adapter found for job"); + } + _unlock(); + if (jp->tables_per_task == 0) { + hostlist_iterator_destroy(hi); + return SLURM_FAILURE; + } + hostlist_iterator_reset(hi); + + if (adapter_type == NRT_IPONLY) { + /* Without setting tables_per_task == 0, non-existant switch + * windows are allocated resulting in some inconstencies in + * NRT's records. Specifically the IPONLY devices report their + * maximum window count is 0, but then report a non-zero + * current window count. */ + jp->tables_per_task = 0; + } + + if (instances <= 0) { + info("switch/nrt: invalid instances specification (%d)", + instances); + hostlist_iterator_destroy(hi); + return SLURM_FAILURE; + } + jp->tables_per_task *= instances; + + protocol_table = _get_protocol_table(protocol); + if ((protocol_table == NULL) || + (protocol_table->protocol_table_cnt <= 0)) { + info("switch/nrt: invalid protcol specification (%s)", + protocol); + xfree(protocol_table); + hostlist_iterator_destroy(hi); + return SLURM_FAILURE; + } + jp->tables_per_task *= protocol_table->protocol_table_cnt; + + /* Allocate memory for each nrt_tableinfo_t */ + jp->tableinfo = (nrt_tableinfo_t *) xmalloc(jp->tables_per_task * + sizeof(nrt_tableinfo_t)); + for (i = 0; i < jp->tables_per_task; i++) { + jp->tableinfo[i].table_length = nprocs; + /* jp->tableinfo[i].table allocated with windows function */ + } + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("Allocating windows: adapter_name:%s adapter_type:%s", + adapter_name, _adapter_type_str(adapter_type)); + } else { + debug("Allocating windows"); + } + + if (jp->tables_per_task) { + _lock(); + for (i = 0; i < nnodes; i++) { + host = hostlist_next(hi); + if (!host) + error("Failed to get next host"); + + for (j = 0; j < tasks_per_node[i]; j++) { + + if (adapter_name == NULL) { + rc = _allocate_windows_all(jp, host, i, + tids[i][j], + adapter_type, + network_id, + protocol_table, + instances); + } else { + rc = _allocate_window_single( + adapter_name, + jp, host, i, + tids[i][j], + adapter_type, + network_id, + protocol_table, + instances); + } + if (rc != SLURM_SUCCESS) { + _unlock(); + goto fail; + } + } + free(host); + } + _unlock(); + } + + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_build_jobinfo"); + _print_jobinfo(jp); + } + + hostlist_iterator_destroy(hi); + xfree(protocol_table); + return SLURM_SUCCESS; + +fail: + free(host); + hostlist_iterator_destroy(hi); + xfree(protocol_table); + (void) nrt_job_step_complete(jp, hl); /* Release resources already + * allocated */ + /* slurmctld will call nrt_free_jobinfo(jp) to free memory */ + return SLURM_FAILURE; +} + +static void +_pack_tableinfo(nrt_tableinfo_t *tableinfo, Buf buf, slurm_nrt_jobinfo_t *jp) +{ + uint32_t adapter_type; + bool ip_v4; + int i, j; + + xassert(tableinfo); + xassert(jp); + + ip_v4 = jp->ip_v4; + packmem(tableinfo->adapter_name, NRT_MAX_ADAPTER_NAME_LEN, buf); + adapter_type = tableinfo->adapter_type; + pack32(adapter_type, buf); + pack16(tableinfo->context_id, buf); + pack64(tableinfo->network_id, buf); + packmem(tableinfo->protocol_name, NRT_MAX_PROTO_NAME_LEN, buf); + if (!jp->user_space) + adapter_type = NRT_IPONLY; + pack16(tableinfo->table_id, buf); + pack32(tableinfo->table_length, buf); + + if (adapter_type == NRT_IB) { + nrt_ib_task_info_t *ib_tbl_ptr; + for (i = 0, ib_tbl_ptr = tableinfo->table; + i < tableinfo->table_length; + i++, ib_tbl_ptr++) { + packmem(ib_tbl_ptr->device_name, + NRT_MAX_DEVICENAME_SIZE, buf); + pack32(ib_tbl_ptr->base_lid, buf); + pack8(ib_tbl_ptr->lmc, buf); + pack32(ib_tbl_ptr->node_number, buf); + pack8(ib_tbl_ptr->port_id, buf); + pack32(ib_tbl_ptr->task_id, buf); + pack16(ib_tbl_ptr->win_id, buf); + } + } else if (adapter_type == NRT_IPONLY) { + nrt_ip_task_info_t *ip_tbl_ptr; + for (i = 0, ip_tbl_ptr = tableinfo->table; + i < tableinfo->table_length; + i++, ip_tbl_ptr++) { + if (ip_v4) { + packmem((char *) &ip_tbl_ptr->ip.ipv4_addr, + sizeof(in_addr_t), buf); + } else { + for (j = 0; j < 16; j++) { + pack8(ip_tbl_ptr->ip.ipv6_addr. + s6_addr[j], buf); + } + } + pack32(ip_tbl_ptr->node_number, buf); + pack16(ip_tbl_ptr->reserved, buf); + pack32(ip_tbl_ptr->task_id, buf); + } + } else if (adapter_type == NRT_HFI) { + nrt_hfi_task_info_t *hfi_tbl_ptr; + for (i = 0, hfi_tbl_ptr = tableinfo->table; + i < tableinfo->table_length; + i++, hfi_tbl_ptr++) { + uint16_t tmp_16; + uint8_t tmp_8; + pack32(hfi_tbl_ptr->task_id, buf); + tmp_16 = hfi_tbl_ptr->lid; + pack16(tmp_16, buf); + tmp_8 = hfi_tbl_ptr->win_id; + pack8(tmp_8, buf); + } + } else if ((adapter_type == NRT_HPCE) || (adapter_type == NRT_KMUX)) { + nrt_hpce_task_info_t *hpce_tbl_ptr; + for (i = 0, hpce_tbl_ptr = tableinfo->table; + i < tableinfo->table_length; + i++, hpce_tbl_ptr++) { + pack32(hpce_tbl_ptr->task_id, buf); + pack16(hpce_tbl_ptr->win_id, buf); + pack32(hpce_tbl_ptr->node_number, buf); + packmem(hpce_tbl_ptr->device_name, + NRT_MAX_DEVICENAME_SIZE, buf); + } + } else { + error("_pack_tableinfo: Missing support for adapter type %s", + _adapter_type_str(adapter_type)); + } +} + +/* Used by: all */ +extern int +nrt_pack_jobinfo(slurm_nrt_jobinfo_t *j, Buf buf) +{ + int i; + + assert(j); + assert(j->magic == NRT_JOBINFO_MAGIC); + assert(buf); + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_pack_jobinfo:"); + _print_jobinfo(j); + } + + pack32(j->magic, buf); + pack32(j->job_key, buf); + pack8(j->bulk_xfer, buf); + pack32(j->bulk_xfer_resources, buf); + pack16(j->cau_indexes, buf); + pack16(j->immed_slots, buf); + pack8(j->ip_v4, buf); + pack8(j->user_space, buf); + pack16(j->tables_per_task, buf); + pack32(j->num_tasks, buf); + + for (i = 0; i < j->tables_per_task; i++) + _pack_tableinfo(&j->tableinfo[i], buf, j); + + return SLURM_SUCCESS; +} + +/* return 0 on success, -1 on failure */ +static int +_unpack_tableinfo(nrt_tableinfo_t *tableinfo, Buf buf, slurm_nrt_jobinfo_t *jp) +{ + uint32_t tmp_32, adapter_type; + uint16_t tmp_16; + uint8_t tmp_8; + char *name_ptr; + int i, j; + bool ip_v4; + + xassert(jp); + xassert(tableinfo); + + safe_unpackmem_ptr(&name_ptr, &tmp_32, buf); + if (tmp_32 != NRT_MAX_ADAPTER_NAME_LEN) + goto unpack_error; + memcpy(tableinfo->adapter_name, name_ptr, tmp_32); + safe_unpack32(&adapter_type, buf); + tableinfo->adapter_type = (int) adapter_type; + safe_unpack16(&tableinfo->context_id, buf); + safe_unpack64(&tableinfo->network_id, buf); + safe_unpackmem_ptr(&name_ptr, &tmp_32, buf); + if (tmp_32 != NRT_MAX_PROTO_NAME_LEN) + goto unpack_error; + memcpy(tableinfo->protocol_name, name_ptr, tmp_32); + ip_v4 = jp->ip_v4; + if (!jp->user_space) + adapter_type = NRT_IPONLY; + safe_unpack16(&tableinfo->table_id, buf); + safe_unpack32(&tableinfo->table_length, buf); + + if (adapter_type == NRT_IB) { + nrt_ib_task_info_t *ib_tbl_ptr; + tableinfo->table = (nrt_ib_task_info_t *) + xmalloc(tableinfo->table_length * + sizeof(nrt_ib_task_info_t)); + for (i = 0, ib_tbl_ptr = tableinfo->table; + i < tableinfo->table_length; + i++, ib_tbl_ptr++) { + safe_unpackmem(ib_tbl_ptr->device_name, &tmp_32, buf); + if (tmp_32 != NRT_MAX_DEVICENAME_SIZE) + goto unpack_error; + safe_unpack32(&ib_tbl_ptr->base_lid, buf); + safe_unpack8(&ib_tbl_ptr->lmc, buf); + safe_unpack32(&ib_tbl_ptr->node_number, buf); + safe_unpack8(&ib_tbl_ptr->port_id, buf); + safe_unpack32(&ib_tbl_ptr->task_id, buf); + safe_unpack16(&ib_tbl_ptr->win_id, buf); + } + } else if (adapter_type == NRT_IPONLY) { + nrt_ip_task_info_t *ip_tbl_ptr; + tableinfo->table = (nrt_ip_task_info_t *) + xmalloc(tableinfo->table_length * + sizeof(nrt_ip_task_info_t)); + for (i = 0, ip_tbl_ptr = tableinfo->table; + i < tableinfo->table_length; + i++, ip_tbl_ptr++) { + if (ip_v4) { + safe_unpackmem((char *) + &ip_tbl_ptr->ip.ipv4_addr, + &tmp_32, buf); + if (tmp_32 != sizeof(in_addr_t)) + goto unpack_error; + } else { + for (j = 0; j < 16; j++) { + safe_unpack8(&ip_tbl_ptr->ip.ipv6_addr. + s6_addr[j], buf); + } + } + safe_unpack32(&ip_tbl_ptr->node_number, buf); + safe_unpack16(&ip_tbl_ptr->reserved, buf); + safe_unpack32(&ip_tbl_ptr->task_id, buf); + } + } else if (adapter_type == NRT_HFI) { + nrt_hfi_task_info_t *hfi_tbl_ptr; + tableinfo->table = (nrt_hfi_task_info_t *) + xmalloc(tableinfo->table_length * + sizeof(nrt_hfi_task_info_t)); + for (i = 0, hfi_tbl_ptr = tableinfo->table; + i < tableinfo->table_length; + i++, hfi_tbl_ptr++) { + + safe_unpack32(&hfi_tbl_ptr->task_id, buf); + safe_unpack16(&tmp_16, buf); + hfi_tbl_ptr->lid = tmp_16; + safe_unpack8(&tmp_8, buf); + hfi_tbl_ptr->win_id = tmp_8; + } + } else if ((adapter_type == NRT_HPCE) || (adapter_type == NRT_KMUX)) { + nrt_hpce_task_info_t *hpce_tbl_ptr; + tableinfo->table = (nrt_hpce_task_info_t *) + xmalloc(tableinfo->table_length * + sizeof(nrt_hpce_task_info_t)); + for (i = 0, hpce_tbl_ptr = tableinfo->table; + i < tableinfo->table_length; + i++, hpce_tbl_ptr++) { + safe_unpack32(&hpce_tbl_ptr->task_id, buf); + safe_unpack16(&hpce_tbl_ptr->win_id, buf); + safe_unpack32(&hpce_tbl_ptr->node_number, buf); + safe_unpackmem(hpce_tbl_ptr->device_name, &tmp_32,buf); + if (tmp_32 != NRT_MAX_DEVICENAME_SIZE) + goto unpack_error; + } + } else { + error("_unpack_tableinfo: Missing support for adapter type %s", + _adapter_type_str(adapter_type)); + } + + return SLURM_SUCCESS; + +unpack_error: /* safe_unpackXX are macros which jump to unpack_error */ + error("unpack error in _unpack_tableinfo"); + return SLURM_ERROR; +} + +/* Used by: all */ +extern int +nrt_unpack_jobinfo(slurm_nrt_jobinfo_t *j, Buf buf) +{ + int i; + + assert(j); + assert(j->magic == NRT_JOBINFO_MAGIC); + assert(buf); + + safe_unpack32(&j->magic, buf); + assert(j->magic == NRT_JOBINFO_MAGIC); + safe_unpack32(&j->job_key, buf); + safe_unpack8(&j->bulk_xfer, buf); + safe_unpack32(&j->bulk_xfer_resources, buf); + safe_unpack16(&j->cau_indexes, buf); + safe_unpack16(&j->immed_slots, buf); + safe_unpack8(&j->ip_v4, buf); + safe_unpack8(&j->user_space, buf); + safe_unpack16(&j->tables_per_task, buf); + safe_unpack32(&j->num_tasks, buf); + + j->tableinfo = (nrt_tableinfo_t *) xmalloc(j->tables_per_task * + sizeof(nrt_tableinfo_t)); + for (i = 0; i < j->tables_per_task; i++) { + if (_unpack_tableinfo(&j->tableinfo[i], buf, j)) + goto unpack_error; + } + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_unpack_jobinfo:"); + _print_jobinfo(j); + } + + return SLURM_SUCCESS; + +unpack_error: + error("nrt_unpack_jobinfo error"); + if (j->tableinfo) { + for (i = 0; i < j->tables_per_task; i++) + xfree(j->tableinfo[i].table); + xfree(j->tableinfo); + } + slurm_seterrno_ret(EUNPACK); + return SLURM_ERROR; +} + +/* Used by: all */ +extern slurm_nrt_jobinfo_t * +nrt_copy_jobinfo(slurm_nrt_jobinfo_t *job) +{ + slurm_nrt_jobinfo_t *new; + int i; + int base_size = 0, table_size; + + assert(job); + assert(job->magic == NRT_JOBINFO_MAGIC); + + if (nrt_alloc_jobinfo(&new)) { + error("Allocating new jobinfo"); + slurm_seterrno(ENOMEM); + return NULL; + } + memcpy(new, job, sizeof(slurm_nrt_jobinfo_t)); + + new->tableinfo = (nrt_tableinfo_t *) xmalloc(job->tables_per_task * + sizeof(nrt_table_info_t)); + for (i = 0; i < job->tables_per_task; i++) { + if (!job->user_space || + (job->tableinfo->adapter_type == NRT_IPONLY)) { + base_size = sizeof(nrt_ip_task_info_t); + } else if (job->tableinfo->adapter_type == NRT_IB) { + base_size = sizeof(nrt_ib_task_info_t); + } else if (job->tableinfo->adapter_type == NRT_HFI) { + base_size = sizeof(nrt_hfi_task_info_t); + } else if ((job->tableinfo->adapter_type == NRT_HPCE) || + (job->tableinfo->adapter_type == NRT_KMUX)) { + base_size = sizeof(nrt_hpce_task_info_t); + } else { + error("nrt_copy_jobinfo: Missing support for adapter " + "type %s", + _adapter_type_str(job->tableinfo->adapter_type)); + } + new->tableinfo[i].table_length = job->tableinfo[i].table_length; + table_size = base_size * job->tableinfo[i].table_length; + new->tableinfo->table = xmalloc(table_size); + memcpy(new->tableinfo[i].table, job->tableinfo[i].table, + table_size); + } + + return new; +} + +/* Used by: all */ +extern void +nrt_free_jobinfo(slurm_nrt_jobinfo_t *jp) +{ + int i; + nrt_tableinfo_t *tableinfo; + + if (!jp) + return; + + if (jp->magic != NRT_JOBINFO_MAGIC) { + error("jp is not a switch/nrt slurm_nrt_jobinfo_t"); + return; + } + + jp->magic = 0; + if ((jp->tables_per_task > 0) && (jp->tableinfo != NULL)) { + for (i = 0; i < jp->tables_per_task; i++) { + tableinfo = &jp->tableinfo[i]; + xfree(tableinfo->table); + } + xfree(jp->tableinfo); + } + if (jp->nodenames) + hostlist_destroy(jp->nodenames); + + xfree(jp); + jp = NULL; + + return; +} + +/* Return data to code for which jobinfo is an opaque type. + * + * Used by: all + */ +extern int +nrt_get_jobinfo(slurm_nrt_jobinfo_t *jp, int key, void *data) +{ + nrt_tableinfo_t **tableinfo = (nrt_tableinfo_t **) data; + int *tables_per = (int *) data; + int *job_key = (int *) data; + + assert(jp); + assert(jp->magic == NRT_JOBINFO_MAGIC); + + switch (key) { + case NRT_JOBINFO_TABLEINFO: + *tableinfo = jp->tableinfo; + break; + case NRT_JOBINFO_TABLESPERTASK: + *tables_per = (int) jp->tables_per_task; + break; + case NRT_JOBINFO_KEY: + *job_key = (int) jp->job_key; + break; + default: + slurm_seterrno_ret(EINVAL); + } + + return SLURM_SUCCESS; +} + +/* + * Check up to "retry" times for "window_id" on "adapter_name" + * to switch to the NRT_WIN_AVAILABLE. Sleep one second between + * each retry. + * + * Used by: slurmd + */ +static int +_wait_for_window_unloaded(char *adapter_name, nrt_adapter_t adapter_type, + nrt_window_id_t window_id, int retry, + unsigned int max_windows) +{ + int err, i, j; + int rc = SLURM_ERROR; + nrt_cmd_status_adapter_t status_adapter; + nrt_status_t *status_array = NULL; + nrt_window_id_t window_count; + + status_adapter.adapter_name = adapter_name; + status_adapter.adapter_type = adapter_type; + status_adapter.status_array = &status_array; + status_adapter.window_count = &window_count; + + for (i = 0; i < retry; i++) { + if (i > 0) + sleep(1); + + if (status_array) { + free(status_array); + status_array = NULL; + } + err = nrt_command(NRT_VERSION, NRT_CMD_STATUS_ADAPTER, + &status_adapter); + if (err != NRT_SUCCESS) { + error("nrt_status_adapter(%s, %s): %s", adapter_name, + _adapter_type_str(adapter_type), + nrt_err_str(err)); + break; + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("_wait_for_window_unloaded"); + _print_adapter_status(&status_adapter); + } + for (j = 0; j < window_count; j++) { + if (status_array[j].window_id == window_id) + break; + } + if (j >= window_count) { + error("nrt_status_adapter(%s, %s), window %hu not " + "found", + adapter_name, _adapter_type_str(adapter_type), + window_id); + break; + } + if (status_array[j].state == NRT_WIN_AVAILABLE) { + rc = SLURM_SUCCESS; + break; + } + debug2("nrt_status_adapter(%s, %s), window %u state %s", + adapter_name, + _adapter_type_str(adapter_type), window_id, + _win_state_str(status_array[j].state)); + } + if (status_array) + free(status_array); + + return rc; +} + +/* + * Look through the table and find all of the NRT that are for an adapter on + * this node. Wait until the window from each local NRT is in the + * NRT_WIN_AVAILABLE. + * + * Used by: slurmd + */ +static int +_wait_for_all_windows(nrt_tableinfo_t *tableinfo) +{ + int err, i, rc = SLURM_SUCCESS; + int retry = 15; + nrt_window_id_t window_id = 0; + nrt_cmd_query_adapter_names_t adapter_names; + unsigned int max_windows, num_adapter_names; + + adapter_names.adapter_type = tableinfo->adapter_type; + adapter_names.max_windows = &max_windows; + adapter_names.num_adapter_names = &num_adapter_names; + err = nrt_command(NRT_VERSION, NRT_CMD_QUERY_ADAPTER_NAMES, + &adapter_names); + if (err != NRT_SUCCESS) { + error("nrt_command(adapter_names, %s): %s", + _adapter_type_str(adapter_names.adapter_type), + nrt_err_str(err)); + rc = SLURM_ERROR; + /* We will still try to unload the windows. It is unclear what + * the maximum window count is, but 512 is largest seen. */ + max_windows = 1024; + } + + for (i = 0; i < tableinfo->table_length; i++) { + if (tableinfo->adapter_type == NRT_IB) { + nrt_ib_task_info_t *ib_tbl_ptr; + ib_tbl_ptr = (nrt_ib_task_info_t *) tableinfo->table; + ib_tbl_ptr += i; + window_id = ib_tbl_ptr->win_id; + } else if (adapter_names.adapter_type == NRT_HFI) { + nrt_hfi_task_info_t *hfi_tbl_ptr; + hfi_tbl_ptr = (nrt_hfi_task_info_t *) tableinfo->table; + hfi_tbl_ptr += i; + window_id = hfi_tbl_ptr->win_id; + } else if ((adapter_names.adapter_type == NRT_HPCE) || + (adapter_names.adapter_type == NRT_KMUX)) { + nrt_hpce_task_info_t *hpce_tbl_ptr; + hpce_tbl_ptr = (nrt_hpce_task_info_t *) tableinfo-> + table; + hpce_tbl_ptr += i; + window_id = hpce_tbl_ptr->win_id; + } else { + error("_wait_for_all_windows: Missing support for " + "adapter_type %s", + _adapter_type_str(tableinfo->adapter_type)); + } + + err = _wait_for_window_unloaded(tableinfo->adapter_name, + tableinfo->adapter_type, + window_id, retry, max_windows); + if (err != SLURM_SUCCESS) { + error("Window %hu adapter %s did not " + "become free within %d seconds", + window_id, tableinfo->adapter_name, retry); + rc = err; + } + } + + return rc; +} + +/* Load a network table on node. If table contains more than one window + * for a given adapter, load the table only once for that adapter. + * + * Used by: slurmd + * + * Notes on context_id and table_id from Bill LePera, IBM, 6/7/2012: + * + * Each NRT is uniquely identified by a combination of three elements: job_key, + * context_id, and table_id. context_id and table_id usually start at zero and + * are incremented based on how many NRTs are required to define all the + * resources used for a job, based on factors like striping, instances, and + * number of protocols. + * + * For example, a scheduler building an NRT for a job using a single protocol, + * single network (no striping), and a single instance would set both + * context_id and table_id to zero. A multi-protocol job (one that used both + * MPI and PAMI, for example), would build at least one NRT for each protocol. + * In this case, there would be two NRTs, with context_id 0 and 1. If you are + * still using a single network and single instance, the table_id's for both + * NRTs would be zero, and these would be the only two NRTs needed for the job. + * + * The table_id is incremented on a per-protocol basis, based on number of + * networks (or stripes) and number of instances. For example, a single- + * protocol job running across two networks using four instances would need + * 2 * 4 = 8 NRTs, with context_id set to 0 for each, and table_id 0 - 7. If + * this same job was a multi-protocol job, you would need 16 NRTs total + * (2 protocols * 2 networks * 4 instances), with context_id 0 and 1, and + * table_id 0-7 within each protocol. + */ +extern int +nrt_load_table(slurm_nrt_jobinfo_t *jp, int uid, int pid, char *job_name) +{ + int i; + int err; + char *adapter_name; + int rc; + nrt_cmd_load_table_t load_table; + nrt_table_info_t table_info; + + assert(jp); + assert(jp->magic == NRT_JOBINFO_MAGIC); + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_load_table"); + _print_jobinfo(jp); + } + + for (i = 0; i < jp->tables_per_task; i++) { + if (debug_flags & DEBUG_FLAG_SWITCH) { + nrt_adapter_t adapter_type; + if (jp->user_space) + adapter_type = jp->tableinfo[i].adapter_type; + else + adapter_type = NRT_IPONLY; + _print_table(jp->tableinfo[i].table, + jp->tableinfo[i].table_length, + adapter_type, jp->ip_v4); + } + + adapter_name = jp->tableinfo[i].adapter_name; + if (jp->user_space) { + rc = _wait_for_all_windows(&jp->tableinfo[i]); + if (rc != SLURM_SUCCESS) + return rc; + } + + if (adapter_name == NULL) + continue; + + bzero(&table_info, sizeof(nrt_table_info_t)); + table_info.num_tasks = jp->tableinfo[i].table_length; + table_info.job_key = jp->job_key; + table_info.uid = uid; + table_info.network_id = jp->tableinfo[i].network_id; + table_info.pid = pid; + table_info.adapter_type = jp->tableinfo[i].adapter_type; + if (jp->user_space) { + table_info.is_ipv4 = 0; + table_info.is_user_space = 1; + } else if (jp->ip_v4) { + table_info.is_ipv4 = 1; + table_info.is_user_space = 0; + } else { /* IP V6 */ + table_info.is_ipv4 = 0; + table_info.is_user_space = 0; + } + table_info.context_id = jp->tableinfo[i].context_id; + table_info.table_id = jp->tableinfo[i].table_id; + if (job_name) { + char *sep = strrchr(job_name,'/'); + if (sep) + sep++; + else + sep = job_name; + strncpy(table_info.job_name, sep, + NRT_MAX_JOB_NAME_LEN); + } else { + table_info.job_name[0] = '\0'; + } + strncpy(table_info.protocol_name, + jp->tableinfo[i].protocol_name, + NRT_MAX_PROTO_NAME_LEN); + table_info.use_bulk_transfer = jp->bulk_xfer; + table_info.bulk_transfer_resources = jp->bulk_xfer_resources; + /* The following fields only apply to Power7 processors + * and have no effect on x86 processors: + * immed_send_slots_per_win + * num_cau_indexes */ + table_info.num_cau_indexes = jp->cau_indexes; + table_info.immed_send_slots_per_win = jp->immed_slots; + load_table.table_info = &table_info; + load_table.per_task_input = jp->tableinfo[i].table; + + if (debug_flags & DEBUG_FLAG_SWITCH) + _print_load_table(&load_table); + + err = nrt_command(NRT_VERSION, NRT_CMD_LOAD_TABLE, + &load_table); + if (err != NRT_SUCCESS) { + error("nrt_command(load table): %s", nrt_err_str(err)); + return SLURM_ERROR; + } + } + umask(nrt_umask); + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("nrt_load_table complete"); + + return SLURM_SUCCESS; +} + +/* + * Try up to "retry" times to unload a window. + */ +static int +_unload_window(char *adapter_name, nrt_adapter_t adapter_type, + nrt_job_key_t job_key, nrt_window_id_t window_id, int retry) +{ + int err, i; + nrt_cmd_clean_window_t clean_window; + nrt_cmd_unload_window_t unload_window; + + for (i = 0; i < retry; i++) { + if (i > 0) { + sleep(1); + } else { + unload_window.adapter_name = adapter_name; + unload_window.adapter_type = adapter_type; + unload_window.job_key = job_key; + unload_window.window_id = window_id; + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_command(unload_window, %s, %s, %u, %hu)", + adapter_name, _adapter_type_str(adapter_type), + job_key, window_id); + } + + err = nrt_command(NRT_VERSION, NRT_CMD_UNLOAD_WINDOW, + &unload_window); + if (err == NRT_SUCCESS) + return SLURM_SUCCESS; + debug("Unable to unload window for job_key %u, " + "nrt_unload_window(%s, %s): %s", + job_key, adapter_name, _adapter_type_str(adapter_type), + nrt_err_str(err)); + + if (i == 0) { + clean_window.adapter_name = adapter_name; + clean_window.adapter_type = adapter_type; + clean_window.leave_inuse_or_kill = KILL; + clean_window.window_id = window_id; + } + err = nrt_command(NRT_VERSION, NRT_CMD_CLEAN_WINDOW, + &clean_window); + if (err == NRT_SUCCESS) + return SLURM_SUCCESS; + error("Unable to clean window for job_key %u, " + "nrt_clean_window(%s, %u): %s", + job_key, adapter_name, adapter_type, nrt_err_str(err)); + if (err != NRT_EAGAIN) + break; + } + + return SLURM_FAILURE; +} + +static int _unload_job_table(slurm_nrt_jobinfo_t *jp) +{ + int err, i, rc = SLURM_SUCCESS; + nrt_cmd_unload_table_t unload_table; + + unload_table.job_key = jp->job_key; + for (i = 0; i < jp->tables_per_task; i++) { + unload_table.context_id = jp->tableinfo[i].context_id; + unload_table.table_id = jp->tableinfo[i].table_id; + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("Unload table for job_key:%u " + "context_id:%u table_id:%u", + unload_table.job_key, unload_table.context_id, + unload_table.table_id); + } + err = nrt_command(NRT_VERSION, NRT_CMD_UNLOAD_TABLE, + &unload_table); + if (err != NRT_SUCCESS) { + error("Unable to unload table for job_key:%u " + "context_id:%u table_id:%u error:%s", + unload_table.job_key, unload_table.context_id, + unload_table.table_id, nrt_err_str(err)); + rc = SLURM_ERROR; + } + } + return rc; +} + +static int _unload_job_windows(slurm_nrt_jobinfo_t *jp) +{ + nrt_window_id_t window_id = 0; + int err, i, j, rc = SLURM_SUCCESS; + int retry = 15; + + for (i = 0; i < jp->tables_per_task; i++) { + for (j = 0; j < jp->tableinfo[i].table_length; j++) { + if (jp->tableinfo[i].adapter_type == NRT_IB) { + nrt_ib_task_info_t *ib_tbl_ptr; + ib_tbl_ptr = (nrt_ib_task_info_t *) + jp->tableinfo[i].table; + ib_tbl_ptr += j; + window_id = ib_tbl_ptr->win_id; + } else if (jp->tableinfo[i].adapter_type == NRT_HFI) { + nrt_hfi_task_info_t *hfi_tbl_ptr; + hfi_tbl_ptr = (nrt_hfi_task_info_t *) + jp->tableinfo[i].table; + hfi_tbl_ptr += j; + window_id = hfi_tbl_ptr->win_id; + } else if ((jp->tableinfo[i].adapter_type==NRT_HPCE) || + (jp->tableinfo[i].adapter_type==NRT_KMUX)) { + nrt_hpce_task_info_t *hpce_tbl_ptr; + hpce_tbl_ptr = (nrt_hpce_task_info_t *) + jp->tableinfo[i].table; + hpce_tbl_ptr += j; + window_id = hpce_tbl_ptr->win_id; + } else { + fatal("nrt_unload_window: invalid adapter " + "type: %s", + _adapter_type_str(jp->tableinfo[i]. + adapter_type)); + } + err = _unload_window(jp->tableinfo[i].adapter_name, + jp->tableinfo[i].adapter_type, + jp->job_key, + window_id, retry); + if (err != NRT_SUCCESS) + rc = SLURM_ERROR; + } + } + return rc; +} + +/* Assumes that, on error, new switch state information will be + * read from node. + * + * Used by: slurmd + */ +extern int +nrt_unload_table(slurm_nrt_jobinfo_t *jp) +{ + int rc = SLURM_SUCCESS; + + assert(jp); + assert(jp->magic == NRT_JOBINFO_MAGIC); + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_unload_table"); + _print_jobinfo(jp); + } + + if (jp->user_space) + rc = _unload_job_windows(jp); + else + rc = _unload_job_table(jp); + + return rc; +} + +extern int +nrt_fini(void) +{ + return SLURM_SUCCESS; +} + +static void +_free_libstate(slurm_nrt_libstate_t *lp) +{ + int i; + + if (!lp) + return; + if (lp->node_list != NULL) { + for (i = 0; i < lp->node_count; i++) + nrt_free_nodeinfo(&lp->node_list[i], true); + xfree(lp->node_list); + } + xfree(lp->hash_table); + xfree(lp); +} + +/* Used by: slurmctld */ +static int +_pack_libstate(slurm_nrt_libstate_t *lp, Buf buffer) +{ + int offset; + int i; + + assert(lp); + assert(lp->magic == NRT_LIBSTATE_MAGIC); + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("_pack_libstate"); + _print_libstate(lp); + } + + offset = get_buf_offset(buffer); + packstr(NRT_STATE_VERSION, buffer); + pack32(lp->magic, buffer); + pack32(lp->node_count, buffer); + for (i = 0; i < lp->node_count; i++) + (void)nrt_pack_nodeinfo(&lp->node_list[i], buffer); + /* don't pack hash_table, we'll just rebuild on restore */ + pack32(lp->key_index, buffer); + + return(get_buf_offset(buffer) - offset); +} + +/* Used by: slurmctld */ +extern void +nrt_libstate_save(Buf buffer, bool free_flag) +{ + _lock(); + + if (nrt_state != NULL) + _pack_libstate(nrt_state, buffer); + + /* Clean up nrt_state since backup slurmctld can repeatedly + * save and restore state */ + if (free_flag) { + _free_libstate(nrt_state); + nrt_state = NULL; /* freed above */ + } + _unlock(); +} + +/* Used by: slurmctld */ +static int +_unpack_libstate(slurm_nrt_libstate_t *lp, Buf buffer) +{ + char *ver_str = NULL; + uint32_t ver_str_len; + uint16_t protocol_version = (uint16_t) NO_VAL; + uint32_t node_count; + int i; + + /* 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) { + if (!strcmp(ver_str, NRT_STATE_VERSION)) + protocol_version = SLURM_PROTOCOL_VERSION; + } + if (protocol_version == (uint16_t) NO_VAL) { + error("******************************************************"); + error("Can not recover switch/nrt state, incompatible version"); + error("******************************************************"); + xfree(ver_str); + return EFAULT; + } + xfree(ver_str); + + assert(lp->magic == NRT_LIBSTATE_MAGIC); + safe_unpack32(&lp->magic, buffer); + safe_unpack32(&node_count, buffer); + for (i = 0; i < node_count; i++) { + if (_unpack_nodeinfo(NULL, buffer, false) != SLURM_SUCCESS) + goto unpack_error; + } + if (lp->node_count != node_count) { + error("Failed to recover switch state of all nodes (%u of %u)", + lp->node_count, node_count); + return SLURM_ERROR; + } + safe_unpack32(&lp->key_index, buffer); + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("_unpack_libstate"); + _print_libstate(lp); + } + + return SLURM_SUCCESS; + +unpack_error: + error("unpack error in _unpack_libstate"); + slurm_seterrno_ret(EBADMAGIC_NRT_LIBSTATE); + return SLURM_ERROR; +} + +/* Used by: slurmctld */ +extern int +nrt_libstate_restore(Buf buffer) +{ + int rc; + + _lock(); + assert(!nrt_state); + + nrt_state = _alloc_libstate(); + if (!nrt_state) { + error("nrt_libstate_restore nrt_state is NULL"); + _unlock(); + return SLURM_FAILURE; + } + rc = _unpack_libstate(nrt_state, buffer); + _unlock(); + + return rc; +} + +extern int +nrt_libstate_clear(void) +{ + int i, j, k; + slurm_nrt_nodeinfo_t *node; + slurm_nrt_adapter_t *adapter; + slurm_nrt_window_t *window; + + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("Clearing state on all windows in global NRT state"); + else + debug3("Clearing state on all windows in global NRT state"); + + _lock(); + if (!nrt_state || !nrt_state->node_list) { + error("nrt_state or node_list not initialized!"); + _unlock(); + return SLURM_ERROR; + } + + for (i = 0; i < nrt_state->node_count; i++) { + node = &nrt_state->node_list[i]; + if (!node->adapter_list) + continue; + for (j = 0; j < node->adapter_count; j++) { + adapter = &node->adapter_list[i]; + if (!adapter || !adapter->window_list) + continue; + for (k = 0; k < adapter->window_count; k++) { + window = &adapter->window_list[k]; + if (!window) + continue; + window->state = NRT_WIN_UNAVAILABLE; + } + } + } + _unlock(); + + return SLURM_SUCCESS; +} + +extern int +nrt_clear_node_state(void) +{ + static bool first_use = true; + int err, i, j, k, rc = SLURM_SUCCESS; + nrt_cmd_query_adapter_types_t adapter_types; + unsigned int num_adapter_types; + nrt_adapter_t adapter_type[NRT_MAX_ADAPTER_TYPES]; + nrt_cmd_query_adapter_names_t adapter_names; + unsigned int max_windows, num_adapter_names; + nrt_cmd_status_adapter_t adapter_status; + nrt_window_id_t window_count; + nrt_status_t *status_array = NULL; + nrt_cmd_clean_window_t clean_window; + char window_str[128]; + hostset_t hs = NULL; + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("nrt_clear_node_state: begin"); + + adapter_types.num_adapter_types = &num_adapter_types; + adapter_types.adapter_types = adapter_type; + for (i = 0; i < 2; i++) { + err = nrt_command(NRT_VERSION, NRT_CMD_QUERY_ADAPTER_TYPES, + &adapter_types); + if (err != NRT_EAGAIN) + break; + error("nrt_command(adapter_types): %s", nrt_err_str(err)); + error("Is pnsd daemon started? Retrying..."); + /* Run "/opt/ibmhpc/pecurrent/ppe.pami/pnsd/pnsd -A" */ + sleep(5); + } + if (err != NRT_SUCCESS) { + error("nrt_command(adapter_types): %s", nrt_err_str(err)); + return SLURM_ERROR; + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + for (i = 0; i < num_adapter_types; i++) { + info("nrt_command(adapter_types): %s", + _adapter_type_str(adapter_types.adapter_types[i])); + } + } + + for (i = 0; i < num_adapter_types; i++) { + adapter_names.adapter_type = adapter_type[i]; + adapter_names.num_adapter_names = &num_adapter_names; + adapter_names.max_windows = &max_windows; + err = nrt_command(NRT_VERSION, NRT_CMD_QUERY_ADAPTER_NAMES, + &adapter_names); + if (err != NRT_SUCCESS) { + error("nrt_command(adapter_names, %s): %s", + _adapter_type_str(adapter_names.adapter_type), + nrt_err_str(err)); + rc = SLURM_ERROR; + continue; + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + for (j = 0; j < num_adapter_names; j++) { + info("nrt_command(adapter_names, %s, %s) " + "max_windows: %hu", + adapter_names.adapter_names[j], + _adapter_type_str(adapter_names. + adapter_type), + max_windows); + } + } + + for (j = 0; j < num_adapter_names; j++) { + if (status_array) { + free(status_array); + status_array = NULL; + } + adapter_status.adapter_name = adapter_names. + adapter_names[j]; + adapter_status.adapter_type = adapter_names. + adapter_type; + adapter_status.status_array = &status_array; + adapter_status.window_count = &window_count; + err = nrt_command(NRT_VERSION, NRT_CMD_STATUS_ADAPTER, + &adapter_status); + if (err != NRT_SUCCESS) { + error("nrt_command(status_adapter, %s, %s): %s", + adapter_status.adapter_name, + _adapter_type_str(adapter_status. + adapter_type), + nrt_err_str(err)); + rc = SLURM_ERROR; + continue; + } + if (window_count > max_windows) { + /* This error seems to happen on IP_ONLY + * adapters if the unload_table does not + * occur */ +/* FIXME: Review and test Torrent logic */ + if (first_use) { + error("nrt_command(status_adapter, " + "%s, %s): window_count > " + "max_windows (%u > %hu)", + adapter_status.adapter_name, + _adapter_type_str(adapter_status. + adapter_type), + window_count, max_windows); + } else { + debug("nrt_command(status_adapter, " + "%s, %s): window_count > " + "max_windows (%u > %hu)", + adapter_status.adapter_name, + _adapter_type_str(adapter_status. + adapter_type), + window_count, max_windows); + } + /* Reset value to avoid logging bad data */ + window_count = max_windows; + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("nrt_command(status_adapter, %s, %s) " + "window_count: %hu", + adapter_status.adapter_name, + _adapter_type_str(adapter_status. + adapter_type), + window_count); + for (k = 0; k < window_count; k++) { + win_state_t state = status_array[k]. + state; + if ((state == NRT_WIN_AVAILABLE) && + (k >= NRT_DEBUG_CNT)) + continue; + info("window_id:%d uid:%d pid:%d " + "state:%s", + status_array[k].window_id, + status_array[k].uid, + status_array[k].client_pid, + _win_state_str(state)); + } + + hs = hostset_create(""); + if (hs == NULL) + fatal("hostset_create malloc failure"); + } + for (k = 0; k < window_count; k++) { + clean_window.adapter_name = adapter_names. + adapter_names[j]; + clean_window.adapter_type = adapter_names. + adapter_type; + clean_window.leave_inuse_or_kill = KILL; + clean_window.window_id = status_array[k]. + window_id; + err = nrt_command(NRT_VERSION, + NRT_CMD_CLEAN_WINDOW, + &clean_window); + if (err != NRT_SUCCESS) { + error("nrt_command(clean_window, " + "%s, %s, %u): %s", + clean_window.adapter_name, + _adapter_type_str(clean_window. + adapter_type), + clean_window.window_id, + nrt_err_str(err)); + rc = SLURM_ERROR; + continue; + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + snprintf(window_str, + sizeof(window_str), "%d", + clean_window.window_id); + hostset_insert(hs, window_str); + } + } + if (debug_flags & DEBUG_FLAG_SWITCH) { + if (hostset_count(hs) > 0) { + hostset_ranged_string(hs, + sizeof(window_str), + window_str); + info("nrt_command(clean_window, " + "%s, %s, %s)", + adapter_names.adapter_names[j], + _adapter_type_str(adapter_names. + adapter_type), + window_str); + } + hostset_destroy(hs); + } + } + } + if (status_array) + free(status_array); + if (debug_flags & DEBUG_FLAG_SWITCH) + info("nrt_clear_node_state: complete:%d", rc); + + return rc; +} + +extern char *nrt_err_str(int rc) +{ + static char str[16]; + + switch (rc) { + case NRT_ALREADY_LOADED: + return "Already loaded"; + case NRT_BAD_VERSION: + return "Bad version"; + case NRT_CAU_EXCEEDED: + return "CAU index request exeeds available resources"; + case NRT_CAU_RESERVE: + return "Error during CAU index reserve"; + case NRT_CAU_UNRESERVE: + return "Error during CAU index unreserve"; + case NRT_EADAPTER: + return "Invalid adapter name"; + case NRT_EADAPTYPE: + return "Invalid adapter type"; + case NRT_EAGAIN: + return "Try call again later"; + case NRT_EINVAL: + return "Invalid input paramter"; + case NRT_EIO: + return "Adapter reported a DOWN state"; + case NRT_EMEM: + return "Memory allocation error"; + case NRT_EPERM: + return "Permission denied, not root"; + case NRT_ERR_COMMAND_TYPE: + return "Invalid command type"; + case NRT_ESYSTEM: + return "A system error occured"; + case NRT_IMM_SEND_RESERVE: + return "Error during immediate send slot reserve"; + case NRT_NO_FREE_WINDOW: + return "No free window"; + case NRT_NO_RDMA_AVAIL: + return "No RDMA windows available"; + case NRT_NTBL_LOAD_FAILED: + return "Failed to load NTBL"; + case NRT_NTBL_NOT_FOUND: + return "NTBL not found"; + case NRT_NTBL_UNLOAD_FAILED: + return "Failed to unload NTBL"; + case NRT_OP_NOT_VALID: + return "Requested operation not valid for given device"; + case NRT_PNSDAPI: + return "Error communicating with Protocol Network Services " + "Daemon"; + case NRT_RDMA_CLEAN_FAILED: + return "Task RDMA cleanup failed"; + case NRT_SUCCESS: + return "Success"; + case NRT_TIMEOUT: + return "No response back from PNSD/job"; + case NRT_UNKNOWN_ADAPTER: + return "Unknown adaper"; + case NRT_WIN_CLOSE_FAILED: + return "Task can not close window"; + case NRT_WIN_OPEN_FAILED: + return "Task can not open window"; + case NRT_WRONG_PREEMPT_STATE: + return "Invalid preemption state"; + case NRT_WRONG_WINDOW_STATE: + return "Wrong window state"; + } + + snprintf(str, sizeof(str), "%d", rc); + return str; +} + + +/* Determine if a token is the name of an adapter + * IN token - token from job's "network" specification + * IN list - hostlist of allocated nodes + * RET - True if token is a adapter name, false otherwise */ +extern bool nrt_adapter_name_check(char *token, hostlist_t hl) +{ + int i; + hostlist_iterator_t hi; + slurm_nrt_nodeinfo_t *node; + char *host; + bool name_found = false; + + if (!token || !hl) + return name_found; + + hi = hostlist_iterator_create(hl); + host = hostlist_next(hi); + hostlist_iterator_destroy(hi); + _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)) + continue; + name_found = true; + break; + } + } + _unlock(); + + return name_found; +} diff --git a/src/plugins/switch/nrt/nrt_keys.h b/src/plugins/switch/nrt/nrt_keys.h new file mode 100644 index 0000000000000000000000000000000000000000..8e0aac0d99da56e7a7cc13b5a901f20df6c2e5be --- /dev/null +++ b/src/plugins/switch/nrt/nrt_keys.h @@ -0,0 +1,80 @@ +/*****************************************************************************\ + ** nrt_keys.h - Key definitions used by the get_jobinfo functions + ***************************************************************************** + * Copyright (C) 2004 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Jason King + * CODE-OCEC-09-009. All rights reserved. + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 _NRT_KEYS_INCLUDED +#define _NRT_KEYS_INCLUDED + +#if HAVE_LIBNRT +# include +#else +# error "Must have libnrt to compile this module!" +#endif + +enum { + /* NRT specific get_jobinfo keys */ + NRT_JOBINFO_TABLEINFO, + NRT_JOBINFO_TABLESPERTASK, /* Count of nrt_tableinfo records */ + NRT_JOBINFO_KEY, + NRT_JOBINFO_PROTOCOL, + NRT_JOBINFO_MODE +}; + +/* Information shared between slurm_ll_api and the slurm NRT driver */ +typedef struct nrt_tableinfo { + char adapter_name[NRT_MAX_ADAPTER_NAME_LEN]; /* eth0, mlx4_0, etc. */ + nrt_adapter_t adapter_type; + nrt_context_id_t context_id; + nrt_network_id_t network_id; + char protocol_name[NRT_MAX_PROTO_NAME_LEN]; /* MPI, LAPI, UPC, etc. */ + nrt_table_id_t table_id; + uint32_t table_length; + void *table; /* Pointer to nrt_*_task_info_t */ +} nrt_tableinfo_t; + +/* In order to determine the adapters and protocols in use: + * int table_cnt; + * nrt_tableinfo_t *tables; + * switch_p_get_jobinfo(switch_job_ptr, NRT_JOBINFO_TABLESPERTASK, &table_cnt); + * switch_p_get_jobinfo(switch_job_ptr, NRT_JOBINFO_TABLESPERTASK, &table); + * for (i=0, table_ptr=table; iadapter_name, + * table_ptr->protocol_name); + * } + */ + +#endif /* _NRT_KEYS_INCLUDED */ diff --git a/src/plugins/switch/nrt/slurm_nrt.h b/src/plugins/switch/nrt/slurm_nrt.h new file mode 100644 index 0000000000000000000000000000000000000000..e507953980705c23782fc24f30b0c41b23688cd1 --- /dev/null +++ b/src/plugins/switch/nrt/slurm_nrt.h @@ -0,0 +1,126 @@ +/*****************************************************************************\ + * slurm_nrt.h - Library routines for initiating jobs using IBM's NRT + * (Network Routing Table) + ***************************************************************************** + * Copyright (C) 2004 The Regents of the University of California. + * Portions Copyright (C) 2011 SchedMD LLC. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Jason King + * CODE-OCEC-09-009. All rights reserved. + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 "src/common/slurm_xlator.h" + +#ifndef _SLURM_NRT_INCLUDED +#define _SLURM_NRT_INCLUDED + +#if HAVE_LIBNRT +# include +#else +# error "Must have libnrt to compile this module!" +#endif + +/* opaque data structures - no peeking! */ +typedef struct slurm_nrt_libstate slurm_nrt_libstate_t; +typedef struct slurm_nrt_jobinfo slurm_nrt_jobinfo_t; +typedef struct slurm_nrt_nodeinfo slurm_nrt_nodeinfo_t; + +/* NOTE: error codes should be between ESLURM_SWITCH_MIN and + * ESLURM_SWITCH MAX as defined in slurm/slurm_errno.h */ +enum { + /* switch/nrt specific error codes */ + ESTATUS = 3000, + EADAPTER, + ENOADAPTER, + EBADMAGIC_NRT_NODEINFO, + EBADMAGIC_NRT_JOBINFO, + EBADMAGIC_NRT_LIBSTATE, + EUNPACK, + EHOSTNAME, + ENOTSUPPORTED, + EVERSION, + EWINDOW, + EUNLOAD +}; + +#define NRT_DEBUG_CNT 0 /* Count of windows, adapters, etc to log + * use this to limit volume of logging */ +#define NRT_MAXADAPTERS 8 +#define NRT_LIBSTATE_LEN (1024 * 1024 * 1) + +extern uint32_t debug_flags; + +extern bool nrt_adapter_name_check(char *token, hostlist_t hl); +extern int nrt_clear_node_state(void); +extern char *nrt_err_str(int rc); +extern int nrt_slurmctld_init(void); +extern int nrt_slurmd_init(void); +extern int nrt_slurmd_step_init(void); +extern int nrt_alloc_nodeinfo(slurm_nrt_nodeinfo_t **nh); +extern int nrt_build_nodeinfo(slurm_nrt_nodeinfo_t *np, char *hostname); +extern char *nrt_print_nodeinfo(slurm_nrt_nodeinfo_t *np, char *buf, size_t size); +extern int nrt_pack_nodeinfo(slurm_nrt_nodeinfo_t *np, Buf buf); +extern int nrt_unpack_nodeinfo(slurm_nrt_nodeinfo_t *np, Buf buf); +extern void nrt_free_nodeinfo(slurm_nrt_nodeinfo_t *np, bool ptr_into_array); +extern int nrt_alloc_jobinfo(slurm_nrt_jobinfo_t **jh); +extern int nrt_build_jobinfo(slurm_nrt_jobinfo_t *jp, hostlist_t hl, + uint16_t *tasks_per_node, uint32_t **tids, + bool sn_all, + char *adapter_name, nrt_adapter_t dev_type, + bool bulk_xfer, uint32_t bulk_xfer_resources, + bool ip_v4, bool user_space, char *protocol, + int instances, int cau, int immed); +extern int nrt_pack_jobinfo(slurm_nrt_jobinfo_t *jp, Buf buf); +extern int nrt_unpack_jobinfo(slurm_nrt_jobinfo_t *jp, Buf buf); +extern slurm_nrt_jobinfo_t *nrt_copy_jobinfo(slurm_nrt_jobinfo_t *jp); +extern void nrt_free_jobinfo(slurm_nrt_jobinfo_t *jp); +extern int nrt_load_table(slurm_nrt_jobinfo_t *jp, int uid, int pid, + char *job_name); +extern int nrt_init(void); +extern int nrt_fini(void); +extern int nrt_unload_table(slurm_nrt_jobinfo_t *jp); +extern int nrt_unpack_libstate(slurm_nrt_libstate_t *lp, Buf buffer); +extern int nrt_get_jobinfo(slurm_nrt_jobinfo_t *jp, int key, void *data); +extern void nrt_libstate_save(Buf buffer, bool free_flag); +extern int nrt_libstate_restore(Buf buffer); +extern int nrt_job_step_complete(slurm_nrt_jobinfo_t *jp, hostlist_t hl); +extern int nrt_job_step_allocated(slurm_nrt_jobinfo_t *jp, hostlist_t hl); +extern int nrt_libstate_clear(void); +extern int nrt_slurmctld_init(void); +extern int nrt_slurmd_init(void); +extern int nrt_slurmd_step_init(void); + +#endif /* _SLURM_NRT_INCLUDED */ diff --git a/src/plugins/switch/nrt/switch_nrt.c b/src/plugins/switch/nrt/switch_nrt.c new file mode 100644 index 0000000000000000000000000000000000000000..21d1271f60037bc77eaff347d8298bfef07d5960 --- /dev/null +++ b/src/plugins/switch/nrt/switch_nrt.c @@ -0,0 +1,868 @@ +/***************************************************************************** \ + * switch_nrt.c - Swtich plugin interface, This calls functions in nrt.c + * which contains the interface to IBM's NRT (Network Routing Table) API + ***************************************************************************** + * Copyright (C) 2004-2007 The Regents of the University of California. + * Copyright (C) 2008 Lawrence Livermore National Security. + * Portions Copyright (C) 2011-2012 SchedMD LLC. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Jason King + * CODE-OCEC-09-009. All rights reserved. + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 +#include +#include +#include +#include +#include + +#include "slurm/slurm_errno.h" +#include "src/common/slurm_xlator.h" +#include "src/common/macros.h" +#include "src/plugins/switch/nrt/slurm_nrt.h" + +#define NRT_BUF_SIZE 4096 + +char local_dir_path[1024]; +bool nrt_need_state_save = false; + +static void _spawn_state_save_thread(char *dir); +static int _switch_p_libstate_save(char * dir_name, bool free_flag); + +/* Type for error string table entries */ +typedef struct { + int xe_number; + char *xe_message; +} slurm_errtab_t; + +static slurm_errtab_t slurm_errtab[] = { + {0, "No error"}, + {-1, "Unspecified error"}, + + /* switch/nrt routine error codes */ + + { ESTATUS, + "Cannot get adapter status" }, + { EADAPTER, + "Open of adapter failed" }, + { ENOADAPTER, + "No adapters found" }, + { EBADMAGIC_NRT_NODEINFO, + "Bad magic in NRT nodeinfo" }, + { EBADMAGIC_NRT_JOBINFO, + "Bad magic in NRT jobinfo" }, + { EBADMAGIC_NRT_LIBSTATE, + "Bad magic in NRT libstate" }, + { EUNPACK, + "Error during unpack" }, + { EHOSTNAME, + "Cannot get hostname" }, + { ENOTSUPPORTED, + "This feature not currently supported" }, + { EVERSION, + "Header/library version mismatch" }, + { EWINDOW, + "Error allocating switch window" }, + { EUNLOAD, + "Error unloading switch window table" } +}; + +/* + * 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 + * + * / + * + * where is a description of the intended application of + * the plugin (e.g., "switch" for SLURM switch) and 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[] = "switch NRT plugin"; +const char plugin_type[] = "switch/nrt"; +const uint32_t plugin_version = 100; + +uint32_t debug_flags = 0; + +/* + * init() is called when the plugin is loaded, before any other functions + * are called. Put global initialization here. + */ +extern int init ( void ) +{ + verbose("%s loaded", plugin_name); + debug_flags = slurm_get_debug_flags(); + + return SLURM_SUCCESS; +} + +extern int fini ( void ) +{ + return nrt_fini(); +} + +extern int switch_p_reconfig ( void ) +{ + debug_flags = slurm_get_debug_flags(); + return SLURM_SUCCESS; +} + +extern int switch_p_slurmctld_init( void ) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_slurmctld_init()"); + + return nrt_slurmctld_init(); +} + +extern int switch_p_slurmd_init( void ) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_slurmd_init()"); + + return nrt_slurmd_init(); +} + +extern int switch_p_slurmd_step_init( void ) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_slurmd_step_init()"); + + return nrt_slurmd_step_init(); +} + +/* + * Switch functions for global state save + * NOTE: Clears current switch state as needed for backup + * controller to repeatedly assume control primary server + */ +extern int switch_p_libstate_save ( char * dir_name ) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_libstate_save()"); + + return _switch_p_libstate_save(dir_name, true); +} + +/* save and purge the libstate if free_flag is true */ +static int _switch_p_libstate_save ( char * dir_name, bool free_flag ) +{ + Buf buffer; + char *file_name; + int ret = SLURM_SUCCESS; + int state_fd; + + buffer = init_buf(NRT_LIBSTATE_LEN); + (void) nrt_libstate_save(buffer, free_flag); + file_name = xstrdup(dir_name); + xstrcat(file_name, "/nrt_state"); + (void) unlink(file_name); + state_fd = creat(file_name, 0600); + if (state_fd < 0) { + error("Can't save state, error creating file %s %m", + file_name); + ret = SLURM_ERROR; + } else { + char *buf = get_buf_data(buffer); + size_t len = get_buf_offset(buffer); + while (1) { + int wrote = write (state_fd, buf, len); + if ((wrote < 0) && (errno == EINTR)) + continue; + if (wrote == 0) + break; + if (wrote < 0) { + error("Can't save switch state: %m"); + ret = SLURM_ERROR; + break; + } + buf += wrote; + len -= wrote; + } + close(state_fd); + } + xfree(file_name); + + if (buffer) + free_buf(buffer); + + return ret; +} + + +/* + * Restore global nodeinfo from a file. + * + * NOTE: switch_p_libstate_restore is only called by slurmctld, and only + * once at start-up. We exploit this fact to spawn a pthread to + * periodically call _switch_p_libstate_save(). + */ +extern int switch_p_libstate_restore ( char * dir_name, bool recover ) +{ + char *data = NULL, *file_name; + Buf buffer = NULL; + int error_code = SLURM_SUCCESS; + int state_fd, data_allocated = 0, data_read = 0, data_size = 0; + + xassert(dir_name != NULL); + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_libstate_restore()"); + + _spawn_state_save_thread(xstrdup(dir_name)); + if (!recover) /* clean start, no recovery */ + return nrt_init(); + + file_name = xstrdup(dir_name); + xstrcat(file_name, "/nrt_state"); + state_fd = open (file_name, O_RDONLY); + if (state_fd >= 0) { + data_allocated = NRT_BUF_SIZE; + data = xmalloc(data_allocated); + while (1) { + data_read = read (state_fd, &data[data_size], + NRT_BUF_SIZE); + if ((data_read < 0) && (errno == EINTR)) + continue; + if (data_read < 0) { + error ("Read error on %s, %m", file_name); + error_code = SLURM_ERROR; + break; + } else if (data_read == 0) + break; + data_size += data_read; + data_allocated += data_read; + xrealloc(data, data_allocated); + } + close (state_fd); + xfree(file_name); + } else { + error("No %s file for switch/nrt state recovery", file_name); + error("Starting switch/nrt with clean state"); + xfree(file_name); + return nrt_init(); + } + + if (error_code == SLURM_SUCCESS) { + buffer = create_buf (data, data_size); + data = NULL; /* now in buffer, don't xfree() */ + if (nrt_libstate_restore(buffer) < 0) + error_code = SLURM_ERROR; + } + + if (buffer) + free_buf(buffer); + xfree(data); + + return error_code; +} + +extern int switch_p_libstate_clear(void) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_libstate_clear()"); + + return nrt_libstate_clear(); +} + +/***************************************************************************** + * switch state monitoring functions + *****************************************************************************/ +/* NOTE: we assume that once the switch state is cleared, + * notification of this will be forwarded to slurmctld. We do not + * enforce that in this function. + */ +extern int switch_p_clear_node_state(void) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_clear_node_state()"); + + return nrt_clear_node_state(); +} + +extern int switch_p_alloc_node_info(switch_node_info_t **switch_node) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_alloc_node_info()"); + + return nrt_alloc_nodeinfo((slurm_nrt_nodeinfo_t **)switch_node); +} + +extern int switch_p_build_node_info(switch_node_info_t *switch_node) +{ + char hostname[256]; + char *tmp; + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_build_node_info()"); + + if (gethostname(hostname, 256) < 0) + slurm_seterrno_ret(EHOSTNAME); + /* remove the domain portion, if necessary */ + tmp = strstr(hostname, "."); + if (tmp) + *tmp = '\0'; + return nrt_build_nodeinfo((slurm_nrt_nodeinfo_t *)switch_node, + hostname); +} + +extern int switch_p_pack_node_info(switch_node_info_t *switch_node, Buf buffer) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_pack_node_info()"); + + return nrt_pack_nodeinfo((slurm_nrt_nodeinfo_t *)switch_node, buffer); +} + +extern int switch_p_unpack_node_info(switch_node_info_t *switch_node, + Buf buffer) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_unpack_node_info()"); + + return nrt_unpack_nodeinfo((slurm_nrt_nodeinfo_t *)switch_node, buffer); +} + +extern void switch_p_free_node_info(switch_node_info_t **switch_node) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_free_node_info()"); + + if (switch_node) + nrt_free_nodeinfo((slurm_nrt_nodeinfo_t *)*switch_node, false); +} + +extern char * switch_p_sprintf_node_info(switch_node_info_t *switch_node, + char *buf, size_t size) +{ + return nrt_print_nodeinfo((slurm_nrt_nodeinfo_t *)switch_node, buf, size); +} + +/* + * switch functions for job step specific credential + */ +extern int switch_p_alloc_jobinfo(switch_jobinfo_t **switch_job) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_alloc_jobinfo()"); + + return nrt_alloc_jobinfo((slurm_nrt_jobinfo_t **)switch_job); +} + +extern int switch_p_build_jobinfo(switch_jobinfo_t *switch_job, char *nodelist, + uint16_t *tasks_per_node, uint32_t **tids, + char *network) +{ + hostlist_t list = NULL; + bool bulk_xfer = false, ip_v4 = true, user_space = false; + uint32_t bulk_xfer_resources = 0; + bool sn_all = true; /* default to sn_all */ + int cau = 0, immed = 0, instances = 1; + int dev_type = NRT_MAX_ADAPTER_TYPES; + int err = SLURM_SUCCESS; + char *adapter_name = NULL; + char *protocol = NULL; + char *network_str = NULL, *token = NULL, *save_ptr = NULL; + + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("switch_p_build_jobinfo(): nodelist:%s network:%s", + nodelist, network); + } else { + debug3("network = \"%s\"", network); + } + + list = hostlist_create(nodelist); + if (!list) + fatal("hostlist_create(%s): %m", nodelist); + + if (network) { + network_str = xstrdup(network); + token = strtok_r(network_str, ",", &save_ptr); + } + while (token) { + /* bulk_xfer options */ + if (!strncasecmp(token, "bulk_xfer=", 10)) { + long int resources; + char *end_ptr = NULL; + bulk_xfer = true; + resources = strtol(token+10, &end_ptr, 10); + if ((end_ptr[0] == 'k') || (end_ptr[0] == 'K')) + resources *= 1024; + else if ((end_ptr[0] == 'm') || (end_ptr[0] == 'M')) + resources *= (1024 * 1024); + else if ((end_ptr[0] == 'g') || (end_ptr[0] == 'G')) + resources *= (1024 * 1024 * 1024); + if (resources >= 0) + bulk_xfer_resources = resources; + else { + info("switch/nrt: invalid option: %s", token); + err = SLURM_ERROR; + } + } else if (!strcasecmp(token, "bulk_xfer")) { + bulk_xfer = true; + + /* device name options */ + } else if (!strncasecmp(token, "devname=", 8)) { + char *name_ptr = token + 8; + if (nrt_adapter_name_check(name_ptr, list)) { + debug("switch/nrt: Found adapter %s in " + "network string", token); + adapter_name = xstrdup(name_ptr); + sn_all = false; + } else { + info("switch/nrt: invalid devname: %s", + name_ptr); + err = SLURM_ERROR; + } + + /* device type options */ + } else if (!strncasecmp(token, "devtype=", 8)) { + char *type_ptr = token + 8; + if (!strcasecmp(type_ptr, "ib")) { + dev_type = NRT_IB; + } else if (!strcasecmp(type_ptr, "hfi")) { + dev_type = NRT_HFI; + } else if (!strcasecmp(type_ptr, "iponly")) { + dev_type = NRT_IPONLY; + } else if (!strcasecmp(type_ptr, "hpce")) { + dev_type = NRT_HPCE; + } else if (!strcasecmp(type_ptr, "kmux")) { + dev_type = NRT_KMUX; + } else { + info("switch/nrt: invalid option: %s", token); + err = SLURM_ERROR; + } + + /* instances options */ + } else if (!strncasecmp(token, "instances=", 10)) { + long int count; + char *end_ptr = NULL; + count = strtol(token+10, &end_ptr, 10); + if ((end_ptr[0] == 'k') || (end_ptr[0] == 'K')) + count *= 1024; + if (count >= 0) + instances = count; + else { + info("switch/nrt: invalid option: %s", token); + err = SLURM_ERROR; + } + + /* network options */ + } else if (!strcasecmp(token, "ip")) { + ip_v4 = true; + } else if (!strcasecmp(token, "ipv4")) { + ip_v4 = true; + } else if (!strcasecmp(token, "ipv6")) { + ip_v4 = false; + } else if (!strcasecmp(token, "us")) { + user_space = true; + + /* protocol options */ + } else if ((!strncasecmp(token, "lapi", 4)) || + (!strncasecmp(token, "mpi", 3)) || + (!strncasecmp(token, "pami", 4)) || + (!strncasecmp(token, "upc", 3))) { + if (protocol) + xstrcat(protocol, ","); + xstrcat(protocol, token); + + /* adapter options */ + } else if (!strcasecmp(token, "sn_all")) { + sn_all = true; + } else if (!strcasecmp(token, "sn_single")) { + sn_all = false; + + /* Collective Acceleration Units (CAU) */ + } else if (!strncasecmp(token, "cau=", 4)) { + long int count; + char *end_ptr = NULL; + count = strtol(token+4, &end_ptr, 10); + if ((end_ptr[0] == 'k') || (end_ptr[0] == 'K')) + count *= 1024; + if (count >= 0) + cau = count; + else { + info("switch/nrt: invalid option: %s", token); + err = SLURM_ERROR; + } + + /* Immediate Send Slots Per Window */ + } else if (!strncasecmp(token, "immed=", 6)) { + long int count; + char *end_ptr = NULL; + count = strtol(token+6, &end_ptr, 10); + if ((end_ptr[0] == 'k') || (end_ptr[0] == 'K')) + count *= 1024; + if (count >= 0) + immed = count; + else { + info("switch/nrt: invalid option: %s", token); + err = SLURM_ERROR; + } + + /* other */ + } else { + info("switch/nrt: invalid option: %s", token); + err = SLURM_ERROR; + } + token = strtok_r(NULL, ",", &save_ptr); + } + + if (protocol == NULL) + xstrcat(protocol, "mpi"); + if (!user_space) { + /* Bulk transfer only supported with user space */ + bulk_xfer = false; + bulk_xfer_resources = 0; + } + + if (err == SLURM_SUCCESS) { + err = nrt_build_jobinfo((slurm_nrt_jobinfo_t *)switch_job, + list, tasks_per_node, tids, sn_all, + adapter_name, dev_type, + bulk_xfer, bulk_xfer_resources, + ip_v4, user_space, protocol, + instances, cau, immed); + } + + nrt_need_state_save = true; + xfree(adapter_name); + xfree(protocol); + hostlist_destroy(list); + xfree(network_str); + + return err; +} + +extern switch_jobinfo_t *switch_p_copy_jobinfo(switch_jobinfo_t *switch_job) +{ + switch_jobinfo_t *j; + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_copy_jobinfo()"); + + j = (switch_jobinfo_t *)nrt_copy_jobinfo((slurm_nrt_jobinfo_t *)switch_job); + if (!j) + error("nrt_copy_jobinfo failed"); + + return j; +} + +extern void switch_p_free_jobinfo(switch_jobinfo_t *switch_job) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_free_jobinfo()"); + + return nrt_free_jobinfo((slurm_nrt_jobinfo_t *)switch_job); +} + +extern int switch_p_pack_jobinfo(switch_jobinfo_t *switch_job, Buf buffer) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_pack_jobinfo()"); + + return nrt_pack_jobinfo((slurm_nrt_jobinfo_t *)switch_job, buffer); +} + +extern int switch_p_unpack_jobinfo(switch_jobinfo_t *switch_job, Buf buffer) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_unpack_jobinfo()"); + + return nrt_unpack_jobinfo((slurm_nrt_jobinfo_t *)switch_job, buffer); +} + +extern int switch_p_get_jobinfo(switch_jobinfo_t *switch_job, int key, + void *resulting_data) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_get_jobinfo()"); + + return nrt_get_jobinfo((slurm_nrt_jobinfo_t *)switch_job, key, + resulting_data); +} + +static inline int _make_step_comp(switch_jobinfo_t *jobinfo, char *nodelist) +{ + hostlist_t list = NULL; + int rc; + + list = hostlist_create(nodelist); + rc = nrt_job_step_complete((slurm_nrt_jobinfo_t *)jobinfo, list); + hostlist_destroy(list); + + return rc; +} + +extern int switch_p_job_step_complete(switch_jobinfo_t *jobinfo, + char *nodelist) +{ + int rc; + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_job_step_complete()"); + + rc = _make_step_comp(jobinfo, nodelist); + nrt_need_state_save = true; + return rc; +} + +extern int switch_p_job_step_part_comp(switch_jobinfo_t *jobinfo, + char *nodelist) +{ + int rc; + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_job_step_part_comp()"); + + rc = _make_step_comp(jobinfo, nodelist); + nrt_need_state_save = true; + return rc; +} + +extern bool switch_p_part_comp(void) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_part_comp()"); + + return true; +} + +extern int switch_p_job_step_allocated(switch_jobinfo_t *jobinfo, + char *nodelist) +{ + hostlist_t list = NULL; + int rc; + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_job_step_allocated()"); + + list = hostlist_create(nodelist); + rc = nrt_job_step_allocated((slurm_nrt_jobinfo_t *)jobinfo, list); + hostlist_destroy(list); + + return rc; +} + +extern void switch_p_print_jobinfo(FILE *fp, switch_jobinfo_t *jobinfo) +{ + return; +} + +extern char *switch_p_sprint_jobinfo(switch_jobinfo_t *switch_jobinfo, + char *buf, size_t size) +{ + return NULL; +} + +/* + * switch functions for job initiation + */ +static bool _nrt_version_ok(void) +{ + if ((NRT_VERSION >= 1100) && (NRT_VERSION <= 1200)) + return true; + error("switch/nrt: Incompatable NRT version"); + return false; +} + +int switch_p_node_init(void) +{ + /* check to make sure the version of the library we compiled with + * matches the one dynamically linked + */ + if (!_nrt_version_ok()) { + slurm_seterrno_ret(EVERSION); + } + + return SLURM_SUCCESS; +} + +extern int switch_p_node_fini(void) +{ + return SLURM_SUCCESS; +} + +extern int switch_p_job_preinit(switch_jobinfo_t *jobinfo) +{ + return SLURM_SUCCESS; +} + +extern int switch_p_job_init (switch_jobinfo_t *jobinfo, uid_t uid, + char *job_name) +{ + pid_t pid; + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_job_init()"); + + pid = getpid(); + return nrt_load_table((slurm_nrt_jobinfo_t *)jobinfo, uid, pid, + job_name); +} + +extern int switch_p_job_fini (switch_jobinfo_t *jobinfo) +{ + return SLURM_SUCCESS; +} + +extern int switch_p_job_postfini(switch_jobinfo_t *jobinfo, uid_t pgid, + uint32_t job_id, uint32_t step_id) +{ + int err; + + if (debug_flags & DEBUG_FLAG_SWITCH) + info("switch_p_job_postfini()"); + + /* + * Kill all processes in the job's session + */ + if (pgid) { + debug2("Sending SIGKILL to pgid %lu", + (unsigned long) pgid); + kill(-pgid, SIGKILL); + } else + debug("Job %u.%u: pgid value is zero", job_id, step_id); + + err = nrt_unload_table((slurm_nrt_jobinfo_t *)jobinfo); + if (err != SLURM_SUCCESS) + return SLURM_ERROR; + + return SLURM_SUCCESS; +} + +extern int switch_p_job_attach(switch_jobinfo_t *jobinfo, char ***env, + uint32_t nodeid, uint32_t procid, + uint32_t nnodes, uint32_t nprocs, uint32_t rank) +{ + if (debug_flags & DEBUG_FLAG_SWITCH) { + info("switch_p_job_attach()"); + info("nodeid = %u", nodeid); + info("procid = %u", procid); + info("nnodes = %u", nnodes); + info("nprocs = %u", nprocs); + info("rank = %u", rank); + } + + return SLURM_SUCCESS; +} + +/* + * switch functions for other purposes + */ + +/* + * Linear search through table of errno values and strings, + * returns NULL on error, string on success. + */ +static char *_lookup_slurm_api_errtab(int errnum) +{ + char *res = NULL; + int i; + + for (i = 0; i < sizeof(slurm_errtab) / sizeof(slurm_errtab_t); i++) { + if (slurm_errtab[i].xe_number == errnum) { + res = slurm_errtab[i].xe_message; + break; + } + } + return res; +} + +extern int switch_p_get_errno(void) +{ + int err = slurm_get_errno(); + + if ((err >= ESLURM_SWITCH_MIN) && (err <= ESLURM_SWITCH_MAX)) + return err; + + return SLURM_SUCCESS; +} + +extern char *switch_p_strerror(int errnum) +{ + char *res = _lookup_slurm_api_errtab(errnum); + return (res ? res : strerror(errnum)); +} + + +static void *_state_save_thread(void *arg) +{ + char *dir_name = (char *)arg; + + strncpy(local_dir_path, dir_name, sizeof(local_dir_path)); + xfree(dir_name); + + while (1) { + sleep(10); + if (nrt_need_state_save) { + nrt_need_state_save = false; + _switch_p_libstate_save(local_dir_path, false); + } + } + + return NULL; +} + +static void _spawn_state_save_thread(char *dir) +{ + pthread_attr_t attr; + pthread_t id; + + slurm_attr_init(&attr); + + if (pthread_create(&id, &attr, &_state_save_thread, (void *)dir) != 0) + error("Could not start switch/nrt state saving pthread"); + + slurm_attr_destroy(&attr); +} diff --git a/src/plugins/task/Makefile.in b/src/plugins/task/Makefile.in index bdb16c6112da2b25cc8836c2a00bbb26da172bd6..37669124beed3554c434e907e0f37930de6073a9 100644 --- a/src/plugins/task/Makefile.in +++ b/src/plugins/task/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/task/affinity/Makefile.in b/src/plugins/task/affinity/Makefile.in index 4b3efec9b27bc4328ff2d64ac97111b124b156c9..d2bde7ad487600bc777f3c3248f8ed399125679b 100644 --- a/src/plugins/task/affinity/Makefile.in +++ b/src/plugins/task/affinity/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) task_affinity_la_LIBADD = @@ -183,9 +188,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -193,9 +196,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -227,6 +229,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -254,6 +258,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -431,7 +436,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -task_affinity.la: $(task_affinity_la_OBJECTS) $(task_affinity_la_DEPENDENCIES) +task_affinity.la: $(task_affinity_la_OBJECTS) $(task_affinity_la_DEPENDENCIES) $(EXTRA_task_affinity_la_DEPENDENCIES) $(task_affinity_la_LINK) $(am_task_affinity_la_rpath) $(task_affinity_la_OBJECTS) $(task_affinity_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -573,10 +578,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/task/affinity/affinity.h b/src/plugins/task/affinity/affinity.h index 74a62df8c8be0486d87f0e6fe19aee78465c6dd6..0a4ac46a4d2855f79524fa13718ff33e73893c01 100644 --- a/src/plugins/task/affinity/affinity.h +++ b/src/plugins/task/affinity/affinity.h @@ -81,6 +81,7 @@ #include "src/slurmd/slurmstepd/slurmstepd_job.h" #include "src/common/cbuf.h" +#include "src/common/cpu_frequency.h" #include "src/common/hostlist.h" #include "src/common/log.h" #include "src/common/node_select.h" diff --git a/src/plugins/task/affinity/task_affinity.c b/src/plugins/task/affinity/task_affinity.c index 1e4ad92344199de9f5539f513aca557396c5d483..ee90ec14edbe9a8a004923830cafd691fff0c4a4 100644 --- a/src/plugins/task/affinity/task_affinity.c +++ b/src/plugins/task/affinity/task_affinity.c @@ -300,6 +300,7 @@ extern int task_slurmd_release_resources (uint32_t job_id) extern int task_pre_setuid (slurmd_job_t *job) { char path[PATH_MAX]; + int rc; if (!(conf->task_plugin_param & CPU_BIND_CPUSETS)) return SLURM_SUCCESS; @@ -319,7 +320,14 @@ extern int task_pre_setuid (slurmd_job_t *job) return SLURM_ERROR; } #endif - return slurm_build_cpuset(CPUSET_DIR, path, job->uid, job->gid); + + rc = slurm_build_cpuset(CPUSET_DIR, path, job->uid, job->gid); + + /* if cpuset was built ok, check for cpu frequency setting */ + if ( !(rc) && (job->cpu_freq != NO_VAL)) + cpu_freq_cpuset_validate(job); + + return rc; } /* diff --git a/src/plugins/task/cgroup/Makefile.in b/src/plugins/task/cgroup/Makefile.in index b2df2be6d2513c758755d82201b42528285ec9d8..68c9e14ce63d0a7aaa83c0bcb60c13abe0b30e5e 100644 --- a/src/plugins/task/cgroup/Makefile.in +++ b/src/plugins/task/cgroup/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) task_cgroup_la_LIBADD = @@ -174,9 +179,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -184,9 +187,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -218,6 +220,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -245,6 +249,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -413,7 +418,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -task_cgroup.la: $(task_cgroup_la_OBJECTS) $(task_cgroup_la_DEPENDENCIES) +task_cgroup.la: $(task_cgroup_la_OBJECTS) $(task_cgroup_la_DEPENDENCIES) $(EXTRA_task_cgroup_la_DEPENDENCIES) $(task_cgroup_la_LINK) -rpath $(pkglibdir) $(task_cgroup_la_OBJECTS) $(task_cgroup_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -581,10 +586,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/task/cgroup/task_cgroup_cpuset.c b/src/plugins/task/cgroup/task_cgroup_cpuset.c index 8779a7f97a25aabd47c725cb02e86f278e7dea0d..75ff2e82119399a9bf769abd9f8345523f320277 100644 --- a/src/plugins/task/cgroup/task_cgroup_cpuset.c +++ b/src/plugins/task/cgroup/task_cgroup_cpuset.c @@ -48,6 +48,7 @@ #include "slurm/slurm.h" #include "src/slurmd/slurmstepd/slurmstepd_job.h" #include "src/slurmd/slurmd/slurmd.h" +#include "src/common/cpu_frequency.h" #include "src/common/bitstring.h" #include "src/common/xstring.h" @@ -685,6 +686,11 @@ extern int task_cgroup_cpuset_create(slurmd_job_t *job) } else fstatus = SLURM_SUCCESS; + /* validate the requested cpu frequency and set it */ + if (job->cpu_freq != NO_VAL) { + cpu_freq_cgroup_validate(job, step_alloc_cores); + } + error: xcgroup_unlock(&cpuset_cg); xcgroup_destroy(&cpuset_cg); diff --git a/src/plugins/task/none/Makefile.in b/src/plugins/task/none/Makefile.in index f30cad8d483ddeed7783d32a5c73388e7d1f7c59..56e6341d7d69f0c3755d5ef2454a99d011db7044 100644 --- a/src/plugins/task/none/Makefile.in +++ b/src/plugins/task/none/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) task_none_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -task_none.la: $(task_none_la_OBJECTS) $(task_none_la_DEPENDENCIES) +task_none.la: $(task_none_la_OBJECTS) $(task_none_la_DEPENDENCIES) $(EXTRA_task_none_la_DEPENDENCIES) $(task_none_la_LINK) -rpath $(pkglibdir) $(task_none_la_OBJECTS) $(task_none_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/topology/3d_torus/Makefile.in b/src/plugins/topology/3d_torus/Makefile.in index aeabe2888e8e166d959ee5c90b4616bcc53fc9a1..de32bc5514ce2a75b892d9867cadfed526411411 100644 --- a/src/plugins/topology/3d_torus/Makefile.in +++ b/src/plugins/topology/3d_torus/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) topology_3d_torus_la_LIBADD = @@ -172,9 +177,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -182,9 +185,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -216,6 +218,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -243,6 +247,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -411,7 +416,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -topology_3d_torus.la: $(topology_3d_torus_la_OBJECTS) $(topology_3d_torus_la_DEPENDENCIES) +topology_3d_torus.la: $(topology_3d_torus_la_OBJECTS) $(topology_3d_torus_la_DEPENDENCIES) $(EXTRA_topology_3d_torus_la_DEPENDENCIES) $(topology_3d_torus_la_LINK) -rpath $(pkglibdir) $(topology_3d_torus_la_OBJECTS) $(topology_3d_torus_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -550,10 +555,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/topology/Makefile.in b/src/plugins/topology/Makefile.in index e9391f55183aef4bb362dcf78621739dcec1ced0..ba41309e21d69a58abde03f55a5b70b7dc510e2b 100644 --- a/src/plugins/topology/Makefile.in +++ b/src/plugins/topology/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -166,9 +165,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -176,9 +173,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -210,6 +206,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -237,6 +235,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -576,10 +575,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/topology/node_rank/Makefile.in b/src/plugins/topology/node_rank/Makefile.in index 4e6581e47efbf22630aa1a553ded12b3b7fa3708..7e3df5f23f94fe1e9632e4c87f83f9538a3ce336 100644 --- a/src/plugins/topology/node_rank/Makefile.in +++ b/src/plugins/topology/node_rank/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) topology_node_rank_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -topology_node_rank.la: $(topology_node_rank_la_OBJECTS) $(topology_node_rank_la_DEPENDENCIES) +topology_node_rank.la: $(topology_node_rank_la_OBJECTS) $(topology_node_rank_la_DEPENDENCIES) $(EXTRA_topology_node_rank_la_DEPENDENCIES) $(topology_node_rank_la_LINK) -rpath $(pkglibdir) $(topology_node_rank_la_OBJECTS) $(topology_node_rank_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/topology/none/Makefile.in b/src/plugins/topology/none/Makefile.in index 49edbcb57a10705207fafe3752150e7bdf2c3020..587d02e13534e1338d7c3858fb92642464d8ce26 100644 --- a/src/plugins/topology/none/Makefile.in +++ b/src/plugins/topology/none/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) topology_none_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -405,7 +410,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -topology_none.la: $(topology_none_la_OBJECTS) $(topology_none_la_DEPENDENCIES) +topology_none.la: $(topology_none_la_OBJECTS) $(topology_none_la_DEPENDENCIES) $(EXTRA_topology_none_la_DEPENDENCIES) $(topology_none_la_LINK) -rpath $(pkglibdir) $(topology_none_la_OBJECTS) $(topology_none_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -542,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/plugins/topology/tree/Makefile.in b/src/plugins/topology/tree/Makefile.in index 06e3ee413a02bb4080c8ee89e05fe0661aac6ace..ab62c7889ceaa917794edad5290128c1bdf03995 100644 --- a/src/plugins/topology/tree/Makefile.in +++ b/src/plugins/topology/tree/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -105,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ 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) topology_tree_la_LIBADD = @@ -171,9 +176,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +184,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +217,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +246,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -406,7 +411,7 @@ clean-pkglibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -topology_tree.la: $(topology_tree_la_OBJECTS) $(topology_tree_la_DEPENDENCIES) +topology_tree.la: $(topology_tree_la_OBJECTS) $(topology_tree_la_DEPENDENCIES) $(EXTRA_topology_tree_la_DEPENDENCIES) $(topology_tree_la_LINK) -rpath $(pkglibdir) $(topology_tree_la_OBJECTS) $(topology_tree_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -543,10 +548,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sacct/Makefile.am b/src/sacct/Makefile.am index d203aaf3d8136d693e7b6e49408333963db6cd33..7acfcb86704c491d755ece97fed43b7854772465 100644 --- a/src/sacct/Makefile.am +++ b/src/sacct/Makefile.am @@ -9,7 +9,8 @@ bin_PROGRAMS = sacct sacct_LDADD = $(top_builddir)/src/db_api/libslurmdb.o $(DL_LIBS) -sacct_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sacct_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) noinst_HEADERS = sacct.c sacct_SOURCES = \ diff --git a/src/sacct/Makefile.in b/src/sacct/Makefile.in index 113d390c761ba50138ab6e9bf89e9a368ff27216..75b11a1df1e750d36fd3319492693242957fdc29 100644 --- a/src/sacct/Makefile.in +++ b/src/sacct/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -60,9 +60,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -70,6 +68,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -157,9 +156,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -167,9 +164,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -201,6 +197,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -228,6 +226,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -322,7 +321,9 @@ AUTOMAKE_OPTIONS = foreign CLEANFILES = core.* INCLUDES = -I$(top_srcdir) sacct_LDADD = $(top_builddir)/src/db_api/libslurmdb.o $(DL_LIBS) -sacct_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sacct_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + noinst_HEADERS = sacct.c sacct_SOURCES = \ options.c \ @@ -408,7 +409,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sacct$(EXEEXT): $(sacct_OBJECTS) $(sacct_DEPENDENCIES) +sacct$(EXEEXT): $(sacct_OBJECTS) $(sacct_DEPENDENCIES) $(EXTRA_sacct_DEPENDENCIES) @rm -f sacct$(EXEEXT) $(sacct_LINK) $(sacct_OBJECTS) $(sacct_LDADD) $(LIBS) @@ -549,10 +550,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sacctmgr/Makefile.am b/src/sacctmgr/Makefile.am index 584b4b5856c1eff4f3c5c2d6275958b18eabe270..9a887d4e6fe7120c44d472aac8bb5e3f5764748d 100644 --- a/src/sacctmgr/Makefile.am +++ b/src/sacctmgr/Makefile.am @@ -27,7 +27,8 @@ sacctmgr_SOURCES = \ wckey_functions.c \ problem_functions.c -sacctmgr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sacctmgr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(sacctmgr_LDADD) : force diff --git a/src/sacctmgr/Makefile.in b/src/sacctmgr/Makefile.in index 8d32e246ffa875d3f2097b05b650f29a44bf1b27..3d0aab24b5f355c65500956cb98a3f0efdd1d481 100644 --- a/src/sacctmgr/Makefile.in +++ b/src/sacctmgr/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -160,9 +159,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -170,9 +167,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -204,6 +200,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -231,6 +229,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -344,7 +343,9 @@ sacctmgr_SOURCES = \ wckey_functions.c \ problem_functions.c -sacctmgr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sacctmgr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -422,7 +423,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sacctmgr$(EXEEXT): $(sacctmgr_OBJECTS) $(sacctmgr_DEPENDENCIES) +sacctmgr$(EXEEXT): $(sacctmgr_OBJECTS) $(sacctmgr_DEPENDENCIES) $(EXTRA_sacctmgr_DEPENDENCIES) @rm -f sacctmgr$(EXEEXT) $(sacctmgr_LINK) $(sacctmgr_OBJECTS) $(sacctmgr_LDADD) $(LIBS) @@ -574,10 +575,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sacctmgr/archive_functions.c b/src/sacctmgr/archive_functions.c index 0dbafb0a740c3c810c2400b71982fefc2350ebe6..dacdb7039d62303d05040be5fb948661ce8f8e85 100644 --- a/src/sacctmgr/archive_functions.c +++ b/src/sacctmgr/archive_functions.c @@ -38,6 +38,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ +#include + #include "src/sacctmgr/sacctmgr.h" #include /* MAXPATHLEN */ #include "src/common/proc_args.h" diff --git a/src/sacctmgr/sacctmgr.h b/src/sacctmgr/sacctmgr.h index bb8d9b2449cae224d5959d4bdcb88c5af93404f1..c535f2265086a7ecbe9d93102ab3eb1b38bb46c6 100644 --- a/src/sacctmgr/sacctmgr.h +++ b/src/sacctmgr/sacctmgr.h @@ -78,7 +78,7 @@ #include "slurm/slurm.h" -#include "src/common/jobacct_common.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/parse_time.h" #include "src/common/slurm_accounting_storage.h" #include "src/common/xstring.h" @@ -86,6 +86,7 @@ #define CKPT_WAIT 10 #define MAX_INPUT_FIELDS 128 +#define BUFFER_SIZE 4096 typedef enum { /* COMMON */ diff --git a/src/salloc/Makefile.am b/src/salloc/Makefile.am index 4ef6a74a514efe33b51eff78d40fee8072479bc8..885818538a15507441699f6f34d04257853ff28b 100644 --- a/src/salloc/Makefile.am +++ b/src/salloc/Makefile.am @@ -18,7 +18,8 @@ if HAVE_REAL_CRAY salloc_LDADD += -ljob endif -salloc_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +salloc_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(convenience_libs) : force diff --git a/src/salloc/Makefile.in b/src/salloc/Makefile.in index 6d0f889cef4dd96214d178ac9576a150f56f2051..cf83a3adbcb94fc107aba93793a721386a8dc91a 100644 --- a/src/salloc/Makefile.in +++ b/src/salloc/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -59,9 +59,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -69,6 +67,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -155,9 +154,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -165,9 +162,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -199,6 +195,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -226,6 +224,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -322,7 +321,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) salloc_SOURCES = salloc.c salloc.h opt.c opt.h convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) salloc_LDADD = $(convenience_libs) $(am__append_1) -salloc_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +salloc_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -400,7 +401,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -salloc$(EXEEXT): $(salloc_OBJECTS) $(salloc_DEPENDENCIES) +salloc$(EXEEXT): $(salloc_OBJECTS) $(salloc_DEPENDENCIES) $(EXTRA_salloc_DEPENDENCIES) @rm -f salloc$(EXEEXT) $(salloc_LINK) $(salloc_OBJECTS) $(salloc_LDADD) $(LIBS) @@ -539,10 +540,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sattach/Makefile.am b/src/sattach/Makefile.am index 1f6b88518f36b3fcbec85315094d899e836c72e9..4ca5a0b3f3ce39192e54182d01d409d349263357 100644 --- a/src/sattach/Makefile.am +++ b/src/sattach/Makefile.am @@ -17,7 +17,8 @@ convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) sattach_LDADD = \ $(convenience_libs) -sattach_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sattach_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(convenience_libs) : force diff --git a/src/sattach/Makefile.in b/src/sattach/Makefile.in index 355859db16c77ee66a25ef5a4aaf1d4113437f4a..c6a4ad49eb95e3da85fc84ebdcffe772661604e5 100644 --- a/src/sattach/Makefile.in +++ b/src/sattach/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -155,9 +154,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -165,9 +162,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -199,6 +195,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -226,6 +224,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -328,7 +327,9 @@ convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) sattach_LDADD = \ $(convenience_libs) -sattach_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sattach_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -406,7 +407,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sattach$(EXEEXT): $(sattach_OBJECTS) $(sattach_DEPENDENCIES) +sattach$(EXEEXT): $(sattach_OBJECTS) $(sattach_DEPENDENCIES) $(EXTRA_sattach_DEPENDENCIES) @rm -f sattach$(EXEEXT) $(sattach_LINK) $(sattach_OBJECTS) $(sattach_LDADD) $(LIBS) @@ -547,10 +548,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sattach/sattach.c b/src/sattach/sattach.c index 697f424af105e9cc923c9923e4037c742035777b..3a8b45ebd6586c379e6d29508f9a6027b1aea1a1 100644 --- a/src/sattach/sattach.c +++ b/src/sattach/sattach.c @@ -456,7 +456,7 @@ static message_thread_state_t *_msg_thr_create(int num_nodes, int num_tasks) mts->resp_port = xmalloc(sizeof(uint16_t) * mts->num_resp_port); for (i = 0; i < mts->num_resp_port; i++) { if (net_stream_listen(&sock, &port) < 0) { - error("unable to intialize step launch" + error("unable to initialize step launch" " listening socket: %m"); goto fail; } diff --git a/src/sbatch/Makefile.am b/src/sbatch/Makefile.am index 9b88be83fecc3ce0010670c1608d0e5c41f7ba19..929c22bb3c3a2e08a424bf0a7f70f5dbbfc13baf 100644 --- a/src/sbatch/Makefile.am +++ b/src/sbatch/Makefile.am @@ -13,7 +13,8 @@ convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) sbatch_LDADD = $(convenience_libs) -sbatch_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sbatch_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(convenience_libs) : force diff --git a/src/sbatch/Makefile.in b/src/sbatch/Makefile.in index bd9052b1d4db09058f930fe8660ad55d85a26af3..80127584c0f53024b10ce506698ee996ae026749 100644 --- a/src/sbatch/Makefile.in +++ b/src/sbatch/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -155,9 +154,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -165,9 +162,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -199,6 +195,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -226,6 +224,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -322,7 +321,9 @@ INCLUDES = -I$(top_srcdir) sbatch_SOURCES = sbatch.c mult_cluster.c mult_cluster.h opt.c opt.h convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) sbatch_LDADD = $(convenience_libs) -sbatch_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sbatch_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -400,7 +401,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sbatch$(EXEEXT): $(sbatch_OBJECTS) $(sbatch_DEPENDENCIES) +sbatch$(EXEEXT): $(sbatch_OBJECTS) $(sbatch_DEPENDENCIES) $(EXTRA_sbatch_DEPENDENCIES) @rm -f sbatch$(EXEEXT) $(sbatch_LINK) $(sbatch_OBJECTS) $(sbatch_LDADD) $(LIBS) @@ -540,10 +541,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c index 59fa03a778458c6ca86c56993d2d8e667308953d..4aedfbcdea9a5ed230c72c79beb8fc441b6f0f03 100644 --- a/src/sbatch/opt.c +++ b/src/sbatch/opt.c @@ -2161,7 +2161,7 @@ static bool _opt_verify(void) setenv("SLURM_JOB_NAME", opt.job_name, 0); /* check for realistic arguments */ - if (opt.ntasks <= 0) { + if (opt.ntasks < 0) { error("invalid number of tasks (-n %d)", opt.ntasks); verified = false; } @@ -2365,8 +2365,7 @@ static bool _opt_verify(void) if(!opt.nodes_set) { opt.nodes_set = 1; hostlist_uniq(hl); - opt.min_nodes = opt.max_nodes - = hostlist_count(hl); + opt.min_nodes = opt.max_nodes = hostlist_count(hl); } hostlist_destroy(hl); } diff --git a/src/sbatch/sbatch.c b/src/sbatch/sbatch.c index 97e311fdaa5570f39703fdc557701dd130364516..841fcc8f5e9303cd69d967ea9b2c983349d970c9 100644 --- a/src/sbatch/sbatch.c +++ b/src/sbatch/sbatch.c @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) _set_exit_code(); if (spank_init_allocator() < 0) { - error("Failed to intialize plugin stack"); + error("Failed to initialize plugin stack"); exit(error_exit); } @@ -262,7 +262,7 @@ static int _check_cluster_specific_settings(job_desc_msg_t *req) /* Returns 0 on success, -1 on failure */ static int _fill_job_desc_from_opts(job_desc_msg_t *desc) { - int i; + int i; extern char **environ; if (opt.jobid_set) @@ -281,12 +281,14 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc) desc->req_nodes = opt.nodelist; desc->exc_nodes = opt.exc_nodes; desc->partition = opt.partition; - if (opt.nodes_set || opt.min_nodes) - desc->min_nodes = opt.min_nodes; if (opt.licenses) desc->licenses = xstrdup(opt.licenses); - if (opt.nodes_set || opt.max_nodes) - desc->max_nodes = opt.max_nodes; + if (opt.nodes_set) { + desc->min_nodes = opt.min_nodes; + if (opt.max_nodes) + desc->max_nodes = opt.max_nodes; + } else if (opt.ntasks_set && (opt.ntasks == 0)) + desc->min_nodes = 0; if (opt.ntasks_per_node) desc->ntasks_per_node = opt.ntasks_per_node; desc->user_id = opt.uid; @@ -360,6 +362,8 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc) desc->overcommit = opt.overcommit; } else if (opt.cpus_set) desc->min_cpus = opt.ntasks * opt.cpus_per_task; + else if (opt.nodes_set && (opt.min_nodes == 0)) + desc->min_cpus = 0; else desc->min_cpus = opt.ntasks; @@ -416,7 +420,7 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc) "SLURM_GET_USER_ENV", "1"); } - if(opt.distribution == SLURM_DIST_ARBITRARY) { + if (opt.distribution == SLURM_DIST_ARBITRARY) { env_array_overwrite_fmt(&desc->environment, "SLURM_ARBITRARY_NODELIST", "%s", desc->req_nodes); diff --git a/src/sbcast/Makefile.am b/src/sbcast/Makefile.am index 6ec2083e5e2968121d7b2271203caeb8acc16bf9..166f66f80e68bcb1a06f8168d60da6b968eb8683 100644 --- a/src/sbcast/Makefile.am +++ b/src/sbcast/Makefile.am @@ -15,5 +15,6 @@ force: $(sbcast_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sbcast_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sbcast_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/sbcast/Makefile.in b/src/sbcast/Makefile.in index 6b3b74f36d8df0c00a858c986ee8104a85ae300c..1e3e5dba44de596b885386402b17b2c34e7a40a6 100644 --- a/src/sbcast/Makefile.in +++ b/src/sbcast/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -61,9 +61,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -71,6 +69,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -157,9 +156,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -167,9 +164,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -201,6 +197,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -228,6 +226,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -323,7 +322,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) sbcast_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) -lm noinst_HEADERS = sbcast.h sbcast_SOURCES = agent.c sbcast.c opts.c -sbcast_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sbcast_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -401,7 +402,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sbcast$(EXEEXT): $(sbcast_OBJECTS) $(sbcast_DEPENDENCIES) +sbcast$(EXEEXT): $(sbcast_OBJECTS) $(sbcast_DEPENDENCIES) $(EXTRA_sbcast_DEPENDENCIES) @rm -f sbcast$(EXEEXT) $(sbcast_LINK) $(sbcast_OBJECTS) $(sbcast_LDADD) $(LIBS) @@ -541,10 +542,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/scancel/Makefile.am b/src/scancel/Makefile.am index f8aa1d75bdee4ee5aff3d34ac9f186cb6648e885..7bd9beef046d4f259d66c080755d447757028490 100644 --- a/src/scancel/Makefile.am +++ b/src/scancel/Makefile.am @@ -11,7 +11,8 @@ scancel_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = scancel.h scancel_SOURCES = scancel.c opt.c -scancel_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +scancel_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(scancel_LDADD) : force diff --git a/src/scancel/Makefile.in b/src/scancel/Makefile.in index eb7f4586449e6a8f9a31c5afba0dbae48697ba38..131a7c944d6cd6edda99de348b4d126d0617a376 100644 --- a/src/scancel/Makefile.in +++ b/src/scancel/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -60,9 +60,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -70,6 +68,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -156,9 +155,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -166,9 +163,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -200,6 +196,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -227,6 +225,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -322,7 +321,9 @@ INCLUDES = -I$(top_srcdir) scancel_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = scancel.h scancel_SOURCES = scancel.c opt.c -scancel_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +scancel_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -400,7 +401,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -scancel$(EXEEXT): $(scancel_OBJECTS) $(scancel_DEPENDENCIES) +scancel$(EXEEXT): $(scancel_OBJECTS) $(scancel_DEPENDENCIES) $(EXTRA_scancel_DEPENDENCIES) @rm -f scancel$(EXEEXT) $(scancel_LINK) $(scancel_OBJECTS) $(scancel_LDADD) $(LIBS) @@ -539,10 +540,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/scontrol/Makefile.am b/src/scontrol/Makefile.am index af1c41183aa7b952ce07a31c5f4a5cafc5d57f91..316506270abcff645aacefca3d3ee11316aa92e5 100644 --- a/src/scontrol/Makefile.am +++ b/src/scontrol/Makefile.am @@ -27,7 +27,8 @@ scontrol_LDADD = \ $(convenience_libs) \ $(READLINE_LIBS) -scontrol_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +scontrol_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(convenience_libs) : force diff --git a/src/scontrol/Makefile.in b/src/scontrol/Makefile.in index 69322736ee21ef02f309e4e08bce23ba5fb39685..3091c3a888b5dfc081342eff653fb33390068b0d 100644 --- a/src/scontrol/Makefile.in +++ b/src/scontrol/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -158,9 +157,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -168,9 +165,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -202,6 +198,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -229,6 +227,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -340,7 +339,9 @@ scontrol_LDADD = \ $(convenience_libs) \ $(READLINE_LIBS) -scontrol_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +scontrol_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -418,7 +419,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -scontrol$(EXEEXT): $(scontrol_OBJECTS) $(scontrol_DEPENDENCIES) +scontrol$(EXEEXT): $(scontrol_OBJECTS) $(scontrol_DEPENDENCIES) $(EXTRA_scontrol_DEPENDENCIES) @rm -f scontrol$(EXEEXT) $(scontrol_LINK) $(scontrol_OBJECTS) $(scontrol_LDADD) $(LIBS) @@ -566,10 +567,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/scontrol/create_res.c b/src/scontrol/create_res.c index 15b4d24daf2f01853371f397152042f20eaf34d4..0267e4a87f0339519038c0efd673fd1305dfaa30 100644 --- a/src/scontrol/create_res.c +++ b/src/scontrol/create_res.c @@ -76,8 +76,8 @@ static char * _process_plus_minus(char plus_or_minus, char *src) /* * _parse_flags is used to parse the Flags= option. It handles - * daily, weekly, static_alloc, and maint, optionally preceded by + or -, - * separated by a comma but no spaces. + * daily, weekly, static_alloc, part_nodes, and maint, optionally + * preceded by + or -, separated by a comma but no spaces. */ static uint32_t _parse_flags(const char *flagstr, const char *msg) { @@ -144,6 +144,13 @@ static uint32_t _parse_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)) + == 0) { + curr += taglen; + if (flip) + outflags |= RESERVE_FLAG_NO_PART_NODES; + else + outflags |= RESERVE_FLAG_PART_NODES; } else { error("Error parsing flags %s. %s", flagstr, msg); return 0xffffffff; @@ -284,8 +291,10 @@ scontrol_parse_res_options(int argc, char *argv[], const char *msg, } xfree(node_cnt); - } else if (strncasecmp(tag, "CoreCnt", MAX(taglen,5)) == 0 || - strncasecmp(tag, "CoreCount", MAX(taglen,5)) == 0) { + } else if (strncasecmp(tag, "CoreCnt", MAX(taglen,5)) == 0 || + strncasecmp(tag, "CoreCount", MAX(taglen,5)) == 0 || + strncasecmp(tag, "CPUCnt", MAX(taglen,5)) == 0 || + strncasecmp(tag, "CPUCount", MAX(taglen,5)) == 0) { char *endptr = NULL; resv_msg_ptr->core_cnt = strtol(val, &endptr, 10); @@ -480,18 +489,33 @@ scontrol_create_res(int argc, char *argv[]) resv_msg.node_list = NULL; } } + /* + * If "all" is specified for the nodes and RESERVE_FLAG_PART_NODES + * 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) && + (resv_msg.flags != (uint16_t) NO_VAL) && + (resv_msg.flags & RESERVE_FLAG_PART_NODES)) { + exit_code = 1; + error("Part_Nodes flag requires specifying a Partition. " + "No reservation created."); + goto SCONTROL_CREATE_RES_CLEANUP; + } /* * If the following parameters are null, but a partition is named, then * make the reservation for the whole partition. */ - if ((resv_msg.node_cnt == NULL || resv_msg.node_cnt[0] == 0) && + if ((resv_msg.core_cnt == 0) && + (resv_msg.node_cnt == NULL || resv_msg.node_cnt[0] == 0) && (resv_msg.node_list == NULL || resv_msg.node_list[0] == '\0') && (resv_msg.licenses == NULL || resv_msg.licenses[0] == '\0')) { if (resv_msg.partition == NULL) { exit_code = 1; - error("Nodes, NodeCnt or Licenses must be specified. " - "No reservation created."); + error("CoreCnt, Nodes, NodeCnt or Licenses must be " + "specified. No reservation created."); goto SCONTROL_CREATE_RES_CLEANUP; } else if ((node_count = _partition_node_count(resv_msg.partition)) == NO_VAL) { diff --git a/src/scontrol/info_job.c b/src/scontrol/info_job.c index 97caab696a1c45325f5be5f1453ad15b03e4bf04..3f9e8b05fd8facd801f8ecb47135653666a6fb61 100644 --- a/src/scontrol/info_job.c +++ b/src/scontrol/info_job.c @@ -84,8 +84,11 @@ _scontrol_load_jobs(job_info_msg_t ** job_buffer_pptr, uint32_t job_id) if (all_flag) show_flags |= SHOW_ALL; - if (detail_flag) + if (detail_flag) { show_flags |= SHOW_DETAIL; + if (detail_flag > 1) + show_flags |= SHOW_DETAIL2; + } if (old_job_info_ptr) { if (last_show_flags != show_flags) diff --git a/src/scontrol/scontrol.c b/src/scontrol/scontrol.c index 7ff08373c72f69845e568dc39c9b0850b76f5ec3..96a33d785b55691a378bb8af96656768ca16cbcd 100644 --- a/src/scontrol/scontrol.c +++ b/src/scontrol/scontrol.c @@ -143,7 +143,7 @@ main (int argc, char *argv[]) all_flag = 1; break; case (int)'d': - detail_flag = 1; + detail_flag++; break; case (int)'h': _usage (); @@ -564,8 +564,9 @@ static int _reboot_nodes(char *node_list) conf = slurm_conf_lock(); if (conf->reboot_program == NULL) { - fprintf (stderr, "RebootProgram isn't defined"); + error("RebootProgram isn't defined"); slurm_conf_unlock(); + slurm_seterrno(SLURM_ERROR); return SLURM_ERROR; } slurm_conf_unlock(); @@ -705,6 +706,16 @@ _process_command (int argc, char *argv[]) } detail_flag = 1; } + else if (strncasecmp (tag, "script", MAX(tag_len, 3)) == 0) { + if (argc > 1) { + exit_code = 1; + fprintf (stderr, + "too many arguments for keyword:%s\n", + tag); + return 0; + } + detail_flag = 2; + } else if (strncasecmp (tag, "exit", MAX(tag_len, 1)) == 0) { if (argc > 1) { exit_code = 1; @@ -1038,7 +1049,7 @@ _process_command (int argc, char *argv[]) } } } - else if (strncasecmp (tag, "schedloglevel", MAX(tag_len, 2)) == 0) { + else if (strncasecmp (tag, "schedloglevel", MAX(tag_len, 3)) == 0) { if (argc > 2) { exit_code = 1; if (quiet_flag != 1) diff --git a/src/sdiag/Makefile.am b/src/sdiag/Makefile.am index 2f111e8a623a8b39422534c9336cb51c1430ef51..4b1a92c796271687ad31bcfe79531156c69a9293 100644 --- a/src/sdiag/Makefile.am +++ b/src/sdiag/Makefile.am @@ -14,5 +14,6 @@ force: $(sdiag_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sdiag_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sdiag_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/sdiag/Makefile.in b/src/sdiag/Makefile.in index f113fd545955805af96e0ae81e69056b468736e3..5128c731a738bbca88c892d55fa5bab16c200ca0 100644 --- a/src/sdiag/Makefile.in +++ b/src/sdiag/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -59,9 +59,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -69,6 +67,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -154,9 +153,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -164,9 +161,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -198,6 +194,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -225,6 +223,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -319,7 +318,9 @@ AUTOMAKE_OPTIONS = foreign INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) sdiag_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) sdiag_SOURCES = sdiag.c opts.c -sdiag_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sdiag_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -397,7 +398,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sdiag$(EXEEXT): $(sdiag_OBJECTS) $(sdiag_DEPENDENCIES) +sdiag$(EXEEXT): $(sdiag_OBJECTS) $(sdiag_DEPENDENCIES) $(EXTRA_sdiag_DEPENDENCIES) @rm -f sdiag$(EXEEXT) $(sdiag_LINK) $(sdiag_OBJECTS) $(sdiag_LDADD) $(LIBS) @@ -536,10 +537,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sinfo/Makefile.am b/src/sinfo/Makefile.am index 96e06a97cb7bcc2ba2f6d2740e8ed7667b27b821..aef1c160efb69feed1c086e13eab05e05311f0d6 100644 --- a/src/sinfo/Makefile.am +++ b/src/sinfo/Makefile.am @@ -15,5 +15,6 @@ force: $(sinfo_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sinfo_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sinfo_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/sinfo/Makefile.in b/src/sinfo/Makefile.in index 69638150fd283d3b410d4c009862e607a7c57ce5..63f70c9950947e8f7914117364dec02d279778ff 100644 --- a/src/sinfo/Makefile.in +++ b/src/sinfo/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -61,9 +61,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -71,6 +69,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -158,9 +157,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -168,9 +165,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -202,6 +198,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -229,6 +227,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -324,7 +323,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) sinfo_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = sinfo.h print.h sinfo_SOURCES = sinfo.c opts.c print.c sort.c -sinfo_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sinfo_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -402,7 +403,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sinfo$(EXEEXT): $(sinfo_OBJECTS) $(sinfo_DEPENDENCIES) +sinfo$(EXEEXT): $(sinfo_OBJECTS) $(sinfo_DEPENDENCIES) $(EXTRA_sinfo_DEPENDENCIES) @rm -f sinfo$(EXEEXT) $(sinfo_LINK) $(sinfo_OBJECTS) $(sinfo_LDADD) $(LIBS) @@ -543,10 +544,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/slurmctld/Makefile.am b/src/slurmctld/Makefile.am index 67b463114d67766e965cc89e17339733fe557076..db271915bd27e99fdf6c6894174f08e1dce61237 100644 --- a/src/slurmctld/Makefile.am +++ b/src/slurmctld/Makefile.am @@ -66,7 +66,8 @@ sbin_PROGRAMS = slurmctld slurmctld_LDADD = \ $(top_builddir)/src/common/libdaemonize.la \ $(top_builddir)/src/api/libslurm.o $(DL_LIBS) -slurmctld_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmctld_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(slurmctld_LDADD) : force diff --git a/src/slurmctld/Makefile.in b/src/slurmctld/Makefile.in index 58e2280b4e2aaa6fc1acb8af2750e05cc07ac902..2c08a1cac2a4083569b43a28f602c59c38295cf9 100644 --- a/src/slurmctld/Makefile.in +++ b/src/slurmctld/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -59,9 +59,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -69,6 +67,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -164,9 +163,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -174,9 +171,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -208,6 +204,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -235,6 +233,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -387,7 +386,9 @@ slurmctld_LDADD = \ $(top_builddir)/src/common/libdaemonize.la \ $(top_builddir)/src/api/libslurm.o $(DL_LIBS) -slurmctld_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmctld_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -465,7 +466,7 @@ clean-sbinPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -slurmctld$(EXEEXT): $(slurmctld_OBJECTS) $(slurmctld_DEPENDENCIES) +slurmctld$(EXEEXT): $(slurmctld_OBJECTS) $(slurmctld_DEPENDENCIES) $(EXTRA_slurmctld_DEPENDENCIES) @rm -f slurmctld$(EXEEXT) $(slurmctld_LINK) $(slurmctld_OBJECTS) $(slurmctld_LDADD) $(LIBS) @@ -630,10 +631,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/slurmctld/acct_policy.c b/src/slurmctld/acct_policy.c index ad15f96f09e8cfc44be47525b9bb78425a2ef5af..3eaadccd5389f8f16163aa8010c2d5678cfb2a89 100644 --- a/src/slurmctld/acct_policy.c +++ b/src/slurmctld/acct_policy.c @@ -1063,7 +1063,7 @@ extern bool acct_policy_job_runnable(struct job_record *job_ptr) return true; /* clear old state reason */ - if (acct_policy_job_runnable_state(job_ptr)) + if (!acct_policy_job_runnable_state(job_ptr)) job_ptr->state_reason = WAIT_NO_REASON; job_cpu_time_limit = (uint64_t)job_ptr->time_limit diff --git a/src/slurmctld/agent.c b/src/slurmctld/agent.c index c7d55f876a767c8f37b0b5e8037b9f356e9bdbec..86cb3c1a3c69b64704fad9810139e7fcae05bdae 100644 --- a/src/slurmctld/agent.c +++ b/src/slurmctld/agent.c @@ -178,7 +178,6 @@ static void _purge_agent_args(agent_arg_t *agent_arg_ptr); static void _queue_agent_retry(agent_info_t * agent_info_ptr, int count); static int _setup_requeue(agent_arg_t *agent_arg_ptr, thd_t *thread_ptr, int count, int *spot); -static void _slurmctld_free_batch_job_launch_msg(batch_job_launch_msg_t * msg); static void _spawn_retry_agent(agent_arg_t * agent_arg_ptr); static void *_thread_per_group_rpc(void *args); static int _valid_agent_arg(agent_arg_t *agent_arg_ptr); @@ -818,6 +817,7 @@ static void *_thread_per_group_rpc(void *args) xsignal(SIGUSR1, _sig_handler); xsignal_unblock(sig_array); is_kill_msg = ( (msg_type == REQUEST_KILL_TIMELIMIT) || + (msg_type == REQUEST_KILL_PREEMPTED) || (msg_type == REQUEST_TERMINATE_JOB) ); srun_agent = ( (msg_type == SRUN_PING) || (msg_type == SRUN_EXEC) || @@ -1328,12 +1328,12 @@ static void _spawn_retry_agent(agent_arg_t * agent_arg_ptr) slurm_attr_destroy(&attr_agent); } -/* _slurmctld_free_batch_job_launch_msg is a variant of +/* slurmctld_free_batch_job_launch_msg is a variant of * slurm_free_job_launch_msg because all environment variables currently * loaded in one xmalloc buffer (see get_job_env()), which is different * from how slurmd assembles the data from a message */ -static void _slurmctld_free_batch_job_launch_msg(batch_job_launch_msg_t * msg) +extern void slurmctld_free_batch_job_launch_msg(batch_job_launch_msg_t * msg) { if (msg) { if (msg->environment) { @@ -1374,8 +1374,8 @@ static void _purge_agent_args(agent_arg_t *agent_arg_ptr) xfree(agent_arg_ptr->addr); if (agent_arg_ptr->msg_args) { if (agent_arg_ptr->msg_type == REQUEST_BATCH_JOB_LAUNCH) - _slurmctld_free_batch_job_launch_msg( - agent_arg_ptr->msg_args); + slurmctld_free_batch_job_launch_msg(agent_arg_ptr-> + msg_args); else if (agent_arg_ptr->msg_type == RESPONSE_RESOURCE_ALLOCATION) slurm_free_resource_allocation_response_msg( diff --git a/src/slurmctld/agent.h b/src/slurmctld/agent.h index 5547732f7d483eb1801dc1116ab81457716e0d09..d41aba744f8ba916859477f45d3499dc253ce990 100644 --- a/src/slurmctld/agent.h +++ b/src/slurmctld/agent.h @@ -108,4 +108,11 @@ extern void mail_job_info (struct job_record *job_ptr, uint16_t mail_type); /* Return length of agent's retry_list */ extern int retry_list_size(void); +/* slurmctld_free_batch_job_launch_msg is a variant of + * slurm_free_job_launch_msg because all environment variables currently + * loaded in one xmalloc buffer (see get_job_env()), which is different + * from how slurmd assembles the data from a message + */ +extern void slurmctld_free_batch_job_launch_msg(batch_job_launch_msg_t * msg); + #endif /* !_AGENT_H */ diff --git a/src/slurmctld/backup.c b/src/slurmctld/backup.c index 2456e764f5a290d56b31b2d2135ad84b5f876116..ab6ebbc2bad0ebdff27619bdfab830ae9d9b08e4 100644 --- a/src/slurmctld/backup.c +++ b/src/slurmctld/backup.c @@ -225,7 +225,7 @@ void run_backup(void) } slurmctld_config.shutdown_time = (time_t) 0; unlock_slurmctld(config_write_lock); - select_g_select_nodeinfo_set_all(time(NULL)); + select_g_select_nodeinfo_set_all(); return; } diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c index f35e3aa3f8b15a46d38d8c3067bdcfc117687668..8bd524bf96f1a7c89471e2ec3e3e180ce96f9334 100644 --- a/src/slurmctld/controller.c +++ b/src/slurmctld/controller.c @@ -238,6 +238,7 @@ int main(int argc, char *argv[]) assoc_init_args_t assoc_init_arg; pthread_t assoc_cache_thread; slurm_trigger_callbacks_t callbacks; + char *dir_name; /* * Establish initial configuration @@ -437,7 +438,7 @@ int main(int argc, char *argv[]) fatal( "failed to initialize checkpoint plugin" ); if (slurm_acct_storage_init(NULL) != SLURM_SUCCESS ) fatal( "failed to initialize accounting_storage plugin"); - if (slurm_jobacct_gather_init() != SLURM_SUCCESS ) + if (jobacct_gather_init() != SLURM_SUCCESS ) fatal( "failed to initialize jobacct_gather plugin"); if (job_submit_plugin_init() != SLURM_SUCCESS ) fatal( "failed to initialize job_submit plugin"); @@ -468,7 +469,7 @@ int main(int argc, char *argv[]) slurm_strerror(error_code)); } unlock_slurmctld(config_write_lock); - select_g_select_nodeinfo_set_all(time(NULL)); + select_g_select_nodeinfo_set_all(); if (recover == 0) _accounting_mark_all_nodes_down("cold-start"); @@ -569,6 +570,9 @@ int main(int argc, char *argv[]) _slurmctld_background(NULL); /* termination of controller */ + dir_name = slurm_get_state_save_location(); + switch_save(dir_name); + xfree(dir_name); slurm_priority_fini(); shutdown_state_save(); pthread_join(slurmctld_config.thread_id_sig, NULL); @@ -619,7 +623,7 @@ int main(int argc, char *argv[]) { /* This should purge all allocated memory, *\ \* Anything left over represents a leak. */ - char *dir_name; + /* Give running agents a chance to complete and free memory. * Wait up to 60 seconds (3 seconds * 20) */ @@ -653,7 +657,7 @@ int main(int argc, char *argv[]) job_submit_plugin_fini(); slurm_preempt_fini(); g_slurm_jobcomp_fini(); - slurm_jobacct_gather_fini(); + jobacct_gather_fini(); slurm_select_fini(); slurm_topo_fini(); checkpoint_fini(); diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index 6250652990c73a34d833a191ebf1216923df798f..6bd8656db5caeac174734482853f00182d1e7570 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -101,7 +101,9 @@ #define JOB_HASH_INX(_job_id) (_job_id % hash_table_size) /* Change JOB_STATE_VERSION value when changing the state save format */ -#define JOB_STATE_VERSION "VER011" +#define JOB_STATE_VERSION "VER013" +#define JOB_2_5_STATE_VERSION "VER013" /* SLURM version 2.5 */ +#define JOB_2_4_STATE_VERSION "VER012" /* SLURM version 2.4 */ #define JOB_2_3_STATE_VERSION "VER011" /* SLURM version 2.3 */ #define JOB_2_2_STATE_VERSION "VER010" /* SLURM version 2.2 */ #define JOB_2_1_STATE_VERSION "VER009" /* SLURM version 2.1 */ @@ -186,7 +188,6 @@ static void _signal_job(struct job_record *job_ptr, int signal); static void _suspend_job(struct job_record *job_ptr, uint16_t op); static int _suspend_job_nodes(struct job_record *job_ptr, bool indf_susp); static bool _top_priority(struct job_record *job_ptr); -static int _validate_job_create_req(job_desc_msg_t * job_desc); static int _validate_job_desc(job_desc_msg_t * job_desc_msg, int allocate, uid_t submit_uid, struct part_record *part_ptr); static void _validate_job_files(List batch_dirs); @@ -624,6 +625,10 @@ extern int load_all_job_state(void) if (ver_str) { if (!strcmp(ver_str, JOB_STATE_VERSION)) { protocol_version = SLURM_PROTOCOL_VERSION; + } else if (!strcmp(ver_str, JOB_2_4_STATE_VERSION)) { + protocol_version = SLURM_2_4_PROTOCOL_VERSION; + } else if (!strcmp(ver_str, JOB_2_3_STATE_VERSION)) { + protocol_version = SLURM_2_3_PROTOCOL_VERSION; } else if (!strcmp(ver_str, JOB_2_2_STATE_VERSION)) { protocol_version = SLURM_2_2_PROTOCOL_VERSION; } else if (!strcmp(ver_str, JOB_2_1_STATE_VERSION)) { @@ -641,6 +646,13 @@ extern int load_all_job_state(void) } xfree(ver_str); + /* There was a bug in 2.4.0 where the job state version wasn't + * incremented correctly. Luckly the node state was. We will + * use it to set the version correctly in the job. + */ + if (load_2_4_state && protocol_version == SLURM_2_3_PROTOCOL_VERSION) + protocol_version = SLURM_2_4_PROTOCOL_VERSION; + safe_unpack_time(&buf_time, buffer); safe_unpack32( &saved_job_id, buffer); job_id_sequence = MAX(saved_job_id, job_id_sequence); @@ -1684,7 +1696,8 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version) memset(&qos_rec, 0, sizeof(slurmdb_qos_rec_t)); qos_rec.id = job_ptr->qos_id; job_ptr->qos_ptr = _determine_and_validate_qos( - job_ptr->resv_name, job_ptr->assoc_ptr, false, &qos_rec, + job_ptr->resv_name, job_ptr->assoc_ptr, + job_ptr->limit_set_qos, &qos_rec, &qos_error); if ((qos_error != SLURM_SUCCESS) && !job_ptr->limit_set_qos) { info("Holding job %u with invalid qos", job_id); @@ -2211,10 +2224,10 @@ extern int kill_job_by_part_name(char *part_name) difftime(now, job_ptr->suspend_time); } else job_ptr->end_time = now; + job_completion_logger(job_ptr, false); if (!pending) deallocate_nodes(job_ptr, false, suspended, false); - job_completion_logger(job_ptr, false); } else if (pending) { job_count++; info("Killing job_id %u on defunct partition %s", @@ -2333,9 +2346,9 @@ extern int kill_job_by_front_end_name(char *node_name) * job looks like a new job. */ job_ptr->job_state = JOB_NODE_FAIL; build_cg_bitmap(job_ptr); + job_completion_logger(job_ptr, true); deallocate_nodes(job_ptr, false, suspended, false); - job_completion_logger(job_ptr, true); job_ptr->db_index = 0; job_ptr->job_state = JOB_PENDING; if (job_ptr->node_cnt) @@ -2377,9 +2390,9 @@ extern int kill_job_by_front_end_name(char *node_name) job_ptr->suspend_time); } else job_ptr->end_time = now; + job_completion_logger(job_ptr, false); deallocate_nodes(job_ptr, false, suspended, false); - job_completion_logger(job_ptr, false); } } } @@ -2566,9 +2579,9 @@ extern int kill_running_job_by_node_name(char *node_name) * job looks like a new job. */ job_ptr->job_state = JOB_NODE_FAIL; build_cg_bitmap(job_ptr); + job_completion_logger(job_ptr, true); deallocate_nodes(job_ptr, false, suspended, false); - job_completion_logger(job_ptr, true); job_ptr->db_index = 0; job_ptr->job_state = JOB_PENDING; if (job_ptr->node_cnt) @@ -2610,9 +2623,9 @@ extern int kill_running_job_by_node_name(char *node_name) job_ptr->suspend_time); } else job_ptr->end_time = now; + job_completion_logger(job_ptr, false); deallocate_nodes(job_ptr, false, suspended, false); - job_completion_logger(job_ptr, false); } } @@ -2900,7 +2913,7 @@ extern void rehash_jobs(void) * IN will_run - don't initiate the job if set, just test if it could run * now or later * OUT resp - will run response (includes start location, time, etc.) - * IN allocate - resource allocation request if set, not a full job + * IN allocate - resource allocation request only if set, batch job if zero * IN submit_uid -uid of user issuing the request * OUT job_pptr - set to pointer to job record * RET 0 or an error code. If the job would only be able to execute with @@ -2920,10 +2933,11 @@ extern int job_allocate(job_desc_msg_t * job_specs, int immediate, int error_code; bool no_alloc, top_prio, test_only, too_fragmented, independent; struct job_record *job_ptr; + time_t now = time(NULL); + error_code = _job_create(job_specs, allocate, will_run, &job_ptr, submit_uid); *job_pptr = job_ptr; - time_t now = time(NULL); if (error_code) { if (job_ptr && (immediate || will_run)) { @@ -3009,14 +3023,13 @@ extern int job_allocate(job_desc_msg_t * job_specs, int immediate, test_only = will_run || (allocate == 0); no_alloc = test_only || too_fragmented || - (!top_prio) || (!independent); + (!top_prio) || (!independent); if (!no_alloc && !avail_front_end()) { debug("sched: job_allocate() returning, no front end nodes " "are available"); error_code = ESLURM_NODES_BUSY; } else error_code = select_nodes(job_ptr, no_alloc, NULL); - if (!test_only) { last_job_update = now; slurm_sched_schedule(); /* work for external scheduler */ @@ -3120,11 +3133,11 @@ extern int job_fail(uint32_t job_id) job_ptr->exit_code = 1; job_ptr->state_reason = FAIL_LAUNCH; xfree(job_ptr->state_desc); + job_completion_logger(job_ptr, false); if (job_ptr->node_bitmap) { build_cg_bitmap(job_ptr); deallocate_nodes(job_ptr, false, suspended, false); } - job_completion_logger(job_ptr, false); return SLURM_SUCCESS; } /* All other states */ @@ -3227,8 +3240,8 @@ extern int job_signal(uint32_t job_id, uint16_t signal, uint16_t batch_flag, job_ptr->job_state = job_term_state | JOB_COMPLETING; build_cg_bitmap(job_ptr); jobacct_storage_g_job_suspend(acct_db_conn, job_ptr); - deallocate_nodes(job_ptr, false, true, preempt); job_completion_logger(job_ptr, false); + deallocate_nodes(job_ptr, false, true, preempt); verbose("job_signal %u of suspended job %u successful", signal, job_id); return SLURM_SUCCESS; @@ -3242,8 +3255,8 @@ extern int job_signal(uint32_t job_id, uint16_t signal, uint16_t batch_flag, last_job_update = now; job_ptr->job_state = job_term_state | JOB_COMPLETING; build_cg_bitmap(job_ptr); - deallocate_nodes(job_ptr, false, false, preempt); job_completion_logger(job_ptr, false); + deallocate_nodes(job_ptr, false, false, preempt); } else if (batch_flag) { if (job_ptr->batch_flag) _signal_batch_job(job_ptr, signal); @@ -3481,6 +3494,7 @@ static int _part_access_check(struct part_record *part_ptr, { uint32_t total_nodes; + if ((part_ptr->flags & PART_FLAG_REQ_RESV) && (!job_desc->reservation || !strlen(job_desc->reservation))) { info("_part_access_check: uid %u access to partition %s " @@ -3671,7 +3685,6 @@ static int _valid_job_part(job_desc_msg_t * job_desc, if ((job_desc->max_nodes != NO_VAL) && slurmctld_conf.enforce_part_limits && - job_desc->max_nodes && (job_desc->max_nodes < min_nodes_orig)) { info("_valid_job_part: job's max nodes less than partition's " "min nodes (%u < %u)", @@ -3770,27 +3783,27 @@ extern int job_limits_check(struct job_record **job_pptr) if ((job_min_nodes > part_max_nodes) && (!qos_ptr || (qos_ptr && !(qos_ptr->flags & QOS_FLAG_PART_MAX_NODE)))) { - info("Job %u requested too many nodes (%u) of " - "partition %s(MaxNodes %u)", - job_ptr->job_id, job_min_nodes, - part_ptr->name, part_max_nodes); + debug2("Job %u requested too many nodes (%u) of " + "partition %s(MaxNodes %u)", + job_ptr->job_id, job_min_nodes, + part_ptr->name, part_max_nodes); fail_reason = WAIT_PART_NODE_LIMIT; } else if ((job_max_nodes != 0) && /* no max_nodes for job */ ((job_max_nodes < part_min_nodes) && (!qos_ptr || (qos_ptr && !(qos_ptr->flags & QOS_FLAG_PART_MIN_NODE))))) { - info("Job %u requested too few nodes (%u) of " - "partition %s(MinNodes %u)", - job_ptr->job_id, job_max_nodes, - part_ptr->name, part_min_nodes); + debug2("Job %u requested too few nodes (%u) of " + "partition %s(MinNodes %u)", + job_ptr->job_id, job_max_nodes, + part_ptr->name, part_min_nodes); fail_reason = WAIT_PART_NODE_LIMIT; } else if (part_ptr->state_up == PARTITION_DOWN) { - info("Job %u requested down partition %s", - job_ptr->job_id, part_ptr->name); + debug2("Job %u requested down partition %s", + job_ptr->job_id, part_ptr->name); fail_reason = WAIT_PART_DOWN; } else if (part_ptr->state_up == PARTITION_INACTIVE) { - info("Job %u requested inactive partition %s", - job_ptr->job_id, part_ptr->name); + debug2("Job %u requested inactive partition %s", + job_ptr->job_id, part_ptr->name); fail_reason = WAIT_PART_INACTIVE; } else if ((((job_ptr->time_limit != NO_VAL) && (job_ptr->time_limit > part_ptr->max_time)) || @@ -3798,15 +3811,15 @@ extern int job_limits_check(struct job_record **job_pptr) (job_ptr->time_min > part_ptr->max_time))) && (!qos_ptr || (qos_ptr && !(qos_ptr->flags & QOS_FLAG_PART_TIME_LIMIT)))) { - info("Job %u exceeds partition time limit", job_ptr->job_id); + debug2("Job %u exceeds partition time limit", job_ptr->job_id); fail_reason = WAIT_PART_TIME_LIMIT; } else if (qos_ptr && assoc_ptr && (qos_ptr->flags & QOS_FLAG_ENFORCE_USAGE_THRES) && (!fuzzy_equal(qos_ptr->usage_thres, NO_VAL))) { - if (!job_ptr->prio_factors) + if (!job_ptr->prio_factors) { job_ptr->prio_factors = xmalloc(sizeof(priority_factors_object_t)); - + } if (!job_ptr->prio_factors->priority_fs) { if (fuzzy_equal(assoc_ptr->usage->usage_efctv, NO_VAL)) priority_g_set_assoc_usage(assoc_ptr); @@ -3816,8 +3829,9 @@ extern int job_limits_check(struct job_record **job_pptr) (long double)assoc_ptr->usage-> shares_norm); } - if (job_ptr->prio_factors->priority_fs < qos_ptr->usage_thres) { - info("Job %u exceeds usage threahold", job_ptr->job_id); + if (job_ptr->prio_factors->priority_fs < qos_ptr->usage_thres){ + debug2("Job %u exceeds usage threahold", + job_ptr->job_id); fail_reason = WAIT_QOS_THRES; } } @@ -3934,11 +3948,6 @@ static int _job_create(job_desc_msg_t * job_desc, int allocate, int will_run, if (error_code != SLURM_SUCCESS) goto cleanup_fail; - /* Make sure anything that may be put in the database will be - lower case */ - xstrtolower(job_desc->account); - xstrtolower(job_desc->wckey); - if ((error_code = _validate_job_desc(job_desc, allocate, submit_uid, part_ptr))) { error_code = error_code; @@ -4134,9 +4143,6 @@ static int _job_create(job_desc_msg_t * job_desc, int allocate, int will_run, goto cleanup_fail; } - if ((error_code =_validate_job_create_req(job_desc))) - goto cleanup; - if ((error_code = _copy_job_desc_to_job_record(job_desc, job_pptr, &req_bitmap, @@ -4242,7 +4248,6 @@ static int _job_create(job_desc_msg_t * job_desc, int allocate, int will_run, xfree(job_ptr->state_desc); } -cleanup: FREE_NULL_LIST(license_list); FREE_NULL_BITMAP(req_bitmap); FREE_NULL_BITMAP(exc_bitmap); @@ -4281,7 +4286,7 @@ static int _test_strlen(char *test_str, char *str_name, int max_str_len) /* Perform some size checks on strings we store to prevent * malicious user filling slurmctld's memory * RET 0 or error code */ -static int _validate_job_create_req(job_desc_msg_t * job_desc) +extern int validate_job_create_req(job_desc_msg_t * job_desc) { if (_test_strlen(job_desc->account, "account", 1024) || _test_strlen(job_desc->alloc_node, "alloc_node", 1024) || @@ -4313,6 +4318,11 @@ static int _validate_job_create_req(job_desc_msg_t * job_desc) _test_strlen(job_desc->work_dir, "work_dir", 1024)) return ESLURM_PATHNAME_TOO_LONG; + /* Make sure anything that may be put in the database will be + * lower case */ + xstrtolower(job_desc->account); + xstrtolower(job_desc->wckey); + return SLURM_SUCCESS; } @@ -5302,8 +5312,8 @@ static void _job_timed_out(struct job_record *job_ptr) job_ptr->job_state = JOB_TIMEOUT | JOB_COMPLETING; build_cg_bitmap(job_ptr); job_ptr->exit_code = MAX(job_ptr->exit_code, 1); - deallocate_nodes(job_ptr, true, false, false); job_completion_logger(job_ptr, false); + deallocate_nodes(job_ptr, true, false, false); } else job_signal(job_ptr->job_id, SIGKILL, 0, 0, false); return; @@ -5737,7 +5747,7 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer, packstr(dump_job_ptr->gres, buffer); packstr(dump_job_ptr->batch_host, buffer); if (!IS_JOB_COMPLETED(dump_job_ptr) && - (show_flags & SHOW_DETAIL) && + (show_flags & SHOW_DETAIL2) && ((dump_job_ptr->user_id == (uint32_t) uid) || validate_slurm_user(uid))) { char *batch_script = get_job_script(dump_job_ptr); @@ -6982,10 +6992,11 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid) job_ptr->comment, job_specs->job_id); if (wiki_sched && strstr(job_ptr->comment, "QOS:")) { - slurmdb_qos_rec_t qos_rec; if (!IS_JOB_PENDING(job_ptr)) error_code = ESLURM_DISABLED; else { + slurmdb_qos_rec_t qos_rec; + slurmdb_qos_rec_t *new_qos_ptr; char *resv_name; if (job_specs->reservation && job_specs->reservation[0] != '\0') @@ -7001,12 +7012,24 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid) "FLAGS:PREEMPTEE")) qos_rec.name = "standby"; - job_ptr->qos_ptr = _determine_and_validate_qos( + new_qos_ptr = _determine_and_validate_qos( resv_name, job_ptr->assoc_ptr, - admin, &qos_rec, &error_code); + authorized, &qos_rec, &error_code); if (error_code == SLURM_SUCCESS) { - job_ptr->qos_id = qos_rec.id; - update_accounting = true; + info("update_job: setting qos to %s " + "for job_id %u", + job_specs->qos, job_specs->job_id); + if (job_ptr->qos_id != qos_rec.id) { + job_ptr->qos_id = qos_rec.id; + job_ptr->qos_ptr = new_qos_ptr; + if (authorized) + job_ptr->limit_set_qos = + ADMIN_SET_LIMIT; + else + job_ptr->limit_set_qos + = 0; + update_accounting = true; + } } } } @@ -7015,12 +7038,13 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid) goto fini; if (job_specs->qos) { - slurmdb_qos_rec_t qos_rec; - uint16_t save_qos_id; if (!IS_JOB_PENDING(job_ptr)) error_code = ESLURM_DISABLED; else { + slurmdb_qos_rec_t qos_rec; + slurmdb_qos_rec_t *new_qos_ptr; char *resv_name; + if (job_specs->reservation && job_specs->reservation[0] != '\0') resv_name = job_specs->reservation; @@ -7030,22 +7054,23 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid) memset(&qos_rec, 0, sizeof(slurmdb_qos_rec_t)); qos_rec.name = job_specs->qos; - save_qos_id = job_ptr->qos_id; - job_ptr->qos_ptr = _determine_and_validate_qos( + new_qos_ptr = _determine_and_validate_qos( resv_name, job_ptr->assoc_ptr, - admin, &qos_rec, &error_code); + authorized, &qos_rec, &error_code); if (error_code == SLURM_SUCCESS) { info("update_job: setting qos to %s " "for job_id %u", job_specs->qos, job_specs->job_id); - job_ptr->qos_id = qos_rec.id; - if ((save_qos_id != job_ptr->qos_id) && admin){ - job_ptr->limit_set_qos = - ADMIN_SET_LIMIT; - } else { - job_ptr->limit_set_qos = 0; + if (job_ptr->qos_id != qos_rec.id) { + job_ptr->qos_id = qos_rec.id; + job_ptr->qos_ptr = new_qos_ptr; + if (authorized) + job_ptr->limit_set_qos = + ADMIN_SET_LIMIT; + else + job_ptr->limit_set_qos = 0; + update_accounting = true; } - update_accounting = true; } } } @@ -7987,8 +8012,9 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid) if (fail_reason != WAIT_NO_REASON) { if (fail_reason == WAIT_QOS_THRES) error_code = ESLURM_QOS_THRES; - else if (fail_reason == WAIT_PART_TIME_LIMIT || - fail_reason == WAIT_PART_NODE_LIMIT) + else if ((fail_reason == WAIT_PART_TIME_LIMIT) || + (fail_reason == WAIT_PART_NODE_LIMIT) || + (fail_reason == WAIT_HELD)) error_code = SLURM_SUCCESS; else error_code = ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE; @@ -8208,6 +8234,7 @@ fini: static void _send_job_kill(struct job_record *job_ptr) { + static int select_serial = -1; kill_job_msg_t *kill_job = NULL; agent_arg_t *agent_args = NULL; #ifdef HAVE_FRONT_END @@ -8217,6 +8244,13 @@ static void _send_job_kill(struct job_record *job_ptr) struct node_record *node_ptr; #endif + if (select_serial == -1) { + if (strcmp(slurmctld_conf.select_type, "select/serial")) + select_serial = 0; + else + select_serial = 1; + } + xassert(job_ptr); xassert(job_ptr->details); @@ -8257,7 +8291,8 @@ static void _send_job_kill(struct job_record *job_ptr) } #endif if (agent_args->node_count == 0) { - if (job_ptr->details->expanding_jobid == 0) { + if ((job_ptr->details->expanding_jobid == 0) && + (select_serial == 0)) { error("Job %u allocated no nodes to be killed on", job_ptr->job_id); } @@ -8866,7 +8901,13 @@ extern bool job_epilog_complete(uint32_t job_id, char *node_name, if (base_state == NODE_STATE_DOWN) { debug("Epilog complete response for job %u from DOWN " "node %s", job_id, node_name); + } else if (job_ptr->restart_cnt) { + /* Duplicate epilog complete can be due to race + * condition, especially with select/serial */ + debug("Duplicate epilog complete response for job %u", + job_id); } else { + error("Epilog complete response for non-running job " "%u, slurmctld and slurmd out of sync", job_id); } @@ -8996,9 +9037,8 @@ extern void job_completion_logger(struct job_record *job_ptr, bool requeue) #ifdef HAVE_BG /* If on a bluegene system we want to remove the job_resrcs so - we don't get an error message about them already existing - when the job goes to run again. - */ + * we don't get an error message about them already existing + * when the job goes to run again. */ if (requeue) free_job_resources(&job_ptr->job_resrcs); #endif @@ -9031,7 +9071,7 @@ extern void job_completion_logger(struct job_record *job_ptr, bool requeue) g_slurm_jobcomp_write(job_ptr); /* When starting the resized job everything is taken care of - there, so don't call it here. */ + * elsewhere, so don't call it here. */ if (IS_JOB_RESIZING(job_ptr)) return; @@ -9055,7 +9095,7 @@ extern void job_completion_logger(struct job_record *job_ptr, bool requeue) } } - if(!with_slurmdbd && !job_ptr->db_index) + if (!with_slurmdbd && !job_ptr->db_index) jobacct_storage_g_job_start(acct_db_conn, job_ptr); jobacct_storage_g_job_complete(acct_db_conn, job_ptr); @@ -9584,9 +9624,9 @@ extern int job_requeue (uid_t uid, uint32_t job_id, slurm_fd_t conn_fd, * job looks like a new job. */ job_ptr->job_state = JOB_CANCELLED; build_cg_bitmap(job_ptr); + job_completion_logger(job_ptr, true); deallocate_nodes(job_ptr, false, suspended, preempt); xfree(job_ptr->details->req_node_layout); - job_completion_logger(job_ptr, true); job_ptr->db_index = 0; job_ptr->job_state = JOB_PENDING; if (job_ptr->node_cnt) diff --git a/src/slurmctld/job_scheduler.c b/src/slurmctld/job_scheduler.c index 43ff5c044789da03ef272166bce363f51e37d3ba..aa981df992f0583f021e535fc5b66da8b2040b2b 100644 --- a/src/slurmctld/job_scheduler.c +++ b/src/slurmctld/job_scheduler.c @@ -86,6 +86,9 @@ static void _feature_list_delete(void *x); static void _job_queue_append(List job_queue, struct job_record *job_ptr, struct part_record *part_ptr); static void _job_queue_rec_del(void *x); +static bool _job_runnable_test1(struct job_record *job_ptr, + bool clear_start); +static bool _job_runnable_test2(struct job_record *job_ptr); static void * _run_epilog(void *arg); static void * _run_prolog(void *arg); static bool _scan_depend(List dependency_list, uint32_t job_id); @@ -146,6 +149,59 @@ static void _job_queue_rec_del(void *x) xfree(x); } +/* Job test for ability to run now, excludes partition specific tests */ +static bool _job_runnable_test1(struct job_record *job_ptr, bool clear_start) +{ + bool job_indepen = false; + + xassert(job_ptr->magic == JOB_MAGIC); + if (!IS_JOB_PENDING(job_ptr) || IS_JOB_COMPLETING(job_ptr)) + return false; + + job_indepen = job_independent(job_ptr, 0); + if (clear_start) + job_ptr->start_time = (time_t) 0; + if (job_ptr->priority == 0) { /* held */ + if ((job_ptr->state_reason != WAIT_HELD) && + (job_ptr->state_reason != WAIT_HELD_USER)) { + job_ptr->state_reason = WAIT_HELD; + xfree(job_ptr->state_desc); + } + debug3("sched: JobId=%u. State=%s. Reason=%s. Priority=%u.", + job_ptr->job_id, + job_state_string(job_ptr->job_state), + job_reason_string(job_ptr->state_reason), + job_ptr->priority); + return false; + } + + if (!job_indepen && + ((job_ptr->state_reason == WAIT_HELD) || + (job_ptr->state_reason == WAIT_HELD_USER))) { + /* released behind active dependency? */ + job_ptr->state_reason = WAIT_DEPENDENCY; + xfree(job_ptr->state_desc); + } + + if (!job_indepen) /* can not run now */ + return false; + return true; +} + +/* Job and partition tests for ability to run now */ +static bool _job_runnable_test2(struct job_record *job_ptr) +{ + if (!part_policy_job_runnable_state(job_ptr)) { + if (job_limits_check(&job_ptr) == WAIT_NO_REASON) { + job_ptr->state_reason = WAIT_NO_REASON; + xfree(job_ptr->state_desc); + } else { + return false; + } + } + return true; +} + /* * build_job_queue - build (non-priority ordered) list of pending jobs * IN clear_start - if set then clear the start_time for pending jobs @@ -158,8 +214,6 @@ extern List build_job_queue(bool clear_start) ListIterator job_iterator, part_iterator; struct job_record *job_ptr = NULL; struct part_record *part_ptr; - bool job_is_pending; - bool job_indepen = false; job_queue = list_create(_job_queue_rec_del); if (job_queue == NULL) @@ -168,37 +222,9 @@ extern List build_job_queue(bool clear_start) if (job_iterator == NULL) fatal("list_iterator_create memory allocation failure"); while ((job_ptr = (struct job_record *) list_next(job_iterator))) { - xassert (job_ptr->magic == JOB_MAGIC); - job_is_pending = IS_JOB_PENDING(job_ptr); - if (!job_is_pending || IS_JOB_COMPLETING(job_ptr)) - continue; - /* ensure dependency shows current values behind a hold */ - job_indepen = job_independent(job_ptr, 0); - if (job_is_pending && clear_start) - job_ptr->start_time = (time_t) 0; - if (job_ptr->priority == 0) { /* held */ - if ((job_ptr->state_reason != WAIT_HELD) && - (job_ptr->state_reason != WAIT_HELD_USER)) { - job_ptr->state_reason = WAIT_HELD; - xfree(job_ptr->state_desc); - } - debug3("sched: JobId=%u. State=%s. Reason=%s. " - "Priority=%u.", - job_ptr->job_id, - job_state_string(job_ptr->job_state), - job_reason_string(job_ptr->state_reason), - job_ptr->priority); + if (!_job_runnable_test1(job_ptr, clear_start)) continue; - } else if (!job_indepen && - ((job_ptr->state_reason == WAIT_HELD) || - (job_ptr->state_reason == WAIT_HELD_USER))) { - /* released behind active dependency? */ - job_ptr->state_reason = WAIT_DEPENDENCY; - xfree(job_ptr->state_desc); - } - if (!job_indepen) /* can not run now */ - continue; if (job_ptr->part_ptr_list) { part_iterator = list_iterator_create(job_ptr-> part_ptr_list); @@ -227,15 +253,8 @@ extern List build_job_queue(bool clear_start) "part %s", job_ptr->job_id, job_ptr->partition); } - if (!part_policy_job_runnable_state(job_ptr)) { - if (job_limits_check(&job_ptr) == - WAIT_NO_REASON) { - job_ptr->state_reason = WAIT_NO_REASON; - xfree(job_ptr->state_desc); - } else { - continue; - } - } + if (!_job_runnable_test2(job_ptr)) + continue; _job_queue_append(job_queue, job_ptr, job_ptr->part_ptr); } @@ -363,6 +382,241 @@ static void do_diag_stats(struct timeval tv1, struct timeval tv2) } +/* + * Given that one batch job just completed, attempt to launch a suitable + * replacement batch job in a response messge as a REQUEST_BATCH_JOB_LAUNCH + * message type, alternately send a return code fo SLURM_SUCCESS + * msg IN - The original message from slurmd + * fini_job_ptr IN - Pointer to job that just completed and needs replacement + * RET true if there are pending jobs that might use the resources + */ +extern bool replace_batch_job(slurm_msg_t * msg, void *fini_job) +{ + static int select_serial = -1; + /* Locks: Read config, write job, write node, read partition */ + slurmctld_lock_t job_write_lock = + { READ_LOCK, WRITE_LOCK, WRITE_LOCK, READ_LOCK }; + struct job_record *job_ptr = NULL; + struct job_record *fini_job_ptr = (struct job_record *) fini_job; + struct part_record *part_ptr; + ListIterator job_iterator = NULL, part_iterator = NULL; + batch_job_launch_msg_t *launch_msg = NULL; + bitstr_t *orig_exc_bitmap = NULL; + bool have_node_bitmaps, pending_jobs = false; + time_t now, min_age; + int error_code; + + if (select_serial == -1) { + if (strcmp(slurmctld_conf.select_type, "select/serial")) + select_serial = 0; + else + select_serial = 1; + } + if ((select_serial != 1) || (fini_job_ptr == NULL) || + (msg->msg_type != REQUEST_COMPLETE_BATCH_JOB)) + goto send_reply; + + now = time(NULL); + min_age = now - slurmctld_conf.min_job_age; + lock_slurmctld(job_write_lock); + if (!fini_job_ptr->job_resrcs || + !fini_job_ptr->job_resrcs->node_bitmap) { + /* This should never happen, but if it does, avoid using + * a bad pointer below. */ + error("job_resrcs empty for job %u", fini_job_ptr->job_id); + unlock_slurmctld(job_write_lock); + goto send_reply; + } + if (!avail_front_end()) { + unlock_slurmctld(job_write_lock); + goto send_reply; + } + job_iterator = list_iterator_create(job_list); + if (job_iterator == NULL) + fatal("list_iterator_create memory allocation failure"); + while (1) { + if (job_ptr && part_iterator) + goto next_part; + + job_ptr = (struct job_record *) list_next(job_iterator); + if (!job_ptr) + break; + + if (job_ptr == fini_job_ptr) + continue; + + if (job_ptr->priority == 0) + continue; + + if (!IS_JOB_PENDING(job_ptr)) { + if (IS_JOB_FINISHED(job_ptr) && + (job_ptr != fini_job_ptr) && + (job_ptr->end_time <= min_age)) { + /* If we don't have a db_index by now and we + * are running with the slurmdbd lets put it on + * the list to be handled later when it comes + * back up since we won't get another chance */ + if (with_slurmdbd && !job_ptr->db_index) { + jobacct_storage_g_job_start(acct_db_conn, + job_ptr); + } + list_delete_item(job_iterator); + } + continue; + } + + /* Tests dependencies, begin time and reservations */ + if (!job_independent(job_ptr, 0)) + continue; + + if (job_ptr->part_ptr_list) { + part_iterator = list_iterator_create(job_ptr-> + part_ptr_list); + if (!part_iterator) + fatal("list_iterator_create: malloc failure"); +next_part: part_ptr = (struct part_record *) + list_next(part_iterator); + if (part_ptr) { + job_ptr->part_ptr = part_ptr; + } else { + list_iterator_destroy(part_iterator); + part_iterator = NULL; + continue; + } + } + + /* Test for valid account, QOS and required nodes on each pass */ + if (job_ptr->state_reason == FAIL_ACCOUNT) { + slurmdb_association_rec_t assoc_rec; + memset(&assoc_rec, 0, sizeof(slurmdb_association_rec_t)); + assoc_rec.acct = job_ptr->account; + if (job_ptr->part_ptr) + assoc_rec.partition = job_ptr->part_ptr->name; + assoc_rec.uid = job_ptr->user_id; + + if (!assoc_mgr_fill_in_assoc(acct_db_conn, &assoc_rec, + accounting_enforce, + (slurmdb_association_rec_t **) + &job_ptr->assoc_ptr)) { + job_ptr->state_reason = WAIT_NO_REASON; + job_ptr->assoc_id = assoc_rec.id; + } else { + continue; + } + } + if (job_ptr->qos_id) { + slurmdb_association_rec_t *assoc_ptr; + assoc_ptr = (slurmdb_association_rec_t *)job_ptr->assoc_ptr; + if (assoc_ptr && + !bit_test(assoc_ptr->usage->valid_qos, + job_ptr->qos_id)) { + info("sched: JobId=%u has invalid QOS", + job_ptr->job_id); + xfree(job_ptr->state_desc); + job_ptr->state_reason = FAIL_QOS; + continue; + } else if (job_ptr->state_reason == FAIL_QOS) { + xfree(job_ptr->state_desc); + job_ptr->state_reason = WAIT_NO_REASON; + } + } + + if ((job_ptr->state_reason == WAIT_QOS_JOB_LIMIT) || + (job_ptr->state_reason == WAIT_QOS_RESOURCE_LIMIT) || + (job_ptr->state_reason == WAIT_QOS_TIME_LIMIT)) + job_ptr->state_reason = WAIT_NO_REASON; + + if ((job_ptr->state_reason == WAIT_NODE_NOT_AVAIL) && + job_ptr->details && job_ptr->details->req_node_bitmap && + !bit_super_set(job_ptr->details->req_node_bitmap, + avail_node_bitmap)) { + continue; + } + + if (bit_overlap(avail_node_bitmap, + job_ptr->part_ptr->node_bitmap) == 0) { + /* This node DRAIN or DOWN */ + continue; + } + + if (license_job_test(job_ptr, now) != SLURM_SUCCESS) { + job_ptr->state_reason = WAIT_LICENSES; + xfree(job_ptr->state_desc); + continue; + } + + if (assoc_mgr_validate_assoc_id(acct_db_conn, + job_ptr->assoc_id, + accounting_enforce)) { + /* NOTE: This only happens if a user's account is + * disabled between when the job was submitted and + * the time we consider running it. It should be + * very rare. */ + info("sched: JobId=%u has invalid account", + job_ptr->job_id); + last_job_update = now; + job_ptr->state_reason = FAIL_ACCOUNT; + xfree(job_ptr->state_desc); + continue; + } + + if (job_ptr->details && job_ptr->details->exc_node_bitmap) + have_node_bitmaps = true; + else + have_node_bitmaps = false; + if (have_node_bitmaps && + (bit_overlap(job_ptr->details->exc_node_bitmap, + fini_job_ptr->job_resrcs->node_bitmap) != 0)) + continue; + + if (!job_ptr->batch_flag) { /* Can't pull interactive jobs */ + pending_jobs = true; + break; + } + + if (have_node_bitmaps) + orig_exc_bitmap = job_ptr->details->exc_node_bitmap; + else + orig_exc_bitmap = NULL; + job_ptr->details->exc_node_bitmap = + bit_copy(fini_job_ptr->job_resrcs->node_bitmap); + bit_not(job_ptr->details->exc_node_bitmap); + error_code = select_nodes(job_ptr, false, NULL); + bit_free(job_ptr->details->exc_node_bitmap); + job_ptr->details->exc_node_bitmap = orig_exc_bitmap; + if (error_code == SLURM_SUCCESS) { + last_job_update = now; + info("sched: Allocate JobId=%u NodeList=%s #CPUs=%u", + job_ptr->job_id, job_ptr->nodes, + job_ptr->total_cpus); + if (job_ptr->details->prolog_running == 0) + launch_msg = build_launch_job_msg(job_ptr); + } + break; + } + unlock_slurmctld(job_write_lock); + if (job_iterator) + list_iterator_destroy(job_iterator); + if (part_iterator) + list_iterator_destroy(part_iterator); + +send_reply: + if (launch_msg) { + slurm_msg_t response_msg; + 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 = REQUEST_BATCH_JOB_LAUNCH; + response_msg.data = launch_msg; + slurm_send_node_msg(msg->conn_fd, &response_msg); + slurmctld_free_batch_job_launch_msg(launch_msg); + return false; + } + slurm_send_rc_msg(msg, SLURM_SUCCESS); + return pending_jobs; +} + /* * schedule - attempt to schedule all pending jobs * pending jobs for each partition will be scheduled in priority @@ -378,11 +632,12 @@ static void do_diag_stats(struct timeval tv1, struct timeval tv2) */ extern int schedule(uint32_t job_limit) { + ListIterator job_iterator = NULL, part_iterator = NULL; List job_queue = NULL; int error_code, failed_part_cnt = 0, job_cnt = 0, i; uint32_t job_depth = 0; job_queue_rec_t *job_queue_rec; - struct job_record *job_ptr; + struct job_record *job_ptr = NULL; struct part_record *part_ptr, **failed_parts = NULL; bitstr_t *save_avail_node_bitmap; /* Locks: Read config, write job, write node, read partition */ @@ -395,6 +650,7 @@ extern int schedule(uint32_t job_limit) #endif static time_t sched_update = 0; static bool wiki_sched = false; + static bool fifo_sched = false; static int sched_timeout = 0; static int def_job_limit = 100; time_t now = time(NULL), sched_start; @@ -411,6 +667,8 @@ extern int schedule(uint32_t job_limit) if (strcmp(sched_type, "sched/backfill") == 0) backfill_sched = true; #endif + if (strcmp(sched_type, "sched/builtin") == 0) + fifo_sched = true; /* Disable avoiding of fragmentation with sched/wiki */ if ((strcmp(sched_type, "sched/wiki") == 0) || (strcmp(sched_type, "sched/wiki2") == 0)) @@ -426,7 +684,7 @@ extern int schedule(uint32_t job_limit) error("ignoring SchedulerParameters: " "default_queue_depth value of %d", i); } else { - def_job_limit = i; + def_job_limit = i; } } xfree(sched_params); @@ -486,14 +744,67 @@ extern int schedule(uint32_t job_limit) save_avail_node_bitmap = bit_copy(avail_node_bitmap); debug("sched: Running job scheduler"); - job_queue = build_job_queue(false); - slurmctld_diag_stats.schedule_queue_len = list_count(job_queue); - while ((job_queue_rec = list_pop_bottom(job_queue, sort_job_queue2))) { - job_ptr = job_queue_rec->job_ptr; - part_ptr = job_queue_rec->part_ptr; - /* Cycle through partitions usable for this job */ - job_ptr->part_ptr = part_ptr; - xfree(job_queue_rec); + /* + * If we are doing FIFO scheduling, use the job records right off the + * job list. + * + * If a job is submitted to multiple partitions then build_job_queue() + * will return a separate record for each job:partition pair. + * + * In both cases, we test each partition associated with the job. + */ + if (fifo_sched) { + slurmctld_diag_stats.schedule_queue_len = list_count(job_list); + job_iterator = list_iterator_create(job_list); + if (job_iterator == NULL) + fatal("list_iterator_create memory allocation failure"); + } else { + job_queue = build_job_queue(false); + slurmctld_diag_stats.schedule_queue_len = list_count(job_queue); + } + while (1) { + if (fifo_sched) { + if (job_ptr && part_iterator && + IS_JOB_PENDING(job_ptr)) /*started in other part?*/ + goto next_part; + job_ptr = (struct job_record *) list_next(job_iterator); + if (!job_ptr) + break; + if (!_job_runnable_test1(job_ptr, false)) + continue; + if (job_ptr->part_ptr_list) { + part_iterator = list_iterator_create( + job_ptr->part_ptr_list); + if (!part_iterator) + fatal("list_iterator_create: malloc failure"); +next_part: part_ptr = (struct part_record *) + list_next(part_iterator); + if (part_ptr) { + job_ptr->part_ptr = part_ptr; + if (job_limits_check(&job_ptr) != + WAIT_NO_REASON) + continue; + } else { + list_iterator_destroy(part_iterator); + part_iterator = NULL; + continue; + } + } else { + if (!_job_runnable_test2(job_ptr)) + continue; + } + } else { + job_queue_rec = list_pop_bottom(job_queue, + sort_job_queue2); + if (!job_queue_rec) + break; + job_ptr = job_queue_rec->job_ptr; + part_ptr = job_queue_rec->part_ptr; + xfree(job_queue_rec); + if (!IS_JOB_PENDING(job_ptr)) + continue; /* started in other partition */ + job_ptr->part_ptr = part_ptr; + } if ((time(NULL) - sched_start) >= sched_timeout) { debug("sched: loop taking too long, breaking out"); break; @@ -506,18 +817,6 @@ extern int schedule(uint32_t job_limit) slurmctld_diag_stats.schedule_cycle_depth++; - if (!IS_JOB_PENDING(job_ptr)) - continue; /* started in other partition */ - if (job_ptr->priority == 0) { /* held */ - debug3("sched: JobId=%u. State=%s. Reason=%s. " - "Priority=%u.", - job_ptr->job_id, - job_state_string(job_ptr->job_state), - job_reason_string(job_ptr->state_reason), - job_ptr->priority); - continue; - } - /* Test for valid account, QOS and required nodes on each pass */ if (job_ptr->state_reason == FAIL_ACCOUNT) { slurmdb_association_rec_t assoc_rec; @@ -554,12 +853,9 @@ extern int schedule(uint32_t job_limit) } } - if ((job_ptr->state_reason == WAIT_QOS_JOB_LIMIT) || - (job_ptr->state_reason == WAIT_QOS_RESOURCE_LIMIT) || - (job_ptr->state_reason == WAIT_QOS_TIME_LIMIT)) { - job_ptr->state_reason = WAIT_NO_REASON; - acct_policy_job_runnable(job_ptr); - } + if (!acct_policy_job_runnable_state(job_ptr) && + !acct_policy_job_runnable(job_ptr)) + continue; if ((job_ptr->state_reason == WAIT_NODE_NOT_AVAIL) && job_ptr->details && job_ptr->details->req_node_bitmap && @@ -584,9 +880,13 @@ extern int schedule(uint32_t job_limit) job_ptr->partition); continue; } - if (bit_overlap(avail_node_bitmap, - job_ptr->part_ptr->node_bitmap) == 0) { - /* All nodes DRAIN, DOWN, or + i = bit_overlap(avail_node_bitmap, + job_ptr->part_ptr->node_bitmap); + if ((job_ptr->details && + (job_ptr->details->min_nodes != NO_VAL) && + (job_ptr->details->min_nodes > i)) || + (!job_ptr->details && (i == 0))) { + /* Too many nodes DRAIN, DOWN, or * reserved for jobs in higher priority partition */ job_ptr->state_reason = WAIT_RESOURCES; debug3("sched: JobId=%u. State=%s. Reason=%s. " @@ -687,7 +987,7 @@ extern int schedule(uint32_t job_limit) select_g_select_jobinfo_get(job_ptr->select_jobinfo, SELECT_JOBDATA_IONODES, &ionodes); - if(ionodes) { + if (ionodes) { sprintf(tmp_char,"%s[%s]", job_ptr->nodes, ionodes); } else { @@ -730,7 +1030,14 @@ extern int schedule(uint32_t job_limit) FREE_NULL_BITMAP(avail_node_bitmap); avail_node_bitmap = save_avail_node_bitmap; xfree(failed_parts); - list_destroy(job_queue); + if (fifo_sched) { + if (job_iterator) + list_iterator_destroy(job_iterator); + if (part_iterator) + list_iterator_destroy(part_iterator); + } else { + FREE_NULL_LIST(job_queue); + } unlock_slurmctld(job_write_lock); END_TIMER2("schedule"); @@ -785,14 +1092,10 @@ extern int sort_job_queue2(void *x, void *y) return 0; } -/* - * launch_job - send an RPC to a slurmd to initiate a batch job - * IN job_ptr - pointer to job that will be initiated - */ -extern void launch_job(struct job_record *job_ptr) +/* 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) { batch_job_launch_msg_t *launch_msg_ptr; - agent_arg_t *agent_arg_ptr; /* Initialization of data structures */ launch_msg_ptr = (batch_job_launch_msg_t *) @@ -818,9 +1121,10 @@ extern void launch_job(struct job_record *job_ptr) * too deep into the job launch to gracefully clean up. */ job_ptr->end_time = time(NULL); job_ptr->time_limit = 0; + xfree(launch_msg_ptr->alias_list); xfree(launch_msg_ptr->nodes); xfree(launch_msg_ptr); - return; + return NULL; } launch_msg_ptr->std_err = xstrdup(job_ptr->details->std_err); @@ -852,7 +1156,23 @@ extern void launch_job(struct job_record *job_ptr) (sizeof(uint32_t) * job_ptr->job_resrcs->cpu_array_cnt)); launch_msg_ptr->select_jobinfo = select_g_select_jobinfo_copy( - job_ptr->select_jobinfo); + job_ptr->select_jobinfo); + + return launch_msg_ptr; +} + +/* + * launch_job - send an RPC to a slurmd to initiate a batch job + * IN job_ptr - pointer to job that will be initiated + */ +extern void launch_job(struct job_record *job_ptr) +{ + batch_job_launch_msg_t *launch_msg_ptr; + agent_arg_t *agent_arg_ptr; + + launch_msg_ptr = build_launch_job_msg(job_ptr); + if (launch_msg_ptr == NULL) + return; agent_arg_ptr = (agent_arg_t *) xmalloc(sizeof(agent_arg_t)); agent_arg_ptr->node_count = 1; @@ -1453,7 +1773,8 @@ 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); + i = job_test_resv(job_ptr, &start_res, false, &resv_bitmap, + &exc_core_bitmap); if (i != SLURM_SUCCESS) return i; bit_and(avail_bitmap, resv_bitmap); diff --git a/src/slurmctld/job_scheduler.h b/src/slurmctld/job_scheduler.h index 0ddd1f7d0ba06fec942f8313af09c0f9c1e9cf7e..6d2396a8bdb92afbdcfaf0f0a8a68cd0e573df09 100644 --- a/src/slurmctld/job_scheduler.h +++ b/src/slurmctld/job_scheduler.h @@ -65,6 +65,9 @@ extern int build_feature_list(struct job_record *job_ptr); */ extern List build_job_queue(bool clear_start); +/* 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); /* * epilog_slurmctld - execute the prolog_slurmctld for a job that has just * terminated. @@ -120,6 +123,16 @@ extern int prolog_slurmctld(struct job_record *job_ptr); * actually used is first in the string. Needed for job state save/restore */ extern void rebuild_job_part_list(struct job_record *job_ptr); +/* + * Given that one batch job just completed, attempt to launch a suitable + * replacement batch job in a response messge as a REQUEST_BATCH_JOB_LAUNCH + * message type, alternately send a return code fo SLURM_SUCCESS + * msg IN - The original message from slurmd + * fini_job_ptr IN - Pointer to job that just completed and needs replacement + * RET true if there are pending jobs that might use the resources + */ +extern bool replace_batch_job(slurm_msg_t * msg, void *fini_job); + /* * schedule - attempt to schedule all pending jobs * pending jobs for each partition will be scheduled in priority diff --git a/src/slurmctld/job_submit.c b/src/slurmctld/job_submit.c index 7ded61704201ac7265f90c435c25e9c9b1bd1b25..3d72a4fbdbc6b5be639dcac0fa0aefa771d1f510 100644 --- a/src/slurmctld/job_submit.c +++ b/src/slurmctld/job_submit.c @@ -72,6 +72,7 @@ #include "src/common/xmalloc.h" #include "src/common/xstring.h" #include "src/slurmctld/slurmctld.h" +#include "src/slurmctld/job_submit.h" typedef struct slurm_submit_ops { int (*submit) ( struct job_descriptor *job_desc, @@ -81,110 +82,20 @@ typedef struct slurm_submit_ops { uint32_t submit_uid ); } slurm_submit_ops_t; -typedef struct slurm_submit_context { - char *sched_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int sched_errno; - slurm_submit_ops_t ops; -} slurm_submit_context_t; - -static int submit_context_cnt = -1; -static slurm_submit_context_t *submit_context = NULL; +/* + * Must be synchronized with slurm_submit_ops_t above. + */ +static const char *syms[] = { + "job_submit", + "job_modify" +}; + +static int g_context_cnt = -1; +static slurm_submit_ops_t *ops = NULL; +static plugin_context_t **g_context = NULL; static char *submit_plugin_list = NULL; -static pthread_mutex_t submit_context_lock = PTHREAD_MUTEX_INITIALIZER; - -static int _load_submit_plugin(char *plugin_name, - slurm_submit_context_t *plugin_context) -{ - /* - * Must be synchronized with slurm_submit_ops_t above. - */ - static const char *syms[] = { - "job_submit", - "job_modify" - }; - int n_syms = sizeof(syms) / sizeof(char *); - - /* Find the correct plugin */ - plugin_context->sched_type = xstrdup("job_submit/"); - xstrcat(plugin_context->sched_type, plugin_name); - plugin_context->plugin_list = NULL; - plugin_context->cur_plugin = PLUGIN_INVALID_HANDLE; - plugin_context->sched_errno = SLURM_SUCCESS; - - plugin_context->cur_plugin = plugin_load_and_link( - plugin_context->sched_type, - n_syms, syms, - (void **) &plugin_context->ops); - if (plugin_context->cur_plugin != PLUGIN_INVALID_HANDLE) - return SLURM_SUCCESS; - - if(errno != EPLUGIN_NOTFOUND) { - error("job_submit: Couldn't load specified plugin name " - "for %s: %s", - plugin_context->sched_type, plugin_strerror(errno)); - return SLURM_ERROR; - } - - error("job_submit: Couldn't find the specified plugin name for %s " - "looking at all files", - plugin_context->sched_type); - - /* Get plugin list */ - if (plugin_context->plugin_list == NULL) { - char *plugin_dir; - plugin_context->plugin_list = plugrack_create(); - if (plugin_context->plugin_list == NULL) { - error("job_submit: cannot create plugin manager"); - return SLURM_ERROR; - } - plugrack_set_major_type(plugin_context->plugin_list, - "job_submit"); - plugrack_set_paranoia(plugin_context->plugin_list, - PLUGRACK_PARANOIA_NONE, 0); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir(plugin_context->plugin_list, plugin_dir); - xfree(plugin_dir); - } - - plugin_context->cur_plugin = plugrack_use_by_type( - plugin_context->plugin_list, - plugin_context->sched_type ); - if (plugin_context->cur_plugin == PLUGIN_INVALID_HANDLE) { - error("job_submit: cannot find scheduler plugin for %s", - plugin_context->sched_type); - return SLURM_ERROR; - } - - /* Dereference the API. */ - if (plugin_get_syms(plugin_context->cur_plugin, - n_syms, syms, - (void **) &plugin_context->ops ) < n_syms ) { - error("job_submit: incomplete plugin detected"); - return SLURM_ERROR; - } - return SLURM_SUCCESS; -} - -static int _unload_submit_plugin(slurm_submit_context_t *plugin_context) -{ - int rc; - - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if (plugin_context->plugin_list) - rc = plugrack_destroy(plugin_context->plugin_list); - else { - rc = SLURM_SUCCESS; - plugin_unload(plugin_context->cur_plugin); - } - xfree(plugin_context->sched_type); - - return rc; -} +static pthread_mutex_t g_context_lock = PTHREAD_MUTEX_INITIALIZER; +static bool init_run = false; /* * Initialize the job submit plugin. @@ -194,33 +105,54 @@ static int _unload_submit_plugin(slurm_submit_context_t *plugin_context) extern int job_submit_plugin_init(void) { int rc = SLURM_SUCCESS; - char *last = NULL, *names, *one_name; + char *last = NULL, *names; + char *plugin_type = "job_submit"; + char *type; + + if (init_run && (g_context_cnt >= 0)) + return rc; - slurm_mutex_lock(&submit_context_lock); - if (submit_context_cnt >= 0) + slurm_mutex_lock(&g_context_lock); + if (g_context_cnt >= 0) goto fini; submit_plugin_list = slurm_get_job_submit_plugins(); - submit_context_cnt = 0; + g_context_cnt = 0; if ((submit_plugin_list == NULL) || (submit_plugin_list[0] == '\0')) goto fini; - submit_context_cnt = 0; - names = xstrdup(submit_plugin_list); - one_name = strtok_r(names, ",", &last); - while (one_name) { - xrealloc(submit_context, (sizeof(slurm_submit_context_t) * - (submit_context_cnt + 1))); - rc = _load_submit_plugin(one_name, - submit_context + submit_context_cnt); - if (rc != SLURM_SUCCESS) + names = submit_plugin_list; + while ((type = strtok_r(names, ",", &last))) { + xrealloc(ops, + (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) + type += 11; /* backward compatibility */ + type = xstrdup_printf("job_submit/%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; - submit_context_cnt++; - one_name = strtok_r(NULL, ",", &last); + } + + xfree(type); + g_context_cnt++; + names = NULL; /* for next iteration */ } - xfree(names); + init_run = true; + +fini: + slurm_mutex_unlock(&g_context_lock); + + if (rc != SLURM_SUCCESS) + job_submit_plugin_fini(); -fini: slurm_mutex_unlock(&submit_context_lock); return rc; } @@ -233,20 +165,24 @@ extern int job_submit_plugin_fini(void) { int i, j, rc = SLURM_SUCCESS; - slurm_mutex_lock(&submit_context_lock); - if (submit_context_cnt < 0) + slurm_mutex_lock(&g_context_lock); + if (g_context_cnt < 0) goto fini; - for (i=0; iname, license_entry->used, + license_entry->total); + } + list_iterator_destroy(iter); + } + slurm_mutex_unlock(&license_mutex); + + return licenses_used; +} + /* Initialize licenses on this system based upon slurm.conf */ extern int license_init(char *licenses) { diff --git a/src/slurmctld/licenses.h b/src/slurmctld/licenses.h index f8fa9f53a7b4271f5ef2edfb54f29a4253407f89..1ecdc0c028a71a4418cd6e25b28df611bc51c060 100644 --- a/src/slurmctld/licenses.h +++ b/src/slurmctld/licenses.h @@ -50,6 +50,8 @@ typedef struct licenses { extern List license_list; +/* Get string of used license information. Caller must xfree return value */ +extern char *get_licenses_used(void); /* Initialize licenses on this system based upon slurm.conf */ extern int license_init(char *licenses); diff --git a/src/slurmctld/node_mgr.c b/src/slurmctld/node_mgr.c index fbb5faf4d37ce69699e0cd9e3b5b92fba287a4f5..f1f4b7928deb7ab3d640b5a15e4e40d016782806 100644 --- a/src/slurmctld/node_mgr.c +++ b/src/slurmctld/node_mgr.c @@ -82,7 +82,8 @@ #define MAX_RETRIES 10 /* Change NODE_STATE_VERSION value when changing the state save format */ -#define NODE_STATE_VERSION "VER005" +#define NODE_STATE_VERSION "VER006" +#define NODE_2_5_STATE_VERSION "VER006" /* SLURM version 2.5 */ #define NODE_2_4_STATE_VERSION "VER005" /* SLURM version 2.4 */ #define NODE_2_2_STATE_VERSION "VER004" /* SLURM version 2.2 & 2.3 */ #define NODE_2_1_STATE_VERSION "VER003" /* SLURM version 2.1 */ @@ -94,6 +95,14 @@ bitstr_t *idle_node_bitmap = NULL; /* bitmap of idle nodes */ bitstr_t *power_node_bitmap = NULL; /* bitmap of powered down nodes */ bitstr_t *share_node_bitmap = NULL; /* bitmap of sharable nodes */ bitstr_t *up_node_bitmap = NULL; /* bitmap of non-down nodes */ +bool load_2_4_state = false; /* There was a bug in 2.4.0 + * where the job state version + * wasn't incremented + * correctly. Luckly the node + * state was. We will use it + * to set the version + * correctly in the job. + */ static void _dump_node_state (struct node_record *dump_node_ptr, Buf buffer); @@ -214,6 +223,7 @@ _dump_node_state (struct node_record *dump_node_ptr, Buf buffer) packstr (dump_node_ptr->gres, buffer); pack16 (dump_node_ptr->node_state, buffer); pack16 (dump_node_ptr->cpus, buffer); + pack16 (dump_node_ptr->boards, buffer); pack16 (dump_node_ptr->sockets, buffer); pack16 (dump_node_ptr->cores, buffer); pack16 (dump_node_ptr->threads, buffer); @@ -271,7 +281,7 @@ extern int load_all_node_state ( bool state_only ) char *features = NULL, *gres = NULL; int data_allocated, data_read = 0, error_code = 0, node_cnt = 0; uint16_t node_state; - uint16_t cpus = 1, sockets = 1, cores = 1, threads = 1; + uint16_t cpus = 1, boards = 1, sockets = 1, cores = 1, threads = 1; uint32_t real_memory, tmp_disk, data_size = 0, name_len; uint32_t reason_uid = NO_VAL; time_t reason_time = 0; @@ -326,6 +336,8 @@ extern int load_all_node_state ( bool state_only ) if (ver_str) { if (!strcmp(ver_str, NODE_STATE_VERSION)) { protocol_version = SLURM_PROTOCOL_VERSION; + } else if (!strcmp(ver_str, NODE_2_4_STATE_VERSION)) { + protocol_version = SLURM_2_4_PROTOCOL_VERSION; } else if (!strcmp(ver_str, NODE_2_2_STATE_VERSION)) { protocol_version = SLURM_2_2_PROTOCOL_VERSION; } else if (!strcmp(ver_str, NODE_2_1_STATE_VERSION)) { @@ -343,11 +355,37 @@ extern int load_all_node_state ( bool state_only ) } xfree(ver_str); + if (protocol_version == SLURM_2_4_PROTOCOL_VERSION) + load_2_4_state = true; + safe_unpack_time (&time_stamp, buffer); while (remaining_buf (buffer) > 0) { uint16_t base_state; - if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_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 (&gres, &name_len, buffer); + safe_unpack16 (&node_state, buffer); + safe_unpack16 (&cpus, buffer); + safe_unpack16 (&boards, buffer); + safe_unpack16 (&sockets, buffer); + safe_unpack16 (&cores, buffer); + safe_unpack16 (&threads, buffer); + safe_unpack32 (&real_memory, buffer); + safe_unpack32 (&tmp_disk, buffer); + safe_unpack32 (&reason_uid, buffer); + safe_unpack_time (&reason_time, 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_2_4_PROTOCOL_VERSION) { safe_unpackstr_xmalloc (&comm_name, &name_len, buffer); safe_unpackstr_xmalloc (&node_name, &name_len, buffer); safe_unpackstr_xmalloc (&node_hostname, @@ -407,13 +445,14 @@ extern int load_all_node_state ( bool state_only ) /* validity test as possible */ if ((cpus == 0) || + (boards == 0) || (sockets == 0) || (cores == 0) || (threads == 0) || (base_state >= NODE_STATE_END)) { - error ("Invalid data for node %s: procs=%u, " - "sockets=%u, cores=%u, threads=%u, state=%u", - node_name, cpus, + error ("Invalid data for node %s: procs=%u, boards=%u," + " sockets=%u, cores=%u, threads=%u, state=%u", + node_name, cpus, boards, sockets, cores, threads, node_state); error ("No more node data will be processed from the " "checkpoint file"); @@ -486,6 +525,7 @@ extern int load_all_node_state ( bool state_only ) /* Recover hardware state for powered * down nodes */ node_ptr->cpus = cpus; + node_ptr->boards = boards; node_ptr->sockets = sockets; node_ptr->cores = cores; node_ptr->threads = threads; @@ -732,7 +772,56 @@ extern void pack_all_node (char **buffer_ptr, int *buffer_size, static void _pack_node (struct node_record *dump_node_ptr, Buf buffer, uint16_t protocol_version) { - if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_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); + /* On a bluegene system always use the regular node + * infomation not what is in the config_ptr. + */ +#ifndef HAVE_BG + if (slurmctld_conf.fast_schedule) { + /* Only data from config_record used for scheduling */ + pack16(dump_node_ptr->config_ptr->cpus, buffer); + pack16(dump_node_ptr->config_ptr->boards, buffer); + pack16(dump_node_ptr->config_ptr->sockets, buffer); + pack16(dump_node_ptr->config_ptr->cores, buffer); + pack16(dump_node_ptr->config_ptr->threads, buffer); + pack32(dump_node_ptr->config_ptr->real_memory, buffer); + pack32(dump_node_ptr->config_ptr->tmp_disk, buffer); + } else { +#endif + /* Individual node data used for scheduling */ + pack16(dump_node_ptr->cpus, buffer); + pack16(dump_node_ptr->boards, buffer); + pack16(dump_node_ptr->sockets, buffer); + pack16(dump_node_ptr->cores, buffer); + pack16(dump_node_ptr->threads, buffer); + pack32(dump_node_ptr->real_memory, buffer); + pack32(dump_node_ptr->tmp_disk, buffer); +#ifndef HAVE_BG + } +#endif + pack32(dump_node_ptr->config_ptr->weight, buffer); + pack32(dump_node_ptr->reason_uid, buffer); + + pack_time(dump_node_ptr->boot_time, buffer); + pack_time(dump_node_ptr->reason_time, buffer); + pack_time(dump_node_ptr->slurmd_start_time, buffer); + + select_g_select_nodeinfo_pack(dump_node_ptr->select_nodeinfo, + buffer, protocol_version); + + packstr(dump_node_ptr->arch, buffer); + packstr(dump_node_ptr->features, buffer); + if (dump_node_ptr->gres) + packstr(dump_node_ptr->gres, buffer); + else + packstr(dump_node_ptr->config_ptr->gres, buffer); + packstr(dump_node_ptr->os, buffer); + packstr(dump_node_ptr->reason, buffer); + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { packstr (dump_node_ptr->name, buffer); packstr (dump_node_ptr->node_hostname, buffer); packstr (dump_node_ptr->comm_name, buffer); @@ -1277,6 +1366,7 @@ struct config_record * _dup_config(struct config_record *config_ptr) new_config_ptr = create_config_record(); new_config_ptr->magic = config_ptr->magic; new_config_ptr->cpus = config_ptr->cpus; + new_config_ptr->boards = config_ptr->boards; new_config_ptr->sockets = config_ptr->sockets; new_config_ptr->cores = config_ptr->cores; new_config_ptr->threads = config_ptr->threads; @@ -1769,6 +1859,7 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg) } } if (error_code == SLURM_SUCCESS) { + node_ptr->boards = reg_msg->boards; node_ptr->sockets = reg_msg->sockets; node_ptr->cores = reg_msg->cores; node_ptr->threads = reg_msg->threads; @@ -2090,6 +2181,7 @@ extern int validate_nodes_via_front_end( } } + /* purge orphan batch jobs */ job_iterator = list_iterator_create(job_list); while ((job_ptr = (struct job_record *) list_next(job_iterator))) { diff --git a/src/slurmctld/node_scheduler.c b/src/slurmctld/node_scheduler.c index a321062edd7756c888174305197243573b28102a..0f3143c3acd8ebe10761612c886b0fa636af7ec8 100644 --- a/src/slurmctld/node_scheduler.c +++ b/src/slurmctld/node_scheduler.c @@ -116,7 +116,8 @@ static int _pick_best_nodes(struct node_set *node_set_ptr, uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, bool test_only, List preemptee_candidates, - List *preemptee_job_list, bool has_xand, bitstr_t *exc_node_bitmap); + List *preemptee_job_list, bool has_xand, + bitstr_t *exc_node_bitmap); static bool _valid_feature_counts(struct job_details *detail_ptr, bitstr_t *node_bitmap, bool *has_xor); static bitstr_t *_valid_features(struct job_details *detail_ptr, @@ -135,13 +136,6 @@ extern void allocate_nodes(struct job_record *job_ptr) struct node_record *node_ptr; bool has_cloud = false, has_cloud_power_save = false; - xfree(job_ptr->batch_host); -#ifdef HAVE_FRONT_END - job_ptr->front_end_ptr = assign_front_end(); - xassert(job_ptr->front_end_ptr); - job_ptr->batch_host = xstrdup(job_ptr->front_end_ptr->name); -#endif - for (i = 0, node_ptr = node_record_table_ptr; i < node_record_count; i++, node_ptr++) { if (!bit_test(job_ptr->node_bitmap, i)) @@ -153,9 +147,8 @@ extern void allocate_nodes(struct job_record *job_ptr) has_cloud_power_save = true; } make_node_alloc(node_ptr, job_ptr); - if (job_ptr->batch_host == NULL) - job_ptr->batch_host = xstrdup(node_ptr->name); } + last_node_update = time(NULL); license_job_get(job_ptr); @@ -211,8 +204,9 @@ extern void set_job_alias_list(struct job_record *job_ptr) * IN preempted - true if job is being preempted */ extern void deallocate_nodes(struct job_record *job_ptr, bool timeout, - bool suspended, bool preempted) + bool suspended, bool preempted) { + static int select_serial = -1; int i; kill_job_msg_t *kill_job = NULL; agent_arg_t *agent_args = NULL; @@ -225,6 +219,13 @@ extern void deallocate_nodes(struct job_record *job_ptr, bool timeout, xassert(job_ptr); xassert(job_ptr->details); + if (select_serial == -1) { + if (strcmp(slurmctld_conf.select_type, "select/serial")) + select_serial = 0; + else + select_serial = 1; + } + license_job_return(job_ptr); acct_policy_job_fini(job_ptr); if (slurm_sched_freealloc(job_ptr) != SLURM_SUCCESS) @@ -326,6 +327,11 @@ extern void deallocate_nodes(struct job_record *job_ptr, bool timeout, } bit_clear(job_ptr->node_bitmap_cg, i); job_update_cpu_cnt(job_ptr, i); + /* node_cnt indicates how many nodes we are waiting + * to get epilog complete messages from, so do not + * count down nodes. NOTE: The job's node_cnt will not + * match the number of entries in the node string + * during its completion. */ job_ptr->node_cnt--; } make_node_comp(node_ptr, job_ptr, suspended); @@ -342,13 +348,12 @@ extern void deallocate_nodes(struct job_record *job_ptr, bool timeout, } if (agent_args->node_count == 0) { - if (job_ptr->details->expanding_jobid == 0) { + if ((job_ptr->details->expanding_jobid == 0) && + (select_serial == 0)) { error("Job %u allocated no nodes to be killed on", job_ptr->job_id); } - xfree(kill_job->nodes); - select_g_select_jobinfo_free(kill_job->select_jobinfo); - xfree(kill_job); + slurm_free_kill_job_msg(kill_job); hostlist_destroy(agent_args->hostlist); xfree(agent_args); return; @@ -489,7 +494,8 @@ _get_req_features(struct node_set *node_set_ptr, int node_set_size, * of select_bitmap to those nodes */ if (job_ptr->resv_name == NULL) { time_t start_res = time(NULL); - rc = job_test_resv(job_ptr, &start_res, false, &resv_bitmap, &exc_core_bitmap); + rc = job_test_resv(job_ptr, &start_res, false, &resv_bitmap, + &exc_core_bitmap); if ((rc != SLURM_SUCCESS) || (bit_set_count(resv_bitmap) < min_nodes) || (job_ptr->details->req_node_bitmap && @@ -505,12 +511,13 @@ _get_req_features(struct node_set *node_set_ptr, int node_set_size, avail_node_bitmap = resv_bitmap; } else FREE_NULL_BITMAP(resv_bitmap); - }else{ + } else { time_t start_res = time(NULL); - rc = job_test_resv(job_ptr, &start_res, false, &resv_bitmap, &exc_core_bitmap); - - /* We do not care about return value. We are just interested in exc_core_bitmap creation */ - } + rc = job_test_resv(job_ptr, &start_res, false, &resv_bitmap, + &exc_core_bitmap); + /* We do not care about return value. + * We are just interested in exc_core_bitmap creation */ + } /* save job and request state */ saved_min_nodes = min_nodes; @@ -582,7 +589,8 @@ _get_req_features(struct node_set *node_set_ptr, int node_set_size, job_ptr, part_ptr, min_nodes, max_nodes, req_nodes, test_only, preemptee_candidates, - preemptee_job_list, false, exc_core_bitmap); + preemptee_job_list, false, + exc_core_bitmap); #if 0 { char *tmp_str = bitmap2node_name(feature_bitmap); @@ -748,7 +756,8 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, struct part_record *part_ptr, uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, bool test_only, List preemptee_candidates, - List *preemptee_job_list, bool has_xand, bitstr_t *exc_core_bitmap) + List *preemptee_job_list, bool has_xand, + bitstr_t *exc_core_bitmap) { int error_code = SLURM_SUCCESS, i, j, pick_code; int total_nodes = 0, avail_nodes = 0; @@ -768,7 +777,27 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, else select_mode = SELECT_MODE_RUN_NOW; - if (node_set_size == 0) { + if ((job_ptr->details->min_nodes == 0) && + (job_ptr->details->max_nodes == 0)) { + avail_bitmap = bit_alloc(node_record_count); + if (!avail_bitmap) + fatal("bit_alloc: malloc failure"); + pick_code = select_g_job_test(job_ptr, + avail_bitmap, + 0, 0, 0, + select_mode, + preemptee_candidates, + preemptee_job_list, + exc_core_bitmap); + + if (pick_code == SLURM_SUCCESS) { + *select_bitmap = avail_bitmap; + return SLURM_SUCCESS; + } else { + bit_free(avail_bitmap); + return ESLURM_REQUESTED_NODE_CONFIG_UNAVAILABLE; + } + } else if (node_set_size == 0) { info("_pick_best_nodes: empty node set for selection"); return ESLURM_REQUESTED_NODE_CONFIG_UNAVAILABLE; } @@ -974,7 +1003,8 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, req_nodes, select_mode, preemptee_candidates, - preemptee_job_list, exc_core_bitmap); + preemptee_job_list, + exc_core_bitmap); #if 0 { char *tmp_str1 = bitmap2node_name(backup_bitmap); @@ -1021,7 +1051,8 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, req_nodes, select_mode, preemptee_candidates, - preemptee_job_list, exc_core_bitmap); + preemptee_job_list, + exc_core_bitmap); if ((pick_code == SLURM_SUCCESS) && (bit_set_count(avail_bitmap) <= max_nodes)) { FREE_NULL_BITMAP(total_bitmap); @@ -1054,7 +1085,8 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, max_nodes, req_nodes, SELECT_MODE_TEST_ONLY, - preemptee_candidates, NULL, exc_core_bitmap); + preemptee_candidates, NULL, + exc_core_bitmap); if (pick_code == SLURM_SUCCESS) { runable_ever = true; if (bit_set_count(avail_bitmap) <= @@ -1072,7 +1104,8 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, max_nodes, req_nodes, SELECT_MODE_TEST_ONLY, - preemptee_candidates, NULL, exc_core_bitmap); + preemptee_candidates, NULL, + exc_core_bitmap); if (pick_code == SLURM_SUCCESS) { FREE_NULL_BITMAP(possible_bitmap); possible_bitmap = total_bitmap; @@ -1164,6 +1197,11 @@ static void _preempt_jobs(List preemptee_job_list, int *error_code) } if (rc != SLURM_SUCCESS) { + if ((mode != PREEMPT_MODE_CANCEL) + && (slurm_job_check_grace(job_ptr) + == SLURM_SUCCESS)) + continue; + rc = job_signal(job_ptr->job_id, SIGKILL, 0, 0, true); if (rc == SLURM_SUCCESS) info("preempted job %u had to be killed", @@ -1212,16 +1250,7 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only, time_t now = time(NULL); bool configuring = false; List preemptee_job_list = NULL; - slurmdb_association_rec_t *assoc_ptr = NULL; slurmdb_qos_rec_t *qos_ptr = NULL; - uint32_t job_min_nodes, job_max_nodes; - uint32_t part_min_nodes, part_max_nodes; -#ifdef HAVE_BG - static uint16_t cpus_per_node = 0; - if (!cpus_per_node) - select_g_alter_node_cnt(SELECT_GET_NODE_CPU_CNT, - &cpus_per_node); -#endif xassert(job_ptr); xassert(job_ptr->magic == JOB_MAGIC); @@ -1230,7 +1259,6 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only, return ESLURM_ACCOUNTING_POLICY; part_ptr = job_ptr->part_ptr; - assoc_ptr = (slurmdb_association_rec_t *)job_ptr->assoc_ptr; qos_ptr = (slurmdb_qos_rec_t *)job_ptr->qos_ptr; /* identify partition */ @@ -1242,70 +1270,19 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only, job_ptr->job_id, job_ptr->partition); } -#ifdef HAVE_BG - job_min_nodes = job_ptr->details->min_cpus / cpus_per_node; - job_max_nodes = job_ptr->details->max_cpus / cpus_per_node; - part_min_nodes = part_ptr->min_nodes_orig; - part_max_nodes = part_ptr->max_nodes_orig; -#else - job_min_nodes = job_ptr->details->min_nodes; - job_max_nodes = job_ptr->details->max_nodes; - part_min_nodes = part_ptr->min_nodes; - part_max_nodes = part_ptr->max_nodes; -#endif - /* Confirm that partition is up and has compatible nodes limits */ - fail_reason = WAIT_NO_REASON; - if (part_ptr->state_up == PARTITION_DOWN) - fail_reason = WAIT_PART_DOWN; - else if (part_ptr->state_up == PARTITION_INACTIVE) - fail_reason = WAIT_PART_INACTIVE; - else if (job_ptr->priority == 0) /* user or administrator hold */ - fail_reason = WAIT_HELD; - else if ((((job_ptr->time_limit != NO_VAL) && - (job_ptr->time_limit > part_ptr->max_time)) || - ((job_ptr->time_min != NO_VAL) && - (job_ptr->time_min > part_ptr->max_time))) && - (!qos_ptr || (qos_ptr && !(qos_ptr->flags & - QOS_FLAG_PART_TIME_LIMIT)))) - fail_reason = WAIT_PART_TIME_LIMIT; - else if (((job_max_nodes != 0) && - ((job_max_nodes < part_min_nodes) && - (!qos_ptr || (qos_ptr && !(qos_ptr->flags - & QOS_FLAG_PART_MIN_NODE))))) || - ((job_min_nodes > part_max_nodes) && - (!qos_ptr || (qos_ptr && !(qos_ptr->flags - & QOS_FLAG_PART_MAX_NODE))))) - fail_reason = WAIT_PART_NODE_LIMIT; - else if (qos_ptr && assoc_ptr && - (qos_ptr->flags & QOS_FLAG_ENFORCE_USAGE_THRES) && - (!fuzzy_equal(qos_ptr->usage_thres, NO_VAL))) { - if (!job_ptr->prio_factors) - job_ptr->prio_factors = - xmalloc(sizeof(priority_factors_object_t)); - - if (!job_ptr->prio_factors->priority_fs) { - if (fuzzy_equal(assoc_ptr->usage->usage_efctv, NO_VAL)) - priority_g_set_assoc_usage(assoc_ptr); - job_ptr->prio_factors->priority_fs = - priority_g_calc_fs_factor( - assoc_ptr->usage->usage_efctv, - (long double)assoc_ptr->usage-> - shares_norm); + if (job_ptr->priority == 0) { /* user/admin hold */ + if ((job_ptr->state_reason != WAIT_HELD) && + (job_ptr->state_reason != WAIT_HELD_USER)) { + job_ptr->state_reason = WAIT_HELD; } - if (job_ptr->prio_factors->priority_fs < qos_ptr->usage_thres) - fail_reason = WAIT_QOS_THRES; + return ESLURM_JOB_HELD; } + /* Confirm that partition is up and has compatible nodes limits */ + fail_reason = job_limits_check(&job_ptr); if (fail_reason != WAIT_NO_REASON) { last_job_update = now; xfree(job_ptr->state_desc); - if (job_ptr->priority == 0) { /* user/admin hold */ - if ((job_ptr->state_reason != WAIT_HELD) && - (job_ptr->state_reason != WAIT_HELD_USER)) { - job_ptr->state_reason = WAIT_HELD; - } - return ESLURM_JOB_HELD; - } job_ptr->state_reason = fail_reason; return ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE; } @@ -1763,7 +1740,7 @@ static int _build_node_list(struct job_record *job_ptr, xfree(job_ptr->state_desc); if (rc == ESLURM_INVALID_TIME_VALUE) return ESLURM_RESERVATION_NOT_USABLE; - + if (rc == ESLURM_NODES_BUSY) return ESLURM_NODES_BUSY; @@ -1780,6 +1757,12 @@ 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)) { + *node_set_pptr = NULL; + *node_set_size = 0; + return SLURM_SUCCESS; + } node_set_inx = 0; node_set_ptr = (struct node_set *) @@ -2093,6 +2076,12 @@ extern void build_node_details(struct job_record *job_ptr) xrealloc(job_ptr->node_addr, (sizeof(slurm_addr_t) * job_ptr->node_cnt)); + xfree(job_ptr->batch_host); +#ifdef HAVE_FRONT_END + job_ptr->front_end_ptr = assign_front_end(); + xassert(job_ptr->front_end_ptr); + job_ptr->batch_host = xstrdup(job_ptr->front_end_ptr->name); +#endif while ((this_node_name = hostlist_shift(host_list))) { if ((node_ptr = find_node_record(this_node_name))) { memcpy(&job_ptr->node_addr[node_inx++], @@ -2101,6 +2090,8 @@ extern void build_node_details(struct job_record *job_ptr) error("Invalid node %s in JobId=%u", this_node_name, job_ptr->job_id); } + if (job_ptr->batch_host == NULL) + job_ptr->batch_host = xstrdup(this_node_name); free(this_node_name); } hostlist_destroy(host_list); diff --git a/src/slurmctld/partition_mgr.c b/src/slurmctld/partition_mgr.c index ff5bf112e1d54955b4548035de9bac8c1050f8fc..e5fcb94d019319c26f4fb1ac572792ecd889999f 100644 --- a/src/slurmctld/partition_mgr.c +++ b/src/slurmctld/partition_mgr.c @@ -64,6 +64,7 @@ #include "src/slurmctld/groups.h" #include "src/slurmctld/locks.h" #include "src/slurmctld/proc_req.h" +#include "src/slurmctld/reservation.h" #include "src/slurmctld/sched_plugin.h" #include "src/slurmctld/slurmctld.h" #include "src/slurmctld/state_save.h" @@ -1378,6 +1379,7 @@ extern int update_part (update_part_msg_t * part_desc, bool create_flag) part_ptr->nodes, part_desc->name); xfree(backup_node_list); } + update_part_nodes_in_resv(part_ptr); } else if (part_ptr->node_bitmap == NULL) { /* Newly created partition needs a bitmap, even if empty */ part_ptr->node_bitmap = bit_alloc(node_record_count); diff --git a/src/slurmctld/preempt.c b/src/slurmctld/preempt.c index 59cc11a051398528094faa81cab471abf85b9e52..50923f08b2bf4d58e6bc242b73751f1729a130a0 100644 --- a/src/slurmctld/preempt.c +++ b/src/slurmctld/preempt.c @@ -59,135 +59,20 @@ typedef struct slurm_preempt_ops { job_queue_rec_t *preemptee); } slurm_preempt_ops_t; - -/* ************************************************************************ */ -/* TAG( slurm_preempt_contex_t ) */ -/* ************************************************************************ */ -typedef struct slurm_preempt_context { - char *preempt_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int preempt_errno; - slurm_preempt_ops_t ops; -} slurm_preempt_context_t; - -static slurm_preempt_context_t *g_preempt_context = NULL; -static pthread_mutex_t g_preempt_context_lock = PTHREAD_MUTEX_INITIALIZER; - - -/* ************************************************************************ */ -/* TAG( _slurm_preempt_get_ops ) */ -/* ************************************************************************ */ -static slurm_preempt_ops_t * -_slurm_preempt_get_ops(slurm_preempt_context_t *c) -{ - /* - * Must be synchronized with slurm_preempt_ops_t above. - */ - static const char *syms[] = { - "find_preemptable_jobs", - "job_preempt_mode", - "preemption_enabled", - "job_preempt_check", - }; - int n_syms = sizeof(syms) / sizeof(char *); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->preempt_type, n_syms, syms, - (void **) &c->ops); - if (c->cur_plugin != PLUGIN_INVALID_HANDLE) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->preempt_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->preempt_type); - - /* Get plugin list. */ - if (c->plugin_list == NULL) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if (c->plugin_list == NULL) { - error("cannot create plugin manager"); - return NULL; - } - plugrack_set_major_type(c->plugin_list, "preempt"); - plugrack_set_paranoia(c->plugin_list, - PLUGRACK_PARANOIA_NONE, 0); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir(c->plugin_list, plugin_dir); - xfree(plugin_dir); - } - - c->cur_plugin = plugrack_use_by_type(c->plugin_list, c->preempt_type); - if (c->cur_plugin == PLUGIN_INVALID_HANDLE) { - error("cannot find preempt plugin for %s", c->preempt_type); - return NULL; - } - - /* Dereference the API. */ - if (plugin_get_syms(c->cur_plugin, - n_syms, - syms, - (void **) &c->ops) < n_syms) { - error("incomplete preempt plugin detected"); - return NULL; - } - - return &c->ops; -} - - -/* ************************************************************************ */ -/* TAG( _slurm_preempt_context_create ) */ -/* ************************************************************************ */ -static slurm_preempt_context_t * -_slurm_preempt_context_create(const char *preempt_type) -{ - slurm_preempt_context_t *c; - - if (preempt_type == NULL) { - debug3("slurm_preempt_context: no preempt type"); - return NULL; - } - - c = xmalloc(sizeof(slurm_preempt_context_t)); - c->preempt_type = xstrdup(preempt_type); - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - c->preempt_errno = SLURM_SUCCESS; - - return c; -} - - -/* ************************************************************************ */ -/* TAG( _slurm_preempt_context_destroy ) */ -/* ************************************************************************ */ -static int _slurm_preempt_context_destroy(slurm_preempt_context_t *c) -{ - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if (c->plugin_list) { - if (plugrack_destroy(c->plugin_list) != SLURM_SUCCESS) { - return SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree(c->preempt_type); - xfree(c); - - return SLURM_SUCCESS; -} +/* + * Must be synchronized with slurm_preempt_ops_t above. + */ +static const char *syms[] = { + "find_preemptable_jobs", + "job_preempt_mode", + "preemption_enabled", + "job_preempt_check", +}; + +static slurm_preempt_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; /* *********************************************************************** */ /* TAG( _preempt_signal ) */ @@ -252,38 +137,34 @@ extern int slurm_job_check_grace(struct job_record *job_ptr) extern int slurm_preempt_init(void) { int retval = SLURM_SUCCESS; - char *preempt_type = NULL; + char *plugin_type = "preempt"; + char *type = NULL; /* This function is called frequently, so it should be as fast as * possible. The test below will be TRUE almost all of the time and * is as fast as possible. */ - if (g_preempt_context) + if (init_run && g_context) return retval; - slurm_mutex_lock(&g_preempt_context_lock); + slurm_mutex_lock(&g_context_lock); - if (g_preempt_context) + if (g_context) goto done; - preempt_type = slurm_get_preempt_type(); - g_preempt_context = _slurm_preempt_context_create(preempt_type); - if (g_preempt_context == NULL) { - error("cannot create preempt context for %s", - preempt_type); - retval = SLURM_ERROR; - goto done; - } + type = slurm_get_preempt_type(); + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); - if (_slurm_preempt_get_ops(g_preempt_context) == NULL) { - error("cannot resolve preempt plugin operations"); - _slurm_preempt_context_destroy(g_preempt_context); - g_preempt_context = NULL; + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; + goto done; } + init_run = true; done: - slurm_mutex_unlock(&g_preempt_context_lock); - xfree(preempt_type); + slurm_mutex_unlock(&g_context_lock); + xfree(type); return retval; } @@ -294,11 +175,12 @@ extern int slurm_preempt_fini(void) { int rc; - if (!g_preempt_context) + if (!g_context) return SLURM_SUCCESS; - rc = _slurm_preempt_context_destroy(g_preempt_context); - g_preempt_context = NULL; + init_run = false; + rc = plugin_context_destroy(g_context); + g_context = NULL; return rc; } @@ -311,7 +193,7 @@ extern List slurm_find_preemptable_jobs(struct job_record *job_ptr) if (slurm_preempt_init() < 0) return NULL; - return (*(g_preempt_context->ops.find_jobs))(job_ptr); + return (*(ops.find_jobs))(job_ptr); } /* @@ -322,7 +204,7 @@ extern uint16_t slurm_job_preempt_mode(struct job_record *job_ptr) if (slurm_preempt_init() < 0) return (uint16_t) PREEMPT_MODE_OFF; - return (*(g_preempt_context->ops.job_preempt_mode))(job_ptr); + return (*(ops.job_preempt_mode))(job_ptr); } /* @@ -333,7 +215,7 @@ extern bool slurm_preemption_enabled(void) if (slurm_preempt_init() < 0) return false; - return (*(g_preempt_context->ops.preemption_enabled))(); + return (*(ops.preemption_enabled))(); } /* @@ -345,6 +227,6 @@ extern bool slurm_job_preempt_check(job_queue_rec_t *preemptor, if (slurm_preempt_init() < 0) return false; - return (*(g_preempt_context->ops.job_preempt_check)) + return (*(ops.job_preempt_check)) (preemptor, preemptee); } diff --git a/src/slurmctld/proc_req.c b/src/slurmctld/proc_req.c index 9b9ccee11dcf94653eb30fe4a1eb1c215a42bf8e..27011b23a3509fd2746127db21e1c864fefcf989 100644 --- a/src/slurmctld/proc_req.c +++ b/src/slurmctld/proc_req.c @@ -77,6 +77,7 @@ #include "src/slurmctld/front_end.h" #include "src/slurmctld/gang.h" #include "src/slurmctld/job_scheduler.h" +#include "src/slurmctld/licenses.h" #include "src/slurmctld/locks.h" #include "src/slurmctld/proc_req.h" #include "src/slurmctld/read_config.h" @@ -231,6 +232,7 @@ void slurmctld_req (slurm_msg_t * msg) _slurm_rpc_complete_job_allocation(msg); slurm_free_complete_job_allocation_msg(msg->data); break; + case REQUEST_COMPLETE_BATCH_JOB: case REQUEST_COMPLETE_BATCH_SCRIPT: _slurm_rpc_complete_batch_script(msg); slurm_free_complete_batch_script_msg(msg->data); @@ -527,7 +529,9 @@ void _fill_ctld_conf(slurm_ctl_conf_t * conf_ptr) conf_ptr->kill_wait = conf->kill_wait; conf_ptr->kill_on_bad_exit = conf->kill_on_bad_exit; + conf_ptr->launch_type = xstrdup(conf->launch_type); conf_ptr->licenses = xstrdup(conf->licenses); + conf_ptr->licenses_used = get_licenses_used(); conf_ptr->mail_prog = xstrdup(conf->mail_prog); conf_ptr->max_job_cnt = conf->max_job_cnt; @@ -792,6 +796,8 @@ static void _slurm_rpc_allocate_resources(slurm_msg_t * msg) error("REQUEST_RESOURCE_ALLOCATE lacks alloc_node from uid=%d", uid); } + if (error_code == SLURM_SUCCESS) + error_code = validate_job_create_req(job_desc_msg); #if HAVE_CRAY /* * Catch attempts to nest salloc sessions. It is not possible to use an @@ -1187,7 +1193,7 @@ static void _slurm_rpc_dump_nodes(slurm_msg_t * msg) return; } - select_g_select_nodeinfo_set_all(node_req_msg->last_update - 1); + select_g_select_nodeinfo_set_all(); if ((node_req_msg->last_update - 1) >= last_node_update) { unlock_slurmctld(node_write_lock); @@ -1284,14 +1290,13 @@ static void _slurm_rpc_epilog_complete(slurm_msg_t * msg) START_TIMER; debug2("Processing RPC: MESSAGE_EPILOG_COMPLETE uid=%d", uid); - lock_slurmctld(job_write_lock); if (!validate_slurm_user(uid)) { - unlock_slurmctld(job_write_lock); error("Security violation, EPILOG_COMPLETE RPC from uid=%d", uid); return; } + lock_slurmctld(job_write_lock); if (job_epilog_complete(epilog_msg->job_id, epilog_msg->node_name, epilog_msg->return_code)) run_scheduler = true; @@ -1464,7 +1469,7 @@ static void _slurm_rpc_complete_batch_script(slurm_msg_t * msg) }; uid_t uid = g_slurm_auth_get_uid(msg->auth_cred, NULL); bool job_requeue = false; - bool dump_job = false, dump_node = false; + bool dump_job = false, dump_node = false, run_sched = false; struct job_record *job_ptr = NULL; char *msg_title = "node(s)"; char *nodes = comp_msg->node_name; @@ -1488,10 +1493,10 @@ static void _slurm_rpc_complete_batch_script(slurm_msg_t * msg) lock_slurmctld(job_write_lock); + job_ptr = find_job_record(comp_msg->job_id); /* Send batch step info to accounting */ - if (association_based_accounting && - (job_ptr = find_job_record(comp_msg->job_id))) { + if (association_based_accounting && job_ptr) { struct step_record batch_step; memset(&batch_step, 0, sizeof(struct step_record)); batch_step.job_ptr = job_ptr; @@ -1515,8 +1520,6 @@ static void _slurm_rpc_complete_batch_script(slurm_msg_t * msg) } #ifdef HAVE_FRONT_END - if (!job_ptr) - job_ptr = find_job_record(comp_msg->job_id); if (job_ptr && job_ptr->front_end_ptr) nodes = job_ptr->front_end_ptr->name; msg_title = "front_end"; @@ -1597,6 +1600,8 @@ static void _slurm_rpc_complete_batch_script(slurm_msg_t * msg) } /* Mark job allocation complete */ + if (msg->msg_type == REQUEST_COMPLETE_BATCH_JOB) + job_epilog_complete(comp_msg->job_id, comp_msg->node_name, 0); i = job_complete(comp_msg->job_id, uid, job_requeue, false, comp_msg->job_rc); error_code = MAX(error_code, i); @@ -1625,10 +1630,14 @@ static void _slurm_rpc_complete_batch_script(slurm_msg_t * msg) } else { debug2("_slurm_rpc_complete_batch_script JobId=%u %s", comp_msg->job_id, TIME_STR); - slurm_send_rc_msg(msg, SLURM_SUCCESS); slurmctld_diag_stats.jobs_completed++; dump_job = true; + if (replace_batch_job(msg, job_ptr)) + run_sched = true; } + + if (run_sched) + (void) schedule(0); /* Has own locking */ if (dump_job) (void) schedule_job_save(); /* Has own locking */ if (dump_node) @@ -1822,6 +1831,8 @@ static void _slurm_rpc_job_will_run(slurm_msg_t * msg) error_code = ESLURM_INVALID_NODE_NAME; error("REQUEST_JOB_WILL_RUN lacks alloc_node from uid=%d", uid); } + if (error_code == SLURM_SUCCESS) + error_code = validate_job_create_req(job_desc_msg); slurm_get_peer_addr(msg->conn_fd, &resp_addr); job_desc_msg->resp_host = xmalloc(16); slurm_get_ip_str(&resp_addr, &port, job_desc_msg->resp_host, 16); @@ -2555,6 +2566,8 @@ static void _slurm_rpc_submit_batch_job(slurm_msg_t * msg) error_code = ESLURM_INVALID_NODE_NAME; error("REQUEST_SUBMIT_BATCH_JOB lacks alloc_node from uid=%d", uid); } + if (error_code == SLURM_SUCCESS) + error_code = validate_job_create_req(job_desc_msg); dump_job_desc(job_desc_msg); if (error_code == SLURM_SUCCESS) { lock_slurmctld(job_write_lock); @@ -2639,6 +2652,8 @@ static void _slurm_rpc_submit_batch_job(slurm_msg_t * msg) false, NULL, 0, uid, &job_ptr); unlock_slurmctld(job_write_lock); END_TIMER2("_slurm_rpc_submit_batch_job"); + if (job_desc_msg->immediate && (error_code != SLURM_SUCCESS)) + error_code = ESLURM_CAN_NOT_START_IMMEDIATELY; } /* return result */ @@ -2661,7 +2676,12 @@ static void _slurm_rpc_submit_batch_job(slurm_msg_t * msg) response_msg.msg_type = RESPONSE_SUBMIT_BATCH_JOB; response_msg.data = &submit_msg; slurm_send_node_msg(msg->conn_fd, &response_msg); - schedule(0); /* has own locks */ + /* We need to use schedule() to initiate a batch job in order + * to run the various prologs, boot the node, etc. + * We also run schedule() even if this job could not start, + * say due to a higher priority job, since the locks are + * released above and we might start some other job here. */ + schedule(1); /* has own locks */ schedule_job_save(); /* has own locks */ schedule_node_save(); /* has own locks */ } @@ -3130,7 +3150,7 @@ static void _slurm_rpc_resv_show(slurm_msg_t * msg) slurm_send_rc_msg(msg, SLURM_NO_CHANGE_IN_DATA); } else { lock_slurmctld(node_read_lock); - show_resv(&dump, &dump_size, uid); + show_resv(&dump, &dump_size, uid, msg->protocol_version); unlock_slurmctld(node_read_lock); END_TIMER2("_slurm_rpc_resv_show"); @@ -3652,7 +3672,6 @@ int _launch_batch_step(job_desc_msg_t *job_desc_msg, uid_t uid, launch_msg_ptr->step_id = step_rec->step_id; launch_msg_ptr->gid = job_ptr->group_id; launch_msg_ptr->uid = uid; - launch_msg_ptr->nodes = xstrdup(job_ptr->nodes); launch_msg_ptr->nodes = xstrdup(job_ptr->alias_list); launch_msg_ptr->restart_cnt = job_ptr->restart_cnt; if (job_ptr->details) { @@ -3924,6 +3943,7 @@ inline static void _slurm_rpc_set_debug_flags(slurm_msg_t *msg) priority_g_reconfig(); select_g_reconfigure(); (void) slurm_sched_reconfig(); + (void) switch_g_reconfig(); unlock_slurmctld (config_write_lock); flag_string = debug_flags2str(debug_flags); diff --git a/src/slurmctld/read_config.c b/src/slurmctld/read_config.c index fd3184023084b020091cd0bd3350a3323f9edd1a..563e2e47ec8500d01649d3827f5da07c022d5658 100644 --- a/src/slurmctld/read_config.c +++ b/src/slurmctld/read_config.c @@ -71,6 +71,7 @@ #include "src/common/slurm_rlimits_info.h" #include "src/common/switch.h" #include "src/common/xstring.h" +#include "src/common/strnatcmp.h" #include "src/slurmctld/acct_policy.h" #include "src/slurmctld/front_end.h" @@ -121,11 +122,50 @@ static void _validate_node_proc_count(void); #endif /* - * _reorder_node_record_table - order node table in ascending order of node_rank + * _reorder_nodes_by_name - order node table in ascending order of name + */ +static void _reorder_nodes_by_name(void) +{ + struct node_record *node_ptr, *node_ptr2; + int i, j, min_inx; + + /* Now we need to sort the node records */ + for (i = 0; i < node_record_count; i++) { + min_inx = i; + for (j = i + 1; j < node_record_count; j++) { + if (strnatcmp(node_record_table_ptr[j].name, + node_record_table_ptr[min_inx].name) < 0) + min_inx = j; + } + + if (min_inx != i) { /* swap records */ + struct node_record node_record_tmp; + + j = sizeof(struct node_record); + node_ptr = node_record_table_ptr + i; + node_ptr2 = node_record_table_ptr + min_inx; + + memcpy(&node_record_tmp, node_ptr, j); + memcpy(node_ptr, node_ptr2, j); + memcpy(node_ptr2, &node_record_tmp, j); + } + } + +#if _DEBUG + /* Log the results */ + for (i=0, node_ptr = node_record_table_ptr; i < node_record_count; + i++, node_ptr++) { + info("node_rank[%d]: %s", i, node_ptr->name); + } +#endif +} + +/* + * _reorder_nodes_by_rank - order node table in ascending order of node_rank * This depends on the TopologyPlugin and/or SelectPlugin, which may generate * such a ranking. */ -static void _reorder_node_record_table(void) +static void _reorder_nodes_by_rank(void) { struct node_record *node_ptr, *node_ptr2; int i, j, min_inx; @@ -146,7 +186,7 @@ static void _reorder_node_record_table(void) struct node_record node_record_tmp; j = sizeof(struct node_record); - node_ptr = node_record_table_ptr + i; + node_ptr = node_record_table_ptr + i; node_ptr2 = node_record_table_ptr + min_inx; memcpy(&node_record_tmp, node_ptr, j); @@ -159,7 +199,7 @@ static void _reorder_node_record_table(void) /* Log the results */ for (i=0, node_ptr = node_record_table_ptr; i < node_record_count; i++, node_ptr++) { - info("%s: %u", node_ptr->name, node_ptr->node_rank); + info("node_rank[%u]: %s", node_ptr->node_rank, node_ptr->name); } #endif } @@ -748,6 +788,11 @@ int read_slurm_conf(int recover, bool reconfig) g_slurm_jobcomp_init(slurmctld_conf.job_comp_loc); if (slurm_sched_init() != SLURM_SUCCESS) fatal("Failed to initialize sched plugin"); + if (!reconfig && (old_preempt_mode & PREEMPT_MODE_GANG) && + (gs_init() != SLURM_SUCCESS)) { + /* gs_init() must immediately follow slurm_sched_init() */ + fatal("Failed to initialize gang scheduler"); + } if (switch_init() != SLURM_SUCCESS) fatal("Failed to initialize switch plugin"); @@ -771,7 +816,9 @@ int read_slurm_conf(int recover, bool reconfig) do_reorder_nodes |= select_g_node_ranking(node_record_table_ptr, node_record_count); if (do_reorder_nodes) - _reorder_node_record_table(); + _reorder_nodes_by_rank(); + else + _reorder_nodes_by_name(); rehash_node(); rehash_jobs(); @@ -883,6 +930,8 @@ int read_slurm_conf(int recover, bool reconfig) /* Update plugin parameters as possible */ rc = job_submit_plugin_reconfig(); error_code = MAX(error_code, rc); /* not fatal */ + rc = switch_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 */ @@ -1004,6 +1053,7 @@ static int _restore_node_state(int recover, node_ptr->cpus = old_node_ptr->cpus; node_ptr->cores = old_node_ptr->cores; node_ptr->last_idle = old_node_ptr->last_idle; + node_ptr->boards = old_node_ptr->boards; node_ptr->sockets = old_node_ptr->sockets; node_ptr->threads = old_node_ptr->threads; node_ptr->real_memory = old_node_ptr->real_memory; @@ -1337,6 +1387,7 @@ static int _update_preempt(uint16_t old_preempt_mode) return gs_fini(); } + error("Invalid gang scheduling mode change"); return EINVAL; } diff --git a/src/slurmctld/reservation.c b/src/slurmctld/reservation.c index 1b7b7a8f93ef3d610465c204df88de456efc5c6c..8ae371abef7779167535b2db3548d447bc76c2d8 100644 --- a/src/slurmctld/reservation.c +++ b/src/slurmctld/reservation.c @@ -81,7 +81,9 @@ /* Change RESV_STATE_VERSION value when changing the state save format * Add logic to permit reading of the previous version's state in order * to avoid losing reservations between releases major SLURM updates. */ -#define RESV_STATE_VERSION "VER003" +#define RESV_STATE_VERSION "VER004" +#define RESV_2_5_STATE_VERSION "VER004" +#define RESV_2_4_STATE_VERSION "VER003" time_t last_resv_update = (time_t) 0; List resv_list = (List) NULL; @@ -112,12 +114,14 @@ static bool _job_overlap(time_t start_time, uint16_t flags, static List _list_dup(List license_list); static int _open_resv_state_file(char **state_file); static void _pack_resv(slurmctld_resv_t *resv_ptr, Buf buffer, - bool internal); + bool internal, uint16_t protocol_version); static bitstr_t *_pick_idle_nodes(bitstr_t *avail_nodes, - resv_desc_msg_t *resv_desc_ptr, bitstr_t **core_bitmap); + resv_desc_msg_t *resv_desc_ptr, + bitstr_t **core_bitmap); static bitstr_t *_pick_idle_node_cnt(bitstr_t *avail_bitmap, resv_desc_msg_t *resv_desc_ptr, - uint32_t node_cnt, bitstr_t **core_bitmap); + uint32_t node_cnt, + bitstr_t **core_bitmap); 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, @@ -1033,48 +1037,175 @@ static int _update_uid_list(slurmctld_resv_t *resv_ptr, char *users) * plus load_all_resv_state() below. */ static void _pack_resv(slurmctld_resv_t *resv_ptr, Buf buffer, - bool internal) + bool internal, uint16_t protocol_version) { #ifdef HAVE_BG uint32_t cnode_cnt; #endif - packstr(resv_ptr->accounts, buffer); - pack_time(resv_ptr->end_time, buffer); - packstr(resv_ptr->features, buffer); - packstr(resv_ptr->licenses, buffer); - packstr(resv_ptr->name, buffer); + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + packstr(resv_ptr->accounts, buffer); + pack_time(resv_ptr->end_time, buffer); + packstr(resv_ptr->features, buffer); + packstr(resv_ptr->licenses, buffer); + packstr(resv_ptr->name, buffer); #ifdef HAVE_BG - if (!cnodes_per_bp) { - select_g_alter_node_cnt(SELECT_GET_NODE_SCALING, - &cnodes_per_bp); - } - cnode_cnt = resv_ptr->node_cnt; - if (cnodes_per_bp && !internal) - cnode_cnt *= cnodes_per_bp; - pack32(cnode_cnt, buffer); + if (!cnodes_per_bp) { + select_g_alter_node_cnt(SELECT_GET_NODE_SCALING, + &cnodes_per_bp); + } + cnode_cnt = resv_ptr->node_cnt; + if (cnodes_per_bp && !internal) + cnode_cnt *= cnodes_per_bp; + pack32(cnode_cnt, buffer); #else - pack32(resv_ptr->node_cnt, buffer); - pack32(resv_ptr->cpu_cnt, buffer); + pack32(resv_ptr->node_cnt, buffer); #endif - packstr(resv_ptr->node_list, buffer); - packstr(resv_ptr->partition, buffer); - pack_time(resv_ptr->start_time_first, buffer); - pack16(resv_ptr->flags, buffer); - packstr(resv_ptr->users, buffer); - - if (internal) { - packstr(resv_ptr->assoc_list, buffer); - pack32(resv_ptr->resv_id, buffer); - pack_time(resv_ptr->start_time_prev, buffer); - pack_time(resv_ptr->start_time, buffer); - pack32(resv_ptr->duration, buffer); - pack_bit_fmt(resv_ptr->core_bitmap, buffer); + pack32(resv_ptr->cpu_cnt, buffer); + packstr(resv_ptr->node_list, buffer); + packstr(resv_ptr->partition, buffer); + pack_time(resv_ptr->start_time_first, buffer); + pack16(resv_ptr->flags, buffer); + packstr(resv_ptr->users, buffer); + + if (internal) { + packstr(resv_ptr->assoc_list, buffer); + pack32(resv_ptr->resv_id, buffer); + pack_time(resv_ptr->start_time_prev, buffer); + pack_time(resv_ptr->start_time, buffer); + pack32(resv_ptr->duration, buffer); + pack_bit_fmt(resv_ptr->core_bitmap, buffer); + } else { + pack_bit_fmt(resv_ptr->node_bitmap, buffer); + } } else { - pack_bit_fmt(resv_ptr->node_bitmap, buffer); + packstr(resv_ptr->accounts, buffer); + pack_time(resv_ptr->end_time, buffer); + packstr(resv_ptr->features, buffer); + packstr(resv_ptr->licenses, buffer); + packstr(resv_ptr->name, buffer); +#ifdef HAVE_BG + if (!cnodes_per_bp) { + select_g_alter_node_cnt(SELECT_GET_NODE_SCALING, + &cnodes_per_bp); + } + cnode_cnt = resv_ptr->node_cnt; + if (cnodes_per_bp && !internal) + cnode_cnt *= cnodes_per_bp; + pack32(cnode_cnt, buffer); +#else + pack32(resv_ptr->node_cnt, buffer); +#endif + packstr(resv_ptr->node_list, buffer); + packstr(resv_ptr->partition, buffer); + pack_time(resv_ptr->start_time_first, buffer); + pack16(resv_ptr->flags, buffer); + packstr(resv_ptr->users, buffer); + + if (internal) { + packstr(resv_ptr->assoc_list, buffer); + pack32(resv_ptr->resv_id, buffer); + pack_time(resv_ptr->start_time_prev, buffer); + pack_time(resv_ptr->start_time, buffer); + pack32(resv_ptr->duration, buffer); + } else { + pack_bit_fmt(resv_ptr->node_bitmap, buffer); + } } } +slurmctld_resv_t *_load_reservation_state(Buf buffer, + uint16_t protocol_version) +{ + slurmctld_resv_t *resv_ptr; + uint32_t uint32_tmp; + char *core_inx_str = NULL; + + resv_ptr = xmalloc(sizeof(slurmctld_resv_t)); + xassert(resv_ptr->magic = RESV_MAGIC); /* Sets value */ + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpackstr_xmalloc(&resv_ptr->accounts, + &uint32_tmp, buffer); + safe_unpack_time(&resv_ptr->end_time, buffer); + safe_unpackstr_xmalloc(&resv_ptr->features, + &uint32_tmp, 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_unpack32(&resv_ptr->cpu_cnt, buffer); + safe_unpackstr_xmalloc(&resv_ptr->node_list, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&resv_ptr->partition, + &uint32_tmp, buffer); + safe_unpack_time(&resv_ptr->start_time_first, buffer); + safe_unpack16(&resv_ptr->flags, buffer); + safe_unpackstr_xmalloc(&resv_ptr->users,&uint32_tmp, buffer); + + /* Fields saved for internal use only (save state) */ + safe_unpackstr_xmalloc(&resv_ptr->assoc_list, + &uint32_tmp, 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_unpack32(&resv_ptr->duration, buffer); + safe_unpackstr_xmalloc(&core_inx_str, &uint32_tmp, buffer); + if (core_inx_str == NULL) { + debug2("Reservation %s has no core_bitmap", + resv_ptr->name); + } else { + struct node_record *node_ptr; + node_ptr = find_node_record(resv_ptr->node_list); + if (!node_ptr) { + error("could not find node %s for " + "reservation %s", resv_ptr->node_list, + resv_ptr->name); + xfree(core_inx_str); + goto unpack_error; + } + resv_ptr->core_bitmap = bit_alloc(node_ptr->cores); + bit_unfmt(resv_ptr->core_bitmap, core_inx_str); + info("Reservation %s has core_bitmap %s on node %s", + resv_ptr->name, core_inx_str, + resv_ptr->node_list); + xfree(core_inx_str); + } + } else { + safe_unpackstr_xmalloc(&resv_ptr->accounts, + &uint32_tmp, buffer); + safe_unpack_time(&resv_ptr->end_time, buffer); + safe_unpackstr_xmalloc(&resv_ptr->features, + &uint32_tmp, 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_unpack_time(&resv_ptr->start_time_first, buffer); + safe_unpack16(&resv_ptr->flags, buffer); + safe_unpackstr_xmalloc(&resv_ptr->users,&uint32_tmp, buffer); + + /* Fields saved for internal use only (save state) */ + safe_unpackstr_xmalloc(&resv_ptr->assoc_list, + &uint32_tmp, 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_unpack32(&resv_ptr->duration, buffer); + safe_unpackstr_xmalloc(&core_inx_str, &uint32_tmp, buffer); + } + return resv_ptr; + +unpack_error: + error("Incomplete reservation state save file"); + _del_resv_rec(resv_ptr); + return NULL; +} + /* * Test if a new/updated reservation request will overlap running jobs * RET true if overlap @@ -1242,7 +1373,8 @@ extern int create_resv(resv_desc_msg_t *resv_desc_ptr) RESERVE_FLAG_DAILY | RESERVE_FLAG_WEEKLY | RESERVE_FLAG_LIC_ONLY | - RESERVE_FLAG_STATIC; + RESERVE_FLAG_STATIC | + RESERVE_FLAG_PART_NODES; } if (resv_desc_ptr->partition) { part_ptr = find_part_record(resv_desc_ptr->partition); @@ -1252,6 +1384,11 @@ extern int create_resv(resv_desc_msg_t *resv_desc_ptr) rc = ESLURM_INVALID_PARTITION_NAME; goto bad_parse; } + } else if (resv_desc_ptr->flags & RESERVE_FLAG_PART_NODES) { + info("Reservation request with Part_Nodes flag lacks " + "partition specification"); + rc = ESLURM_INVALID_PARTITION_NAME; + goto bad_parse; } if ((resv_desc_ptr->accounts == NULL) && (resv_desc_ptr->users == NULL)) { @@ -1302,10 +1439,8 @@ extern int create_resv(resv_desc_msg_t *resv_desc_ptr) } } - if (resv_desc_ptr->core_cnt == NO_VAL) - resv_desc_ptr->core_cnt = 0; - - + if (resv_desc_ptr->core_cnt == NO_VAL) + resv_desc_ptr->core_cnt = 0; #ifdef HAVE_BG if (!cnodes_per_bp) { @@ -1345,8 +1480,15 @@ extern int create_resv(resv_desc_msg_t *resv_desc_ptr) if (resv_desc_ptr->node_list) { resv_desc_ptr->flags |= RESERVE_FLAG_SPEC_NODES; if (strcasecmp(resv_desc_ptr->node_list, "ALL") == 0) { - node_bitmap = bit_alloc(node_record_count); - bit_nset(node_bitmap, 0, (node_record_count - 1)); + if ((resv_desc_ptr->partition) && + (resv_desc_ptr->flags & RESERVE_FLAG_PART_NODES)) { + part_ptr = find_part_record( + resv_desc_ptr->partition); + node_bitmap = bit_copy(part_ptr->node_bitmap); + } else { + node_bitmap = bit_alloc(node_record_count); + bit_nset(node_bitmap, 0,(node_record_count-1)); + } xfree(resv_desc_ptr->node_list); resv_desc_ptr->node_list = bitmap2node_name(node_bitmap); @@ -1372,15 +1514,17 @@ extern int create_resv(resv_desc_msg_t *resv_desc_ptr) rc = ESLURM_NODES_BUSY; goto bad_parse; } - resv_desc_ptr->core_cnt = 0; /* We do no allow to request cores when nodelist */ - - } else if ((resv_desc_ptr->node_cnt == NULL) || - (resv_desc_ptr->node_cnt[0] == 0)){ + /* We do no allow to request cores with nodelist */ + resv_desc_ptr->core_cnt = 0; + } else if (((resv_desc_ptr->node_cnt == NULL) || + (resv_desc_ptr->node_cnt[0] == 0)) && + (resv_desc_ptr->core_cnt == 0) && + ((resv_desc_ptr->flags & RESERVE_FLAG_LIC_ONLY) == 0)) { info("Reservation request lacks node specification"); rc = ESLURM_INVALID_NODE_NAME; goto bad_parse; - } else if ((rc = _select_nodes(resv_desc_ptr, &part_ptr, &node_bitmap, &core_bitmap)) - != SLURM_SUCCESS) { + } else if ((rc = _select_nodes(resv_desc_ptr, &part_ptr, &node_bitmap, + &core_bitmap)) != SLURM_SUCCESS) { goto bad_parse; } else { /* Get count of allocated nodes, on BlueGene systems, this @@ -1444,14 +1588,14 @@ extern int create_resv(resv_desc_msg_t *resv_desc_ptr) resv_ptr->user_list = user_list; resv_desc_ptr->users = NULL; /* Nothing left to free */ - if(resv_desc_ptr->core_cnt == 0){ - debug2("reservation using full nodes"); - _set_cpu_cnt(resv_ptr); - resv_ptr->full_nodes = 1; - } else { - debug2("reservation using partial nodes: core count %d", resv_desc_ptr->core_cnt); - resv_ptr->cpu_cnt = resv_desc_ptr->core_cnt; - } + if (resv_desc_ptr->core_cnt == 0) { + debug2("reservation using full nodes"); + _set_cpu_cnt(resv_ptr); + } else { + debug2("reservation using partial nodes: core count %u", + resv_desc_ptr->core_cnt); + resv_ptr->cpu_cnt = resv_desc_ptr->core_cnt; + } if((rc = _set_assoc_list(resv_ptr)) != SLURM_SUCCESS) goto bad_parse; @@ -1555,6 +1699,21 @@ extern int update_resv(resv_desc_msg_t *resv_desc_ptr) resv_ptr->flags |= RESERVE_FLAG_STATIC; if (resv_desc_ptr->flags & RESERVE_FLAG_NO_STATIC) resv_ptr->flags &= (~RESERVE_FLAG_STATIC); + if (resv_desc_ptr->flags & RESERVE_FLAG_PART_NODES) { + if ((resv_ptr->partition == NULL) && + (resv_desc_ptr->partition == NULL)) { + info("Reservation request can not set " + "Part_Nodes flag without partition"); + error_code = ESLURM_INVALID_PARTITION_NAME; + goto update_failure; + } + resv_ptr->flags |= RESERVE_FLAG_PART_NODES; + /* Explicitly set the node_list to ALL */ + xfree(resv_desc_ptr->node_list); + resv_desc_ptr->node_list = xstrdup("ALL"); + } + if (resv_desc_ptr->flags & RESERVE_FLAG_NO_PART_NODES) + resv_ptr->flags &= (~RESERVE_FLAG_PART_NODES); } if (resv_desc_ptr->partition && (resv_desc_ptr->partition[0] == '\0')){ /* Clear the partition */ @@ -1696,15 +1855,31 @@ extern int update_resv(resv_desc_msg_t *resv_desc_ptr) bitstr_t *node_bitmap; resv_ptr->flags |= RESERVE_FLAG_SPEC_NODES; if (strcasecmp(resv_desc_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_desc_ptr->node_list, + if ((resv_ptr->partition) && + (resv_ptr->flags & RESERVE_FLAG_PART_NODES)) { + struct part_record *part_ptr = NULL; + part_ptr = find_part_record(resv_ptr-> + partition); + node_bitmap = bit_copy(part_ptr->node_bitmap); + xfree(resv_ptr->node_list); + resv_ptr->node_list = xstrdup(part_ptr->nodes); + } else { + node_bitmap = bit_alloc(node_record_count); + bit_nset(node_bitmap, 0,(node_record_count-1)); + resv_ptr->flags &= (~RESERVE_FLAG_PART_NODES); + xfree(resv_ptr->node_list); + resv_ptr->node_list = resv_desc_ptr->node_list; + } + } else { + resv_ptr->flags &= (~RESERVE_FLAG_PART_NODES); + if (node_name2bitmap(resv_desc_ptr->node_list, false, &node_bitmap)) { - error_code = ESLURM_INVALID_NODE_NAME; - goto update_failure; + error_code = ESLURM_INVALID_NODE_NAME; + goto update_failure; + } + xfree(resv_ptr->node_list); + resv_ptr->node_list = resv_desc_ptr->node_list; } - xfree(resv_ptr->node_list); - resv_ptr->node_list = resv_desc_ptr->node_list; resv_desc_ptr->node_list = NULL; /* Nothing left to free */ FREE_NULL_BITMAP(resv_ptr->node_bitmap); FREE_NULL_BITMAP(resv_ptr->core_bitmap); @@ -1713,6 +1888,7 @@ extern int update_resv(resv_desc_msg_t *resv_desc_ptr) } if (resv_desc_ptr->node_cnt) { uint32_t total_node_cnt = 0; + resv_ptr->flags &= (~RESERVE_FLAG_PART_NODES); #ifdef HAVE_BG if (!cnodes_per_bp) { @@ -1879,7 +2055,8 @@ extern int delete_resv(reservation_name_msg_t *resv_desc_ptr) } /* Dump the reservation records to a buffer */ -extern void show_resv(char **buffer_ptr, int *buffer_size, uid_t uid) +extern void show_resv(char **buffer_ptr, int *buffer_size, uid_t uid, + uint16_t protocol_version) { ListIterator iter; slurmctld_resv_t *resv_ptr; @@ -1920,7 +2097,7 @@ extern void show_resv(char **buffer_ptr, int *buffer_size, uid_t uid) continue; } - _pack_resv(resv_ptr, buffer, false); + _pack_resv(resv_ptr, buffer, false, protocol_version); resv_packed++; } list_iterator_destroy(iter); @@ -1964,7 +2141,7 @@ extern int dump_all_resv_state(void) if (!iter) fatal("malloc: list_iterator_create"); while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) - _pack_resv(resv_ptr, buffer, true); + _pack_resv(resv_ptr, buffer, true, SLURM_PROTOCOL_VERSION); list_iterator_destroy(iter); old_file = xstrdup(slurmctld_conf.state_save_location); @@ -2004,11 +2181,11 @@ extern int dump_all_resv_state(void) (void) unlink(new_file); else { /* file shuffle */ (void) unlink(old_file); - if(link(reg_file, 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)) + if (link(new_file, reg_file)) debug4("unable to create link for %s -> %s: %m", new_file, reg_file); (void) unlink(new_file); @@ -2255,8 +2432,7 @@ extern int load_all_resv_state(int recover) int data_allocated, data_read = 0, error_code = 0, state_fd; Buf buffer; slurmctld_resv_t *resv_ptr = NULL; - char *core_inx_str = NULL; - char str[100]; + uint16_t protocol_version = (uint16_t) NO_VAL; last_resv_update = time(NULL); if ((recover == 0) && resv_list) { @@ -2306,7 +2482,13 @@ 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) != 0)) { + if (ver_str) { + if (!strcmp(ver_str, RESV_STATE_VERSION)) + protocol_version = SLURM_PROTOCOL_VERSION; + else if (!strcmp(ver_str, RESV_2_4_STATE_VERSION)) + protocol_version = SLURM_2_4_PROTOCOL_VERSION; + } + if (protocol_version == (uint16_t) NO_VAL) { error("************************************************************"); error("Can not recover reservation state, data version incompatible"); error("************************************************************"); @@ -2320,47 +2502,9 @@ extern int load_all_resv_state(int recover) safe_unpack32(&top_suffix, buffer); while (remaining_buf(buffer) > 0) { - resv_ptr = xmalloc(sizeof(slurmctld_resv_t)); - xassert(resv_ptr->magic = RESV_MAGIC); /* Sets value */ - safe_unpackstr_xmalloc(&resv_ptr->accounts, - &uint32_tmp, buffer); - safe_unpack_time(&resv_ptr->end_time, buffer); - safe_unpackstr_xmalloc(&resv_ptr->features, - &uint32_tmp, 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_unpack_time(&resv_ptr->start_time_first, buffer); - safe_unpack16(&resv_ptr->flags, buffer); - safe_unpackstr_xmalloc(&resv_ptr->users,&uint32_tmp, buffer); - - /* Fields saved for internal use only (save state) */ - safe_unpackstr_xmalloc(&resv_ptr->assoc_list, - &uint32_tmp, buffer); - safe_unpack32(&resv_ptr->cpu_cnt, 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_unpack32(&resv_ptr->duration, buffer); - safe_unpackstr_xmalloc(&core_inx_str, &uint32_tmp, buffer); - if (core_inx_str == NULL){ - info("Reservation %s has not core_bitmap", resv_ptr->name); - resv_ptr->core_bitmap = NULL; - } - else - { - info("Reservation coremap string: %s", core_inx_str); - node_name2bitmap(core_inx_str, false, &resv_ptr->core_bitmap); - xfree(core_inx_str); - core_inx_str = NULL; - bit_fmt(str, (sizeof(str) - 1), resv_ptr->core_bitmap); - info("Reservation %s has core_bitmap %s", resv_ptr->name, str); - } + resv_ptr = _load_reservation_state(buffer, protocol_version); + if (!resv_ptr) + break; list_append(resv_list, resv_ptr); info("Recovered state of reservation %s", resv_ptr->name); @@ -2627,7 +2771,8 @@ static int _select_nodes(resv_desc_msg_t *resv_desc_ptr, } static bitstr_t *_pick_idle_nodes(bitstr_t *avail_bitmap, - resv_desc_msg_t *resv_desc_ptr, bitstr_t **core_bitmap) + resv_desc_msg_t *resv_desc_ptr, + bitstr_t **core_bitmap) { int i; bitstr_t *ret_bitmap = NULL, *tmp_bitmap; @@ -2647,11 +2792,13 @@ static bitstr_t *_pick_idle_nodes(bitstr_t *avail_bitmap, #endif if (resv_desc_ptr->node_cnt == NULL) { - return _pick_idle_node_cnt(avail_bitmap, resv_desc_ptr, 0, core_bitmap); + return _pick_idle_node_cnt(avail_bitmap, resv_desc_ptr, 0, + core_bitmap); } else if ((resv_desc_ptr->node_cnt[0] == 0) || (resv_desc_ptr->node_cnt[1] == 0)) { return _pick_idle_node_cnt(avail_bitmap, resv_desc_ptr, - resv_desc_ptr->node_cnt[0], core_bitmap); + resv_desc_ptr->node_cnt[0], + core_bitmap); } /* Try to create a single reservation that can contain all blocks @@ -2675,7 +2822,8 @@ static bitstr_t *_pick_idle_nodes(bitstr_t *avail_bitmap, resv_debug = slurm_get_debug_flags() & DEBUG_FLAG_RESERVATION; for (i = 0; resv_desc_ptr->node_cnt[i]; i++) { tmp_bitmap = _pick_idle_node_cnt(avail_bitmap, resv_desc_ptr, - resv_desc_ptr->node_cnt[i], core_bitmap); + resv_desc_ptr->node_cnt[i], + core_bitmap); if (tmp_bitmap == NULL) { /* allocation failure */ if (resv_debug) { info("reservation of %u nodes failed", @@ -2717,15 +2865,6 @@ static bitstr_t *_pick_idle_node_cnt(bitstr_t *avail_bitmap, } save_bitmap = bit_copy(avail_bitmap); - /* First: Try to reserve nodes that are currently IDLE */ - if (bit_overlap(avail_bitmap, idle_node_bitmap) >= node_cnt) { - bit_and(avail_bitmap, idle_node_bitmap); - ret_bitmap = select_g_resv_test(avail_bitmap, node_cnt, resv_desc_ptr->core_cnt, core_bitmap); - if (ret_bitmap) - goto fini; - } - - /* Second: Try to reserve nodes that are will be IDLE */ bit_or(avail_bitmap, save_bitmap); /* restore avail_bitmap */ job_iterator = list_iterator_create(job_list); if (job_iterator == NULL) @@ -2736,17 +2875,19 @@ static bitstr_t *_pick_idle_node_cnt(bitstr_t *avail_bitmap, if (job_ptr->end_time < resv_desc_ptr->start_time) continue; - /* TODO: This needs to be based on cores used by job instead of based on nodes */ + /* TODO: This needs to be based on cores used by job + * instead of based on nodes */ bit_not(job_ptr->node_bitmap); bit_and(avail_bitmap, job_ptr->node_bitmap); bit_not(job_ptr->node_bitmap); } list_iterator_destroy(job_iterator); - ret_bitmap = select_g_resv_test(avail_bitmap, node_cnt, resv_desc_ptr->core_cnt, core_bitmap); + ret_bitmap = select_g_resv_test(avail_bitmap, node_cnt, + resv_desc_ptr->core_cnt, core_bitmap); if (ret_bitmap) goto fini; - /* Third: Try to reserve nodes that will be allocated to a limited + /* Next: Try to reserve nodes that will be allocated to a limited * number of running jobs. We could sort the jobs by priority, QOS, * size or other criterion if desired. Right now we just go down * the unsorted job list. */ @@ -2766,7 +2907,9 @@ static bitstr_t *_pick_idle_node_cnt(bitstr_t *avail_bitmap, if (bit_set_count(tmp_bitmap) > 0) { bit_or(avail_bitmap, tmp_bitmap); ret_bitmap = select_g_resv_test(avail_bitmap, - node_cnt, resv_desc_ptr->core_cnt, core_bitmap); + node_cnt, + resv_desc_ptr->core_cnt, + core_bitmap); } FREE_NULL_BITMAP(tmp_bitmap); if (ret_bitmap) @@ -2777,14 +2920,15 @@ static bitstr_t *_pick_idle_node_cnt(bitstr_t *avail_bitmap, fini: FREE_NULL_BITMAP(save_bitmap); #if 0 - if(ret_bitmap){ - bit_fmt(str, (sizeof(str) - 1), ret_bitmap); - info("pick_idle_nodes getting %s from select cons_res", str); - if(*core_bitmap){ - bit_fmt(str, (sizeof(str) - 1), *core_bitmap); - info("pick_idle_nodes getting coremap %s from select cons_res", str); - } - } + if (ret_bitmap) { + bit_fmt(str, (sizeof(str) - 1), ret_bitmap); + info("pick_idle_nodes getting %s from select cons_res", str); + if (*core_bitmap) { + bit_fmt(str, (sizeof(str) - 1), *core_bitmap); + info("pick_idle_nodes getting coremap %s " + "from select/cons_res", str); + } + } #endif return ret_bitmap; } @@ -3026,7 +3170,8 @@ extern int job_test_lic_resv(struct job_record *job_ptr, char *lic_name, * IN move_time - if true, then permit the start time to advance from * "when" as needed IF job has no reservervation * OUT node_bitmap - nodes which the job can use, caller must free unless error - * OUT exc_core_bitmap - cores which the job can NOT use, caller must free unless error + * OUT exc_core_bitmap - cores which the job can NOT use, caller must free + * unless error * RET SLURM_SUCCESS if runable now * ESLURM_RESERVATION_ACCESS access to reservation denied * ESLURM_RESERVATION_INVALID reservation invalid @@ -3035,7 +3180,8 @@ extern int job_test_lic_resv(struct job_record *job_ptr, char *lic_name, * reserved */ extern int job_test_resv(struct job_record *job_ptr, time_t *when, - bool move_time, bitstr_t **node_bitmap, bitstr_t **exc_core_bitmap) + bool move_time, bitstr_t **node_bitmap, + bitstr_t **exc_core_bitmap) { slurmctld_resv_t * resv_ptr, *res2_ptr; time_t job_start_time, job_end_time, lic_resv_time; @@ -3114,11 +3260,12 @@ extern int job_test_resv(struct job_record *job_ptr, time_t *when, xfree(nodes); } - /* if reservation is using just partial nodes, this returns coremap to exclude */ - if(resv_ptr->core_bitmap && exc_core_bitmap){ - *exc_core_bitmap = bit_copy(resv_ptr->core_bitmap); - bit_not(*exc_core_bitmap); - } + /* if reservation is using just partial nodes, this returns + * coremap to exclude */ + if (resv_ptr->core_bitmap && exc_core_bitmap) { + *exc_core_bitmap = bit_copy(resv_ptr->core_bitmap); + bit_not(*exc_core_bitmap); + } return SLURM_SUCCESS; } @@ -3162,22 +3309,24 @@ extern int job_test_resv(struct job_record *job_ptr, time_t *when, (lic_resv_time > resv_ptr->end_time)) lic_resv_time = resv_ptr->end_time; } - /* if reservation uses full nodes ... */ - if(resv_ptr->full_nodes){ - bit_not(resv_ptr->node_bitmap); - bit_and(*node_bitmap, resv_ptr->node_bitmap); - bit_not(resv_ptr->node_bitmap); - }else{ - //info("job_test_resv: %s reservation uses partial nodes ...", resv_ptr->name); - if(*exc_core_bitmap == NULL){ - *exc_core_bitmap = bit_copy(resv_ptr->core_bitmap); - }else{ - //char str[100]; - bit_and(*exc_core_bitmap, resv_ptr->core_bitmap); - //bit_fmt(str, (sizeof(str) - 1), *exc_core_bitmap); - //info("ALEJ: job_test_resv: New exclude core bitmap %s", str); - } - } + + if (resv_ptr->cpu_cnt == 0) { + /* reservation uses full nodes */ + bit_not(resv_ptr->node_bitmap); + bit_and(*node_bitmap, resv_ptr->node_bitmap); + bit_not(resv_ptr->node_bitmap); + } else { + //info("job_test_resv: %s reservation uses partial nodes ...", resv_ptr->name); + if (*exc_core_bitmap == NULL) { + *exc_core_bitmap = bit_copy(resv_ptr->core_bitmap); + } else { + //char str[100]; + bit_and(*exc_core_bitmap, + resv_ptr->core_bitmap); + //bit_fmt(str, (sizeof(str) - 1), *exc_core_bitmap); + //info("ALEJ: job_test_resv: New exclude core bitmap %s", str); + } + } } list_iterator_destroy(iter); @@ -3432,6 +3581,34 @@ extern void update_assocs_in_resvs(void) list_iterator_destroy(iter); } +extern void update_part_nodes_in_resv(struct part_record *part_ptr) +{ + ListIterator iter = NULL; + struct part_record *parti_ptr = NULL; + slurmctld_resv_t *resv_ptr = NULL; + xassert(part_ptr); + + iter = list_iterator_create(resv_list); + if (!iter) + fatal("malloc: list_iterator_create"); + 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)) { + parti_ptr = find_part_record(resv_ptr->partition); + FREE_NULL_BITMAP(resv_ptr->node_bitmap); + resv_ptr->node_bitmap = bit_copy(parti_ptr-> + node_bitmap); + resv_ptr->node_cnt = bit_set_count(resv_ptr-> + node_bitmap); + xfree(resv_ptr->node_list); + resv_ptr->node_list = xstrdup(parti_ptr->nodes); + last_resv_update = time(NULL); + } + } + list_iterator_destroy(iter); +} + static void _set_nodes_maint(slurmctld_resv_t *resv_ptr, time_t now) { int i, i_first, i_last; diff --git a/src/slurmctld/reservation.h b/src/slurmctld/reservation.h index afdea8c8dd51837a78cfe9e26a1f2b136c825eb0..709173876015a55f9c588fe8b857c49ce49c3866 100644 --- a/src/slurmctld/reservation.h +++ b/src/slurmctld/reservation.h @@ -58,7 +58,8 @@ extern int update_resv(resv_desc_msg_t *resv_desc_ptr); extern int delete_resv(reservation_name_msg_t *resv_desc_ptr); /* Dump the reservation records to a buffer */ -extern void show_resv(char **buffer_ptr, int *buffer_size, uid_t uid); +extern void show_resv(char **buffer_ptr, int *buffer_size, uid_t uid, + uint16_t protocol_version); /* Save the state of all reservations to file */ extern int dump_all_resv_state(void); @@ -80,6 +81,12 @@ extern bool is_node_in_maint_reservation(int nodenum); /* After an assocation has been added or removed update the lists. */ extern void update_assocs_in_resvs(void); +/* + * Update reserved nodes for all reservations using a specific partition if the + * resevation has NodeList=ALL and RESERVE_FLAGS_PART_NODES. +*/ +extern void update_part_nodes_in_resv(struct part_record *part_ptr); + /* * Load the reservation state from file, recover on slurmctld restart. * Reset reservation pointers for all jobs. @@ -130,7 +137,8 @@ extern int job_test_lic_resv(struct job_record *job_ptr, char *lic_name, * reserved */ extern int job_test_resv(struct job_record *job_ptr, time_t *when, - bool move_time, bitstr_t **node_bitmap, bitstr_t **exc_core_bitmap); + bool move_time, bitstr_t **node_bitmap, + bitstr_t **exc_core_bitmap); /* * Determine if a job can start now based only upon its reservations diff --git a/src/slurmctld/sched_plugin.c b/src/slurmctld/sched_plugin.c index 55d8908a9731c4cecceeaf9718dc090400a868d4..2f078e9a0100b6af14cfd015522675a22622c2b5 100644 --- a/src/slurmctld/sched_plugin.c +++ b/src/slurmctld/sched_plugin.c @@ -69,147 +69,27 @@ typedef struct slurm_sched_ops { char * (*get_conf) ( void ); } slurm_sched_ops_t; - -/* ************************************************************************ */ -/* TAG( slurm_sched_contex_t ) */ -/* ************************************************************************ */ -typedef struct slurm_sched_context { - char *sched_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int sched_errno; - slurm_sched_ops_t ops; -} slurm_sched_context_t; - -static slurm_sched_context_t *g_sched_context = NULL; -static pthread_mutex_t g_sched_context_lock = PTHREAD_MUTEX_INITIALIZER; - - -/* ************************************************************************ */ -/* TAG( slurm_sched_get_ops ) */ -/* ************************************************************************ */ -static slurm_sched_ops_t * -slurm_sched_get_ops( slurm_sched_context_t *c ) -{ - /* - * Must be synchronized with slurm_sched_ops_t above. - */ - static const char *syms[] = { - "slurm_sched_plugin_schedule", - "slurm_sched_plugin_newalloc", - "slurm_sched_plugin_freealloc", - "slurm_sched_plugin_initial_priority", - "slurm_sched_plugin_job_is_pending", - "slurm_sched_plugin_reconfig", - "slurm_sched_plugin_partition_change", - "slurm_sched_get_errno", - "slurm_sched_strerror", - "slurm_sched_plugin_requeue", - "slurm_sched_get_conf" - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->sched_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->sched_type, plugin_strerror(errno)); - return NULL; - } - - error("sched: Couldn't find the specified plugin name for %s " - "looking at all files", - c->sched_type); - - /* Get plugin list. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "sched: cannot create plugin manager" ); - return NULL; - } - plugrack_set_major_type( c->plugin_list, "sched" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - c->cur_plugin = plugrack_use_by_type( c->plugin_list, c->sched_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "sched: cannot find scheduler plugin for %s", - c->sched_type ); - return NULL; - } - - /* Dereference the API. */ - if ( plugin_get_syms( c->cur_plugin, - n_syms, - syms, - (void **) &c->ops ) < n_syms ) { - error( "sched: incomplete scheduling plugin detected" ); - return NULL; - } - - return &c->ops; -} - - -/* ************************************************************************ */ -/* TAG( slurm_sched_context_create ) */ -/* ************************************************************************ */ -static slurm_sched_context_t * -slurm_sched_context_create( const char *sched_type ) -{ - slurm_sched_context_t *c; - - if ( sched_type == NULL ) { - debug3( "slurm_sched_context: no scheduler type" ); - return NULL; - } - - c = xmalloc( sizeof( slurm_sched_context_t ) ); - c->sched_type = xstrdup( sched_type ); - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - c->sched_errno = SLURM_SUCCESS; - - return c; -} - - -/* ************************************************************************ */ -/* TAG( slurm_sched_context_destroy ) */ -/* ************************************************************************ */ -static int -slurm_sched_context_destroy( slurm_sched_context_t *c ) -{ - int rc = SLURM_SUCCESS; - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree( c->sched_type ); - xfree( c ); - - return rc; -} - +/* + * Must be synchronized with slurm_sched_ops_t above. + */ +static const char *syms[] = { + "slurm_sched_plugin_schedule", + "slurm_sched_plugin_newalloc", + "slurm_sched_plugin_freealloc", + "slurm_sched_plugin_initial_priority", + "slurm_sched_plugin_job_is_pending", + "slurm_sched_plugin_reconfig", + "slurm_sched_plugin_partition_change", + "slurm_sched_get_errno", + "slurm_sched_strerror", + "slurm_sched_plugin_requeue", + "slurm_sched_get_conf" +}; + +static slurm_sched_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; /* *********************************************************************** */ /* TAG( slurm_sched_init ) */ @@ -223,37 +103,31 @@ extern int slurm_sched_init( void ) { int retval = SLURM_SUCCESS; - char *sched_type = NULL; + char *plugin_type = "sched"; + char *type = NULL; - slurm_mutex_lock( &g_sched_context_lock ); + if ( init_run && g_context ) + return retval; - if ( g_sched_context ) - goto done; + slurm_mutex_lock( &g_context_lock ); - sched_type = slurm_get_sched_type(); - g_sched_context = slurm_sched_context_create( sched_type ); - if ( g_sched_context == NULL ) { - error( "cannot create scheduler context for %s", - sched_type ); - retval = SLURM_ERROR; + if ( g_context ) goto done; - } - if ( slurm_sched_get_ops( g_sched_context ) == NULL ) { - error( "cannot resolve scheduler plugin operations" ); - slurm_sched_context_destroy( g_sched_context ); - g_sched_context = NULL; + type = slurm_get_sched_type(); + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); + + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; goto done; } + init_run = true; - if ( (slurm_get_preempt_mode() & PREEMPT_MODE_GANG) && - (gs_init() != SLURM_SUCCESS)) - error( "cannot start gang scheduler "); - - done: - slurm_mutex_unlock( &g_sched_context_lock ); - xfree(sched_type); +done: + slurm_mutex_unlock( &g_context_lock ); + xfree(type); return retval; } @@ -265,11 +139,12 @@ slurm_sched_fini( void ) { int rc; - if (!g_sched_context) + if (!g_context) return SLURM_SUCCESS; - rc = slurm_sched_context_destroy(g_sched_context); - g_sched_context = NULL; + init_run = false; + rc = plugin_context_destroy(g_context); + g_context = NULL; if ( (slurm_get_preempt_mode() & PREEMPT_MODE_GANG) && (gs_fini() != SLURM_SUCCESS)) @@ -292,7 +167,7 @@ slurm_sched_reconfig( void ) (gs_reconfig() != SLURM_SUCCESS)) error( "cannot reconfigure gang scheduler" ); - return (*(g_sched_context->ops.reconfig))(); + return (*(ops.reconfig))(); } /* *********************************************************************** */ @@ -311,7 +186,7 @@ slurm_sched_schedule( void ) error( "gang scheduler could not rescan jobs" ); #endif - return (*(g_sched_context->ops.schedule))(); + return (*(ops.schedule))(); } /* *********************************************************************** */ @@ -329,7 +204,7 @@ slurm_sched_newalloc( struct job_record *job_ptr ) job_ptr->job_id); } - return (*(g_sched_context->ops.newalloc))( job_ptr ); + return (*(ops.newalloc))( job_ptr ); } /* *********************************************************************** */ @@ -347,7 +222,7 @@ slurm_sched_freealloc( struct job_record *job_ptr ) job_ptr->job_id); } - return (*(g_sched_context->ops.freealloc))( job_ptr ); + return (*(ops.freealloc))( job_ptr ); } @@ -361,8 +236,7 @@ slurm_sched_initial_priority( uint32_t last_prio, if ( slurm_sched_init() < 0 ) return SLURM_ERROR; - return (*(g_sched_context->ops.initial_priority))( last_prio, - job_ptr ); + return (*(ops.initial_priority))( last_prio, job_ptr ); } /* *********************************************************************** */ @@ -374,7 +248,7 @@ slurm_sched_job_is_pending( void ) if ( slurm_sched_init() < 0 ) return; - (*(g_sched_context->ops.job_is_pending))(); + (*(ops.job_is_pending))(); } /* *********************************************************************** */ @@ -390,7 +264,7 @@ slurm_sched_partition_change( void ) (gs_reconfig() != SLURM_SUCCESS)) error( "cannot reconfigure gang scheduler" ); - (*(g_sched_context->ops.partition_change))(); + (*(ops.partition_change))(); } /* *********************************************************************** */ @@ -402,7 +276,7 @@ slurm_sched_p_get_errno( void ) if ( slurm_sched_init() < 0 ) return SLURM_ERROR; - return (*(g_sched_context->ops.get_errno))( ); + return (*(ops.get_errno))( ); } /* *********************************************************************** */ @@ -414,7 +288,7 @@ slurm_sched_p_strerror( int errnum ) if ( slurm_sched_init() < 0 ) return NULL; - return (*(g_sched_context->ops.strerror))( errnum ); + return (*(ops.strerror))( errnum ); } /* *********************************************************************** */ @@ -426,7 +300,7 @@ slurm_sched_requeue( struct job_record *job_ptr, char *reason ) if ( slurm_sched_init() < 0 ) return; - (*(g_sched_context->ops.job_requeue))( job_ptr, reason ); + (*(ops.job_requeue))( job_ptr, reason ); } /* *********************************************************************** */ @@ -438,7 +312,7 @@ slurm_sched_p_get_conf( void ) if ( slurm_sched_init() < 0 ) return NULL; - return (*(g_sched_context->ops.get_conf))( ); + return (*(ops.get_conf))( ); } diff --git a/src/slurmctld/slurmctld.h b/src/slurmctld/slurmctld.h index b1188b5ad86aa8b42b6281d97515a5ed1ea495e4..c27afb500d03c27e49cf448896dc1c2ac7eee669 100644 --- a/src/slurmctld/slurmctld.h +++ b/src/slurmctld/slurmctld.h @@ -212,6 +212,7 @@ extern int accounting_enforce; extern int association_based_accounting; extern uint32_t cluster_cpus; extern int with_slurmdbd; +extern bool load_2_4_state; /*****************************************************************************\ * NODE parameters and data structures, mostly in src/common/node_conf.h @@ -331,7 +332,7 @@ typedef struct slurmctld_resv { char **account_list; /* list of accounts permitted to use */ char *assoc_list; /* list of associations */ uint32_t cpu_cnt; /* number of reserved CPUs */ - bitstr_t *core_bitmap; /* bitmap of reserved cores */ + bitstr_t *core_bitmap; /* bitmap of reserved cores */ uint32_t duration; /* time in seconds for this * reservation to last */ time_t end_time; /* end time of reservation */ @@ -633,6 +634,7 @@ struct step_record { * step relative to job's nodes, * see src/common/job_resources.h */ uint32_t cpu_count; /* count of step's CPUs */ + uint32_t cpu_freq; /* requested cpu frequency */ uint16_t cpus_per_task; /* cpus per task initiated */ uint16_t cyclic_alloc; /* set for cyclic task allocation * across nodes */ @@ -959,7 +961,7 @@ extern int job_alloc_info(uint32_t uid, uint32_t job_id, * IN will_run - don't initiate the job if set, just test if it could run * now or later * OUT resp - will run response (includes start location, time, etc.) - * IN allocate - resource allocation request if set, not a full job + * IN allocate - resource allocation request only if set, batch job if zero * IN submit_uid -uid of user issuing the request * OUT job_pptr - set to pointer to job record * RET 0 or an error code. If the job would only be able to execute with @@ -1822,6 +1824,11 @@ extern int validate_alloc_node(struct part_record *part_ptr, char* alloc_node); */ extern int validate_group (struct part_record *part_ptr, uid_t run_uid); +/* Perform some size checks on strings we store to prevent + * malicious user filling slurmctld's memory + * RET 0 or error code */ +extern int validate_job_create_req(job_desc_msg_t * job_desc); + /* * 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 diff --git a/src/slurmctld/step_mgr.c b/src/slurmctld/step_mgr.c index f284a33eb096415af8c8e7243303302109dfa9c1..f87d4673cffb981b817e6f094f3c15f946ec037c 100644 --- a/src/slurmctld/step_mgr.c +++ b/src/slurmctld/step_mgr.c @@ -59,6 +59,7 @@ #include "src/common/checkpoint.h" #include "src/common/forward.h" #include "src/common/gres.h" +#include "src/common/node_select.h" #include "src/common/slurm_accounting_storage.h" #include "src/common/slurm_jobacct_gather.h" #include "src/common/slurm_protocol_interface.h" @@ -173,7 +174,7 @@ static struct step_record * _create_step_record(struct job_record *job_ptr) step_ptr->job_ptr = job_ptr; step_ptr->start_time = time(NULL); step_ptr->time_limit = INFINITE; - step_ptr->jobacct = jobacct_gather_g_create(NULL); + step_ptr->jobacct = jobacctinfo_create(NULL); step_ptr->requid = -1; if (list_append (job_ptr->step_list, step_ptr) == NULL) fatal ("_create_step_record: unable to allocate memory"); @@ -221,7 +222,7 @@ static void _free_step_rec(struct step_record *step_ptr) xfree(step_ptr->host); xfree(step_ptr->name); slurm_step_layout_destroy(step_ptr->step_layout); - jobacct_gather_g_destroy(step_ptr->jobacct); + jobacctinfo_destroy(step_ptr->jobacct); FREE_NULL_BITMAP(step_ptr->core_bitmap_job); FREE_NULL_BITMAP(step_ptr->exit_node_bitmap); FREE_NULL_BITMAP(step_ptr->step_node_bitmap); @@ -282,8 +283,8 @@ dump_step_desc(job_step_create_request_msg_t *step_spec) step_spec->user_id, step_spec->job_id, step_spec->min_nodes, step_spec->max_nodes, step_spec->cpu_count); - debug3(" num_tasks=%u relative=%u task_dist=%u node_list=%s", - step_spec->num_tasks, step_spec->relative, + debug3(" cpu_freq=%u num_tasks=%u relative=%u task_dist=%u node_list=%s", + step_spec->cpu_freq, step_spec->num_tasks, step_spec->relative, step_spec->task_dist, step_spec->node_list); debug3(" host=%s port=%u name=%s network=%s exclusive=%u", step_spec->host, step_spec->port, step_spec->name, @@ -341,6 +342,7 @@ int job_step_signal(uint32_t job_id, uint32_t step_id, { struct job_record *job_ptr; struct step_record *step_ptr; + int rc = SLURM_SUCCESS; job_ptr = find_job_record(job_id); if (job_ptr == NULL) { @@ -348,9 +350,11 @@ int job_step_signal(uint32_t job_id, uint32_t step_id, return ESLURM_INVALID_JOB_ID; } - if (IS_JOB_FINISHED(job_ptr)) - return ESLURM_ALREADY_DONE; - if (!IS_JOB_RUNNING(job_ptr)) { + if (IS_JOB_FINISHED(job_ptr)) { + rc = ESLURM_ALREADY_DONE; + if (signal != SIG_NODE_FAIL) + return rc; + } else if (!IS_JOB_RUNNING(job_ptr)) { verbose("job_step_signal: step %u.%u can not be sent signal " "%u from state=%s", job_id, step_id, signal, job_state_string(job_ptr->job_state)); @@ -370,7 +374,17 @@ int job_step_signal(uint32_t job_id, uint32_t step_id, return ESLURM_INVALID_JOB_ID; } -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P + /* If SIG_NODE_FAIL codes through it means we had nodes failed + so handle that in the select plugin and switch the signal + to KILL afterwards. + */ + if (signal == SIG_NODE_FAIL) { + select_g_fail_cnode(step_ptr); + signal = SIGKILL; + if (rc != SLURM_SUCCESS) + return rc; + } +#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P srun_step_signal(step_ptr, signal); #endif @@ -1779,13 +1793,6 @@ step_create(job_step_create_request_msg_t *step_specs, #if defined HAVE_BGQ if (step_specs->min_nodes < node_count) { - if (step_specs->min_nodes > 512) { - error("step asked for more than 512 nodes but " - "less than the allocation, on a " - "bluegene/Q system that isn't allowed."); - return ESLURM_INVALID_NODE_COUNT; - } - /* We are asking for less than we have. */ node_count = step_specs->min_nodes; step_specs->min_nodes = 1; @@ -1958,6 +1965,7 @@ step_create(job_step_create_request_msg_t *step_specs, step_ptr->port = step_specs->port; step_ptr->host = xstrdup(step_specs->host); step_ptr->batch_step = batch_step; + step_ptr->cpu_freq = step_specs->cpu_freq; step_ptr->cpus_per_task = (uint16_t)cpus_per_task; step_ptr->mem_per_cpu = step_specs->mem_per_cpu; step_ptr->ckpt_interval = step_specs->ckpt_interval; @@ -2045,9 +2053,8 @@ step_create(job_step_create_request_msg_t *step_specs, if (switch_build_jobinfo(step_ptr->switch_job, step_ptr->step_layout->node_list, step_ptr->step_layout->tasks, - step_ptr->cyclic_alloc, + step_ptr->step_layout->tids, step_ptr->network) < 0) { - error("switch_build_jobinfo: %m"); delete_step_record (job_ptr, step_ptr->step_id); return ESLURM_INTERCONNECT_FAILURE; } @@ -2242,7 +2249,38 @@ 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_2_3_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { + 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, buffer); + pack32(task_cnt, buffer); + pack32(step_ptr->time_limit, 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); + + 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); + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { pack32(step_ptr->job_ptr->job_id, buffer); pack32(step_ptr->step_id, buffer); pack16(step_ptr->ckpt_interval, buffer); @@ -2685,7 +2723,7 @@ extern int step_partial_comp(step_complete_msg_t *req, uid_t uid, step_ptr->exit_code = req->step_rc; if (max_rc) *max_rc = step_ptr->exit_code; - jobacct_gather_g_aggregate(step_ptr->jobacct, req->jobacct); + jobacctinfo_aggregate(step_ptr->jobacct, req->jobacct); /* we don't want to delete the step record here since right after we delete this step again if we delete it here we won't find it when we try the second @@ -2700,7 +2738,7 @@ extern int step_partial_comp(step_complete_msg_t *req, uid_t uid, return EINVAL; } - jobacct_gather_g_aggregate(step_ptr->jobacct, req->jobacct); + jobacctinfo_aggregate(step_ptr->jobacct, req->jobacct); if (!step_ptr->exit_node_bitmap) { /* initialize the node bitmap for exited nodes */ diff --git a/src/slurmd/Makefile.in b/src/slurmd/Makefile.in index 424d4145c1d6d7f97634b921714f5f86c97479dc..bca91c927676d60fec734226791cd2f9b75e2292 100644 --- a/src/slurmd/Makefile.in +++ b/src/slurmd/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -164,9 +163,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -174,9 +171,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -208,6 +204,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -235,6 +233,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -574,10 +573,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/slurmd/common/Makefile.in b/src/slurmd/common/Makefile.in index 65b84c69e471165c50125dba0a44b7a1cbf5110c..000d6a7257ea704108842ec6a7e7ab91f999a7d7 100644 --- a/src/slurmd/common/Makefile.in +++ b/src/slurmd/common/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -57,9 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -67,6 +65,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -147,9 +146,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -157,9 +154,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -191,6 +187,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -218,6 +216,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -366,7 +365,7 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libslurmd_common.la: $(libslurmd_common_la_OBJECTS) $(libslurmd_common_la_DEPENDENCIES) +libslurmd_common.la: $(libslurmd_common_la_OBJECTS) $(libslurmd_common_la_DEPENDENCIES) $(EXTRA_libslurmd_common_la_DEPENDENCIES) $(LINK) $(libslurmd_common_la_OBJECTS) $(libslurmd_common_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -505,10 +504,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/slurmd/common/proctrack.c b/src/slurmd/common/proctrack.c index 5e007f32d9f844258957fee5a6725ab75d53ab45..7621410ff5bcbc1730637c05ec34304753a84582 100644 --- a/src/slurmd/common/proctrack.c +++ b/src/slurmd/common/proctrack.c @@ -59,141 +59,24 @@ typedef struct slurm_proctrack_ops { int (*get_pids) (uint64_t id, pid_t ** pids, int *npids); } slurm_proctrack_ops_t; - -/* ************************************************************************ */ -/* TAG( slurm_proctrack_contex_t ) */ -/* ************************************************************************ */ -typedef struct slurm_proctrack_context { - char * proctrack_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - int op_errno; - slurm_proctrack_ops_t ops; -} slurm_proctrack_context_t; - -static slurm_proctrack_context_t *g_proctrack_context = NULL; -static pthread_mutex_t g_proctrack_context_lock = PTHREAD_MUTEX_INITIALIZER; - - -/* ************************************************************************ */ -/* TAG( _proctrack_get_ops ) */ -/* ************************************************************************ */ -static slurm_proctrack_ops_t * -_proctrack_get_ops(slurm_proctrack_context_t * c) -{ - /* - * Must be synchronized with slurm_proctrack_ops_t above. - */ - static const char *syms[] = { - "slurm_container_plugin_create", - "slurm_container_plugin_add", - "slurm_container_plugin_signal", - "slurm_container_plugin_destroy", - "slurm_container_plugin_find", - "slurm_container_plugin_has_pid", - "slurm_container_plugin_wait", - "slurm_container_plugin_get_pids" - }; - int n_syms = sizeof(syms) / sizeof(char *); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->proctrack_type, n_syms, syms, - (void **) &c->ops); - if (c->cur_plugin != PLUGIN_INVALID_HANDLE) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->proctrack_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", c->proctrack_type); - - /* Get plugin list. */ - if (c->plugin_list == NULL) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if (c->plugin_list == NULL) { - error("cannot create plugin manager"); - return NULL; - } - plugrack_set_major_type(c->plugin_list, "proctrack"); - plugrack_set_paranoia(c->plugin_list, - PLUGRACK_PARANOIA_NONE, 0); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir(c->plugin_list, plugin_dir); - xfree(plugin_dir); - } - - c->cur_plugin = plugrack_use_by_type(c->plugin_list, - c->proctrack_type); - if (c->cur_plugin == PLUGIN_INVALID_HANDLE) { - error("cannot find proctrack plugin for %s", - c->proctrack_type); - return NULL; - } - - /* Dereference the API. */ - if (plugin_get_syms(c->cur_plugin, - n_syms, syms, (void **) &c->ops) < n_syms) { - error("incomplete proctrack plugin detected"); - return NULL; - } - - return &c->ops; -} - - -/* ************************************************************************ */ -/* TAG( _proctrack_context_create ) */ -/* ************************************************************************ */ -static slurm_proctrack_context_t * -_proctrack_context_create(const char *proctrack_type) -{ - slurm_proctrack_context_t *c; - - if (proctrack_type == NULL) { - debug3("_proctrack_context_create: no proctrack type"); - return NULL; - } - - c = xmalloc(sizeof(slurm_proctrack_context_t)); - c->proctrack_type = xstrdup(proctrack_type); - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - c->op_errno = SLURM_SUCCESS; - - return c; -} - - -/* ************************************************************************ */ -/* TAG( _proctrack_context_destroy ) */ -/* ************************************************************************ */ -static int _proctrack_context_destroy(slurm_proctrack_context_t * c) -{ - int rc = SLURM_SUCCESS; - - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if (c->plugin_list) { - if (plugrack_destroy(c->plugin_list) != SLURM_SUCCESS) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree(c->proctrack_type); - xfree(c); - - return rc; -} - +/* + * Must be synchronized with slurm_proctrack_ops_t above. + */ +static const char *syms[] = { + "slurm_container_plugin_create", + "slurm_container_plugin_add", + "slurm_container_plugin_signal", + "slurm_container_plugin_destroy", + "slurm_container_plugin_find", + "slurm_container_plugin_has_pid", + "slurm_container_plugin_wait", + "slurm_container_plugin_get_pids" +}; + +static slurm_proctrack_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; /* *********************************************************************** */ /* TAG( slurm_proctrack_init ) */ @@ -204,33 +87,31 @@ static int _proctrack_context_destroy(slurm_proctrack_context_t * c) extern int slurm_proctrack_init(void) { int retval = SLURM_SUCCESS; - char *proctrack_type = NULL; + char *plugin_type = "proctrack"; + char *type = NULL; - slurm_mutex_lock(&g_proctrack_context_lock); + if (init_run && g_context) + return retval; - if (g_proctrack_context) - goto done; + slurm_mutex_lock(&g_context_lock); - proctrack_type = slurm_get_proctrack_type(); - g_proctrack_context = _proctrack_context_create(proctrack_type); - if (g_proctrack_context == NULL) { - error("cannot create proctrack context for %s", - proctrack_type); - retval = SLURM_ERROR; + if (g_context) goto done; - } - if (_proctrack_get_ops(g_proctrack_context) == NULL) { - error("cannot resolve proctrack plugin operations for %s", - proctrack_type); - _proctrack_context_destroy(g_proctrack_context); - g_proctrack_context = NULL; + type = slurm_get_proctrack_type(); + g_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); + + if (!g_context) { + error("cannot create %s context for %s", plugin_type, type); retval = SLURM_ERROR; + goto done; } + init_run = true; - done: - slurm_mutex_unlock(&g_proctrack_context_lock); - xfree(proctrack_type); +done: + slurm_mutex_unlock(&g_context_lock); + xfree(type); return retval; } @@ -241,11 +122,12 @@ extern int slurm_proctrack_fini(void) { int rc; - if (!g_proctrack_context) + if (!g_context) return SLURM_SUCCESS; - rc = _proctrack_context_destroy(g_proctrack_context); - g_proctrack_context = NULL; + init_run = false; + rc = plugin_context_destroy(g_context); + g_context = NULL; return rc; } @@ -262,7 +144,7 @@ extern int slurm_container_create(slurmd_job_t * job) if (slurm_proctrack_init() < 0) return 0; - return (*(g_proctrack_context->ops.create)) (job); + return (*(ops.create)) (job); } /* @@ -279,7 +161,7 @@ extern int slurm_container_add(slurmd_job_t * job, pid_t pid) if (slurm_proctrack_init() < 0) return SLURM_ERROR; - return (*(g_proctrack_context->ops.add)) (job, pid); + return (*(ops.add)) (job, pid); } /* @@ -295,7 +177,7 @@ extern int slurm_container_signal(uint64_t cont_id, int signal) if (slurm_proctrack_init() < 0) { return SLURM_ERROR; } - return (*(g_proctrack_context->ops.signal)) (cont_id, signal); + return (*(ops.signal)) (cont_id, signal); } /* @@ -309,7 +191,7 @@ extern int slurm_container_destroy(uint64_t cont_id) if (slurm_proctrack_init() < 0) return SLURM_ERROR; - return (*(g_proctrack_context->ops.destroy)) (cont_id); + return (*(ops.destroy)) (cont_id); } /* @@ -322,7 +204,7 @@ extern uint64_t slurm_container_find(pid_t pid) if (slurm_proctrack_init() < 0) return SLURM_ERROR; - return (*(g_proctrack_context->ops.find_cont)) (pid); + return (*(ops.find_cont)) (pid); } /* @@ -334,7 +216,7 @@ extern bool slurm_container_has_pid(uint64_t cont_id, pid_t pid) if (slurm_proctrack_init() < 0) return SLURM_ERROR; - return (*(g_proctrack_context->ops.has_pid)) (cont_id, pid); + return (*(ops.has_pid)) (cont_id, pid); } /* @@ -352,7 +234,7 @@ extern int slurm_container_wait(uint64_t cont_id) if (slurm_proctrack_init() < 0) return SLURM_ERROR; - return (*(g_proctrack_context->ops.wait)) (cont_id); + return (*(ops.wait)) (cont_id); } /* @@ -373,5 +255,5 @@ slurm_container_get_pids(uint64_t cont_id, pid_t ** pids, int *npids) if (slurm_proctrack_init() < 0) return SLURM_ERROR; - return (*(g_proctrack_context->ops.get_pids)) (cont_id, pids, npids); + return (*(ops.get_pids)) (cont_id, pids, npids); } diff --git a/src/slurmd/common/slurmstepd_init.c b/src/slurmd/common/slurmstepd_init.c index 0a07da3adc18ebf10c0367b808c6e3c6fe88f364..708e3c6d80fa143be32baba916db74f5b304a41c 100644 --- a/src/slurmd/common/slurmstepd_init.c +++ b/src/slurmd/common/slurmstepd_init.c @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Danny Auble * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * 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 + * 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 + * 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. @@ -38,10 +38,14 @@ #include "src/slurmd/common/slurmstepd_init.h" +/* Assume that the slurmd and slurmstepd are the same version level when slurmd + * starts slurmstepd, so we do not need to support different protocol versions + * for the different message formats. */ extern void pack_slurmd_conf_lite(slurmd_conf_t *conf, Buf buffer) { xassert(conf != NULL); packstr(conf->hostname, buffer); + pack16(conf->boards, buffer); pack16(conf->sockets, buffer); pack16(conf->cores, buffer); pack16(conf->threads, buffer); @@ -55,6 +59,7 @@ extern void pack_slurmd_conf_lite(slurmd_conf_t *conf, Buf buffer) packstr(conf->task_prolog, buffer); packstr(conf->task_epilog, buffer); pack16(conf->job_acct_gather_freq, buffer); + packstr(conf->job_acct_gather_type, buffer); pack16(conf->propagate_prio, buffer); pack32(conf->debug_flags, buffer); pack32(conf->debug_level, buffer); @@ -64,6 +69,7 @@ extern void pack_slurmd_conf_lite(slurmd_conf_t *conf, Buf buffer) pack16(conf->task_plugin_param, buffer); packstr(conf->node_topo_addr, buffer); packstr(conf->node_topo_pattern, buffer); + pack32((uint32_t)conf->port, buffer); } extern int unpack_slurmd_conf_lite_no_alloc(slurmd_conf_t *conf, Buf buffer) @@ -71,19 +77,22 @@ extern int unpack_slurmd_conf_lite_no_alloc(slurmd_conf_t *conf, Buf buffer) uint32_t uint32_tmp; safe_unpackstr_xmalloc(&conf->hostname, &uint32_tmp, buffer); + safe_unpack16(&conf->boards, buffer); safe_unpack16(&conf->sockets, buffer); safe_unpack16(&conf->cores, buffer); safe_unpack16(&conf->threads, buffer); safe_unpack32(&conf->real_memory_size, buffer); safe_unpack16(&conf->block_map_size, buffer); safe_unpack16_array(&conf->block_map, &uint32_tmp, buffer); - safe_unpack16_array(&conf->block_map_inv, &uint32_tmp, buffer); + safe_unpack16_array(&conf->block_map_inv, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&conf->spooldir, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&conf->node_name, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&conf->logfile, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&conf->task_prolog, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&conf->task_epilog, &uint32_tmp, buffer); safe_unpack16(&conf->job_acct_gather_freq, buffer); + safe_unpackstr_xmalloc(&conf->job_acct_gather_type, &uint32_tmp, + buffer); safe_unpack16(&conf->propagate_prio, buffer); safe_unpack32(&conf->debug_flags, buffer); safe_unpack32(&uint32_tmp, buffer); @@ -96,6 +105,8 @@ extern int unpack_slurmd_conf_lite_no_alloc(slurmd_conf_t *conf, Buf buffer) safe_unpack16(&conf->task_plugin_param, buffer); safe_unpackstr_xmalloc(&conf->node_topo_addr, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&conf->node_topo_pattern, &uint32_tmp, buffer); + safe_unpack32(&uint32_tmp, buffer); + conf->port = uint32_tmp; return SLURM_SUCCESS; unpack_error: diff --git a/src/slurmd/common/task_plugin.c b/src/slurmd/common/task_plugin.c index 7e44b63dc8fbddf920402c2f3e5f09c26b6ebd5f..df648d96d3a9e238a08baff220cf1f4383e5e8b1 100644 --- a/src/slurmd/common/task_plugin.c +++ b/src/slurmd/common/task_plugin.c @@ -45,6 +45,8 @@ #include "src/common/xmalloc.h" #include "src/common/xstring.h" +#include "src/slurmd/common/task_plugin.h" + #include "src/slurmd/slurmstepd/slurmstepd_job.h" typedef struct slurmd_task_ops { @@ -66,130 +68,27 @@ typedef struct slurmd_task_ops { int (*post_step) (slurmd_job_t *job); } slurmd_task_ops_t; - -typedef struct slurmd_task_context { - char *task_type; - plugrack_t plugin_list; - plugin_handle_t cur_plugin; - slurmd_task_ops_t ops; -} slurmd_task_context_t; - -static slurmd_task_context_t **g_task_context = NULL; +/* + * Must be synchronized with slurmd_task_ops_t above. + */ +static const char *syms[] = { + "task_slurmd_batch_request", + "task_slurmd_launch_request", + "task_slurmd_reserve_resources", + "task_slurmd_suspend_job", + "task_slurmd_resume_job", + "task_slurmd_release_resources", + "task_pre_setuid", + "task_pre_launch", + "task_post_term", + "task_post_step", +}; + +static slurmd_task_ops_t *ops = NULL; +static plugin_context_t **g_task_context = NULL; static int g_task_context_num = -1; static pthread_mutex_t g_task_context_lock = PTHREAD_MUTEX_INITIALIZER; - - -static slurmd_task_ops_t * -_slurmd_task_get_ops(slurmd_task_context_t *c) -{ - /* - * Must be synchronized with slurmd_task_ops_t above. - */ - static const char *syms[] = { - "task_slurmd_batch_request", - "task_slurmd_launch_request", - "task_slurmd_reserve_resources", - "task_slurmd_suspend_job", - "task_slurmd_resume_job", - "task_slurmd_release_resources", - "task_pre_setuid", - "task_pre_launch", - "task_post_term", - "task_post_step", - }; - int n_syms = sizeof( syms ) / sizeof( char * ); - - /* Find the correct plugin. */ - c->cur_plugin = plugin_load_and_link(c->task_type, n_syms, syms, - (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) - return &c->ops; - - if(errno != EPLUGIN_NOTFOUND) { - error("Couldn't load specified plugin name for %s: %s", - c->task_type, plugin_strerror(errno)); - return NULL; - } - - error("Couldn't find the specified plugin name for %s " - "looking at all files", - c->task_type); - - /* Get plugin list. */ - if ( c->plugin_list == NULL ) { - char *plugin_dir; - c->plugin_list = plugrack_create(); - if ( c->plugin_list == NULL ) { - error( "cannot create plugin manager" ); - return NULL; - } - plugrack_set_major_type( c->plugin_list, "task" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, - 0 ); - plugin_dir = slurm_get_plugin_dir(); - plugrack_read_dir( c->plugin_list, plugin_dir ); - xfree(plugin_dir); - } - - c->cur_plugin = plugrack_use_by_type( c->plugin_list, c->task_type ); - if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "cannot find task plugin for %s", c->task_type ); - return NULL; - } - - /* Dereference the API. */ - if ( plugin_get_syms( c->cur_plugin, n_syms, syms, - (void **) &c->ops ) < n_syms ) { - error( "incomplete task plugin detected" ); - return NULL; - } - - return &c->ops; -} - - -static slurmd_task_context_t * -_slurmd_task_context_create(const char *task_plugin_type) -{ - slurmd_task_context_t *c; - - if ( task_plugin_type == NULL ) { - debug3( "task_plugin_type is NULL" ); - return NULL; - } - - c = xmalloc( sizeof( slurmd_task_context_t ) ); - c->task_type = xstrdup( task_plugin_type ); - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; - - return c; -} - - -static int -_slurmd_task_context_destroy(slurmd_task_context_t *c) -{ - int rc = SLURM_SUCCESS; - /* - * Must check return code here because plugins might still - * be loaded and active. - */ - if ( c->plugin_list ) { - if ( plugrack_destroy( c->plugin_list ) != SLURM_SUCCESS ) { - rc = SLURM_ERROR; - } - } else { - plugin_unload(c->cur_plugin); - } - - xfree( c->task_type ); - xfree( c ); - - return rc; -} - +static bool init_run = false; /* * Initialize the task plugin. @@ -198,9 +97,13 @@ _slurmd_task_context_destroy(slurmd_task_context_t *c) */ extern int slurmd_task_init(void) { - int retval = SLURM_SUCCESS, i; + int retval = SLURM_SUCCESS; + char *plugin_type = "task"; char *task_plugin_type = NULL; - char *last = NULL, *task_plugin_list, *task_plugin = NULL; + char *last = NULL, *task_plugin_list, *type = NULL; + + if ( init_run && (g_task_context_num >= 0) ) + return retval; slurm_mutex_lock( &g_task_context_lock ); @@ -213,43 +116,39 @@ extern int slurmd_task_init(void) goto done; task_plugin_list = task_plugin_type; - while ((task_plugin = strtok_r(task_plugin_list, ",", &last))) { - i = g_task_context_num++; - xrealloc(g_task_context, - (sizeof(slurmd_task_context_t *) * g_task_context_num)); - if (strncmp(task_plugin, "task/", 5) == 0) - task_plugin += 5; /* backward compatibility */ - task_plugin = xstrdup_printf("task/%s", task_plugin); - g_task_context[i] = _slurmd_task_context_create( task_plugin ); - if ( g_task_context[i] == NULL ) { - error( "cannot create task context for %s", - task_plugin ); - goto error; + while ((type = strtok_r(task_plugin_list, ",", &last))) { + xrealloc(ops, + 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) + type += 5; /* backward compatibility */ + type = xstrdup_printf("task/%s", type); + g_task_context[g_task_context_num] = plugin_context_create( + plugin_type, type, (void **)&ops[g_task_context_num], + syms, sizeof(syms)); + if (!g_task_context[g_task_context_num]) { + error("cannot create %s context for %s", + plugin_type, type); + xfree(type); + retval = SLURM_ERROR; + break; } - if ( _slurmd_task_get_ops( g_task_context[i] ) == NULL ) { - error( "cannot resolve task plugin operations for %s", - task_plugin ); - goto error; - } - xfree(task_plugin); + xfree(type); + g_task_context_num++; task_plugin_list = NULL; /* for next iteration */ } + init_run = true; done: slurm_mutex_unlock( &g_task_context_lock ); xfree(task_plugin_type); - return retval; -error: - xfree(task_plugin); - retval = SLURM_ERROR; - for (i = 0; i < g_task_context_num; i++) - if (g_task_context[i]) - _slurmd_task_context_destroy(g_task_context[i]); - xfree(g_task_context); - g_task_context_num = -1; - goto done; + if (retval != SLURM_SUCCESS) + slurmd_task_fini(); + + return retval; } /* @@ -265,13 +164,17 @@ extern int slurmd_task_fini(void) if (!g_task_context) goto done; + init_run = false; for (i = 0; i < g_task_context_num; i++) { - if (_slurmd_task_context_destroy(g_task_context[i]) != - SLURM_SUCCESS) { - rc = SLURM_ERROR; + if (g_task_context[i]) { + if (plugin_context_destroy(g_task_context[i]) != + SLURM_SUCCESS) { + rc = SLURM_ERROR; + } } } + xfree(ops); xfree(g_task_context); g_task_context_num = -1; @@ -294,8 +197,7 @@ extern int slurmd_batch_request(uint32_t job_id, batch_job_launch_msg_t *req) slurm_mutex_lock( &g_task_context_lock ); for (i = 0; ((i < g_task_context_num) && (rc == SLURM_SUCCESS)); i++) { - rc = (*(g_task_context[i]->ops.slurmd_batch_request))(job_id, - req); + rc = (*(ops[i].slurmd_batch_request))(job_id, req); } slurm_mutex_unlock( &g_task_context_lock ); @@ -318,7 +220,7 @@ extern int slurmd_launch_request(uint32_t job_id, slurm_mutex_lock( &g_task_context_lock ); for (i = 0; ((i < g_task_context_num) && (rc == SLURM_SUCCESS)); i++) { - rc = (*(g_task_context[i]->ops.slurmd_launch_request)) + rc = (*(ops[i].slurmd_launch_request)) (job_id, req, node_id); } slurm_mutex_unlock( &g_task_context_lock ); @@ -342,7 +244,7 @@ extern int slurmd_reserve_resources(uint32_t job_id, slurm_mutex_lock( &g_task_context_lock ); for (i = 0; ((i < g_task_context_num) && (rc == SLURM_SUCCESS)); i++) { - rc = (*(g_task_context[i]->ops.slurmd_reserve_resources)) + rc = (*(ops[i].slurmd_reserve_resources)) (job_id, req, node_id); } slurm_mutex_unlock( &g_task_context_lock ); @@ -364,7 +266,7 @@ extern int slurmd_suspend_job(uint32_t job_id) slurm_mutex_lock( &g_task_context_lock ); for (i = 0; ((i < g_task_context_num) && (rc == SLURM_SUCCESS)); i++) - rc = (*(g_task_context[i]->ops.slurmd_suspend_job))(job_id); + rc = (*(ops[i].slurmd_suspend_job))(job_id); slurm_mutex_unlock( &g_task_context_lock ); return (rc); @@ -384,7 +286,7 @@ extern int slurmd_resume_job(uint32_t job_id) slurm_mutex_lock( &g_task_context_lock ); for (i = 0; ((i < g_task_context_num) && (rc == SLURM_SUCCESS)); i++) - rc = (*(g_task_context[i]->ops.slurmd_resume_job))(job_id); + rc = (*(ops[i].slurmd_resume_job))(job_id); slurm_mutex_unlock( &g_task_context_lock ); return (rc); @@ -404,7 +306,7 @@ extern int slurmd_release_resources(uint32_t job_id) slurm_mutex_lock( &g_task_context_lock ); for (i = 0; ((i < g_task_context_num) && (rc == SLURM_SUCCESS)); i++) { - rc = (*(g_task_context[i]->ops.slurmd_release_resources)) + rc = (*(ops[i].slurmd_release_resources)) (job_id); } slurm_mutex_unlock( &g_task_context_lock ); @@ -427,7 +329,7 @@ extern int pre_setuid(slurmd_job_t *job) slurm_mutex_lock( &g_task_context_lock ); for (i = 0; ((i < g_task_context_num) && (rc == SLURM_SUCCESS)); i++) - rc = (*(g_task_context[i]->ops.pre_setuid))(job); + rc = (*(ops[i].pre_setuid))(job); slurm_mutex_unlock( &g_task_context_lock ); return (rc); @@ -447,7 +349,7 @@ extern int pre_launch(slurmd_job_t *job) slurm_mutex_lock( &g_task_context_lock ); for (i = 0; ((i < g_task_context_num) && (rc == SLURM_SUCCESS)); i++) - rc = (*(g_task_context[i]->ops.pre_launch))(job); + rc = (*(ops[i].pre_launch))(job); slurm_mutex_unlock( &g_task_context_lock ); return (rc); @@ -467,7 +369,7 @@ extern int post_term(slurmd_job_t *job) slurm_mutex_lock( &g_task_context_lock ); for (i = 0; ((i < g_task_context_num) && (rc == SLURM_SUCCESS)); i++) - rc = (*(g_task_context[i]->ops.post_term))(job); + rc = (*(ops[i].post_term))(job); slurm_mutex_unlock( &g_task_context_lock ); return (rc); @@ -487,7 +389,7 @@ extern int post_step(slurmd_job_t *job) slurm_mutex_lock( &g_task_context_lock ); for (i = 0; ((i < g_task_context_num) && (rc == SLURM_SUCCESS)); i++) - rc = (*(g_task_context[i]->ops.post_step))(job); + rc = (*(ops[i].post_step))(job); slurm_mutex_unlock( &g_task_context_lock ); return (rc); diff --git a/src/slurmd/slurmd/Makefile.am b/src/slurmd/slurmd/Makefile.am index 7d81740c4f266f0e480f13b87307772f33fb5aff..a9f6ff2d0cf71c5d53c02ee961984b0ffe68e8af 100644 --- a/src/slurmd/slurmd/Makefile.am +++ b/src/slurmd/slurmd/Makefile.am @@ -27,9 +27,11 @@ 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 +slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) -Wl,-bmaxdata:0x0 else -slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) endif force: diff --git a/src/slurmd/slurmd/Makefile.in b/src/slurmd/slurmd/Makefile.in index 60c22f359e7522e06a5d4aa25302f40e909013d7..43158aa140da4e0ca317b0b2922d0204a3f1dcc0 100644 --- a/src/slurmd/slurmd/Makefile.in +++ b/src/slurmd/slurmd/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -59,9 +59,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -69,6 +67,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -158,9 +157,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -168,9 +165,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -202,6 +198,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -229,6 +227,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -337,11 +336,15 @@ SLURMD_SOURCES = \ xcpu.c xcpu.h slurmd_SOURCES = $(SLURMD_SOURCES) -@HAVE_AIX_FALSE@slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +@HAVE_AIX_FALSE@slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ +@HAVE_AIX_FALSE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + # 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 +@HAVE_AIX_TRUE@slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ +@HAVE_AIX_TRUE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) -Wl,-bmaxdata:0x0 + all: all-am .SUFFIXES: @@ -419,7 +422,7 @@ clean-sbinPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -slurmd$(EXEEXT): $(slurmd_OBJECTS) $(slurmd_DEPENDENCIES) +slurmd$(EXEEXT): $(slurmd_OBJECTS) $(slurmd_DEPENDENCIES) $(EXTRA_slurmd_DEPENDENCIES) @rm -f slurmd$(EXEEXT) $(slurmd_LINK) $(slurmd_OBJECTS) $(slurmd_LDADD) $(LIBS) @@ -562,10 +565,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/slurmd/slurmd/req.c b/src/slurmd/slurmd/req.c index 470153f3fe25bee6da99f25ad0ef1d3ae4acb5f2..982cae53138e5a886ea20326b863c05617cfdc3c 100644 --- a/src/slurmd/slurmd/req.c +++ b/src/slurmd/slurmd/req.c @@ -57,12 +57,12 @@ #include #include +#include "src/common/cpu_frequency.h" #include "src/common/env.h" #include "src/common/fd.h" #include "src/common/forward.h" #include "src/common/gres.h" #include "src/common/hostlist.h" -#include "src/common/jobacct_common.h" #include "src/common/list.h" #include "src/common/log.h" #include "src/common/macros.h" @@ -92,6 +92,9 @@ #define _LIMIT_INFO 0 +#define RETRY_DELAY 15 /* retry every 15 seconds */ +#define MAX_RETRY 240 /* retry 240 times (one hour max) */ + #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 64 #endif @@ -129,18 +132,21 @@ static void _delay_rpc(int host_inx, int host_cnt, int usec_per_rpc); static void _destroy_env(char **env); static int _get_grouplist(uid_t my_uid, gid_t my_gid, int *ngroups, gid_t **groups); +static bool _is_batch_job_finished(uint32_t job_id); static void _job_limits_free(void *x); static int _job_limits_match(void *x, void *key); static bool _job_still_running(uint32_t job_id); static int _kill_all_active_steps(uint32_t jobid, int sig, bool batch); +static void _note_batch_job_finished(uint32_t job_id); static int _step_limits_match(void *x, void *key); static int _terminate_all_steps(uint32_t jobid, bool batch); static void _rpc_launch_tasks(slurm_msg_t *); static void _rpc_abort_job(slurm_msg_t *); -static void _rpc_batch_job(slurm_msg_t *); +static void _rpc_batch_job(slurm_msg_t *msg, bool new_msg); static void _rpc_job_notify(slurm_msg_t *); static void _rpc_signal_tasks(slurm_msg_t *); static void _rpc_checkpoint_tasks(slurm_msg_t *); +static void _rpc_complete_batch(slurm_msg_t *); static void _rpc_terminate_tasks(slurm_msg_t *); static void _rpc_timelimit(slurm_msg_t *); static void _rpc_reattach_tasks(slurm_msg_t *); @@ -205,6 +211,11 @@ static pthread_mutex_t job_limits_mutex = PTHREAD_MUTEX_INITIALIZER; static List job_limits_list = NULL; static bool job_limits_loaded = false; +#define FINI_JOB_CNT 32 +static pthread_mutex_t fini_mutex = PTHREAD_MUTEX_INITIALIZER; +static uint32_t fini_job_id[FINI_JOB_CNT]; +static int next_fini_job_inx = 0; + /* NUM_PARALLEL_SUSPEND controls the number of jobs suspended/resumed * at one time as well as the number of jobsteps per job that can be * suspended at one time */ @@ -237,10 +248,11 @@ slurmd_req(slurm_msg_t *msg) switch(msg->msg_type) { case REQUEST_BATCH_JOB_LAUNCH: + debug2("Processing RPC: REQUEST_BATCH_JOB_LAUNCH"); /* Mutex locking moved into _rpc_batch_job() due to * very slow prolog on Blue Gene system. Only batch * jobs are supported on Blue Gene (no job steps). */ - _rpc_batch_job(msg); + _rpc_batch_job(msg, true); last_slurmctld_msg = time(NULL); slurm_free_job_launch_msg(msg->data); break; @@ -289,6 +301,7 @@ slurmd_req(slurm_msg_t *msg) slurm_free_signal_job_msg(msg->data); break; case REQUEST_SUSPEND: + debug2("Processing RPC: REQUEST_SUSPEND"); _rpc_suspend_job(msg); last_slurmctld_msg = time(NULL); slurm_free_suspend_msg(msg->data); @@ -305,25 +318,35 @@ slurmd_req(slurm_msg_t *msg) _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); @@ -338,6 +361,7 @@ slurmd_req(slurm_msg_t *msg) /* 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 */ @@ -517,6 +541,9 @@ _send_slurmstepd_init(int fd, slurmd_step_type_t type, void *req, /* Send GRES information to slurmstepd */ gres_plugin_send_stepd(fd); + /* send cpu_frequency info to slurmstepd */ + cpu_freq_send_info(fd); + /* send req over to slurmstepd */ switch(type) { case LAUNCH_BATCH_JOB: @@ -538,6 +565,7 @@ _send_slurmstepd_init(int fd, slurmd_step_type_t type, void *req, } buffer = init_buf(0); msg.data = req; + msg.protocol_version = SLURM_PROTOCOL_VERSION; pack_msg(&msg, buffer); len = get_buf_offset(buffer); safe_write(fd, &len, sizeof(int)); @@ -810,6 +838,7 @@ _check_job_credential(launch_tasks_request_msg_t *req, uid_t uid, } host_index = hostset_find(j_hset, conf->node_name); hostset_destroy(j_hset); + if ((host_index < 0) || (host_index >= arg.job_nhosts)) { error("job cr credential invalid host_index %d for " "job %u", host_index, arg.jobid); @@ -1237,22 +1266,52 @@ _set_batch_job_limits(slurm_msg_t *msg) slurm_cred_free_args(&arg); } +/* These functions prevent a possible race condition if the batch script's + * complete RPC is processed before it's launch_successful response. This + * */ +static bool _is_batch_job_finished(uint32_t job_id) +{ + bool found_job = false; + int i; + + slurm_mutex_lock(&fini_mutex); + for (i = 0; i < FINI_JOB_CNT; i++) { + if (fini_job_id[i] == job_id) { + found_job = true; + break; + } + } + slurm_mutex_unlock(&fini_mutex); + + return found_job; +} +static void _note_batch_job_finished(uint32_t job_id) +{ + slurm_mutex_lock(&fini_mutex); + fini_job_id[next_fini_job_inx] = job_id; + if (++next_fini_job_inx >= FINI_JOB_CNT) + next_fini_job_inx = 0; + slurm_mutex_unlock(&fini_mutex); +} + static void -_rpc_batch_job(slurm_msg_t *msg) +_rpc_batch_job(slurm_msg_t *msg, bool new_msg) { batch_job_launch_msg_t *req = (batch_job_launch_msg_t *)msg->data; bool first_job_run = true; int rc = SLURM_SUCCESS; - uid_t req_uid = g_slurm_auth_get_uid(msg->auth_cred, NULL); char *resv_id = NULL; - bool replied = false; + bool replied = false, revoked; slurm_addr_t *cli = &msg->orig_addr; - if (!_slurm_authorized_user(req_uid)) { - error("Security violation, batch launch RPC from uid %d", - req_uid); - rc = ESLURM_USER_ID_MISSING; /* or bad in this case */ - goto done; + if (new_msg) { + uid_t req_uid = g_slurm_auth_get_uid(msg->auth_cred, NULL); + if (!_slurm_authorized_user(req_uid)) { + error("Security violation, batch launch RPC from uid %d", + req_uid); + rc = ESLURM_USER_ID_MISSING; /* or bad in this case */ + goto done; + } } slurm_cred_handle_reissue(conf->vctx, req->cred); if (slurm_cred_revoked(conf->vctx, req->cred)) { @@ -1278,7 +1337,7 @@ _rpc_batch_job(slurm_msg_t *msg) * Just reply now and send a separate kill job request if the * prolog or launch fail. */ replied = true; - if (slurm_send_rc_msg(msg, rc) < 1) { + if (new_msg && (slurm_send_rc_msg(msg, rc) < 1)) { /* The slurmctld is no longer waiting for a reply. * This typically indicates that the slurmd was * blocked from memory and/or CPUs and the slurmctld @@ -1299,7 +1358,7 @@ _rpc_batch_job(slurm_msg_t *msg) SELECT_JOBDATA_BLOCK_ID, &resv_id); #elif defined(HAVE_CRAY) resv_id = select_g_select_jobinfo_xstrdup(req->select_jobinfo, - SELECT_PRINT_RESV_ID); + SELECT_PRINT_RESV_ID); #endif rc = _run_prolog(req->job_id, req->uid, resv_id, req->spank_job_env, req->spank_job_env_size); @@ -1351,8 +1410,16 @@ _rpc_batch_job(slurm_msg_t *msg) /* On a busy system, slurmstepd may take a while to respond, * if the job was cancelled in the interim, run through the - * abort logic below */ - if (slurm_cred_revoked(conf->vctx, req->cred)) { + * abort logic below. */ + revoked = slurm_cred_revoked(conf->vctx, req->cred); + if (revoked && _is_batch_job_finished(req->job_id)) { + /* If configured with select/serial and the batch job already + * completed, consider the job sucessfully launched and do + * not repeat termination logic below, which in the worst case + * just slows things down with another message. */ + revoked = false; + } + if (revoked) { info("Job %u killed while launch was in progress", req->job_id); sleep(1); /* give slurmstepd time to create @@ -1364,7 +1431,7 @@ _rpc_batch_job(slurm_msg_t *msg) done: if (!replied) { - if (slurm_send_rc_msg(msg, rc) < 1) { + if (new_msg && (slurm_send_rc_msg(msg, rc) < 1)) { /* The slurmctld is no longer waiting for a reply. * This typically indicates that the slurmd was * blocked from memory and/or CPUs and the slurmctld @@ -1488,12 +1555,12 @@ _abort_step(uint32_t job_id, uint32_t step_id) resp.range_first = 0; resp.range_last = 0; resp.step_rc = 1; - resp.jobacct = jobacct_gather_g_create(NULL); + resp.jobacct = jobacctinfo_create(NULL); resp_msg.msg_type = REQUEST_STEP_COMPLETE; resp_msg.data = &resp; rc2 = slurm_send_recv_controller_rc_msg(&resp_msg, &rc); /* Note: we are ignoring the RPC return code */ - jobacct_gather_g_destroy(resp.jobacct); + jobacctinfo_destroy(resp.jobacct); return rc2; } @@ -1752,14 +1819,14 @@ _enforce_job_mem_limit(void) if ((!stepd_stat_jobacct(fd, &acct_req, resp)) && (resp->jobacct)) { /* resp->jobacct is NULL if account is disabled */ - jobacct_common_getinfo((struct jobacctinfo *) - resp->jobacct, - JOBACCT_DATA_TOT_RSS, - &step_rss); - jobacct_common_getinfo((struct jobacctinfo *) - resp->jobacct, - JOBACCT_DATA_TOT_VSIZE, - &step_vsize); + jobacctinfo_getinfo((struct jobacctinfo *) + resp->jobacct, + JOBACCT_DATA_TOT_RSS, + &step_rss); + jobacctinfo_getinfo((struct jobacctinfo *) + resp->jobacct, + JOBACCT_DATA_TOT_VSIZE, + &step_vsize); #if _LIMIT_INFO info("Step:%u.%u RSS:%u KB VSIZE:%u KB", stepd->jobid, stepd->stepid, @@ -2142,6 +2209,7 @@ _rpc_daemon_status(slurm_msg_t *msg) resp = xmalloc(sizeof(slurmd_status_t)); resp->actual_cpus = conf->actual_cpus; + resp->actual_boards = conf->actual_boards; resp->actual_sockets = conf->actual_sockets; resp->actual_cores = conf->actual_cores; resp->actual_threads = conf->actual_threads; @@ -2985,8 +3053,9 @@ _epilog_complete(uint32_t jobid, int rc) if (slurm_send_only_controller_msg(&msg) < 0) { error("Unable to send epilog complete message: %m"); ret = SLURM_ERROR; - } else + } else { debug ("Job %u: sent epilog complete msg: rc = %d", jobid, rc); + } switch_g_free_node_info(&req.switch_nodeinfo); return ret; @@ -3285,7 +3354,7 @@ _rpc_suspend_job(slurm_msg_t *msg) } } -/* Job shouldn't even be runnin here, abort it immediately */ +/* Job shouldn't even be running here, abort it immediately */ static void _rpc_abort_job(slurm_msg_t *msg) { @@ -3355,13 +3424,174 @@ _rpc_abort_job(slurm_msg_t *msg) &resv_id); #elif defined(HAVE_CRAY) resv_id = select_g_select_jobinfo_xstrdup(req->select_jobinfo, - SELECT_PRINT_RESV_ID); + SELECT_PRINT_RESV_ID); #endif _run_epilog(req->job_id, req->job_uid, resv_id, req->spank_job_env, req->spank_job_env_size); xfree(resv_id); } +/* This is a variant of _rpc_terminate_job for use with select/serial */ +static void +_rpc_terminate_batch_job(uint32_t job_id, uint32_t user_id) +{ + int rc = SLURM_SUCCESS; + int nsteps = 0; + int delay; + time_t now = time(NULL); + slurm_ctl_conf_t *cf; + + slurmd_release_resources(job_id); + + if (_waiter_init(job_id) == SLURM_ERROR) + return; + + /* + * "revoke" all future credentials for this jobid + */ + _note_batch_job_finished(job_id); + if (slurm_cred_revoke(conf->vctx, job_id, now, now) < 0) { + debug("revoking cred for job %u: %m", job_id); + } else { + save_cred_state(conf->vctx); + debug("credential for job %u revoked", job_id); + } + + /* + * Tasks might be stopped (possibly by a debugger) + * so send SIGCONT first. + */ + _kill_all_active_steps(job_id, SIGCONT, true); + if (errno == ESLURMD_STEP_SUSPENDED) { + /* + * If the job step is currently suspended, we don't + * bother with a "nice" termination. + */ + debug2("Job is currently suspended, terminating"); + nsteps = _terminate_all_steps(job_id, true); + } else { + nsteps = _kill_all_active_steps(job_id, SIGTERM, true); + } + +#ifndef HAVE_AIX + if ((nsteps == 0) && !conf->epilog) { + slurm_cred_begin_expiration(conf->vctx, job_id); + save_cred_state(conf->vctx); + _waiter_complete(job_id); + return; + } +#endif + + /* + * Check for corpses + */ + cf = slurm_conf_lock(); + delay = MAX(cf->kill_wait, 5); + slurm_conf_unlock(); + if (!_pause_for_job_completion(job_id, NULL, delay) && + _terminate_all_steps(job_id, true) ) { + /* + * Block until all user processes are complete. + */ + _pause_for_job_completion(job_id, NULL, 0); + } + + /* + * Begin expiration period for cached information about job. + * If expiration period has already begun, then do not run + * the epilog again, as that script has already been executed + * for this job. + */ + if (slurm_cred_begin_expiration(conf->vctx, job_id) < 0) { + debug("Not running epilog for jobid %d: %m", job_id); + goto done; + } + + save_cred_state(conf->vctx); + + /* NOTE: We lack the job's SPANK environment variables */ + rc = _run_epilog(job_id, (uid_t) user_id, NULL, NULL, 0); + if (rc) { + int term_sig, exit_status; + if (WIFSIGNALED(rc)) { + exit_status = 0; + term_sig = WTERMSIG(rc); + } else { + exit_status = WEXITSTATUS(rc); + term_sig = 0; + } + error("[job %u] epilog failed status=%d:%d", + job_id, exit_status, term_sig); + rc = ESLURMD_EPILOG_FAILED; + } else + debug("completed epilog for jobid %u", job_id); + + done: + _wait_state_completed(job_id, 5); + _waiter_complete(job_id); +} + +/* This complete batch RPC came from slurmstepd because we have select/serial + * configured. Terminate the job here. Forward the batch completion RPC to + * slurmctld and possible get a new batch launch RPC in response. */ +static void +_rpc_complete_batch(slurm_msg_t *msg) +{ + int i, rc, msg_rc; + slurm_msg_t req_msg, resp_msg; + uid_t uid = g_slurm_auth_get_uid(msg->auth_cred, NULL); + complete_batch_script_msg_t *req = msg->data; + + if (!_slurm_authorized_user(uid)) { + error("Security violation: complete_batch(%u) from uid %d", + req->job_id, uid); + if (msg->conn_fd >= 0) + slurm_send_rc_msg(msg, ESLURM_USER_ID_MISSING); + return; + } + + slurm_send_rc_msg(msg, SLURM_SUCCESS); + _rpc_terminate_batch_job(req->job_id, req->user_id); + + slurm_msg_t_init(&req_msg); + req_msg.msg_type= REQUEST_COMPLETE_BATCH_JOB; + req_msg.data = msg->data; + for (i = 0; i <= MAX_RETRY; i++) { + msg_rc = slurm_send_recv_controller_msg(&req_msg, &resp_msg); + if (msg_rc == SLURM_SUCCESS) + break; + info("Retrying job complete RPC for job %u", req->job_id); + sleep(RETRY_DELAY); + } + if (i > MAX_RETRY) { + error("Unable to send job complete message: %m"); + return; + } + + if (resp_msg.msg_type == RESPONSE_SLURM_RC) { + last_slurmctld_msg = time(NULL); + rc = ((return_code_msg_t *) resp_msg.data)->return_code; + slurm_free_return_code_msg(resp_msg.data); + if (rc) { + error("complete_batch for job %u: %s", req->job_id, + slurm_strerror(rc)); + } + return; + } + + if (resp_msg.msg_type != REQUEST_BATCH_JOB_LAUNCH) { + error("Invalid response msg_type (%u) to complete_batch RPC " + "for job %u", resp_msg.msg_type, req->job_id); + return; + } + + /* (resp_msg.msg_type == REQUEST_BATCH_JOB_LAUNCH) */ + debug2("Processing RPC: REQUEST_BATCH_JOB_LAUNCH"); + last_slurmctld_msg = time(NULL); + _rpc_batch_job(&resp_msg, false); + slurm_free_job_launch_msg(resp_msg.data); +} + static void _rpc_terminate_job(slurm_msg_t *msg) { @@ -3543,7 +3773,7 @@ _rpc_terminate_job(slurm_msg_t *msg) &resv_id); #elif defined(HAVE_CRAY) resv_id = select_g_select_jobinfo_xstrdup(req->select_jobinfo, - SELECT_PRINT_RESV_ID); + SELECT_PRINT_RESV_ID); #endif rc = _run_epilog(req->job_id, req->job_uid, resv_id, req->spank_job_env, req->spank_job_env_size); @@ -3781,6 +4011,7 @@ _build_env(uint32_t jobid, uid_t uid, char *resv_id, if (spank_job_env_size) env_array_merge(&env, (const char **) spank_job_env); + setenvf(&env, "SLURM_CONF", conf->conffile); setenvf(&env, "SLURM_JOB_ID", "%u", jobid); setenvf(&env, "SLURM_JOB_UID", "%u", uid); name = uid_to_string(uid); @@ -3836,7 +4067,7 @@ run_spank_job_script (const char *mode, char **env) fd_set_close_on_exec (pfds[1]); - info ("Calling %s spank %s", conf->stepd_loc, mode); + debug ("Calling %s spank %s", conf->stepd_loc, mode); if ((cpid = fork ()) < 0) { error ("executing spank %s: %m", mode); return (-1); @@ -3849,9 +4080,6 @@ run_spank_job_script (const char *mode, char **env) (char *) mode, NULL }; - /* Set the correct slurm.conf location */ - setenvf (&env, "SLURM_CONF", conf->conffile); - if (dup2 (pfds[0], STDIN_FILENO) < 0) fatal ("dup2: %m"); #ifdef SETPGRP_TWO_ARGS diff --git a/src/slurmd/slurmd/slurmd.c b/src/slurmd/slurmd/slurmd.c index 3c78ec9763987f3d77fe814b2aa357e9cf32b3ba..df339cdaab12ce21a7f5ff8bdf64ddcc841d49ee 100644 --- a/src/slurmd/slurmd/slurmd.c +++ b/src/slurmd/slurmd/slurmd.c @@ -63,6 +63,7 @@ #endif #include "src/common/bitstring.h" +#include "src/common/cpu_frequency.h" #include "src/common/daemonize.h" #include "src/common/fd.h" #include "src/common/forward.h" @@ -538,14 +539,12 @@ cleanup: extern int send_registration_msg(uint32_t status, bool startup) { - int ret_val = SLURM_SUCCESS; + int rc, ret_val = SLURM_SUCCESS; slurm_msg_t req; - slurm_msg_t resp; slurm_node_registration_status_msg_t *msg = xmalloc (sizeof (slurm_node_registration_status_msg_t)); slurm_msg_t_init(&req); - slurm_msg_t_init(&resp); msg->startup = (uint16_t) startup; _fill_registration_msg(msg); @@ -554,18 +553,14 @@ send_registration_msg(uint32_t status, bool startup) req.msg_type = MESSAGE_NODE_REGISTRATION_STATUS; req.data = msg; - if (slurm_send_recv_controller_msg(&req, &resp) < 0) { + if (slurm_send_recv_controller_rc_msg(&req, &rc) < 0) { error("Unable to register: %m"); ret_val = SLURM_FAILURE; } else { sent_reg_time = time(NULL); - slurm_free_return_code_msg(resp.data); } slurm_free_node_registration_status_msg (msg); - /* XXX look at response msg - */ - return ret_val; } @@ -584,6 +579,7 @@ _fill_registration_msg(slurm_node_registration_status_msg_t *msg) msg->node_name = xstrdup (conf->node_name); msg->cpus = conf->cpus; + msg->boards = conf->boards; msg->sockets = conf->sockets; msg->cores = conf->cores; msg->threads = conf->threads; @@ -605,15 +601,17 @@ _fill_registration_msg(slurm_node_registration_status_msg_t *msg) if (first_msg) { first_msg = false; - info("CPUs=%u Sockets=%u Cores=%u Threads=%u " + info("Procs=%u Boards=%u Sockets=%u Cores=%u Threads=%u " "Memory=%u TmpDisk=%u Uptime=%u", - msg->cpus, msg->sockets, msg->cores, msg->threads, - msg->real_memory, msg->tmp_disk, msg->up_time); + msg->cpus, msg->boards, msg->sockets, msg->cores, + msg->threads, msg->real_memory, msg->tmp_disk, + msg->up_time); } else { - debug3("CPUs=%u Sockets=%u Cores=%u Threads=%u " + debug3("Procs=%u Boards=%u Sockets=%u Cores=%u Threads=%u " "Memory=%u TmpDisk=%u Uptime=%u", - msg->cpus, msg->sockets, msg->cores, msg->threads, - msg->real_memory, msg->tmp_disk, msg->up_time); + msg->cpus, msg->boards, msg->sockets, msg->cores, + msg->threads, msg->real_memory, msg->tmp_disk, + msg->up_time); } uname(&buf); if ((arch = getenv("SLURM_ARCH"))) @@ -667,7 +665,6 @@ _fill_registration_msg(slurm_node_registration_status_msg_t *msg) } list_iterator_destroy(i); list_destroy(steps); - msg->timestamp = time(NULL); return; @@ -886,9 +883,10 @@ _read_config(void) } conf->port = slurm_conf_get_port(conf->node_name); - slurm_conf_get_cpus_sct(conf->node_name, - &conf->conf_cpus, &conf->conf_sockets, - &conf->conf_cores, &conf->conf_threads); + slurm_conf_get_cpus_bsct(conf->node_name, + &conf->conf_cpus, &conf->conf_boards, + &conf->conf_sockets, &conf->conf_cores, + &conf->conf_threads); /* store hardware properties in slurmd_config */ xfree(conf->block_map); @@ -909,6 +907,7 @@ _read_config(void) #else get_procs(&conf->actual_cpus); get_cpuinfo(conf->actual_cpus, + &conf->actual_boards, &conf->actual_sockets, &conf->actual_cores, &conf->actual_threads, @@ -923,6 +922,7 @@ _read_config(void) * Report actual hardware configuration, irrespective of FastSchedule. */ conf->cpus = conf->actual_cpus; + conf->boards = conf->actual_boards; conf->sockets = conf->actual_sockets; conf->cores = conf->actual_cores; conf->threads = conf->actual_threads; @@ -937,11 +937,13 @@ _read_config(void) ((cf->fast_schedule == 1) && (conf->actual_cpus < conf->conf_cpus))) { conf->cpus = conf->actual_cpus; + conf->boards = conf->actual_boards; conf->sockets = conf->actual_sockets; conf->cores = conf->actual_cores; conf->threads = conf->actual_threads; } else { conf->cpus = conf->conf_cpus; + conf->boards = conf->conf_boards; conf->sockets = conf->conf_sockets; conf->cores = conf->conf_cores; conf->threads = conf->conf_threads; @@ -992,6 +994,7 @@ _read_config(void) _massage_pathname(&conf->spooldir); _free_and_set(&conf->pidfile, xstrdup(cf->slurmd_pidfile)); _massage_pathname(&conf->pidfile); + _free_and_set(&conf->select_type, xstrdup(cf->select_type)); _free_and_set(&conf->task_prolog, xstrdup(cf->task_prolog)); _free_and_set(&conf->task_epilog, xstrdup(cf->task_epilog)); _free_and_set(&conf->pubkey, path_pubkey); @@ -1035,6 +1038,12 @@ _reconfigure(void) slurm_topo_build_config(); _set_topo_info(); + /* + * In case the administrator changed the cpu frequency set capabilities + * on this node, rebuild the cpu frequency table information + */ + cpu_freq_init(conf); + _print_conf(); /* @@ -1073,6 +1082,7 @@ _reconfigure(void) list_destroy(steps); gres_plugin_reconfig(&did_change); + (void) switch_g_reconfig(); if (did_change) { uint32_t cpu_cnt = MAX(conf->conf_cpus, conf->block_map_size); (void) gres_plugin_node_config_load(cpu_cnt); @@ -1106,6 +1116,10 @@ _print_conf(void) conf->cpus, conf->conf_cpus, conf->actual_cpus); + debug3("Boards = %-2u (CF: %2u, HW: %2u)", + conf->boards, + conf->conf_boards, + conf->actual_boards); debug3("Sockets = %-2u (CF: %2u, HW: %2u)", conf->sockets, conf->conf_sockets, @@ -1196,7 +1210,7 @@ _init_conf(void) static void _destroy_conf(void) { - if(conf) { + if (conf) { xfree(conf->block_map); xfree(conf->block_map_inv); xfree(conf->conffile); @@ -1211,6 +1225,7 @@ _destroy_conf(void) xfree(conf->pidfile); xfree(conf->prolog); xfree(conf->pubkey); + xfree(conf->select_type); xfree(conf->spooldir); xfree(conf->stepd_loc); xfree(conf->task_prolog); @@ -1247,6 +1262,7 @@ _print_config(void) #else get_procs(&conf->actual_cpus); get_cpuinfo(conf->actual_cpus, + &conf->actual_boards, &conf->actual_sockets, &conf->actual_cores, &conf->actual_threads, @@ -1421,8 +1437,13 @@ _slurmd_init(void) slurm_topo_build_config(); _set_topo_info(); + /* + * Check for cpu frequency set capabilities on this node + */ + cpu_freq_init(conf); + _print_conf(); - if (slurm_jobacct_gather_init() != SLURM_SUCCESS) + if (jobacct_gather_init() != SLURM_SUCCESS) return SLURM_FAILURE; if (slurm_proctrack_init() != SLURM_SUCCESS) return SLURM_FAILURE; @@ -1458,6 +1479,11 @@ _slurmd_init(void) */ if (!(conf->vctx = slurm_cred_verifier_ctx_create(conf->pubkey))) return SLURM_FAILURE; + if (!strcmp(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); + } /* * Create slurmd spool directory if necessary. @@ -1603,7 +1629,7 @@ _slurmd_fini(void) slurmd_req(NULL); /* purge memory allocated by slurmd_req() */ fini_setproctitle(); slurm_select_fini(); - slurm_jobacct_gather_fini(); + jobacct_gather_fini(); spank_slurmd_exit(); return SLURM_SUCCESS; } diff --git a/src/slurmd/slurmd/slurmd.h b/src/slurmd/slurmd/slurmd.h index d5eb54186efc0cd6ca2374839a5b4a479437d8bd..124f97bf4f2f2762882deca3c7e2762ebdf60cf3 100644 --- a/src/slurmd/slurmd/slurmd.h +++ b/src/slurmd/slurmd/slurmd.h @@ -77,14 +77,17 @@ typedef struct slurmd_config { int *argc; /* pointer to argument count */ char *hostname; /* local hostname */ uint16_t cpus; /* lowest-level logical processors */ - uint16_t sockets; /* sockets count */ - uint16_t cores; /* core count */ + uint16_t boards; /* total boards count */ + uint16_t sockets; /* total sockets count */ + uint16_t cores; /* core per socket count */ uint16_t threads; /* thread per core count */ uint16_t conf_cpus; /* conf file logical processors */ + uint16_t conf_boards; /* conf file boards count */ uint16_t conf_sockets; /* conf file sockets count */ uint16_t conf_cores; /* conf file core count */ uint16_t conf_threads; /* conf file thread per core count */ uint16_t actual_cpus; /* actual logical processors */ + uint16_t actual_boards; /* actual boards count */ uint16_t actual_sockets; /* actual sockets count */ uint16_t actual_cores; /* actual core count */ uint16_t actual_threads; /* actual thread per core count */ @@ -111,6 +114,7 @@ typedef struct slurmd_config { char *pubkey; /* location of job cred public key */ char *epilog; /* Path to Epilog script */ char *prolog; /* Path to prolog script */ + char *select_type; /* SelectType */ char *stepd_loc; /* slurmstepd path */ char *task_prolog; /* per-task prolog script */ char *task_epilog; /* per-task epilog script */ @@ -119,7 +123,7 @@ typedef struct slurmd_config { pid_t pid; /* server pid */ log_options_t log_opts; /* current logging options */ int debug_level; /* logging detail level */ - uint32_t debug_flags; /* DebugFlags configured */ + uint32_t debug_flags; /* DebugFlags configured */ int daemonize:1; /* daemonize flag */ int cleanstart:1; /* clean start requested (-c) */ int mlock_pages:1; /* mlock() slurmd */ @@ -130,6 +134,7 @@ typedef struct slurmd_config { uid_t slurm_user_id; /* UID that slurmctld runs as */ pthread_mutex_t config_mutex; /* lock for slurmd_config access */ uint16_t job_acct_gather_freq; + char *job_acct_gather_type; /* job accounting gather type */ uint16_t use_pam; uint16_t task_plugin_param; /* TaskPluginParams, expressed * using cpu_bind_type_t flags */ diff --git a/src/slurmd/slurmstepd/Makefile.am b/src/slurmd/slurmstepd/Makefile.am index 31d7b1ae532ee206dca7539be66fe61d10aac712..38794ef49c27484cc406fd470787448ae3e7af6b 100644 --- a/src/slurmd/slurmstepd/Makefile.am +++ b/src/slurmd/slurmstepd/Makefile.am @@ -30,9 +30,11 @@ slurmstepd_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. -slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) -Wl,-bmaxdata:0x0 +slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) -Wl,-bmaxdata:0x0 else -slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) endif force: diff --git a/src/slurmd/slurmstepd/Makefile.in b/src/slurmd/slurmstepd/Makefile.in index 8ddfddfe7b3ac769993b09b9d1dbe0d6eb4e1ba8..9126d0a77d87bdadae9e532680a658e8d0cfe70a 100644 --- a/src/slurmd/slurmstepd/Makefile.in +++ b/src/slurmd/slurmstepd/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -59,9 +59,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -69,6 +67,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -160,9 +159,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -170,9 +167,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -204,6 +200,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -231,6 +229,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -343,11 +342,15 @@ slurmstepd_SOURCES = \ multi_prog.c multi_prog.h \ step_terminate_monitor.c step_terminate_monitor.h -@HAVE_AIX_FALSE@slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +@HAVE_AIX_FALSE@slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ +@HAVE_AIX_FALSE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + # 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@slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) -Wl,-bmaxdata:0x0 +@HAVE_AIX_TRUE@slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ +@HAVE_AIX_TRUE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) -Wl,-bmaxdata:0x0 + all: all-am .SUFFIXES: @@ -425,7 +428,7 @@ clean-sbinPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -slurmstepd$(EXEEXT): $(slurmstepd_OBJECTS) $(slurmstepd_DEPENDENCIES) +slurmstepd$(EXEEXT): $(slurmstepd_OBJECTS) $(slurmstepd_DEPENDENCIES) $(EXTRA_slurmstepd_DEPENDENCIES) @rm -f slurmstepd$(EXEEXT) $(slurmstepd_LINK) $(slurmstepd_OBJECTS) $(slurmstepd_LDADD) $(LIBS) @@ -574,10 +577,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/slurmd/slurmstepd/io.c b/src/slurmd/slurmstepd/io.c index 8942700616daf89e427735c320e741de07b5faef..622fb40de66b05a6511adb4468723773bcd837ac 100644 --- a/src/slurmd/slurmstepd/io.c +++ b/src/slurmd/slurmstepd/io.c @@ -276,7 +276,7 @@ _client_writable(eio_obj_t *obj) } /* If this is a newly attached client its msg_queue needs - * to be intialized from the outgoing_cache, and then "obj" needs + * to be initialized from the outgoing_cache, and then "obj" needs * to be added to the List of clients. */ if (client->msg_queue == NULL) { diff --git a/src/slurmd/slurmstepd/mgr.c b/src/slurmd/slurmstepd/mgr.c index dc8fdb19a73af6d4e2b07f4c9e8866e45dc2769b..1fb304733f936f468c3f7f14771a75e3bbf2d817 100644 --- a/src/slurmd/slurmstepd/mgr.c +++ b/src/slurmd/slurmstepd/mgr.c @@ -85,6 +85,7 @@ #include "slurm/slurm_errno.h" #include "src/common/cbuf.h" +#include "src/common/cpu_frequency.h" #include "src/common/env.h" #include "src/common/fd.h" #include "src/common/forward.h" @@ -291,7 +292,7 @@ static int _call_select_plugin_from_stepd(slurmd_job_t *job, uint64_t pagg_id, SELECT_JOBDATA_RESV_ID, &job->resv_id); if (pagg_id) select_g_select_jobinfo_set(fake_job_record.select_jobinfo, - SELECT_JOBDATA_PAGG_ID, &pagg_id); + SELECT_JOBDATA_PAGG_ID, &pagg_id); rc = (*select_fn)(&fake_job_record); select_g_select_jobinfo_free(fake_job_record.select_jobinfo); return rc; @@ -668,7 +669,7 @@ _wait_for_children_slurmstepd(slurmd_job_t *job) while((left = bit_clear_count(step_complete.bits)) > 0) { debug3("Rank %d waiting for %d (of %d) children", - step_complete.rank, left, step_complete.children); + step_complete.rank, left, step_complete.children); rc = pthread_cond_timedwait(&step_complete.cond, &step_complete.lock, &ts); if (rc == ETIMEDOUT) { @@ -719,12 +720,12 @@ _one_step_complete_msg(slurmd_job_t *job, int first, int last) msg.range_first = first; msg.range_last = last; msg.step_rc = step_complete.step_rc; - msg.jobacct = jobacct_gather_g_create(NULL); + msg.jobacct = jobacctinfo_create(NULL); /************* acct stuff ********************/ if (!acct_sent) { - jobacct_gather_g_aggregate(step_complete.jobacct, job->jobacct); - jobacct_gather_g_getinfo(step_complete.jobacct, - JOBACCT_DATA_TOTAL, msg.jobacct); + jobacctinfo_aggregate(step_complete.jobacct, job->jobacct); + jobacctinfo_getinfo(step_complete.jobacct, + JOBACCT_DATA_TOTAL, msg.jobacct); acct_sent = true; } /*********************************************/ @@ -781,7 +782,7 @@ _one_step_complete_msg(slurmd_job_t *job, int first, int last) } finished: - jobacct_gather_g_destroy(msg.jobacct); + jobacctinfo_destroy(msg.jobacct); } /* Given a starting bit in the step_complete.bits bitstring, "start", @@ -906,7 +907,7 @@ job_manager(slurmd_job_t *job) (slurmd_task_init() != SLURM_SUCCESS) || (slurm_proctrack_init() != SLURM_SUCCESS) || (checkpoint_init(ckpt_type) != SLURM_SUCCESS) || - (slurm_jobacct_gather_init() != SLURM_SUCCESS)) { + (jobacct_gather_init() != SLURM_SUCCESS)) { rc = SLURM_PLUGIN_NAME_INVALID; goto fail1; } @@ -970,8 +971,8 @@ job_manager(slurmd_job_t *job) debug2("After call to spank_init()"); /* Call interconnect_init() before becoming user */ - if (!job->batch && - (interconnect_init(job->switch_job, job->uid) < 0)) { + if (!job->batch && job->argv && + (interconnect_init(job->switch_job, job->uid, job->argv[0]) < 0)) { /* error("interconnect_init: %m"); already logged */ rc = ESLURM_INTERCONNECT_FAILURE; goto fail2; @@ -1017,13 +1018,13 @@ job_manager(slurmd_job_t *job) * information here */ if(!conf->job_acct_gather_freq) - jobacct_gather_g_stat_task(0); + jobacct_gather_stat_task(0); /* Send job launch response with list of pids */ _send_launch_resp(job, 0); _wait_for_all_tasks(job); - jobacct_gather_g_endpoll(); + jobacct_gather_endpoll(); job->state = SLURMSTEPD_STEP_ENDING; @@ -1032,7 +1033,7 @@ job_manager(slurmd_job_t *job) error("interconnect_fini: %m"); } - fail2: +fail2: /* * First call interconnect_postfini() - In at least one case, * this will clean up any straggling processes. If this call @@ -1052,7 +1053,7 @@ job_manager(slurmd_job_t *job) step_terminate_monitor_stop(); if (!job->batch) { if (interconnect_postfini(job->switch_job, job->jmgr_pid, - job->jobid, job->stepid) < 0) + job->jobid, job->stepid) < 0) error("interconnect_postfini: %m"); } @@ -1062,9 +1063,17 @@ job_manager(slurmd_job_t *job) if (!job->batch && !job->user_managed_io && io_initialized) _wait_for_io(job); + /* + * Reset cpu frequency if it was changed + */ + + if (job->cpu_freq != NO_VAL) + cpu_freq_reset(job); + /* * Warn task plugin that the user's step have terminated */ + post_step(job); /* @@ -1082,7 +1091,7 @@ job_manager(slurmd_job_t *job) } debug2("After call to spank_fini()"); - fail1: +fail1: /* If interactive job startup was abnormal, * be sure to notify client. */ @@ -1148,8 +1157,10 @@ static void exec_wait_info_destroy (struct exec_wait_info *e) if (e == NULL) return; - close (e->parentfd); - close (e->childfd); + if (e->parentfd >= 0) + close (e->parentfd); + if (e->childfd >= 0) + close (e->childfd); e->id = -1; e->pid = -1; } @@ -1172,9 +1183,17 @@ static struct exec_wait_info * fork_child_with_wait_info (int id) exec_wait_info_destroy (e); return (NULL); } - else if (e->pid == 0) /* In child, close parent fd */ + /* + * Close parentfd in child, and childfd in parent: + */ + if (e->pid == 0) { close (e->parentfd); - + e->parentfd = -1; + } + else { + close (e->childfd); + e->childfd = -1; + } return (e); } @@ -1206,6 +1225,47 @@ static int exec_wait_signal (struct exec_wait_info *e, slurmd_job_t *job) return (0); } +/* + * Send SIGKILL to child in exec_wait_info 'e' + * Returns 0 for success, -1 for failure. + */ +static int exec_wait_kill_child (struct exec_wait_info *e) +{ + if (e->pid < 0) + return (-1); + if (kill (e->pid, SIGKILL) < 0) + return (-1); + e->pid = -1; + return (0); +} + +/* + * Send all children in exec_wait_list SIGKILL. + * Returns 0 for success or < 0 on failure. + */ +static int exec_wait_kill_children (List exec_wait_list) +{ + int rc = 0; + int count; + struct exec_wait_info *e; + ListIterator i; + + if ((count = list_count (exec_wait_list)) == 0) + return (0); + + verbose ("Killing %d remaining child%s", + count, (count > 1 ? "ren" : "")); + + i = list_iterator_create (exec_wait_list); + if (i == NULL) + return error ("exec_wait_kill_children: iterator_create: %m"); + + while ((e = list_next (i))) + rc += exec_wait_kill_child (e); + list_iterator_destroy (i); + return (rc); +} + static void prepare_stdio (slurmd_job_t *job, slurmd_task_info_t *task) { #ifdef HAVE_PTY_H @@ -1337,6 +1397,7 @@ _fork_all_tasks(slurmd_job_t *job, bool *io_initialized) if ((ei = fork_child_with_wait_info (i)) == NULL) { error("child fork: %m"); + exec_wait_kill_children (exec_wait_list); rc = SLURM_ERROR; goto fail4; } else if ((pid = exec_wait_get_pid (ei)) == 0) { /* child */ @@ -1351,7 +1412,7 @@ _fork_all_tasks(slurmd_job_t *job, bool *io_initialized) #ifdef HAVE_AIX (void) mkcrid(0); #endif - /* jobacct_gather_g_endpoll(); + /* jobacctinfo_endpoll(); * closing jobacct files here causes deadlock */ if (conf->propagate_prio) @@ -1388,7 +1449,8 @@ _fork_all_tasks(slurmd_job_t *job, bool *io_initialized) * children in any process groups or containers * before they make a call to exec(2). */ - exec_wait_child_wait_for_parent (ei); + if (exec_wait_child_wait_for_parent (ei) < 0) + exit (1); exec_task(job, i); } @@ -1401,7 +1463,7 @@ _fork_all_tasks(slurmd_job_t *job, bool *io_initialized) LOG_TIMESTAMP(time_stamp); verbose ("task %lu (%lu) started %s", - (unsigned long) job->task[i]->gtid, + (unsigned long) job->task[i]->gtid, (unsigned long) pid, time_stamp); job->task[i]->pid = pid; @@ -1440,12 +1502,12 @@ _fork_all_tasks(slurmd_job_t *job, bool *io_initialized) * has already set its process group as desired */ if ((job->pty == 0) - && (setpgid (job->task[i]->pid, job->pgid) < 0)) { + && (setpgid (job->task[i]->pid, job->pgid) < 0)) { error("Unable to put task %d (pid %d) into " "pgrp %d: %m", - i, - job->task[i]->pid, - job->pgid); + i, + job->task[i]->pid, + job->pgid); } if (slurm_container_add(job, job->task[i]->pid) @@ -1457,8 +1519,7 @@ _fork_all_tasks(slurmd_job_t *job, bool *io_initialized) jobacct_id.nodeid = job->nodeid; jobacct_id.taskid = job->task[i]->gtid; jobacct_id.job = job; - jobacct_gather_g_add_task(job->task[i]->pid, - &jobacct_id); + jobacct_gather_add_task(job->task[i]->pid, &jobacct_id); if (spank_task_post_fork (job, i) < 0) { error ("spank task %d post-fork failed", i); @@ -1466,7 +1527,7 @@ _fork_all_tasks(slurmd_job_t *job, bool *io_initialized) goto fail2; } } - jobacct_gather_g_set_proctrack_container_id(job->cont_id); + jobacct_gather_set_proctrack_container_id(job->cont_id); /* * Now it's ok to unblock the tasks, so they may call exec. @@ -1480,7 +1541,7 @@ _fork_all_tasks(slurmd_job_t *job, bool *io_initialized) * (if specified and able) */ if (pdebug_trace_process(job, job->task[i]->pid) - == SLURM_ERROR) + == SLURM_ERROR) rc = SLURM_ERROR; } @@ -1612,12 +1673,12 @@ _wait_for_any_task(slurmd_job_t *job, bool waitflag) } /************* acct stuff ********************/ - jobacct = jobacct_gather_g_remove_task(pid); + jobacct = jobacct_gather_remove_task(pid); if (jobacct) { - jobacct_gather_g_setinfo(jobacct, - JOBACCT_DATA_RUSAGE, &rusage); - jobacct_gather_g_aggregate(job->jobacct, jobacct); - jobacct_gather_g_destroy(jobacct); + jobacctinfo_setinfo(jobacct, + JOBACCT_DATA_RUSAGE, &rusage); + jobacctinfo_aggregate(job->jobacct, jobacct); + jobacctinfo_destroy(jobacct); } /*********************************************/ @@ -1789,7 +1850,7 @@ _make_batch_dir(slurmd_job_t *job) return xstrdup(path); - error: +error: return NULL; } @@ -1806,7 +1867,7 @@ _make_batch_script(batch_job_launch_msg_t *msg, char *path) snprintf(script, sizeof(script), "%s/%s", path, "slurm_script"); - again: +again: if ((fp = safeopen(script, "w", SAFEOPEN_CREATE_ONLY)) == NULL) { if ((errno != EEXIST) || (unlink(script) < 0)) { error("couldn't open `%s': %m", script); @@ -1838,7 +1899,7 @@ _make_batch_script(batch_job_launch_msg_t *msg, char *path) return xstrdup(script); - error: +error: (void) unlink(script); return NULL; @@ -1963,15 +2024,22 @@ _send_launch_resp(slurmd_job_t *job, int rc) static int _send_complete_batch_script_msg(slurmd_job_t *job, int err, int status) { - int rc, i; + int rc, i, msg_rc; slurm_msg_t req_msg; complete_batch_script_msg_t req; + char * select_type; + bool msg_to_ctld; + + select_type = slurm_get_select_type(); + msg_to_ctld = strcmp(select_type, "select/serial"); + xfree(select_type); req.job_id = job->jobid; req.job_rc = status; - req.slurm_rc = err; req.jobacct = job->jobacct; req.node_name = job->node_name; + req.slurm_rc = err; + req.user_id = (uint32_t) job->uid; slurm_msg_t_init(&req_msg); req_msg.msg_type= REQUEST_COMPLETE_BATCH_SCRIPT; req_msg.data = &req; @@ -1979,8 +2047,19 @@ _send_complete_batch_script_msg(slurmd_job_t *job, int err, int status) info("sending REQUEST_COMPLETE_BATCH_SCRIPT, error:%u", err); /* Note: these log messages don't go to slurmd.log from here */ - for (i=0; i<=MAX_RETRY; i++) { - if (slurm_send_recv_controller_rc_msg(&req_msg, &rc) == 0) + for (i = 0; i <= MAX_RETRY; i++) { + if (msg_to_ctld) { + msg_rc = slurm_send_recv_controller_rc_msg(&req_msg, + &rc); + } else { + if (i == 0) { + slurm_set_addr_char(&req_msg.address, + conf->port, "localhost"); + } + msg_rc = slurm_send_recv_rc_msg_only_one(&req_msg, + &rc, 0); + } + if (msg_rc == SLURM_SUCCESS) break; info("Retrying job complete RPC for %u.%u", job->jobid, job->stepid); @@ -2228,10 +2307,10 @@ _initgroups(slurmd_job_t *job) if ((rc = initgroups(username, gid))) { if ((errno == EPERM) && (getuid() != (uid_t) 0)) { debug("Error in initgroups(%s, %ld): %m", - username, (long)gid); + username, (long)gid); } else { error("Error in initgroups(%s, %ld): %m", - username, (long)gid); + username, (long)gid); } return -1; } diff --git a/src/slurmd/slurmstepd/pam_ses.c b/src/slurmd/slurmstepd/pam_ses.c index 57d4f43fef85642184e410b605ea2bd898524204..93afa8f8c5f628fcad82773401e9d947a8afec10 100644 --- a/src/slurmd/slurmstepd/pam_ses.c +++ b/src/slurmd/slurmstepd/pam_ses.c @@ -90,7 +90,7 @@ pam_setup (char *user, char *host) * handling resource limits. When a PAM session is opened on behalf of * a user, the limits imposed by the sys admin are picked up. Opening * a PAM session requires a PAM handle, which is obtained when the PAM - * interface is intialized. (PAM handles are required with essentially + * interface is initialized. (PAM handles are required with essentially * all PAM calls.) It's also necessary to have the users PAM credentials * to open a user session. */ diff --git a/src/slurmd/slurmstepd/req.c b/src/slurmd/slurmstepd/req.c index 3f3e5e2430dfb4e6e8837d29d6c6108385d8481d..407659cb679d94886eaab25f6b39a457784255f4 100644 --- a/src/slurmd/slurmstepd/req.c +++ b/src/slurmd/slurmstepd/req.c @@ -49,6 +49,7 @@ #include #include +#include "src/common/cpu_frequency.h" #include "src/common/fd.h" #include "src/common/eio.h" #include "src/common/parse_time.h" @@ -58,6 +59,7 @@ #include "src/common/stepd_api.h" #include "src/common/xmalloc.h" #include "src/common/xstring.h" +#include "src/common/checkpoint.h" #include "src/slurmd/slurmd/slurmd.h" #include "src/slurmd/slurmstepd/io.h" @@ -1175,7 +1177,7 @@ _handle_suspend(int fd, slurmd_job_t *job, uid_t uid) goto done; } - jobacct_gather_g_suspend_poll(); + jobacct_gather_suspend_poll(); /* * Signal the container @@ -1210,6 +1212,10 @@ _handle_suspend(int fd, slurmd_job_t *job, uid_t uid) } suspended = true; } + /* reset the cpu frequencies if cpu_freq option used */ + if (job->cpu_freq != NO_VAL) + cpu_freq_reset(job); + pthread_mutex_unlock(&suspend_mutex); done: @@ -1247,7 +1253,7 @@ _handle_resume(int fd, slurmd_job_t *job, uid_t uid) goto done; } - jobacct_gather_g_resume_poll(); + jobacct_gather_resume_poll(); /* * Signal the container */ @@ -1266,6 +1272,10 @@ _handle_resume(int fd, slurmd_job_t *job, uid_t uid) } suspended = false; } + /* set the cpu frequencies if cpu_freq option used */ + if (job->cpu_freq != NO_VAL) + cpu_freq_set(job); + pthread_mutex_unlock(&suspend_mutex); done: @@ -1326,12 +1336,12 @@ _handle_completion(int fd, slurmd_job_t *job, uid_t uid, int protocol) buf = xmalloc(len); safe_read(fd, buf, len); buffer = create_buf(buf, len); - jobacct_gather_g_unpack(&jobacct, SLURM_PROTOCOL_VERSION, + jobacctinfo_unpack(&jobacct, SLURM_PROTOCOL_VERSION, buffer); free_buf(buffer); } else { - jobacct = jobacct_gather_g_create(NULL); - jobacct_gather_g_getinfo(jobacct, JOBACCT_DATA_PIPE, &fd); + jobacct = jobacctinfo_create(NULL); + jobacctinfo_getinfo(jobacct, JOBACCT_DATA_PIPE, &fd); } /* @@ -1368,9 +1378,9 @@ _handle_completion(int fd, slurmd_job_t *job, uid_t uid, int protocol) step_complete.step_rc = MAX(step_complete.step_rc, step_rc); /************* acct stuff ********************/ - jobacct_gather_g_aggregate(step_complete.jobacct, jobacct); + jobacctinfo_aggregate(step_complete.jobacct, jobacct); timeout: - jobacct_gather_g_destroy(jobacct); + jobacctinfo_destroy(jobacct); /*********************************************/ /* Send the return code and errno, we do this within the locked @@ -1407,24 +1417,24 @@ _handle_stat_jobacct(int fd, slurmd_job_t *job, uid_t uid) "owned by uid %ld", (long)uid, job->jobid, job->stepid, (long)job->uid); /* Send NULL */ - jobacct_gather_g_setinfo(jobacct, JOBACCT_DATA_PIPE, &fd); + jobacctinfo_setinfo(jobacct, JOBACCT_DATA_PIPE, &fd); return SLURM_ERROR; } - jobacct = jobacct_gather_g_create(NULL); + jobacct = jobacctinfo_create(NULL); debug3("num tasks = %d", job->node_tasks); for (i = 0; i < job->node_tasks; i++) { - temp_jobacct = jobacct_gather_g_stat_task(job->task[i]->pid); + temp_jobacct = jobacct_gather_stat_task(job->task[i]->pid); if(temp_jobacct) { - jobacct_gather_g_aggregate(jobacct, temp_jobacct); - jobacct_gather_g_destroy(temp_jobacct); + jobacctinfo_aggregate(jobacct, temp_jobacct); + jobacctinfo_destroy(temp_jobacct); num_tasks++; } } - jobacct_gather_g_setinfo(jobacct, JOBACCT_DATA_PIPE, &fd); + jobacctinfo_setinfo(jobacct, JOBACCT_DATA_PIPE, &fd); safe_write(fd, &num_tasks, sizeof(int)); - jobacct_gather_g_destroy(jobacct); + jobacctinfo_destroy(jobacct); return SLURM_SUCCESS; rwfail: return SLURM_ERROR; diff --git a/src/slurmd/slurmstepd/slurmstepd.c b/src/slurmd/slurmstepd/slurmstepd.c index 1ffaa34bc3b76f74ffab5038f9e4dab42b7feab6..3e71928d1ae545c488c0849fccaa517cef8b67e2 100644 --- a/src/slurmd/slurmstepd/slurmstepd.c +++ b/src/slurmd/slurmstepd/slurmstepd.c @@ -47,6 +47,7 @@ #include #include +#include "src/common/cpu_frequency.h" #include "src/common/gres.h" #include "src/common/slurm_jobacct_gather.h" #include "src/common/slurm_rlimits_info.h" @@ -55,6 +56,7 @@ #include "src/common/xmalloc.h" #include "src/common/xsignal.h" #include "src/common/plugstack.h" +#include "src/common/node_select.h" #include "src/slurmd/common/slurmstepd_init.h" #include "src/slurmd/common/setproctitle.h" @@ -381,7 +383,7 @@ _init_from_slurmd(int sock, char **argv, safe_read(sock, &step_complete.max_depth, sizeof(int)); safe_read(sock, &step_complete.parent_addr, sizeof(slurm_addr_t)); step_complete.bits = bit_alloc(step_complete.children); - step_complete.jobacct = jobacct_gather_g_create(NULL); + step_complete.jobacct = jobacctinfo_create(NULL); pthread_mutex_unlock(&step_complete.lock); /* receive conf from slurmd */ @@ -391,7 +393,7 @@ _init_from_slurmd(int sock, char **argv, debug2("debug level is %d.", conf->debug_level); /* acct info */ - jobacct_gather_g_startpoll(conf->job_acct_gather_freq); + jobacct_gather_startpoll(conf->job_acct_gather_freq); switch_g_slurmd_step_init(); @@ -428,6 +430,9 @@ _init_from_slurmd(int sock, char **argv, /* Receive GRES information from slurmd */ gres_plugin_recv_stepd(sock); + /* Receive cpu_frequency info from slurmd */ + cpu_freq_recv_info(sock); + /* receive req from slurmd */ safe_read(sock, &len, sizeof(int)); incoming_buffer = xmalloc(sizeof(char) * len); @@ -436,6 +441,7 @@ _init_from_slurmd(int sock, char **argv, msg = xmalloc(sizeof(slurm_msg_t)); slurm_msg_t_init(msg); + msg->protocol_version = SLURM_PROTOCOL_VERSION; switch(step_type) { case LAUNCH_BATCH_JOB: @@ -504,7 +510,7 @@ _step_setup(slurm_addr_t *cli, slurm_addr_t *self, slurm_msg_t *msg) } job->jmgr_pid = getpid(); - job->jobacct = jobacct_gather_g_create(NULL); + job->jobacct = jobacctinfo_create(NULL); /* Establish GRES environment variables */ if (conf->debug_flags & DEBUG_FLAG_GRES) { @@ -533,7 +539,7 @@ static void _step_cleanup(slurmd_job_t *job, slurm_msg_t *msg, int rc) { if (job) { - jobacct_gather_g_destroy(job->jobacct); + jobacctinfo_destroy(job->jobacct); if (!job->batch) job_destroy(job); } @@ -553,7 +559,7 @@ _step_cleanup(slurmd_job_t *job, slurm_msg_t *msg, int rc) fatal("handle_launch_message: Unrecognized launch RPC"); break; } - jobacct_gather_g_destroy(step_complete.jobacct); + jobacctinfo_destroy(step_complete.jobacct); xfree(msg); } diff --git a/src/slurmd/slurmstepd/slurmstepd_job.c b/src/slurmd/slurmstepd/slurmstepd_job.c index 7855d1f7a410872f0e147b58a655679bfb5deeaa..0ece10d9ca5d9ea0828ef37074ea6e7d6982e111 100644 --- a/src/slurmd/slurmstepd/slurmstepd_job.c +++ b/src/slurmd/slurmstepd/slurmstepd_job.c @@ -220,6 +220,7 @@ job_create(launch_tasks_request_msg_t *msg) job->cpu_bind = xstrdup(msg->cpu_bind); job->mem_bind_type = msg->mem_bind_type; job->mem_bind = xstrdup(msg->mem_bind); + job->cpu_freq = msg->cpu_freq; job->ckpt_dir = xstrdup(msg->ckpt_dir); job->restart_dir = xstrdup(msg->restart_dir); job->cpus_per_task = msg->cpus_per_task; @@ -279,7 +280,7 @@ job_create(launch_tasks_request_msg_t *msg) job->debug = msg->slurmd_debug; job->cpus = msg->cpus_allocated[nodeid]; if (msg->acctg_freq != (uint16_t) NO_VAL) - jobacct_gather_g_change_poll(msg->acctg_freq); + jobacct_gather_change_poll(msg->acctg_freq); job->multi_prog = msg->multi_prog; job->timelimit = (time_t) -1; job->task_flags = msg->task_flags; @@ -291,10 +292,10 @@ job_create(launch_tasks_request_msg_t *msg) &job->job_alloc_cores, &job->step_alloc_cores, &job->job_mem, &job->step_mem); if (job->step_mem) { - jobacct_common_set_mem_limit(job->jobid, job->stepid, + jobacct_gather_set_mem_limit(job->jobid, job->stepid, job->step_mem); } else if (job->job_mem) { - jobacct_common_set_mem_limit(job->jobid, job->stepid, + jobacct_gather_set_mem_limit(job->jobid, job->stepid, job->job_mem); } @@ -378,7 +379,7 @@ job_batch_job_create(batch_job_launch_msg_t *msg) job->batch = true; if (msg->acctg_freq != (uint16_t) NO_VAL) - jobacct_gather_g_change_poll(msg->acctg_freq); + jobacct_gather_change_poll(msg->acctg_freq); job->multi_prog = 0; job->open_mode = msg->open_mode; job->overcommit = (bool) msg->overcommit; @@ -414,11 +415,10 @@ job_batch_job_create(batch_job_launch_msg_t *msg) format_core_allocs(msg->cred, conf->node_name, &job->job_alloc_cores, &job->step_alloc_cores, &job->job_mem, &job->step_mem); - if (job->step_mem) { - jobacct_common_set_mem_limit(job->jobid, NO_VAL, - job->step_mem); - } else if (job->job_mem) - jobacct_common_set_mem_limit(job->jobid, NO_VAL, job->job_mem); + if (job->step_mem) + jobacct_gather_set_mem_limit(job->jobid, NO_VAL, job->step_mem); + else if (job->job_mem) + jobacct_gather_set_mem_limit(job->jobid, NO_VAL, job->job_mem); get_cred_gres(msg->cred, conf->node_name, &job->job_gres_list, &job->step_gres_list); diff --git a/src/slurmd/slurmstepd/slurmstepd_job.h b/src/slurmd/slurmstepd/slurmstepd_job.h index 5dd5a7a127a5c65e90a0d87e966f6e15424f791e..8204690041d91b56eb827afe8a809db33c500f2e 100644 --- a/src/slurmd/slurmstepd/slurmstepd_job.h +++ b/src/slurmd/slurmstepd/slurmstepd_job.h @@ -134,6 +134,7 @@ typedef struct slurmd_job { char *cpu_bind; /* binding map for map/mask_cpu */ mem_bind_type_t mem_bind_type; /* --mem_bind= */ char *mem_bind; /* binding map for tasks to memory */ + uint32_t cpu_freq; /* requested cpu frequency */ switch_jobinfo_t *switch_job; /* switch-specific job information */ uid_t uid; /* user id for job */ gid_t gid; /* group ID for job */ @@ -232,7 +233,7 @@ slurmd_task_info_t * task_info_create(int taskid, int gtaskid, static inline slurmd_task_info_t * job_task_info_by_pid (slurmd_job_t *job, pid_t pid) { - int i; + uint32_t i; for (i = 0; i < job->node_tasks; i++) { if (job->task[i]->pid == pid) return (job->task[i]); diff --git a/src/slurmd/slurmstepd/task.c b/src/slurmd/slurmstepd/task.c index 0137fdc7edb5f01c90be2a63c84f375a8f60ba99..9b371e75af637d4dba0a9904fa029866bf1301ae 100644 --- a/src/slurmd/slurmstepd/task.c +++ b/src/slurmd/slurmstepd/task.c @@ -354,6 +354,7 @@ exec_task(slurmd_job_t *job, int i) job->envtp->distribution = job->task_dist; job->envtp->cpu_bind = xstrdup(job->cpu_bind); job->envtp->cpu_bind_type = job->cpu_bind_type; + job->envtp->cpu_freq = job->cpu_freq; job->envtp->mem_bind = xstrdup(job->mem_bind); job->envtp->mem_bind_type = job->mem_bind_type; job->envtp->distribution = -1; diff --git a/src/slurmdbd/Makefile.am b/src/slurmdbd/Makefile.am index 15a91a5727aac873dd7ec50ddb0e6fa7f3885d85..caac3a1e10cbfc2118a77d3cefe4ed1db1a12eac 100644 --- a/src/slurmdbd/Makefile.am +++ b/src/slurmdbd/Makefile.am @@ -27,7 +27,8 @@ slurmdbd_SOURCES = \ slurmdbd.c \ slurmdbd.h -slurmdbd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmdbd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(slurmdbd_LDADD) : force diff --git a/src/slurmdbd/Makefile.in b/src/slurmdbd/Makefile.in index 69e984e5d8d72c80079d93a25023460133805d4a..2c090e71ed81a49279cf1a0643f19640d9dbe9d3 100644 --- a/src/slurmdbd/Makefile.in +++ b/src/slurmdbd/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -59,9 +59,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -69,6 +67,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -156,9 +155,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -166,9 +163,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -200,6 +196,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -227,6 +225,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -338,7 +337,9 @@ slurmdbd_SOURCES = \ slurmdbd.c \ slurmdbd.h -slurmdbd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmdbd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -416,7 +417,7 @@ clean-sbinPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -slurmdbd$(EXEEXT): $(slurmdbd_OBJECTS) $(slurmdbd_DEPENDENCIES) +slurmdbd$(EXEEXT): $(slurmdbd_OBJECTS) $(slurmdbd_DEPENDENCIES) $(EXTRA_slurmdbd_DEPENDENCIES) @rm -f slurmdbd$(EXEEXT) $(slurmdbd_LINK) $(slurmdbd_OBJECTS) $(slurmdbd_LDADD) $(LIBS) @@ -559,10 +560,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/slurmdbd/proc_req.c b/src/slurmdbd/proc_req.c index db797e0aafb58458e8b070832ef07a7ebc74a071..32aaf50d2713b8d4a644a0cd6b8c04a20751501d 100644 --- a/src/slurmdbd/proc_req.c +++ b/src/slurmdbd/proc_req.c @@ -36,11 +36,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ +#include "src/common/xstring.h" #include "src/common/macros.h" #include "src/common/pack.h" #include "src/common/slurmdbd_defs.h" #include "src/common/slurm_accounting_storage.h" -#include "src/common/jobacct_common.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/slurm_protocol_api.h" #include "src/common/slurm_protocol_defs.h" #include "src/common/uid.h" diff --git a/src/smap/Makefile.am b/src/smap/Makefile.am index 67438cfbc93a9217b99dc5cd8bf34dc5173387e7..4b8ff3c6535a806c8a3209e7342c883480a02a3a 100644 --- a/src/smap/Makefile.am +++ b/src/smap/Makefile.am @@ -33,7 +33,8 @@ force: $(smap_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -smap_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +smap_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) else diff --git a/src/smap/Makefile.in b/src/smap/Makefile.in index 7a6584333e6c8890cc4f43fd4c1c8bcd910dc93b..3c836f7f7f98bdd8e947e7d066c68c4509838237 100644 --- a/src/smap/Makefile.in +++ b/src/smap/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -66,9 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -76,6 +74,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -176,9 +175,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -186,9 +183,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -220,6 +216,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -247,6 +245,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -347,7 +346,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) @BUILD_SMAP_TRUE@smap_LDADD = $(top_builddir)/src/api/libslurm.o \ @BUILD_SMAP_TRUE@ $(DL_LIBS) $(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_TRUE@smap_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ +@BUILD_SMAP_TRUE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + @BUILD_SMAP_FALSE@EXTRA_smap_SOURCES = smap.h smap.c \ @BUILD_SMAP_FALSE@ job_functions.c partition_functions.c \ @BUILD_SMAP_FALSE@ configure_functions.c grid_functions.c \ @@ -430,7 +431,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -smap$(EXEEXT): $(smap_OBJECTS) $(smap_DEPENDENCIES) +smap$(EXEEXT): $(smap_OBJECTS) $(smap_DEPENDENCIES) $(EXTRA_smap_DEPENDENCIES) @rm -f smap$(EXEEXT) $(smap_LINK) $(smap_OBJECTS) $(smap_LDADD) $(LIBS) @@ -574,10 +575,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sprio/Makefile.am b/src/sprio/Makefile.am index a2d2abe194551856d6f3cf54926308841a5c741d..c7d76bd21439500ee405438bb03651b18fa2aba3 100644 --- a/src/sprio/Makefile.am +++ b/src/sprio/Makefile.am @@ -16,5 +16,6 @@ force: $(sprio_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sprio_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sprio_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/sprio/Makefile.in b/src/sprio/Makefile.in index c9c7829ba30a5faaf2c5747fb51104a3a69e2408..1da78935b40961a512c73cf47e1e0e7a9360e9b1 100644 --- a/src/sprio/Makefile.in +++ b/src/sprio/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -61,9 +61,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -71,6 +69,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -157,9 +156,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -167,9 +164,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -201,6 +197,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -228,6 +226,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -323,7 +322,9 @@ INCLUDES = -I$(top_srcdir) sprio_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = sprio.h print.h sprio_SOURCES = sprio.c print.c opts.c -sprio_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sprio_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -401,7 +402,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sprio$(EXEEXT): $(sprio_OBJECTS) $(sprio_DEPENDENCIES) +sprio$(EXEEXT): $(sprio_OBJECTS) $(sprio_DEPENDENCIES) $(EXTRA_sprio_DEPENDENCIES) @rm -f sprio$(EXEEXT) $(sprio_LINK) $(sprio_OBJECTS) $(sprio_LDADD) $(LIBS) @@ -541,10 +542,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/squeue/Makefile.am b/src/squeue/Makefile.am index ee56435c1110e2c944a626144abf0fa0712d8dd7..9ce4fbcf6dee05b7bed49cc5de6786993ecf9d7c 100644 --- a/src/squeue/Makefile.am +++ b/src/squeue/Makefile.am @@ -16,5 +16,6 @@ force: $(squeue_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -squeue_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +squeue_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/squeue/Makefile.in b/src/squeue/Makefile.in index 7f9c812aeba72edf366a8c07ee650ef9201f2969..6bbbccc5218e5776f1f2d4429908a1cc4fcf51cf 100644 --- a/src/squeue/Makefile.in +++ b/src/squeue/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -61,9 +61,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -71,6 +69,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -158,9 +157,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -168,9 +165,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -202,6 +198,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -229,6 +227,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -324,7 +323,9 @@ INCLUDES = -I$(top_srcdir) squeue_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = squeue.h print.h squeue_SOURCES = squeue.c print.c opts.c sort.c -squeue_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +squeue_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -402,7 +403,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -squeue$(EXEEXT): $(squeue_OBJECTS) $(squeue_DEPENDENCIES) +squeue$(EXEEXT): $(squeue_OBJECTS) $(squeue_DEPENDENCIES) $(EXTRA_squeue_DEPENDENCIES) @rm -f squeue$(EXEEXT) $(squeue_LINK) $(squeue_OBJECTS) $(squeue_LDADD) $(LIBS) @@ -543,10 +544,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/squeue/print.c b/src/squeue/print.c index e020fbcbd2ad26b502b8e104fa2f59cb04abb9a3..ce123d85725663738b264b11a2f26bc5dbbd7eb4 100644 --- a/src/squeue/print.c +++ b/src/squeue/print.c @@ -751,10 +751,18 @@ int _print_job_num_nodes(job_info_t * job, int width, bool right_justify, static int _get_node_cnt(job_info_t * job) { int node_cnt = 0, round; - bool completing = job->job_state & JOB_COMPLETING; - uint16_t base_job_state = job->job_state & (~JOB_COMPLETING); - if (base_job_state == JOB_PENDING || completing) { + /* For PENDING jobs, return the maximum of the requested nodelist, + * requested maximum number of nodes, or requested CPUs rounded + * to nearest node. + * + * For COMPLETING jobs, the job->nodes nodelist has already been + * altered to list only the nodes still in the comp state, and + * thus we count only those nodes toward the total nodes still + * allocated to this job. + */ + + if (IS_JOB_PENDING(job)) { node_cnt = _nodes_in_list(job->req_nodes); node_cnt = MAX(node_cnt, job->num_nodes); round = job->num_cpus + params.max_cpus - 1; diff --git a/src/sreport/Makefile.am b/src/sreport/Makefile.am index cfec9b4caec3c66c4f3b039e976df1a5233a309f..d648f745e9270792993b3ab12a8cd90d3ff3c245 100644 --- a/src/sreport/Makefile.am +++ b/src/sreport/Makefile.am @@ -20,7 +20,8 @@ sreport_LDADD = \ $(top_builddir)/src/db_api/libslurmdb.o $(DL_LIBS) \ $(READLINE_LIBS) -sreport_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sreport_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(sreport_LDADD) : force diff --git a/src/sreport/Makefile.in b/src/sreport/Makefile.in index 134e18e12341f8bd8a8be4768ca1e927d9b407e6..46de7be61d3b081d19c1532d16d3345ae1dba825 100644 --- a/src/sreport/Makefile.in +++ b/src/sreport/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -155,9 +154,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -165,9 +162,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -199,6 +195,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -226,6 +224,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -332,7 +331,9 @@ sreport_LDADD = \ $(top_builddir)/src/db_api/libslurmdb.o $(DL_LIBS) \ $(READLINE_LIBS) -sreport_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sreport_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -410,7 +411,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sreport$(EXEEXT): $(sreport_OBJECTS) $(sreport_DEPENDENCIES) +sreport$(EXEEXT): $(sreport_OBJECTS) $(sreport_DEPENDENCIES) $(EXTRA_sreport_DEPENDENCIES) @rm -f sreport$(EXEEXT) $(sreport_LINK) $(sreport_OBJECTS) $(sreport_LDADD) $(LIBS) @@ -554,10 +555,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sreport/sreport.h b/src/sreport/sreport.h index 468a633ee198cb91a67e45e8e26bb789f67dbc58..53cede7234f517a64331b4255a8c8eae619fa02b 100644 --- a/src/sreport/sreport.h +++ b/src/sreport/sreport.h @@ -79,7 +79,7 @@ #include "slurm/slurm.h" #include "slurm/slurmdb.h" -#include "src/common/jobacct_common.h" +#include "src/common/slurm_jobacct_gather.h" #include "src/common/parse_time.h" #include "src/common/slurm_accounting_storage.h" #include "src/common/xstring.h" diff --git a/src/srun/Makefile.am b/src/srun/Makefile.am index ee4f6ee237d70b7f560a1e989ab5900bc31db682..6cf3e306f7b593e88b77c40e436cca959b487ef6 100644 --- a/src/srun/Makefile.am +++ b/src/srun/Makefile.am @@ -1,40 +1,29 @@ # +SUBDIRS = libsrun + AUTOMAKE_OPTIONS = foreign CLEANFILES = core.* -INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/srun/libsrun bin_PROGRAMS = srun +convenience_libs = $(top_builddir)/src/srun/libsrun/libsrun.la \ + $(top_builddir)/src/api/libslurm.o + srun_SOURCES = \ - srun.c srun.h \ - opt.c opt.h \ - srun_job.c srun_job.h \ + srun.c \ srun_pty.c srun_pty.h \ - debugger.h \ - debugger.c \ - fname.c \ - fname.h \ - allocate.c \ - allocate.h \ - multi_prog.c multi_prog.h \ - task_state.c task_state.h \ srun.wrapper.c +srun_LDADD = $(convenience_libs) $(DL_LIBS) - -# pthread is needed for compiling with g++ (which is used for linking -# no matter if on a BGQ or not because of mentioning a .cc file -convenience_libs = \ - $(top_builddir)/src/api/libslurm.o -lpthread $(DL_LIBS) - -srun_LDADD = \ - $(convenience_libs) - -srun_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +srun_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) if BGQ_LOADED -srun_SOURCES += runjob_interface.cc +# because totalview needs the libraries on load we link in srun +# and not in the launch plugin. srun_LDFLAGS += $(RUNJOB_LDFLAGS) endif @@ -42,11 +31,6 @@ force: $(convenience_libs) : force @cd `dirname $@` && $(MAKE) `basename $@` -# debugging information is required for symbols in the debugger -# module so that a debugger can debugger to spawned tasks -debugger.o : debugger.c - $(COMPILE) -c -g -o debugger.o $(srcdir)/debugger.c - install-exec-local: umask 022; \ if [ -x /usr/lib/rpm/debugedit ]; then \ diff --git a/src/srun/Makefile.in b/src/srun/Makefile.in index 94004ef3f5fd845639861310615b5198a54593ec..53c17081c1a41c771edd735923aa058a8f52f965 100644 --- a/src/srun/Makefile.in +++ b/src/srun/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -38,8 +38,10 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = srun$(EXEEXT) -@BGQ_LOADED_TRUE@am__append_1 = runjob_interface.cc -@BGQ_LOADED_TRUE@am__append_2 = $(RUNJOB_LDFLAGS) + +# because totalview needs the libraries on load we link in srun +# and not in the launch plugin. +@BGQ_LOADED_TRUE@am__append_1 = $(RUNJOB_LDFLAGS) subdir = src/srun DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -60,9 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -70,6 +70,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -89,23 +90,14 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) -am__srun_SOURCES_DIST = srun.c srun.h opt.c opt.h srun_job.c \ - srun_job.h srun_pty.c srun_pty.h debugger.h debugger.c fname.c \ - fname.h allocate.c allocate.h multi_prog.c multi_prog.h \ - task_state.c task_state.h srun.wrapper.c runjob_interface.cc -@BGQ_LOADED_TRUE@am__objects_1 = runjob_interface.$(OBJEXT) -am_srun_OBJECTS = srun.$(OBJEXT) opt.$(OBJEXT) srun_job.$(OBJEXT) \ - srun_pty.$(OBJEXT) debugger.$(OBJEXT) fname.$(OBJEXT) \ - allocate.$(OBJEXT) multi_prog.$(OBJEXT) task_state.$(OBJEXT) \ - srun.wrapper.$(OBJEXT) $(am__objects_1) +am_srun_OBJECTS = srun.$(OBJEXT) srun_pty.$(OBJEXT) \ + srun.wrapper.$(OBJEXT) srun_OBJECTS = $(am_srun_OBJECTS) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = $(top_builddir)/src/api/libslurm.o \ - $(am__DEPENDENCIES_1) -srun_DEPENDENCIES = $(am__DEPENDENCIES_2) -srun_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(srun_LDFLAGS) $(LDFLAGS) -o $@ +srun_DEPENDENCIES = $(convenience_libs) $(am__DEPENDENCIES_1) +srun_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(srun_LDFLAGS) \ + $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp am__depfiles_maybe = depfiles @@ -119,20 +111,49 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ SOURCES = $(srun_SOURCES) -DIST_SOURCES = $(am__srun_SOURCES_DIST) +DIST_SOURCES = $(srun_SOURCES) +RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir ETAGS = etags CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) 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@ AR = @AR@ @@ -173,9 +194,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -183,9 +202,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -217,6 +235,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -244,6 +264,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -334,27 +355,25 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +SUBDIRS = libsrun AUTOMAKE_OPTIONS = foreign CLEANFILES = core.* -INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) -srun_SOURCES = srun.c srun.h opt.c opt.h srun_job.c srun_job.h \ - srun_pty.c srun_pty.h debugger.h debugger.c fname.c fname.h \ - allocate.c allocate.h multi_prog.c multi_prog.h task_state.c \ - task_state.h srun.wrapper.c $(am__append_1) - -# pthread is needed for compiling with g++ (which is used for linking -# no matter if on a BGQ or not because of mentioning a .cc file -convenience_libs = \ - $(top_builddir)/src/api/libslurm.o -lpthread $(DL_LIBS) +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/srun/libsrun +convenience_libs = $(top_builddir)/src/srun/libsrun/libsrun.la \ + $(top_builddir)/src/api/libslurm.o -srun_LDADD = \ - $(convenience_libs) +srun_SOURCES = \ + srun.c \ + srun_pty.c srun_pty.h \ + srun.wrapper.c -srun_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(am__append_2) -all: all-am +srun_LDADD = $(convenience_libs) $(DL_LIBS) +srun_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(HWLOC_LDFLAGS) \ + $(HWLOC_LIBS) $(am__append_1) +all: all-recursive .SUFFIXES: -.SUFFIXES: .c .cc .lo .o .obj +.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 \ @@ -428,7 +447,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -srun$(EXEEXT): $(srun_OBJECTS) $(srun_DEPENDENCIES) +srun$(EXEEXT): $(srun_OBJECTS) $(srun_DEPENDENCIES) $(EXTRA_srun_DEPENDENCIES) @rm -f srun$(EXEEXT) $(srun_LINK) $(srun_OBJECTS) $(srun_LDADD) $(LIBS) @@ -438,17 +457,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugger.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi_prog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runjob_interface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srun.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srun.wrapper.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srun_job.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srun_pty.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task_state.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -471,33 +482,82 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< -.cc.o: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cc.obj: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cc.lo: -@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - 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. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; 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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -508,10 +568,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) mkid -fID $$unique tags: TAGS -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ @@ -530,7 +603,7 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ fi; \ fi ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -580,27 +653,61 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + 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-am +check: check-recursive all-am: Makefile $(PROGRAMS) -installdirs: +installdirs: installdirs-recursive +installdirs-am: 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: 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-am +installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: @@ -613,102 +720,100 @@ distclean-generic: 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: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am -distclean: distclean-am +distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags -dvi: dvi-am +dvi: dvi-recursive dvi-am: -html: html-am +html: html-recursive html-am: -info: info-am +info: info-recursive info-am: install-data-am: -install-dvi: install-dvi-am +install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-exec-local -install-html: install-html-am +install-html: install-html-recursive install-html-am: -install-info: install-info-am +install-info: install-info-recursive install-info-am: install-man: -install-pdf: install-pdf-am +install-pdf: install-pdf-recursive install-pdf-am: -install-ps: install-ps-am +install-ps: install-ps-recursive install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-am +maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-am +mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool -pdf: pdf-am +pdf: pdf-recursive pdf-am: -ps: ps-am +ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-local \ - 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 \ +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-local 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-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-binPROGRAMS + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-binPROGRAMS force: $(convenience_libs) : force @cd `dirname $@` && $(MAKE) `basename $@` -# debugging information is required for symbols in the debugger -# module so that a debugger can debugger to spawned tasks -debugger.o : debugger.c - $(COMPILE) -c -g -o debugger.o $(srcdir)/debugger.c - install-exec-local: umask 022; \ if [ -x /usr/lib/rpm/debugedit ]; then \ diff --git a/src/srun/libsrun/Makefile.am b/src/srun/libsrun/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..ca7144c5c0f0067bdaf2ef5831329068b850a6c3 --- /dev/null +++ b/src/srun/libsrun/Makefile.am @@ -0,0 +1,29 @@ +# + +AUTOMAKE_OPTIONS = foreign +CLEANFILES = core.* + +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/srun/libsrun + +noinst_LTLIBRARIES = libsrun.la + +libsrun_la_SOURCES = \ + allocate.c allocate.h \ + debugger.c debugger.h \ + fname.c fname.h \ + launch.c launch.h \ + multi_prog.c multi_prog.h \ + opt.c opt.h \ + srun_job.c srun_job.h +libsrun_la_LIBADD = $(DL_LIBS) +libsrun_la_LDFLAGS = $(LIB_LDFLAGS) -module --export-dynamic + +force: +$(convenience_libs) : force + @cd `dirname $@` && $(MAKE) `basename $@` + +# debugging information is required for symbols in the debugger +# module so that a debugger can debugger to spawned tasks +debugger.o : debugger.c + $(COMPILE) -c -g -o debugger.o $(srcdir)/debugger.c + diff --git a/src/srun/libsrun/Makefile.in b/src/srun/libsrun/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..217f870f0fc859759928e1471263bd17815dc6e2 --- /dev/null +++ b/src/srun/libsrun/Makefile.in @@ -0,0 +1,631 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ +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/srun/libsrun +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_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_cflags.m4 \ + $(top_srcdir)/auxdir/x_ac_cray.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_gpl_licensed.m4 \ + $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ + $(top_srcdir)/auxdir/x_ac_iso.m4 \ + $(top_srcdir)/auxdir/x_ac_lua.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_nrt.m4 \ + $(top_srcdir)/auxdir/x_ac_pam.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_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)/auxdir/x_ac_srun.m4 \ + $(top_srcdir)/auxdir/x_ac_sun_const.m4 \ + $(top_srcdir)/auxdir/x_ac_xcpu.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +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 = +libsrun_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libsrun_la_OBJECTS = allocate.lo debugger.lo fname.lo launch.lo \ + multi_prog.lo opt.lo srun_job.lo +libsrun_la_OBJECTS = $(am_libsrun_la_OBJECTS) +libsrun_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libsrun_la_LDFLAGS) $(LDFLAGS) -o $@ +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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libsrun_la_SOURCES) +DIST_SOURCES = $(libsrun_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTHD_CFLAGS = @AUTHD_CFLAGS@ +AUTHD_LIBS = @AUTHD_LIBS@ +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@ +CMD_LDFLAGS = @CMD_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +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@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ +HAVEPGCONFIG = @HAVEPGCONFIG@ +HAVE_AIX = @HAVE_AIX@ +HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ +HAVE_OPENSSL = @HAVE_OPENSSL@ +HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ +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@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_LDFLAGS = @LIB_LDFLAGS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@ +MUNGE_LDFLAGS = @MUNGE_LDFLAGS@ +MUNGE_LIBS = @MUNGE_LIBS@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +NCURSES = @NCURSES@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ +NUMA_LIBS = @NUMA_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +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@ +PGSQL_CFLAGS = @PGSQL_CFLAGS@ +PGSQL_LIBS = @PGSQL_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +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@ +RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ +SED = @SED@ +SEMAPHORE_LIBS = @SEMAPHORE_LIBS@ +SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +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@ +UTIL_LIBS = @UTIL_LIBS@ +VERSION = @VERSION@ +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@ +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@ +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 +CLEANFILES = core.* +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/srun/libsrun +noinst_LTLIBRARIES = libsrun.la +libsrun_la_SOURCES = \ + allocate.c allocate.h \ + debugger.c debugger.h \ + fname.c fname.h \ + launch.c launch.h \ + multi_prog.c multi_prog.h \ + opt.c opt.h \ + srun_job.c srun_job.h + +libsrun_la_LIBADD = $(DL_LIBS) +libsrun_la_LDFLAGS = $(LIB_LDFLAGS) -module --export-dynamic +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/srun/libsrun/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/srun/libsrun/Makefile +.PRECIOUS: 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)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libsrun.la: $(libsrun_la_OBJECTS) $(libsrun_la_DEPENDENCIES) $(EXTRA_libsrun_la_DEPENDENCIES) + $(libsrun_la_LINK) $(libsrun_la_OBJECTS) $(libsrun_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugger.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fname.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launch.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi_prog.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srun_job.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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" + +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: + -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 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 all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags 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 uninstall uninstall-am + + +force: +$(convenience_libs) : force + @cd `dirname $@` && $(MAKE) `basename $@` + +# debugging information is required for symbols in the debugger +# module so that a debugger can debugger to spawned tasks +debugger.o : debugger.c + $(COMPILE) -c -g -o debugger.o $(srcdir)/debugger.c + +# 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/srun/allocate.c b/src/srun/libsrun/allocate.c similarity index 77% rename from src/srun/allocate.c rename to src/srun/libsrun/allocate.c index a94603a2b299ed19bf8319ec767b4b86e106fbcb..d5a7cd249e7369b5c43ced450a5e3e2b72e1b515 100644 --- a/src/srun/allocate.c +++ b/src/srun/libsrun/allocate.c @@ -58,9 +58,9 @@ #include "src/common/env.h" #include "src/common/fd.h" -#include "src/srun/allocate.h" -#include "src/srun/opt.h" -#include "src/srun/debugger.h" +#include "allocate.h" +#include "opt.h" +#include "launch.h" #ifdef HAVE_BG #include "src/common/node_select.h" @@ -82,10 +82,6 @@ extern char **environ; static uint32_t pending_job_id = 0; -static int sig_array[] = { - SIGHUP, SIGINT, SIGQUIT, SIGPIPE, - SIGTERM, SIGUSR1, SIGUSR2, 0 }; - /* * Static Prototypes */ @@ -742,190 +738,9 @@ job_desc_msg_destroy(job_desc_msg_t *j) extern int create_job_step(srun_job_t *job, bool use_all_cpus) { - int i, rc; - unsigned long my_sleep = 0; - time_t begin_time; - - slurm_step_ctx_params_t_init(&job->ctx_params); - job->ctx_params.job_id = job->jobid; - job->ctx_params.uid = opt.uid; - -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P - /* On a Q and onward this we don't add this. */ -#else - /* set the jobid for totalview */ - totalview_jobid = NULL; - xstrfmtcat(totalview_jobid, "%u", job->ctx_params.job_id); -#endif - /* Validate minimum and maximum node counts */ - if (opt.min_nodes && opt.max_nodes && - (opt.min_nodes > opt.max_nodes)) { - error ("Minimum node count > maximum node count (%d > %d)", - opt.min_nodes, opt.max_nodes); - return -1; - } -#if !defined HAVE_FRONT_END || (defined HAVE_BGQ) -//#if !defined HAVE_FRONT_END || (defined HAVE_BGQ && defined HAVE_BG_FILES) - if (opt.min_nodes && (opt.min_nodes > job->nhosts)) { - error ("Minimum node count > allocated node count (%d > %d)", - opt.min_nodes, job->nhosts); - return -1; - } -#endif - job->ctx_params.min_nodes = job->nhosts; - if (opt.min_nodes && (opt.min_nodes < job->ctx_params.min_nodes)) - job->ctx_params.min_nodes = opt.min_nodes; - job->ctx_params.max_nodes = job->nhosts; - if (opt.max_nodes && (opt.max_nodes < job->ctx_params.max_nodes)) - job->ctx_params.max_nodes = opt.max_nodes; - - if (!opt.ntasks_set && (opt.ntasks_per_node != NO_VAL)) - job->ntasks = opt.ntasks = job->nhosts * opt.ntasks_per_node; - job->ctx_params.task_count = opt.ntasks; - - if (opt.mem_per_cpu != NO_VAL) - job->ctx_params.mem_per_cpu = opt.mem_per_cpu; - if (opt.gres) - job->ctx_params.gres = opt.gres; - else - job->ctx_params.gres = getenv("SLURM_STEP_GRES"); - - if (use_all_cpus) - job->ctx_params.cpu_count = job->cpu_count; - else if (opt.overcommit) - job->ctx_params.cpu_count = job->ctx_params.min_nodes; - else if (opt.cpus_set) - job->ctx_params.cpu_count = opt.ntasks * opt.cpus_per_task; - else - job->ctx_params.cpu_count = opt.ntasks; - - job->ctx_params.relative = (uint16_t)opt.relative; - job->ctx_params.ckpt_interval = (uint16_t)opt.ckpt_interval; - job->ctx_params.ckpt_dir = opt.ckpt_dir; - job->ctx_params.exclusive = (uint16_t)opt.exclusive; - if (opt.immediate == 1) - job->ctx_params.immediate = (uint16_t)opt.immediate; - if (opt.time_limit != NO_VAL) - job->ctx_params.time_limit = (uint32_t)opt.time_limit; - job->ctx_params.verbose_level = (uint16_t)_verbose; - if (opt.resv_port_cnt != NO_VAL) - job->ctx_params.resv_port_cnt = (uint16_t) opt.resv_port_cnt; - - switch (opt.distribution) { - case SLURM_DIST_BLOCK: - case SLURM_DIST_ARBITRARY: - case SLURM_DIST_CYCLIC: - case SLURM_DIST_CYCLIC_CYCLIC: - case SLURM_DIST_CYCLIC_BLOCK: - case SLURM_DIST_BLOCK_CYCLIC: - case SLURM_DIST_BLOCK_BLOCK: - job->ctx_params.task_dist = opt.distribution; - break; - case SLURM_DIST_PLANE: - job->ctx_params.task_dist = SLURM_DIST_PLANE; - job->ctx_params.plane_size = opt.plane_size; - break; - default: - job->ctx_params.task_dist = (job->ctx_params.task_count <= - job->ctx_params.min_nodes) - ? SLURM_DIST_CYCLIC : SLURM_DIST_BLOCK; - opt.distribution = job->ctx_params.task_dist; - break; - - } - job->ctx_params.overcommit = opt.overcommit ? 1 : 0; - - job->ctx_params.node_list = opt.nodelist; - - job->ctx_params.network = opt.network; - job->ctx_params.no_kill = opt.no_kill; - if (opt.job_name_set_cmd && opt.job_name) - job->ctx_params.name = opt.job_name; - else - job->ctx_params.name = opt.cmd_name; - job->ctx_params.features = opt.constraints; - - debug("requesting job %u, user %u, nodes %u including (%s)", - job->ctx_params.job_id, job->ctx_params.uid, - job->ctx_params.min_nodes, job->ctx_params.node_list); - debug("cpus %u, tasks %u, name %s, relative %u", - job->ctx_params.cpu_count, job->ctx_params.task_count, - job->ctx_params.name, job->ctx_params.relative); - begin_time = time(NULL); - - for (i=0; (!destroy_job); i++) { - if (opt.no_alloc) { - job->step_ctx = slurm_step_ctx_create_no_alloc( - &job->ctx_params, job->stepid); - } else - job->step_ctx = slurm_step_ctx_create( - &job->ctx_params); - if (job->step_ctx != NULL) { - if (i > 0) - info("Job step created"); - - break; - } - rc = slurm_get_errno(); - - if (((opt.immediate != 0) && - ((opt.immediate == 1) || - (difftime(time(NULL), begin_time) > opt.immediate))) || - ((rc != ESLURM_NODES_BUSY) && (rc != ESLURM_PORTS_BUSY) && - (rc != ESLURM_PROLOG_RUNNING) && - (rc != SLURM_PROTOCOL_SOCKET_IMPL_TIMEOUT) && - (rc != ESLURM_DISABLED))) { - error ("Unable to create job step: %m"); - return -1; - } - - if (i == 0) { - if (rc == ESLURM_PROLOG_RUNNING) { - verbose("Resources allocated for job %u and " - "being configured, please wait", - job->ctx_params.job_id); - } else { - info("Job step creation temporarily disabled, " - "retrying"); - } - xsignal_unblock(sig_array); - for (i = 0; sig_array[i]; i++) - xsignal(sig_array[i], _signal_while_allocating); - - my_sleep = (getpid() % 1000) * 100 + 100000; - } else { - verbose("Job step creation still disabled, retrying"); - my_sleep = MIN((my_sleep * 2), 29000000); - } - /* sleep 0.1 to 29 secs with exponential back-off */ - usleep(my_sleep); - if (destroy_job) { - /* cancelled by signal */ - break; - } - } - if (i > 0) { - xsignal_block(sig_array); - if (destroy_job) { - info("Cancelled pending job step"); - return -1; - } - } - - slurm_step_ctx_get(job->step_ctx, SLURM_STEP_CTX_STEPID, &job->stepid); - /* Number of hosts in job may not have been initialized yet if - * --jobid was used or only SLURM_JOB_ID was set in user env. - * Reset the value here just in case. - */ - slurm_step_ctx_get(job->step_ctx, SLURM_STEP_CTX_NUM_HOSTS, - &job->nhosts); - - /* - * Recreate filenames which may depend upon step id - */ - job_update_io_fnames(job); - - return 0; + return launch_g_create_job_step(job, use_all_cpus, + _signal_while_allocating, + &destroy_job); } diff --git a/src/srun/allocate.h b/src/srun/libsrun/allocate.h similarity index 99% rename from src/srun/allocate.h rename to src/srun/libsrun/allocate.h index c8002d9d826dfb6d520bc5ac83a749a90da8d9b5..b638badc0ffc609dab5e77a5f58d1dd3e15fa646 100644 --- a/src/srun/allocate.h +++ b/src/srun/libsrun/allocate.h @@ -42,7 +42,7 @@ #include "slurm/slurm.h" -#include "src/srun/srun_job.h" +#include "srun_job.h" typedef struct slurmctld_communication_addr { uint16_t port; diff --git a/src/srun/debugger.c b/src/srun/libsrun/debugger.c similarity index 98% rename from src/srun/debugger.c rename to src/srun/libsrun/debugger.c index e85675a54523098b7b26375020df3d8ee8611f94..2750557bdc8260a54c716a9cf608e20dc586f38e 100644 --- a/src/srun/debugger.c +++ b/src/srun/libsrun/debugger.c @@ -50,8 +50,8 @@ #include "src/common/log.h" -#include "src/srun/debugger.h" -#include "src/srun/srun_job.h" +#include "debugger.h" +#include "srun_job.h" /* * Instantiate extern variables from debugger.h diff --git a/src/srun/debugger.h b/src/srun/libsrun/debugger.h similarity index 99% rename from src/srun/debugger.h rename to src/srun/libsrun/debugger.h index 53b57ecafe6c547c633c052ef086af3b0651a48d..b39c133003f328abc50f600e7cea89942dfb4f00 100644 --- a/src/srun/debugger.h +++ b/src/srun/libsrun/debugger.h @@ -37,7 +37,7 @@ #endif #endif -#include "src/srun/srun_job.h" +#include "srun_job.h" /***************************************************************************** * DEBUGGING SUPPORT * *****************************************************************************/ diff --git a/src/srun/fname.c b/src/srun/libsrun/fname.c similarity index 97% rename from src/srun/fname.c rename to src/srun/libsrun/fname.c index a254049739e64c9338bd339fd805a9c6a96367b0..44d1bd14c7cc439886920d72e67c8d9802145955 100644 --- a/src/srun/fname.c +++ b/src/srun/libsrun/fname.c @@ -46,10 +46,8 @@ #include #include -#include "src/srun/fname.h" -#include "src/srun/opt.h" -#include "src/srun/srun_job.h" -#include "src/srun/opt.h" +#include "fname.h" +#include "opt.h" #include "src/common/xmalloc.h" #include "src/common/xstring.h" diff --git a/src/srun/fname.h b/src/srun/libsrun/fname.h similarity index 98% rename from src/srun/fname.h rename to src/srun/libsrun/fname.h index 67b1a3dba821adbd73f61399f8ccc1aeb688c622..d5b07dabaf35b39a7c6e01ebd805d1eff5090de2 100644 --- a/src/srun/fname.h +++ b/src/srun/libsrun/fname.h @@ -43,7 +43,7 @@ # include "config.h" #endif -#include "src/srun/srun_job.h" +#include "srun_job.h" /* * Create an filename from a (probably user supplied) filename format. diff --git a/src/srun/libsrun/launch.c b/src/srun/libsrun/launch.c new file mode 100644 index 0000000000000000000000000000000000000000..b4abc1478a8b4c341cb9272bbd1c6d8cb94f8fbf --- /dev/null +++ b/src/srun/libsrun/launch.c @@ -0,0 +1,488 @@ +/* launch.c - Define job launch plugin functions. +***************************************************************************** +* Copyright (C) 2012 SchedMD LLC +* Written by Danny Auble +* +* This file is part of SLURM, a resource management program. +* For details, see . +* 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 +#include + +#include "launch.h" + +#include "src/common/env.h" +#include "src/common/xstring.h" +#include "src/common/plugin.h" +#include "src/common/plugrack.h" +#include "src/common/xsignal.h" + +typedef struct { + int (*setup_srun_opt) (char **rest); + int (*create_job_step) (srun_job_t *job, bool use_all_cpus, + void (*signal_function)(int), + sig_atomic_t *destroy_job); + int (*step_launch) (srun_job_t *job, + slurm_step_io_fds_t *cio_fds, + uint32_t *global_rc); + int (*step_wait) (srun_job_t *job, bool got_alloc); + int (*step_terminate) (void); + void (*print_status) (void); + void (*fwd_signal) (int signal); +} plugin_ops_t; + +/* + * Must be synchronized with plugin_ops_t above. + */ +static const char *syms[] = { + "launch_p_setup_srun_opt", + "launch_p_create_job_step", + "launch_p_step_launch", + "launch_p_step_wait", + "launch_p_step_terminate", + "launch_p_print_status", + "launch_p_fwd_signal" +}; + +static plugin_ops_t ops; +static plugin_context_t *plugin_context = NULL; +static pthread_mutex_t plugin_context_lock = PTHREAD_MUTEX_INITIALIZER; +static bool init_run = false; + +static int +_is_local_file (fname_t *fname) +{ + if (fname->name == NULL) + return 1; + + if (fname->taskid != -1) + return 1; + + return ((fname->type != IO_PER_TASK) && (fname->type != IO_ONE)); +} + +/* + * Initialize context for plugin + */ +extern int launch_init(void) +{ + int retval = SLURM_SUCCESS; + char *plugin_type = "launch"; + char *type = NULL; + + if (init_run && plugin_context) + return retval; + + slurm_mutex_lock(&plugin_context_lock); + + if (plugin_context) + goto done; + + type = slurm_get_launch_type(); + plugin_context = plugin_context_create( + plugin_type, type, (void **)&ops, syms, sizeof(syms)); + + if (!plugin_context) { + error("cannot create %s context for %s", plugin_type, type); + retval = SLURM_ERROR; + goto done; + } + init_run = true; + +done: + slurm_mutex_unlock(&plugin_context_lock); + xfree(type); + + return retval; +} + +extern int location_fini(void) +{ + int rc; + + if (!plugin_context) + return SLURM_SUCCESS; + + init_run = false; + rc = plugin_context_destroy(plugin_context); + plugin_context = NULL; + + return rc; +} + +extern slurm_step_layout_t *launch_common_get_slurm_step_layout(srun_job_t *job) +{ + job_step_create_response_msg_t *resp; + + if (!job || !job->step_ctx) + return (NULL); + + slurm_step_ctx_get(job->step_ctx, SLURM_STEP_CTX_RESP, &resp); + if (!resp) + return (NULL); + return (resp->step_layout); +} + +extern int launch_common_create_job_step(srun_job_t *job, bool use_all_cpus, + void (*signal_function)(int), + sig_atomic_t *destroy_job) +{ + int i, rc; + unsigned long my_sleep = 0; + time_t begin_time; + + if (!job) { + error("launch_common_create_job_step: no job given"); + return SLURM_ERROR; + } + + slurm_step_ctx_params_t_init(&job->ctx_params); + job->ctx_params.job_id = job->jobid; + job->ctx_params.uid = opt.uid; + + /* Validate minimum and maximum node counts */ + if (opt.min_nodes && opt.max_nodes && + (opt.min_nodes > opt.max_nodes)) { + error ("Minimum node count > maximum node count (%d > %d)", + opt.min_nodes, opt.max_nodes); + return SLURM_ERROR; + } +#if !defined HAVE_FRONT_END || (defined HAVE_BGQ) +//#if !defined HAVE_FRONT_END || (defined HAVE_BGQ && defined HAVE_BG_FILES) + if (opt.min_nodes && (opt.min_nodes > job->nhosts)) { + error ("Minimum node count > allocated node count (%d > %d)", + opt.min_nodes, job->nhosts); + return SLURM_ERROR; + } +#endif + job->ctx_params.min_nodes = job->nhosts; + if (opt.min_nodes && (opt.min_nodes < job->ctx_params.min_nodes)) + job->ctx_params.min_nodes = opt.min_nodes; + job->ctx_params.max_nodes = job->nhosts; + if (opt.max_nodes && (opt.max_nodes < job->ctx_params.max_nodes)) + job->ctx_params.max_nodes = opt.max_nodes; + + if (!opt.ntasks_set && (opt.ntasks_per_node != NO_VAL)) + job->ntasks = opt.ntasks = job->nhosts * opt.ntasks_per_node; + job->ctx_params.task_count = opt.ntasks; + + if (opt.mem_per_cpu != NO_VAL) + job->ctx_params.mem_per_cpu = opt.mem_per_cpu; + if (opt.gres) + job->ctx_params.gres = opt.gres; + else + job->ctx_params.gres = getenv("SLURM_STEP_GRES"); + + if (use_all_cpus) + job->ctx_params.cpu_count = job->cpu_count; + else if (opt.overcommit) + job->ctx_params.cpu_count = job->ctx_params.min_nodes; + else if (opt.cpus_set) + job->ctx_params.cpu_count = opt.ntasks * opt.cpus_per_task; + else + job->ctx_params.cpu_count = opt.ntasks; + + job->ctx_params.cpu_freq = opt.cpu_freq; + job->ctx_params.relative = (uint16_t)opt.relative; + job->ctx_params.ckpt_interval = (uint16_t)opt.ckpt_interval; + job->ctx_params.ckpt_dir = opt.ckpt_dir; + job->ctx_params.exclusive = (uint16_t)opt.exclusive; + if (opt.immediate == 1) + job->ctx_params.immediate = (uint16_t)opt.immediate; + if (opt.time_limit != NO_VAL) + job->ctx_params.time_limit = (uint32_t)opt.time_limit; + job->ctx_params.verbose_level = (uint16_t)_verbose; + if (opt.resv_port_cnt != NO_VAL) + job->ctx_params.resv_port_cnt = (uint16_t) opt.resv_port_cnt; + + switch (opt.distribution) { + case SLURM_DIST_BLOCK: + case SLURM_DIST_ARBITRARY: + case SLURM_DIST_CYCLIC: + case SLURM_DIST_CYCLIC_CYCLIC: + case SLURM_DIST_CYCLIC_BLOCK: + case SLURM_DIST_BLOCK_CYCLIC: + case SLURM_DIST_BLOCK_BLOCK: + job->ctx_params.task_dist = opt.distribution; + break; + case SLURM_DIST_PLANE: + job->ctx_params.task_dist = SLURM_DIST_PLANE; + job->ctx_params.plane_size = opt.plane_size; + break; + default: + job->ctx_params.task_dist = (job->ctx_params.task_count <= + job->ctx_params.min_nodes) + ? SLURM_DIST_CYCLIC : SLURM_DIST_BLOCK; + opt.distribution = job->ctx_params.task_dist; + break; + + } + job->ctx_params.overcommit = opt.overcommit ? 1 : 0; + + job->ctx_params.node_list = opt.nodelist; + + job->ctx_params.network = opt.network; + job->ctx_params.no_kill = opt.no_kill; + if (opt.job_name_set_cmd && opt.job_name) + job->ctx_params.name = opt.job_name; + else + job->ctx_params.name = opt.cmd_name; + job->ctx_params.features = opt.constraints; + + debug("requesting job %u, user %u, nodes %u including (%s)", + job->ctx_params.job_id, job->ctx_params.uid, + job->ctx_params.min_nodes, job->ctx_params.node_list); + debug("cpus %u, tasks %u, name %s, relative %u", + job->ctx_params.cpu_count, job->ctx_params.task_count, + job->ctx_params.name, job->ctx_params.relative); + begin_time = time(NULL); + + for (i=0; (!(*destroy_job)); i++) { + if (opt.no_alloc) { + job->step_ctx = slurm_step_ctx_create_no_alloc( + &job->ctx_params, job->stepid); + } else + job->step_ctx = slurm_step_ctx_create( + &job->ctx_params); + if (job->step_ctx != NULL) { + if (i > 0) + info("Job step created"); + + break; + } + rc = slurm_get_errno(); + + if (((opt.immediate != 0) && + ((opt.immediate == 1) || + (difftime(time(NULL), begin_time) > opt.immediate))) || + ((rc != ESLURM_NODES_BUSY) && (rc != ESLURM_PORTS_BUSY) && + (rc != ESLURM_PROLOG_RUNNING) && + (rc != SLURM_PROTOCOL_SOCKET_IMPL_TIMEOUT) && + (rc != ESLURM_DISABLED))) { + error ("Unable to create job step: %m"); + return SLURM_ERROR; + } + + if (i == 0) { + if (rc == ESLURM_PROLOG_RUNNING) { + verbose("Resources allocated for job %u and " + "being configured, please wait", + job->ctx_params.job_id); + } else { + info("Job step creation temporarily disabled, " + "retrying"); + } + xsignal_unblock(sig_array); + for (i = 0; sig_array[i]; i++) + xsignal(sig_array[i], signal_function); + + my_sleep = (getpid() % 1000) * 100 + 100000; + } else { + verbose("Job step creation still disabled, retrying"); + my_sleep = MIN((my_sleep * 2), 29000000); + } + /* sleep 0.1 to 29 secs with exponential back-off */ + usleep(my_sleep); + if (*destroy_job) { + /* cancelled by signal */ + break; + } + } + if (i > 0) { + xsignal_block(sig_array); + if (*destroy_job) { + info("Cancelled pending job step"); + return SLURM_ERROR; + } + } + + slurm_step_ctx_get(job->step_ctx, SLURM_STEP_CTX_STEPID, &job->stepid); + /* Number of hosts in job may not have been initialized yet if + * --jobid was used or only SLURM_JOB_ID was set in user env. + * Reset the value here just in case. + */ + slurm_step_ctx_get(job->step_ctx, SLURM_STEP_CTX_NUM_HOSTS, + &job->nhosts); + + /* + * Recreate filenames which may depend upon step id + */ + job_update_io_fnames(job); + + return SLURM_SUCCESS; +} + +extern void launch_common_set_stdio_fds(srun_job_t *job, + slurm_step_io_fds_t *cio_fds) +{ + bool err_shares_out = false; + int file_flags; + + if (opt.open_mode == OPEN_MODE_APPEND) + file_flags = O_CREAT|O_WRONLY|O_APPEND; + else if (opt.open_mode == OPEN_MODE_TRUNCATE) + file_flags = O_CREAT|O_WRONLY|O_APPEND|O_TRUNC; + else { + slurm_ctl_conf_t *conf; + conf = slurm_conf_lock(); + if (conf->job_file_append) + file_flags = O_CREAT|O_WRONLY|O_APPEND; + else + file_flags = O_CREAT|O_WRONLY|O_APPEND|O_TRUNC; + slurm_conf_unlock(); + } + + /* + * create stdin file descriptor + */ + if (_is_local_file(job->ifname)) { + if ((job->ifname->name == NULL) || + (job->ifname->taskid != -1)) { + cio_fds->in.fd = STDIN_FILENO; + } else { + cio_fds->in.fd = open(job->ifname->name, O_RDONLY); + if (cio_fds->in.fd == -1) { + error("Could not open stdin file: %m"); + exit(error_exit); + } + } + if (job->ifname->type == IO_ONE) { + cio_fds->in.taskid = job->ifname->taskid; + cio_fds->in.nodeid = slurm_step_layout_host_id( + launch_common_get_slurm_step_layout(job), + job->ifname->taskid); + } + } + + /* + * create stdout file descriptor + */ + if (_is_local_file(job->ofname)) { + if ((job->ofname->name == NULL) || + (job->ofname->taskid != -1)) { + cio_fds->out.fd = STDOUT_FILENO; + } else { + cio_fds->out.fd = open(job->ofname->name, + file_flags, 0644); + if (cio_fds->out.fd == -1) { + error("Could not open stdout file: %m"); + exit(error_exit); + } + } + if (job->ofname->name != NULL + && job->efname->name != NULL + && !strcmp(job->ofname->name, job->efname->name)) { + err_shares_out = true; + } + } + + /* + * create seperate stderr file descriptor only if stderr is not sharing + * the stdout file descriptor + */ + if (err_shares_out) { + debug3("stdout and stderr sharing a file"); + cio_fds->err.fd = cio_fds->out.fd; + cio_fds->err.taskid = cio_fds->out.taskid; + } else if (_is_local_file(job->efname)) { + if ((job->efname->name == NULL) || + (job->efname->taskid != -1)) { + cio_fds->err.fd = STDERR_FILENO; + } else { + cio_fds->err.fd = open(job->efname->name, + file_flags, 0644); + if (cio_fds->err.fd == -1) { + error("Could not open stderr file: %m"); + exit(error_exit); + } + } + } +} + +extern int launch_g_setup_srun_opt(char **rest) +{ + if (launch_init() < 0) + return SLURM_ERROR; + + return (*(ops.setup_srun_opt))(rest); +} + +extern int launch_g_create_job_step(srun_job_t *job, bool use_all_cpus, + void (*signal_function)(int), + sig_atomic_t *destroy_job) +{ + if (launch_init() < 0) + return SLURM_ERROR; + + return (*(ops.create_job_step))( + job, use_all_cpus, signal_function, destroy_job); +} + +extern int launch_g_step_launch( + srun_job_t *job, slurm_step_io_fds_t *cio_fds, + uint32_t *global_rc) +{ + if (launch_init() < 0) + return SLURM_ERROR; + + return (*(ops.step_launch))(job, cio_fds, global_rc); +} + +extern int launch_g_step_wait(srun_job_t *job, bool got_alloc) +{ + if (launch_init() < 0) + return SLURM_ERROR; + + return (*(ops.step_wait))(job, got_alloc); +} + +extern int launch_g_step_terminate(void) +{ + if (launch_init() < 0) + return SLURM_ERROR; + + return (*(ops.step_terminate))(); +} + +extern void launch_g_print_status(void) +{ + if (launch_init() < 0) + return; + + (*(ops.print_status))(); +} + +extern void launch_g_fwd_signal(int signal) +{ + if (launch_init() < 0) + return; + + (*(ops.fwd_signal))(signal); +} diff --git a/src/srun/libsrun/launch.h b/src/srun/libsrun/launch.h new file mode 100644 index 0000000000000000000000000000000000000000..e4311424eb654341a6e0e8542bf15a4403fffccc --- /dev/null +++ b/src/srun/libsrun/launch.h @@ -0,0 +1,165 @@ +/*****************************************************************************\ + * launch.h - Define job launch plugin functions. + ***************************************************************************** + * Copyright (C) 2012 SchedMD LLC + * Written by Danny Auble + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 _LAUNCH_H +#define _LAUNCH_H + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif /* HAVE_CONFIG_H */ + +#include "slurm/slurm.h" +#include "slurm/slurm_errno.h" + +#include "src/common/xstring.h" + +#include "srun_job.h" +#include "opt.h" +#include "debugger.h" + +/* + * launch_common_get_slurm_step_layout() gets the slurm job step layout. + * + * IN job - the job step layout to get. + * + * RETURN SLURM_SUCCESS on success || SLURM_ERROR else wise + */ +extern slurm_step_layout_t *launch_common_get_slurm_step_layout( + srun_job_t *job); + +/* + * launch_common_create_job_step() creates the job step with the given info. + * + * IN job - job to be created into a job step + * IN use_all_cpus - the choice to use all the cpus. + * IN signal_function - function that handles the signals coming in. + * IN destroy_job - pointer to a global flag signifying if the job was + * canceled while allocating. + * + * RETURN SLURM_SUCCESS on success || SLURM_ERROR else wise + */ +extern int launch_common_create_job_step(srun_job_t *job, bool use_all_cpus, + void (*signal_function)(int), + sig_atomic_t *destroy_job); + +/* + * launch_common_set_stdio_fds() sets the stdio_fds to given info. + * + * IN job - the job that is set. + * IN cio_fds - filling in io descriptors. + */ +extern void launch_common_set_stdio_fds(srun_job_t *job, + slurm_step_io_fds_t *cio_fds); + +/* + * init() is called when the plugin is loaded, before any other functions + * are called. Put global initialization here. + */ +extern int launch_init(void); + +/* + * fini() is called when the plugin is removed. Clear any allocated + * storage here. + */ +extern int launch_fini(void); + +/* + * launch_p_setup_srun_opt() is called when the plugin needs the srun + * operation needs to be set up. + * + * IN rest - extra parameters on the command line not processed by srun + */ +extern int launch_g_setup_srun_opt(char **rest); + +/* + * launch_p_create_job_step() creates the job step. + * + * IN/OUT job - the job to be created into a job step. + * IN use_all_cpus - the choice to use all the cpus. + * IN signal_function - function that handles the signals coming in. + * IN destroy_job - pointer to a global flag signifying if the job was + * canceled while allocating. + * + * RETURN SLURM_SUCCESS on success || SLURM_ERROR else wise + */ +extern int launch_g_create_job_step(srun_job_t *job, bool use_all_cpus, + void (*signal_function)(int), + sig_atomic_t *destroy_job); + +/* + * launch_p_step_launch() is called to launch the job step that + * was created. + * + * IN/OUT job - the job needing to be launched + * IN cio_fds - filled in io descriptors. + * IN/OUT global_rc - srun global return code. + * + * RETURN SLURM_SUCCESS on success || SLURM_ERROR else wise + */ +extern int launch_g_step_launch( + srun_job_t *job, slurm_step_io_fds_t *cio_fds, + uint32_t *global_rc); + +/* + * launch_p_step_wait() is called to wait for the job step to be finished. + * + * IN/OUT job - the job waiting to finish. + * IN got_alloc - if the resource allocation was created inside srun + * + * RETURN SLURM_SUCCESS on success || SLURM_ERROR else wise + */ +extern int launch_g_step_wait(srun_job_t *job, bool got_alloc); + +/* + * launch_p_step_terminate() is called to end the job step. + * + * RETURN SLURM_SUCCESS on success || SLURM_ERROR else wise + */ +extern int launch_g_step_terminate(void); + +/* + * launch_p_print_status() displays the the status of the job step. + */ +extern void launch_g_print_status(void); + +/* + * launch_p_fwd_signal() send a forward signal to an underlining task. + * + * IN signal - the signal to forward to the underlying tasks. + */ +extern void launch_g_fwd_signal(int signal); + +#endif /* _LAUNCH_H */ diff --git a/src/srun/multi_prog.c b/src/srun/libsrun/multi_prog.c similarity index 99% rename from src/srun/multi_prog.c rename to src/srun/libsrun/multi_prog.c index a61a3e7047775da98d5c169fe5214902bc8f6bb4..803636a6e27d9b7a6cafb73b88c93aeb545cfbc1 100644 --- a/src/srun/multi_prog.c +++ b/src/srun/libsrun/multi_prog.c @@ -60,8 +60,9 @@ #include "src/common/xassert.h" #include "src/common/xmalloc.h" #include "src/common/xstring.h" -#include "src/srun/debugger.h" -#include "src/srun/opt.h" + +#include "debugger.h" +#include "opt.h" /* Given a program name, translate it to a fully qualified pathname * as needed based upon the PATH environment variable */ diff --git a/src/srun/multi_prog.h b/src/srun/libsrun/multi_prog.h similarity index 100% rename from src/srun/multi_prog.h rename to src/srun/libsrun/multi_prog.h diff --git a/src/srun/opt.c b/src/srun/libsrun/opt.c similarity index 95% rename from src/srun/opt.c rename to src/srun/libsrun/opt.c index 11d3693b9a2496cfd1ce7af4c12ab81af2a6766d..589eb36ce9e888dbe0bce01c32815d9fee3a3879 100644 --- a/src/srun/opt.c +++ b/src/srun/libsrun/opt.c @@ -72,6 +72,7 @@ #include #include +#include "src/common/cpu_frequency.h" #include "src/common/list.h" #include "src/common/log.h" #include "src/common/mpi.h" @@ -89,9 +90,10 @@ #include "src/api/pmi_server.h" -#include "src/srun/multi_prog.h" -#include "src/srun/opt.h" -#include "src/srun/debugger.h" +#include "debugger.h" +#include "launch.h" +#include "multi_prog.h" +#include "opt.h" /* generic OPT_ definitions -- mainly for use with env vars */ #define OPT_NONE 0x00 @@ -118,6 +120,7 @@ #define OPT_WCKEY 0x16 #define OPT_SIGNAL 0x17 #define OPT_TIME_VAL 0x18 +#define OPT_CPU_FREQ 0x19 /* generic getopt_long flags, integers and *not* valid characters */ #define LONG_OPT_HELP 0x100 @@ -185,6 +188,7 @@ #define LONG_OPT_ALPS 0x152 #define LONG_OPT_REQ_SWITCH 0x153 #define LONG_OPT_RUNJOB_OPTS 0x154 +#define LONG_OPT_CPU_FREQ 0x155 extern char **environ; @@ -195,6 +199,7 @@ int error_exit = 1; int immediate_exit = 1; /*---- forward declarations of static functions ----*/ +static bool mpi_initialized = false; typedef struct env_vars env_vars_t; @@ -450,6 +455,7 @@ static void _opt_default() opt.pty = false; opt.open_mode = 0; opt.acctg_freq = -1; + opt.cpu_freq = NO_VAL; opt.reservation = NULL; opt.wckey = NULL; opt.req_switch = -1; @@ -486,6 +492,7 @@ env_vars_t env_vars[] = { {"SLURM_CONN_TYPE", OPT_CONN_TYPE, NULL, NULL }, {"SLURM_CPUS_PER_TASK", OPT_INT, &opt.cpus_per_task, &opt.cpus_set }, {"SLURM_CPU_BIND", OPT_CPU_BIND, NULL, NULL }, +{"SLURM_CPU_FREQ_REQ", OPT_CPU_FREQ, NULL, NULL }, {"SLURM_DEPENDENCY", OPT_STRING, &opt.dependency, NULL }, {"SLURM_DISABLE_STATUS",OPT_INT, &opt.disable_status,NULL }, {"SLURM_DISTRIBUTION", OPT_DISTRIB, NULL, NULL }, @@ -606,6 +613,11 @@ _process_env_var(env_vars_t *e, const char *val) exit(error_exit); break; + case OPT_CPU_FREQ: + if (cpu_freq_verify_param(val, &opt.cpu_freq)) + error("Invalid --cpu-freq argument: %s. Ignored", val); + break; + case OPT_MEM_BIND: if (slurm_verify_mem_bind(val, &opt.mem_bind, &opt.mem_bind_type)) @@ -678,6 +690,7 @@ _process_env_var(env_vars_t *e, const char *val) e->var, val); exit(error_exit); } + mpi_initialized = true; break; case OPT_SIGNAL: @@ -782,6 +795,7 @@ static 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_bind", required_argument, 0, LONG_OPT_CPU_BIND}, + {"cpu-freq", required_argument, 0, LONG_OPT_CPU_FREQ}, {"debugger-test", no_argument, 0, LONG_OPT_DEBUG_TS}, {"epilog", required_argument, 0, LONG_OPT_EPILOG}, {"exclusive", no_argument, 0, LONG_OPT_EXCLUSIVE}, @@ -1167,6 +1181,7 @@ static void set_options(const int argc, char **argv) optarg); exit(error_exit); } + mpi_initialized = true; break; case LONG_OPT_RESV_PORTS: if (optarg) @@ -1226,13 +1241,6 @@ static void set_options(const int argc, char **argv) /* make other parameters look like debugger * is really attached */ opt.parallel_debug = true; -#if defined HAVE_BG_FILES && !defined HAVE_BGL && !defined HAVE_BGP - /* Use symbols from the runjob.so library provided by - * IBM. Do NOT use debugger symbols local to the srun - * command */ -#else - MPIR_being_debugged = 1; -#endif opt.max_launch_time = 120; opt.max_threads = 1; pmi_server_max_threads(opt.max_threads); @@ -1396,13 +1404,6 @@ static void set_options(const int argc, char **argv) opt.ramdiskimage = xstrdup(optarg); break; case LONG_OPT_REBOOT: -#if defined HAVE_BG && !defined HAVE_BG_L_P - info("WARNING: If your job is smaller than the block " - "it is going to run on and other jobs are " - "running on it the --reboot option will not be " - "honored. If this is the case, contact your " - "admin to reboot the block for you."); -#endif opt.reboot = true; break; case LONG_OPT_GET_USER_ENV: @@ -1449,6 +1450,11 @@ static void set_options(const int argc, char **argv) opt.acctg_freq = _get_int(optarg, "acctg-freq", false); break; + case LONG_OPT_CPU_FREQ: + if (cpu_freq_verify_param(optarg, &opt.cpu_freq)) + error("Invalid --cpu-freq argument: %s. Ignored", + optarg); + break; case LONG_OPT_WCKEY: xfree(opt.wckey); opt.wckey = xstrdup(optarg); @@ -1549,7 +1555,6 @@ static void _load_multi(int *argc, char **argv) } close(config_fd); - argv[*argc+1] = (char *) xmalloc(sizeof(char *)); for (i = *argc+1; i > 1; i--) argv[i] = argv[i-1]; argv[1] = data_buf; @@ -1636,10 +1641,10 @@ static void _opt_args(int argc, char **argv) opt.argc++; } + /* Since this is needed on an emulated system don't put this code in + * the launch plugin. + */ #if defined HAVE_BG && !defined HAVE_BG_L_P - /* A bit of setup for IBM's runjob. runjob only has so many - options, so it isn't that bad. - */ int32_t node_cnt; if (opt.max_nodes) node_cnt = opt.max_nodes; @@ -1666,11 +1671,20 @@ static void _opt_args(int argc, char **argv) opt.max_nodes = opt.min_nodes = node_cnt = opt.ntasks; } - } else if (node_cnt < opt.ntasks) - opt.max_nodes = opt.min_nodes = node_cnt = opt.ntasks; + } else if (node_cnt < opt.ntasks) { + node_cnt = opt.ntasks; + if (opt.ntasks_per_node != NO_VAL) + node_cnt /= opt.ntasks_per_node; + opt.max_nodes = opt.min_nodes = node_cnt; + } if (!opt.ntasks_per_node || (opt.ntasks_per_node == NO_VAL)) { - opt.ntasks_per_node = opt.ntasks / node_cnt; + /* We always want the next larger number if + there is a fraction so we try to stay in + the allocation requested. + */ + opt.ntasks_per_node = + (opt.ntasks + node_cnt - 1) / node_cnt; figured = true; } @@ -1717,122 +1731,14 @@ static void _opt_args(int argc, char **argv) } } -#if defined HAVE_BG_FILES - if (!opt.test_only) { - /* Since we need the opt.argc to allocate the opt.argv array - * we need to do this before actually messing with - * things. All the extra options added to argv will be - * handled after the allocation. */ - - /* Default location of the actual command to be ran. We always - * have to add 3 options (calling prog, '--env-all' and ':') no - * matter what. */ - command_pos = 3; - - if (opt.ntasks_per_node != NO_VAL) - command_pos += 2; - if (opt.ntasks_set) - command_pos += 2; - if (opt.cwd_set) - command_pos += 2; - if (opt.labelio) - command_pos += 2; - if (_verbose) - command_pos += 2; - if (opt.runjob_opts) { - char *save_ptr = NULL, *tok; - char *tmp = xstrdup(opt.runjob_opts); - tok = strtok_r(tmp, " ", &save_ptr); - while (tok) { - command_pos++; - tok = strtok_r(NULL, " ", &save_ptr); - } - xfree(tmp); - } - - opt.argc += command_pos; - } -#endif - #endif - opt.argv = (char **) xmalloc((opt.argc + 1) * sizeof(char *)); + command_pos = launch_g_setup_srun_opt(rest); + /* Since this is needed on an emulated system don't put this code in + * the launch plugin. + */ #if defined HAVE_BG && !defined HAVE_BG_L_P -#if defined HAVE_BG_FILES - if (!opt.test_only) { - i = 0; - /* First arg has to be something when sending it to the - runjob api. This can be anything, srun seemed most - logical, but it doesn't matter. - */ - opt.argv[i++] = xstrdup("srun"); - /* srun launches tasks using runjob API. Slurmd is not used */ - if (opt.ntasks_per_node != NO_VAL) { - opt.argv[i++] = xstrdup("-p"); - opt.argv[i++] = xstrdup_printf("%d", - opt.ntasks_per_node); - } - - if (opt.ntasks_set) { - opt.argv[i++] = xstrdup("--np"); - opt.argv[i++] = xstrdup_printf("%d", opt.ntasks); - } - - if (opt.cwd_set) { - opt.argv[i++] = xstrdup("--cwd"); - opt.argv[i++] = xstrdup(opt.cwd); - } - - if (opt.labelio) { - opt.argv[i++] = xstrdup("--label"); - opt.argv[i++] = xstrdup("short"); - /* Since we are getting labels from runjob. and we - * don't want 2 sets (slurm's will always be 000) - * remove it case. */ - opt.labelio = 0; - } - - if (_verbose) { - opt.argv[i++] = xstrdup("--verbose"); - opt.argv[i++] = xstrdup_printf("%d", _verbose); - } - - if (opt.runjob_opts) { - char *save_ptr = NULL, *tok; - char *tmp = xstrdup(opt.runjob_opts); - tok = strtok_r(tmp, " ", &save_ptr); - while (tok) { - opt.argv[i++] = xstrdup(tok); - tok = strtok_r(NULL, " ", &save_ptr); - } - xfree(tmp); - } - - /* Export all the environment so the runjob_mux will get the - * correct info about the job, namely the block. */ - opt.argv[i++] = xstrdup("--env-all"); - - /* With runjob anything after a ':' is treated as the actual - * job, which in this case is exactly what it is. So, very - * sweet. */ - opt.argv[i++] = xstrdup(":"); - - /* Sanity check to make sure we set it up correctly. */ - if (i != command_pos) { - fatal ("command_pos is set to %d but we are going to " - "put it at %d, please update src/srun/opt.c", - command_pos, i); - } - - /* Set default job name to the executable name rather than - * "runjob" */ - if (!opt.job_name_set_cmd && (command_pos < opt.argc)) { - opt.job_name_set_cmd = true; - opt.job_name = xstrdup(rest[0]); - } - } -#endif if (opt.test_only && !opt.jobid_set && (opt.jobid != NO_VAL)) { /* Do not perform allocate test, only disable use of "runjob" */ opt.test_only = false; @@ -2228,6 +2134,9 @@ static bool _opt_verify(void) &opt.cpu_bind_type)) exit(error_exit); + if (!mpi_initialized) + (void) mpi_hook_client_init(NULL); + return verified; } @@ -2425,6 +2334,7 @@ static void _opt_list(void) opt.cpu_bind == NULL ? "default" : opt.cpu_bind); info("mem_bind : %s", opt.mem_bind == NULL ? "default" : opt.mem_bind); + info("cpu_freq : %u", opt.cpu_freq); info("verbose : %d", _verbose); info("slurmd_debug : %d", opt.slurmd_debug); if (opt.immediate <= 1) @@ -2526,7 +2436,7 @@ static void _opt_list(void) /* Determine if srun is under the control of a parallel debugger or not */ static bool _under_parallel_debugger (void) { -#if defined HAVE_BG_FILES && !defined HAVE_BGL && !defined HAVE_BGP +#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P /* Use symbols from the runjob.so library provided by IBM. * Do NOT use debugger symbols local to the srun command */ return false; diff --git a/src/srun/opt.h b/src/srun/libsrun/opt.h similarity index 98% rename from src/srun/opt.h rename to src/srun/libsrun/opt.h index 7080f70d6a0bfdc1db78be207ba3d08fbdaa53d7..030828b690da4c7141a24eb52cf8c8856f3ba08e 100644 --- a/src/srun/opt.h +++ b/src/srun/libsrun/opt.h @@ -55,7 +55,8 @@ #include "src/common/macros.h" /* true and false */ #include "src/common/env.h" -#include "src/srun/fname.h" + +#include "fname.h" #define DEFAULT_IMMEDIATE 1 #define MAX_THREADS 60 @@ -214,6 +215,7 @@ typedef struct srun_options { char *mail_user; /* --mail-user */ uint8_t open_mode; /* --open-mode=append|truncate */ int acctg_freq; /* --acctg-freq=secs */ + uint32_t cpu_freq; /* --cpu_freq=kilohertz */ bool pty; /* --pty */ char *restart_dir; /* --restart */ int argc; /* length of argv array */ @@ -225,6 +227,7 @@ typedef struct srun_options { int spank_job_env_size; /* size of spank_job_env */ int req_switch; /* Minimum number of switches */ int wait4switch; /* Maximum time to wait for minimum switches */ + bool user_managed_io; /* 0 for "normal" IO, 1 for "user manged" IO */ char *runjob_opts; /* Runjob command options, BGQ only */ } opt_t; @@ -232,6 +235,9 @@ extern opt_t opt; extern int error_exit; /* exit code for slurm errors */ extern int immediate_exit; /* exit code for --imediate option & busy */ +extern bool srun_max_timer; +extern bool srun_shutdown; +extern int sig_array[]; /* return whether any constraints were specified by the user * (if new constraints are added above, might want to add them to this diff --git a/src/srun/libsrun/srun_job.c b/src/srun/libsrun/srun_job.c new file mode 100644 index 0000000000000000000000000000000000000000..4a92e26580f448db22f7e6d7f79b1c43759ac264 --- /dev/null +++ b/src/srun/libsrun/srun_job.c @@ -0,0 +1,1349 @@ +/****************************************************************************\ + * srun_job.c - job data structure creation functions + ***************************************************************************** + * 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 Mark Grondona . + * CODE-OCEC-09-009. All rights reserved. + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include /* MAXPATHLEN */ +#include + + +#include "src/common/bitstring.h" +#include "src/common/cbuf.h" +#include "src/common/hostlist.h" +#include "src/common/log.h" +#include "src/common/plugstack.h" +#include "src/common/read_config.h" +#include "src/common/slurm_protocol_api.h" +#include "src/common/slurm_rlimits_info.h" +#include "src/common/xmalloc.h" +#include "src/common/xsignal.h" +#include "src/common/xstring.h" +#include "src/common/io_hdr.h" +#include "src/common/forward.h" +#include "src/common/fd.h" +#include "src/common/uid.h" + +#include "src/api/step_launch.h" + +#include "allocate.h" +#include "srun_job.h" +#include "opt.h" +#include "fname.h" +#include "debugger.h" +#include "launch.h" +#include "multi_prog.h" + +/* + * allocation information structure used to store general information + * about node allocation to be passed to _job_create_structure() + */ +typedef struct allocation_info { + char *alias_list; + uint16_t *cpus_per_node; + uint32_t *cpu_count_reps; + uint32_t jobid; + uint32_t nnodes; + char *nodelist; + uint32_t num_cpu_groups; + dynamic_plugin_data_t *select_jobinfo; + uint32_t stepid; +} allocation_info_t; + +static int shepard_fd = -1; +static pthread_t signal_thread = (pthread_t) 0; + +/* + * Prototypes: + */ +static inline int _estimate_nports(int nclients, int cli_per_port); +static int _compute_task_count(allocation_info_t *info); +static void _set_ntasks(allocation_info_t *info); +static srun_job_t *_job_create_structure(allocation_info_t *info); +static char * _normalize_hostlist(const char *hostlist); +static int _become_user(void); +static int _call_spank_local_user(srun_job_t *job); +static void _default_sigaction(int sig); +static long _diff_tv_str(struct timeval *tv1, struct timeval *tv2); +static void _handle_intr(srun_job_t *job); +static void _handle_pipe(void); +static void _print_job_information(resource_allocation_response_msg_t *resp); +static void _run_srun_epilog (srun_job_t *job); +static void _run_srun_prolog (srun_job_t *job); +static int _run_srun_script (srun_job_t *job, char *script); +static void _set_env_vars(resource_allocation_response_msg_t *resp); +static void _set_prio_process_env(void); +static int _set_rlimit_env(void); +static void _set_submit_dir_env(void); +static int _set_umask_env(void); +static void _shepard_notify(int shepard_fd); +static int _shepard_spawn(srun_job_t *job, bool got_alloc); +static void *_srun_signal_mgr(void *no_data); +static void _step_opt_exclusive(void); +static int _validate_relative(resource_allocation_response_msg_t *resp); + + +/* + * Create an srun job structure w/out an allocation response msg. + * (i.e. use the command line options) + */ +srun_job_t * +job_create_noalloc(void) +{ + srun_job_t *job = NULL; + allocation_info_t *ai = xmalloc(sizeof(allocation_info_t)); + uint16_t cpn = 1; + hostlist_t hl = hostlist_create(opt.nodelist); + + if (!hl) { + error("Invalid node list `%s' specified", opt.nodelist); + goto error; + } + srand48(getpid()); + ai->jobid = MIN_NOALLOC_JOBID + + ((uint32_t) lrand48() % + (MAX_NOALLOC_JOBID - MIN_NOALLOC_JOBID + 1)); + ai->stepid = (uint32_t) (lrand48()); + ai->nodelist = opt.nodelist; + ai->nnodes = hostlist_count(hl); + + hostlist_destroy(hl); + + cpn = (opt.ntasks + ai->nnodes - 1) / ai->nnodes; + ai->cpus_per_node = &cpn; + ai->cpu_count_reps = &ai->nnodes; + + /* + * Create job, then fill in host addresses + */ + job = _job_create_structure(ai); + + job_update_io_fnames(job); + +error: + xfree(ai); + return (job); + +} + +/* + * Create an srun job structure for a step w/out an allocation response msg. + * (i.e. inside an allocation) + */ +srun_job_t * +job_step_create_allocation(resource_allocation_response_msg_t *resp) +{ + uint32_t job_id = resp->job_id; + srun_job_t *job = NULL; + allocation_info_t *ai = xmalloc(sizeof(allocation_info_t)); + hostlist_t hl = NULL; + char *buf = NULL; + int count = 0; + uint32_t alloc_count = 0; + char *step_nodelist = NULL; + + ai->jobid = job_id; + ai->stepid = NO_VAL; + ai->alias_list = resp->alias_list; + ai->nodelist = opt.alloc_nodelist; + hl = hostlist_create(ai->nodelist); + hostlist_uniq(hl); + alloc_count = hostlist_count(hl); + ai->nnodes = alloc_count; + hostlist_destroy(hl); + + if (opt.exc_nodes) { + hostlist_t exc_hl = hostlist_create(opt.exc_nodes); + hostlist_t inc_hl = NULL; + char *node_name = NULL; + + hl = hostlist_create(ai->nodelist); + if (opt.nodelist) { + inc_hl = hostlist_create(opt.nodelist); + } + hostlist_uniq(hl); + //info("using %s or %s", opt.nodelist, ai->nodelist); + while ((node_name = hostlist_shift(exc_hl))) { + int inx = hostlist_find(hl, node_name); + if (inx >= 0) { + debug("excluding node %s", node_name); + hostlist_delete_nth(hl, inx); + ai->nnodes--; /* decrement node count */ + } + if (inc_hl) { + inx = hostlist_find(inc_hl, node_name); + if (inx >= 0) { + error("Requested node %s is also " + "in the excluded list.", + node_name); + error("Job not submitted."); + hostlist_destroy(exc_hl); + hostlist_destroy(inc_hl); + goto error; + } + } + free(node_name); + } + hostlist_destroy(exc_hl); + + /* we need to set this here so if there are more nodes + * available than we requested we can set it + * straight. If there is no exclude list then we set + * the vars then. + */ + if (!opt.nodes_set) { + /* we don't want to set the number of nodes = + * to the number of requested processes unless we + * know it is less than the number of nodes + * in the allocation + */ + if (opt.ntasks_set && (opt.ntasks < ai->nnodes)) + opt.min_nodes = opt.ntasks; + else + opt.min_nodes = ai->nnodes; + opt.nodes_set = true; + } + if (!opt.max_nodes) + opt.max_nodes = opt.min_nodes; + if ((opt.max_nodes > 0) && (opt.max_nodes < ai->nnodes)) + ai->nnodes = opt.max_nodes; + + count = hostlist_count(hl); + if (!count) { + error("Hostlist is now nothing! Can't run job."); + hostlist_destroy(hl); + goto error; + } + if (inc_hl) { + count = hostlist_count(inc_hl); + if (count < ai->nnodes) { + /* add more nodes to get correct number for + allocation */ + hostlist_t tmp_hl = hostlist_copy(hl); + int i=0; + int diff = ai->nnodes - count; + buf = hostlist_ranged_string_xmalloc(inc_hl); + hostlist_delete(tmp_hl, buf); + xfree(buf); + while ((node_name = hostlist_shift(tmp_hl)) && + (i < diff)) { + hostlist_push(inc_hl, node_name); + i++; + } + hostlist_destroy(tmp_hl); + } + buf = hostlist_ranged_string_xmalloc(inc_hl); + hostlist_destroy(inc_hl); + xfree(opt.nodelist); + opt.nodelist = buf; + } else { + if (count > ai->nnodes) { + /* remove more nodes than needed for + * allocation */ + int i; + for (i = count; i >= ai->nnodes; i--) + hostlist_delete_nth(hl, i); + } + xfree(opt.nodelist); + opt.nodelist = hostlist_ranged_string_xmalloc(hl); + } + + hostlist_destroy(hl); + } else { + if (!opt.nodes_set) { + /* we don't want to set the number of nodes = + * to the number of requested processes unless we + * know it is less than the number of nodes + * in the allocation + */ + if(opt.ntasks_set && (opt.ntasks < ai->nnodes)) + opt.min_nodes = opt.ntasks; + else + opt.min_nodes = ai->nnodes; + opt.nodes_set = true; + } + if (!opt.max_nodes) + opt.max_nodes = opt.min_nodes; + if ((opt.max_nodes > 0) && (opt.max_nodes < ai->nnodes)) + ai->nnodes = opt.max_nodes; + /* Don't reset the ai->nodelist because that is the + * nodelist we want to say the allocation is under + * opt.nodelist is what is used for the allocation. + */ + /* xfree(ai->nodelist); */ + /* ai->nodelist = xstrdup(buf); */ + } + + /* get the correct number of hosts to run tasks on */ + if (opt.nodelist) + step_nodelist = opt.nodelist; + else if ((opt.distribution == SLURM_DIST_ARBITRARY) && (count == 0)) + step_nodelist = getenv("SLURM_ARBITRARY_NODELIST"); + if (step_nodelist) { + hl = hostlist_create(step_nodelist); + if (opt.distribution != SLURM_DIST_ARBITRARY) + hostlist_uniq(hl); + if (!hostlist_count(hl)) { + error("Hostlist is now nothing! Can not run job."); + hostlist_destroy(hl); + goto error; + } + + buf = hostlist_ranged_string_xmalloc(hl); + count = hostlist_count(hl); + hostlist_destroy(hl); + /* Don't reset the ai->nodelist because that is the + * nodelist we want to say the allocation is under + * opt.nodelist is what is used for the allocation. + */ + /* xfree(ai->nodelist); */ + /* ai->nodelist = xstrdup(buf); */ + xfree(opt.nodelist); + opt.nodelist = buf; + } + + if ((opt.distribution == SLURM_DIST_ARBITRARY) && + (count != opt.ntasks)) { + error("You asked for %d tasks but specified %d nodes", + opt.ntasks, count); + goto error; + } + + if (ai->nnodes == 0) { + error("No nodes in allocation, can't run job"); + goto error; + } + + ai->num_cpu_groups = resp->num_cpu_groups; + ai->cpus_per_node = resp->cpus_per_node; + ai->cpu_count_reps = resp->cpu_count_reps; + +/* info("looking for %d nodes out of %s with a must list of %s", */ +/* ai->nnodes, ai->nodelist, opt.nodelist); */ + /* + * Create job + */ + job = _job_create_structure(ai); +error: + xfree(ai); + return (job); + +} + +/* + * Create an srun job structure from a resource allocation response msg + */ +extern srun_job_t * +job_create_allocation(resource_allocation_response_msg_t *resp) +{ + srun_job_t *job; + allocation_info_t *i = xmalloc(sizeof(allocation_info_t)); + + i->alias_list = resp->alias_list; + i->nodelist = _normalize_hostlist(resp->node_list); + i->nnodes = resp->node_cnt; + i->jobid = resp->job_id; + i->stepid = NO_VAL; + 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->select_jobinfo = select_g_select_jobinfo_copy(resp->select_jobinfo); + + job = _job_create_structure(i); + + xfree(i->nodelist); + xfree(i); + + return (job); +} + +extern void init_srun(int ac, char **av, + log_options_t *logopt, int debug_level, + bool slurm_started) +{ + /* This must happen before we spawn any threads + * which are not designed to handle them */ + if (xsignal_block(sig_array) < 0) + error("Unable to block signals"); + + /* Initialize plugin stack, read options from plugins, etc. + */ + init_spank_env(); + if (spank_init(NULL) < 0) { + error("Plug-in initialization failed"); + exit(error_exit); + } + + /* Be sure to call spank_fini when srun exits. + */ + if (atexit((void (*) (void)) spank_fini) < 0) + error("Failed to register atexit handler for plugins: %m"); + + /* set default options, process commandline arguments, and + * verify some basic values + */ + if (initialize_and_process_args(ac, av) < 0) { + error ("srun initialization failed"); + exit (1); + } + record_ppid(); + + if (spank_init_post_opt() < 0) { + error("Plugin stack post-option processing failed."); + exit(error_exit); + } + + /* reinit log with new verbosity (if changed by command line) + */ + if (logopt && (_verbose || opt.quiet)) { + /* If log level is already increased, only increment the + * level to the difference of _verbose an LOG_LEVEL_INFO + */ + if ((_verbose -= (logopt->stderr_level - LOG_LEVEL_INFO)) > 0) + logopt->stderr_level += _verbose; + logopt->stderr_level -= opt.quiet; + logopt->prefix_level = 1; + log_alter(*logopt, 0, NULL); + } else + _verbose = debug_level; + + (void) _set_rlimit_env(); + _set_prio_process_env(); + (void) _set_umask_env(); + _set_submit_dir_env(); + + /* Set up slurmctld message handler */ + slurmctld_msg_init(); +} + +extern void create_srun_job(srun_job_t **p_job, bool *got_alloc, + bool slurm_started) +{ + resource_allocation_response_msg_t *resp; + srun_job_t *job = NULL; + + /* now global "opt" should be filled in and available, + * create a job from opt + */ + if (opt.test_only) { + int rc = allocate_test(); + if (rc) { + slurm_perror("allocation failure"); + exit (1); + } + exit (0); + + } else if (opt.no_alloc) { + info("do not allocate resources"); + job = job_create_noalloc(); + if (create_job_step(job, false) < 0) { + exit(error_exit); + } + } else if ((resp = existing_allocation())) { + select_g_alter_node_cnt(SELECT_APPLY_NODE_MAX_OFFSET, + &resp->node_cnt); + if (opt.nodes_set_env && !opt.nodes_set_opt && + (opt.min_nodes > resp->node_cnt)) { + /* This signifies the job used the --no-kill option + * and a node went DOWN or it used a node count range + * specification, was checkpointed from one size and + * restarted at a different size */ + error("SLURM_NNODES environment varariable " + "conflicts with allocated node count (%u!=%u).", + opt.min_nodes, resp->node_cnt); + /* Modify options to match resource allocation. + * NOTE: Some options are not supported */ + opt.min_nodes = resp->node_cnt; + xfree(opt.alloc_nodelist); + if (!opt.ntasks_set) + opt.ntasks = opt.min_nodes; + } + if (opt.alloc_nodelist == NULL) + opt.alloc_nodelist = xstrdup(resp->node_list); + if (opt.exclusive) + _step_opt_exclusive(); + _set_env_vars(resp); + if (_validate_relative(resp)) + exit(error_exit); + job = job_step_create_allocation(resp); + slurm_free_resource_allocation_response_msg(resp); + + if (opt.begin != 0) { + error("--begin is ignored because nodes" + " are already allocated."); + } + if (!job || create_job_step(job, false) < 0) + exit(error_exit); + } else { + /* Combined job allocation and job step launch */ +#if defined HAVE_FRONT_END && (!defined HAVE_BG || defined HAVE_BG_L_P || !defined HAVE_BG_FILES) + uid_t my_uid = getuid(); + if ((my_uid != 0) && + (my_uid != slurm_get_slurm_user_id())) { + error("srun task launch not supported on this system"); + exit(error_exit); + } +#endif + if (opt.relative_set && opt.relative) { + fatal("--relative option invalid for job allocation " + "request"); + } + + if (!opt.job_name_set_env && opt.job_name_set_cmd) + setenvfs("SLURM_JOB_NAME=%s", opt.job_name); + else if (!opt.job_name_set_env && opt.argc) + setenvfs("SLURM_JOB_NAME=%s", opt.argv[0]); + + if ( !(resp = allocate_nodes()) ) + exit(error_exit); + *got_alloc = true; + _print_job_information(resp); + _set_env_vars(resp); + if (_validate_relative(resp)) { + slurm_complete_job(resp->job_id, 1); + exit(error_exit); + } + job = job_create_allocation(resp); + + opt.exclusive = false; /* not applicable for this step */ + opt.time_limit = NO_VAL;/* not applicable for step, only job */ + xfree(opt.constraints); /* not applicable for this step */ + if (!opt.job_name_set_cmd && opt.job_name_set_env) { + /* use SLURM_JOB_NAME env var */ + opt.job_name_set_cmd = true; + } + + /* + * Become --uid user + */ + if (_become_user () < 0) + info("Warning: Unable to assume uid=%u", opt.uid); + + if (!job || create_job_step(job, true) < 0) { + slurm_complete_job(resp->job_id, 1); + exit(error_exit); + } + + slurm_free_resource_allocation_response_msg(resp); + } + + /* + * Become --uid user + */ + if (_become_user () < 0) + info("Warning: Unable to assume uid=%u", opt.uid); + + if (!slurm_started) { + /* + * Spawn process to insure clean-up of job and/or step + * on abnormal termination + */ + shepard_fd = _shepard_spawn(job, got_alloc); + } + + *p_job = job; +} + +extern void pre_launch_srun_job(srun_job_t *job, bool slurm_started) +{ + pthread_attr_t thread_attr; + if (!signal_thread) { + slurm_attr_init(&thread_attr); + while (pthread_create(&signal_thread, &thread_attr, + _srun_signal_mgr, job)) { + error("pthread_create error %m"); + sleep(1); + } + slurm_attr_destroy(&thread_attr); + } + + /* if running from poe This already happened in srun. */ + if (slurm_started) + return; + + _run_srun_prolog(job); + if (_call_spank_local_user (job) < 0) { + error("Failure in local plugin stack"); + slurm_step_launch_abort(job->step_ctx); + exit(error_exit); + } +} + +extern void fini_srun(srun_job_t *job, bool got_alloc, uint32_t *global_rc, + pthread_t signal_thread, bool slurm_started) +{ + /* If running from poe Most of this already happened in srun. */ + if (slurm_started) + goto cleanup; + if (got_alloc) { + cleanup_allocation(); + + /* send the controller we were cancelled */ + if (job->state >= SRUN_JOB_CANCELLED) + slurm_complete_job(job->jobid, NO_VAL); + else + slurm_complete_job(job->jobid, *global_rc); + } + _shepard_notify(shepard_fd); + +cleanup: + if (signal_thread) { + srun_shutdown = true; + pthread_kill(signal_thread, SIGINT); + pthread_join(signal_thread, NULL); + } + + if (!slurm_started) + _run_srun_epilog(job); + + slurm_step_ctx_destroy(job->step_ctx); + + if (WIFEXITED(*global_rc)) + *global_rc = WEXITSTATUS(*global_rc); + + mpir_cleanup(); + log_fini(); +} + +void +update_job_state(srun_job_t *job, srun_job_state_t state) +{ + pthread_mutex_lock(&job->state_mutex); + if (job->state < state) { + job->state = state; + pthread_cond_signal(&job->state_cond); + + } + pthread_mutex_unlock(&job->state_mutex); + return; +} + +srun_job_state_t +job_state(srun_job_t *job) +{ + srun_job_state_t state; + slurm_mutex_lock(&job->state_mutex); + state = job->state; + slurm_mutex_unlock(&job->state_mutex); + return state; +} + + +void +job_force_termination(srun_job_t *job) +{ + static int kill_sent = 0; + static time_t last_msg = 0; + + if (kill_sent == 0) { + info("forcing job termination"); + /* Sends SIGKILL to tasks directly */ + update_job_state(job, SRUN_JOB_FORCETERM); + } else { + time_t now = time(NULL); + if (last_msg != now) { + info("job abort in progress"); + last_msg = now; + } + if (kill_sent == 1) { + /* Try sending SIGKILL through slurmctld */ + slurm_kill_job_step(job->jobid, job->stepid, SIGKILL); + } + } + kill_sent++; +} + +static inline int +_estimate_nports(int nclients, int cli_per_port) +{ + div_t d; + d = div(nclients, cli_per_port); + return d.rem > 0 ? d.quot + 1 : d.quot; +} + +static int +_compute_task_count(allocation_info_t *ainfo) +{ + int i, cnt = 0; +#if defined HAVE_BGQ +//#if defined HAVE_BGQ && HAVE_BG_FILES + /* always return the ntasks here for Q */ + info("returning %d", opt.ntasks); + return opt.ntasks; +#endif + if (opt.cpus_set) { + for (i = 0; i < ainfo->num_cpu_groups; i++) + cnt += ( ainfo->cpu_count_reps[i] * + (ainfo->cpus_per_node[i]/opt.cpus_per_task)); + } + return (cnt < ainfo->nnodes) ? ainfo->nnodes : cnt; +} + +static void +_set_ntasks(allocation_info_t *ai) +{ + if (!opt.ntasks_set) { + opt.ntasks = _compute_task_count(ai); + if (opt.cpus_set) + opt.ntasks_set = true; /* implicit */ + } +} + +/* + * Create an srun job structure from a resource allocation response msg + */ +static srun_job_t * +_job_create_structure(allocation_info_t *ainfo) +{ + srun_job_t *job = xmalloc(sizeof(srun_job_t)); + int i; + + _set_ntasks(ainfo); + debug2("creating job with %d tasks", opt.ntasks); + + slurm_mutex_init(&job->state_mutex); + pthread_cond_init(&job->state_cond, NULL); + job->state = SRUN_JOB_INIT; + + job->alias_list = xstrdup(ainfo->alias_list); + job->nodelist = xstrdup(ainfo->nodelist); + job->stepid = ainfo->stepid; + +#if defined HAVE_BGQ +//#if defined HAVE_BGQ && defined HAVE_BG_FILES + job->nhosts = ainfo->nnodes; + select_g_alter_node_cnt(SELECT_APPLY_NODE_MAX_OFFSET, &job->nhosts); +#elif defined HAVE_FRONT_END /* Limited job step support */ + opt.overcommit = true; + job->nhosts = 1; +#else + job->nhosts = ainfo->nnodes; +#endif + +#if !defined HAVE_FRONT_END || (defined HAVE_BGQ) +//#if !defined HAVE_FRONT_END || (defined HAVE_BGQ && defined HAVE_BG_FILES) + if(opt.min_nodes > job->nhosts) { + error("Only allocated %d nodes asked for %d", + job->nhosts, opt.min_nodes); + if (opt.exc_nodes) { + /* When resources are pre-allocated and some nodes + * are explicitly excluded, this error can occur. */ + error("Are required nodes explicitly excluded?"); + } + return NULL; + } + if ((ainfo->cpus_per_node == NULL) || + (ainfo->cpu_count_reps == NULL)) { + error("cpus_per_node array is not set"); + return NULL; + } +#endif + job->select_jobinfo = ainfo->select_jobinfo; + job->jobid = ainfo->jobid; + + job->ntasks = opt.ntasks; + for (i=0; inum_cpu_groups; i++) { + job->cpu_count += ainfo->cpus_per_node[i] * + ainfo->cpu_count_reps[i]; + } + + job->rc = -1; + + job_update_io_fnames(job); + + return (job); +} + +void +job_update_io_fnames(srun_job_t *job) +{ + job->ifname = fname_create(job, opt.ifname); + job->ofname = fname_create(job, opt.ofname); + job->efname = opt.efname ? fname_create(job, opt.efname) : job->ofname; +} + +static char * +_normalize_hostlist(const char *hostlist) +{ + char *buf = NULL; + hostlist_t hl = hostlist_create(hostlist); + + if (hl) { + buf = hostlist_ranged_string_xmalloc(hl); + hostlist_destroy(hl); + } + if (!buf) + return xstrdup(hostlist); + + return buf; +} + +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) { + xfree(user); + return (error ("Invalid user id %u: %m", opt.uid)); + } + + if (opt.uid == getuid ()) { + xfree(user); + return (0); + } + + if ((opt.egid != (gid_t) -1) && (setgid (opt.egid) < 0)) { + xfree(user); + return (error ("setgid: %m")); + } + + initgroups (user, gid); /* Ignore errors */ + xfree(user); + + if (setuid (opt.uid) < 0) + return (error ("setuid: %m")); + + return (0); +} + +static int _call_spank_local_user (srun_job_t *job) +{ + struct spank_launcher_job_info info[1]; + + info->uid = opt.uid; + info->gid = opt.gid; + info->jobid = job->jobid; + info->stepid = job->stepid; + info->step_layout = launch_common_get_slurm_step_layout(job); + info->argc = opt.argc; + info->argv = opt.argv; + + return spank_local_user(info); +} + +static void _default_sigaction(int sig) +{ + struct sigaction act; + if (sigaction(sig, NULL, &act)) { + error("sigaction(%d): %m", sig); + return; + } + if (act.sa_handler != SIG_IGN) + return; + + act.sa_handler = SIG_DFL; + if (sigaction(sig, &act, NULL)) + error("sigaction(%d): %m", sig); +} + +/* Return the number of microseconds between tv1 and tv2 with a maximum + * a maximum value of 10,000,000 to prevent overflows */ +static long _diff_tv_str(struct timeval *tv1, struct timeval *tv2) +{ + long delta_t; + + delta_t = MIN((tv2->tv_sec - tv1->tv_sec), 10); + delta_t *= 1000000; + delta_t += tv2->tv_usec - tv1->tv_usec; + return delta_t; +} + +static void _handle_intr(srun_job_t *job) +{ + static struct timeval last_intr = { 0, 0 }; + static struct timeval last_intr_sent = { 0, 0 }; + struct timeval now; + + gettimeofday(&now, NULL); + if (!opt.quit_on_intr && (_diff_tv_str(&last_intr, &now) > 1000000)) { + if (opt.disable_status) { + info("sending Ctrl-C to job %u.%u", + job->jobid, job->stepid); + launch_g_fwd_signal(SIGINT); + } else if (job->state < SRUN_JOB_FORCETERM) { + info("interrupt (one more within 1 sec to abort)"); + launch_g_print_status(); + } else { + info("interrupt (abort already in progress)"); + launch_g_print_status(); + } + last_intr = now; + } else { /* second Ctrl-C in half as many seconds */ + update_job_state(job, SRUN_JOB_CANCELLED); + /* terminate job */ + if (job->state < SRUN_JOB_FORCETERM) { + if (_diff_tv_str(&last_intr_sent, &now) < 1000000) { + job_force_termination(job); + launch_g_fwd_signal(SIGKILL); + return; + } + + info("sending Ctrl-C to job %u.%u", + job->jobid, job->stepid); + last_intr_sent = now; + launch_g_fwd_signal(SIGINT); + } else + job_force_termination(job); + + launch_g_fwd_signal(SIGKILL); + } +} + +static void _handle_pipe(void) +{ + static int ending = 0; + + if (ending) + return; + ending = 1; + launch_g_fwd_signal(SIGKILL); +} + + +static void _print_job_information(resource_allocation_response_msg_t *resp) +{ + int i; + char *str = NULL; + char *sep = ""; + + if (!_verbose) + return; + + xstrfmtcat(str, "jobid %u: nodes(%u):`%s', cpu counts: ", + resp->job_id, resp->node_cnt, resp->node_list); + + for (i = 0; i < resp->num_cpu_groups; i++) { + xstrfmtcat(str, "%s%u(x%u)", + sep, resp->cpus_per_node[i], + resp->cpu_count_reps[i]); + sep = ","; + } + verbose("%s", str); + xfree(str); +} + +static void _run_srun_epilog (srun_job_t *job) +{ + int rc; + + if (opt.epilog && strcasecmp(opt.epilog, "none") != 0) { + rc = _run_srun_script(job, opt.epilog); + debug("srun epilog rc = %d", rc); + } +} + +static void _run_srun_prolog (srun_job_t *job) +{ + int rc; + + if (opt.prolog && strcasecmp(opt.prolog, "none") != 0) { + rc = _run_srun_script(job, opt.prolog); + debug("srun prolog rc = %d", rc); + } +} + +static int _run_srun_script (srun_job_t *job, char *script) +{ + int status; + pid_t cpid; + int i; + char **args = NULL; + + if (script == NULL || script[0] == '\0') + return 0; + + if (access(script, R_OK | X_OK) < 0) { + info("Access denied for %s: %m", script); + return 0; + } + + if ((cpid = fork()) < 0) { + error ("run_srun_script: fork: %m"); + return -1; + } + if (cpid == 0) { + + /* set the scripts command line arguments to the arguments + * for the application, but shifted one higher + */ + args = xmalloc(sizeof(char *) * 1024); + args[0] = script; + for (i = 0; i < opt.argc; i++) { + args[i+1] = opt.argv[i]; + } + args[i+1] = NULL; + execv(script, args); + error("help! %m"); + exit(127); + } + + do { + if (waitpid(cpid, &status, 0) < 0) { + if (errno == EINTR) + continue; + error("waitpid: %m"); + return 0; + } else + return status; + } while(1); + + /* NOTREACHED */ +} + +static void _set_env_vars(resource_allocation_response_msg_t *resp) +{ + char *tmp; + + if (!getenv("SLURM_JOB_CPUS_PER_NODE")) { + tmp = uint32_compressed_to_str(resp->num_cpu_groups, + resp->cpus_per_node, + resp->cpu_count_reps); + if (setenvf(NULL, "SLURM_JOB_CPUS_PER_NODE", "%s", tmp) < 0) { + error("unable to set SLURM_JOB_CPUS_PER_NODE in " + "environment"); + } + xfree(tmp); + } + + if (resp->alias_list) { + if (setenv("SLURM_NODE_ALIASES", resp->alias_list, 1) < 0) { + error("unable to set SLURM_NODE_ALIASES in " + "environment"); + } + } else { + unsetenv("SLURM_NODE_ALIASES"); + } + + return; +} + +/* + * _set_prio_process_env + * + * Set the internal SLURM_PRIO_PROCESS environment variable to support + * the propagation of the users nice value and the "PropagatePrioProcess" + * config keyword. + */ +static void _set_prio_process_env(void) +{ + int retval; + + errno = 0; /* needed to detect a real failure since prio can be -1 */ + + if ((retval = getpriority (PRIO_PROCESS, 0)) == -1) { + if (errno) { + error ("getpriority(PRIO_PROCESS): %m"); + return; + } + } + + if (setenvf (NULL, "SLURM_PRIO_PROCESS", "%d", retval) < 0) { + error ("unable to set SLURM_PRIO_PROCESS in environment"); + return; + } + + debug ("propagating SLURM_PRIO_PROCESS=%d", retval); +} + +/* Set SLURM_RLIMIT_* environment variables with current resource + * limit values, reset RLIMIT_NOFILE to maximum possible value */ +static int _set_rlimit_env(void) +{ + int rc = SLURM_SUCCESS; + struct rlimit rlim[1]; + unsigned long cur; + char name[64], *format; + slurm_rlimits_info_t *rli; + + /* Modify limits with any command-line options */ + if (opt.propagate && parse_rlimits( opt.propagate, PROPAGATE_RLIMITS)){ + error( "--propagate=%s is not valid.", opt.propagate ); + exit(error_exit); + } + + for (rli = get_slurm_rlimits_info(); rli->name != NULL; rli++ ) { + + if (rli->propagate_flag != PROPAGATE_RLIMITS) + continue; + + if (getrlimit (rli->resource, rlim) < 0) { + error ("getrlimit (RLIMIT_%s): %m", rli->name); + rc = SLURM_FAILURE; + continue; + } + + cur = (unsigned long) rlim->rlim_cur; + snprintf(name, sizeof(name), "SLURM_RLIMIT_%s", rli->name); + if (opt.propagate && rli->propagate_flag == PROPAGATE_RLIMITS) + /* + * Prepend 'U' to indicate user requested propagate + */ + format = "U%lu"; + else + format = "%lu"; + + if (setenvf (NULL, name, format, cur) < 0) { + error ("unable to set %s in environment", name); + rc = SLURM_FAILURE; + continue; + } + + debug ("propagating RLIMIT_%s=%lu", rli->name, cur); + } + + /* + * Now increase NOFILE to the max available for this srun + */ + if (getrlimit (RLIMIT_NOFILE, rlim) < 0) + return (error ("getrlimit (RLIMIT_NOFILE): %m")); + + if (rlim->rlim_cur < rlim->rlim_max) { + rlim->rlim_cur = rlim->rlim_max; + if (setrlimit (RLIMIT_NOFILE, rlim) < 0) + return (error ("Unable to increase max no. files: %m")); + } + + return rc; +} + +/* Set SLURM_SUBMIT_DIR environment variable with current state */ +static void _set_submit_dir_env(void) +{ + char buf[MAXPATHLEN + 1]; + + if ((getcwd(buf, MAXPATHLEN)) == NULL) { + error("getcwd failed: %m"); + exit(error_exit); + } + + if (setenvf(NULL, "SLURM_SUBMIT_DIR", "%s", buf) < 0) { + error("unable to set SLURM_SUBMIT_DIR in environment"); + return; + } +} + +/* Set some environment variables with current state */ +static int _set_umask_env(void) +{ + if (!getenv("SRUN_DEBUG")) { /* do not change current value */ + /* NOTE: Default debug level is 3 (info) */ + int log_level = LOG_LEVEL_INFO + _verbose - opt.quiet; + + if (setenvf(NULL, "SRUN_DEBUG", "%d", log_level) < 0) + error ("unable to set SRUN_DEBUG in environment"); + } + + if (!getenv("SLURM_UMASK")) { /* do not change current value */ + char mask_char[5]; + mode_t mask; + + mask = (int)umask(0); + umask(mask); + + sprintf(mask_char, "0%d%d%d", + ((mask>>6)&07), ((mask>>3)&07), mask&07); + if (setenvf(NULL, "SLURM_UMASK", "%s", mask_char) < 0) { + error ("unable to set SLURM_UMASK in environment"); + return SLURM_FAILURE; + } + debug ("propagating UMASK=%s", mask_char); + } + + return SLURM_SUCCESS; +} + +static void _shepard_notify(int shepard_fd) +{ + int rc; + + while (1) { + rc = write(shepard_fd, "", 1); + if (rc == -1) { + if ((errno == EAGAIN) || (errno == EINTR)) + continue; + error("write(shepard): %m"); + } + break; + } + close(shepard_fd); +} + +static int _shepard_spawn(srun_job_t *job, bool got_alloc) +{ + int shepard_pipe[2], rc; + pid_t shepard_pid; + char buf[1]; + + if (pipe(shepard_pipe)) { + error("pipe: %m"); + return -1; + } + + shepard_pid = fork(); + if (shepard_pid == -1) { + error("fork: %m"); + return -1; + } + if (shepard_pid != 0) { + close(shepard_pipe[0]); + return shepard_pipe[1]; + } + + /* Wait for parent to notify of completion or I/O error on abort */ + close(shepard_pipe[1]); + while (1) { + rc = read(shepard_pipe[0], buf, 1); + if (rc == 1) { + exit(0); + } else if (rc == 0) { + break; /* EOF */ + } else if (rc == -1) { + if ((errno == EAGAIN) || (errno == EINTR)) + continue; + break; + } + } + + (void) slurm_terminate_job_step(job->jobid, job->stepid); + if (got_alloc) + slurm_complete_job(job->jobid, NO_VAL); + exit(0); + return -1; +} + +/* _srun_signal_mgr - Process daemon-wide signals */ +static void *_srun_signal_mgr(void *job_ptr) +{ + int sig; + int i, rc; + sigset_t set; + srun_job_t *job = (srun_job_t *)job_ptr; + + /* Make sure no required signals are ignored (possibly inherited) */ + for (i = 0; sig_array[i]; i++) + _default_sigaction(sig_array[i]); + while (!srun_shutdown) { + xsignal_sigset_create(sig_array, &set); + rc = sigwait(&set, &sig); + if (rc == EINTR) + continue; + switch (sig) { + case SIGINT: + if (!srun_shutdown) + _handle_intr(job); + break; + case SIGQUIT: + info("Quit"); + /* continue with slurm_step_launch_abort */ + case SIGTERM: + case SIGHUP: + /* No need to call job_force_termination here since we + * are ending the job now and we don't need to update + * the state. */ + info("forcing job termination"); + launch_g_fwd_signal(SIGKILL); + break; + case SIGCONT: + info("got SIGCONT"); + break; + case SIGPIPE: + _handle_pipe(); + break; + case SIGALRM: + if (srun_max_timer) { + info("First task exited %ds ago", opt.max_wait); + launch_g_print_status(); + launch_g_step_terminate(); + } + break; + default: + launch_g_fwd_signal(sig); + break; + } + } + return NULL; +} + +/* opt.exclusive is set, disable user task layout controls */ +static void _step_opt_exclusive(void) +{ + if (!opt.ntasks_set) { + error("--ntasks must be set with --exclusive"); + exit(error_exit); + } + if (opt.relative_set) { + error("--relative disabled, incompatible with --exclusive"); + exit(error_exit); + } + if (opt.exc_nodes) { + error("--exclude is incompatible with --exclusive"); + exit(error_exit); + } +} + +static int _validate_relative(resource_allocation_response_msg_t *resp) +{ + + if (opt.relative_set && + ((opt.relative + opt.min_nodes) > resp->node_cnt)) { + if (opt.nodes_set_opt) { /* -N command line option used */ + error("--relative and --nodes option incompatible " + "with count of allocated nodes (%d+%d>%d)", + opt.relative, opt.min_nodes, resp->node_cnt); + } else { /* SLURM_NNODES option used */ + error("--relative and SLURM_NNODES option incompatible " + "with count of allocated nodes (%d+%d>%d)", + opt.relative, opt.min_nodes, resp->node_cnt); + } + return -1; + } + return 0; +} + diff --git a/src/srun/srun_job.h b/src/srun/libsrun/srun_job.h similarity index 93% rename from src/srun/srun_job.h rename to src/srun/libsrun/srun_job.h index 974d2e45eb6339849e965fbe86d21bb1d9713b52..4ad62d6f47a53172995ecdab331d617f148a7b1f 100644 --- a/src/srun/srun_job.h +++ b/src/srun/libsrun/srun_job.h @@ -52,6 +52,7 @@ #include "src/common/macros.h" #include "src/common/node_select.h" #include "src/common/slurm_protocol_defs.h" + #include "src/api/step_io.h" @@ -129,8 +130,17 @@ extern srun_job_t *job_step_create_allocation( resource_allocation_response_msg_t *resp); extern srun_job_t * job_create_allocation( resource_allocation_response_msg_t *resp); -extern srun_job_t * job_create_structure( - resource_allocation_response_msg_t *resp); + +extern void init_srun(int ac, char **av, + log_options_t *logopt, int debug_level, + bool slurm_started); + +extern void create_srun_job(srun_job_t **p_job, bool *got_alloc, + bool slurm_started); +extern void pre_launch_srun_job(srun_job_t *job, bool slurm_started); + +extern void fini_srun(srun_job_t *job, bool got_alloc, uint32_t *global_rc, + pthread_t signal_thread, bool slurm_started); /* * Update job filenames and modes for stderr, stdout, and stdin. diff --git a/src/srun/srun.c b/src/srun/srun.c index 2e66d74c49a24af91083fc1b3e2dbd9d7fab2768..1d23f201ccf40a021da5a1f50e6eba793c8be112 100644 --- a/src/srun/srun.c +++ b/src/srun/srun.c @@ -74,7 +74,6 @@ #include "src/common/fd.h" #include "src/common/hostlist.h" #include "src/common/log.h" -#include "src/common/mpi.h" #include "src/common/net.h" #include "src/common/plugstack.h" #include "src/common/read_config.h" @@ -88,22 +87,17 @@ #include "src/common/xsignal.h" #include "src/common/xstring.h" -#include "src/srun/allocate.h" -#include "src/srun/srun_job.h" -#include "src/srun/opt.h" -#include "src/srun/debugger.h" -#include "src/srun/srun.h" +#include "launch.h" +#include "allocate.h" +#include "srun_job.h" +#include "opt.h" +#include "debugger.h" #include "src/srun/srun_pty.h" -#include "src/srun/multi_prog.h" -#include "src/srun/task_state.h" +#include "multi_prog.h" #include "src/api/pmi_server.h" #include "src/api/step_ctx.h" #include "src/api/step_launch.h" -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P -#include "src/srun/runjob_interface.h" -#endif - #if defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL # ifndef strsignal extern char *strsignal(int); @@ -124,59 +118,24 @@ #define TYPE_TEXT 1 #define TYPE_SCRIPT 2 -mpi_plugin_client_info_t mpi_job_info[1]; static struct termios termdefaults; -uint32_t global_rc = 0; -srun_job_t *job = NULL; -task_state_t task_state; - -#define MAX_STEP_RETRIES 4 -time_t launch_start_time; -bool retry_step_begin = false; -int retry_step_cnt = 0; +static uint32_t global_rc = 0; +static srun_job_t *job = NULL; bool srun_max_timer = false; bool srun_shutdown = false; -static int sig_array[] = { +int sig_array[] = { SIGINT, SIGQUIT, SIGCONT, SIGTERM, SIGHUP, SIGALRM, SIGUSR1, SIGUSR2, SIGPIPE, 0 }; /* * forward declaration of static funcs */ -static int _become_user (void); -static int _call_spank_local_user (srun_job_t *job); -static void _default_sigaction(int sig); -static void _define_symbols(void); -static void _handle_intr(void); -static void _handle_pipe(void); -static void _print_job_information(resource_allocation_response_msg_t *resp); static void _pty_restore(void); -static void _run_srun_prolog (srun_job_t *job); -static void _run_srun_epilog (srun_job_t *job); -static int _run_srun_script (srun_job_t *job, char *script); -static void _set_env_vars(resource_allocation_response_msg_t *resp); static void _set_exit_code(void); static void _set_node_alias(void); -static void _step_opt_exclusive(void); -static void _set_stdio_fds(srun_job_t *job, slurm_step_io_fds_t *cio_fds); -static void _set_submit_dir_env(void); -static void _set_prio_process_env(void); -static int _set_rlimit_env(void); -static int _set_umask_env(void); -static void _shepard_notify(int shepard_fd); -static int _shepard_spawn(srun_job_t *job, bool got_alloc); static int _slurm_debug_env_val (void); -static void *_srun_signal_mgr(void *no_data); static char *_uint16_array_to_str(int count, const uint16_t *array); -static int _validate_relative(resource_allocation_response_msg_t *resp); -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P -static void _send_step_complete_rpc(int step_rc); -static pthread_t _spawn_msg_handler(void); -#else -static void _task_start(launch_tasks_response_msg_t *msg); -static void _task_finish(task_exit_msg_t *msg); -#endif /* * from libvirt-0.6.2 GPL2 @@ -200,21 +159,12 @@ void cfmakeraw(struct termios *attr) int srun(int ac, char **av) { - resource_allocation_response_msg_t *resp; int debug_level; env_t *env = xmalloc(sizeof(env_t)); log_options_t logopt = LOG_OPTS_STDERR_ONLY; - pthread_attr_t thread_attr; pthread_t signal_thread = (pthread_t) 0; bool got_alloc = false; - int shepard_fd = -1; -#if !defined HAVE_BG_FILES || defined HAVE_BG_L_P - slurm_step_launch_params_t launch_params; - slurm_step_launch_callbacks_t callbacks; -#else - slurm_step_io_fds_t cio_fds; - pthread_t msg_thread = (pthread_t) 0; -#endif + slurm_step_io_fds_t cio_fds = SLURM_STEP_IO_FDS_INITIALIZER; env->stepid = -1; env->procid = -1; @@ -232,182 +182,18 @@ int srun(int ac, char **av) if (slurm_select_init(1) != SLURM_SUCCESS ) fatal( "failed to initialize node selection plugin" ); - /* This must happen before we spawn any threads - * which are not designed to handle them */ - if (xsignal_block(sig_array) < 0) - error("Unable to block signals"); + if (switch_init() != SLURM_SUCCESS ) + fatal("failed to initialize switch plugin"); + #ifndef HAVE_CRAY_EMULATION if (is_cray_system() || is_cray_select_type()) { error("operation not supported on Cray systems - use aprun(1)"); exit(error_exit); } #endif - /* Initialize plugin stack, read options from plugins, etc. - */ - init_spank_env(); - if (spank_init(NULL) < 0) { - error("Plug-in initialization failed"); - exit(error_exit); - _define_symbols(); - } - - /* Be sure to call spank_fini when srun exits. - */ - if (atexit((void (*) (void)) spank_fini) < 0) - error("Failed to register atexit handler for plugins: %m"); - - /* set default options, process commandline arguments, and - * verify some basic values - */ - if (initialize_and_process_args(ac, av) < 0) { - error ("srun initialization failed"); - exit (1); - } - record_ppid(); - - if (spank_init_post_opt() < 0) { - error("Plugin stack post-option processing failed."); - exit(error_exit); - } - - /* reinit log with new verbosity (if changed by command line) - */ - if (_verbose || opt.quiet) { - /* If log level is already increased, only increment the - * level to the difference of _verbose an LOG_LEVEL_INFO - */ - if ((_verbose -= (logopt.stderr_level - LOG_LEVEL_INFO)) > 0) - logopt.stderr_level += _verbose; - logopt.stderr_level -= opt.quiet; - logopt.prefix_level = 1; - log_alter(logopt, 0, NULL); - } else - _verbose = debug_level; - - (void) _set_rlimit_env(); - _set_prio_process_env(); - (void) _set_umask_env(); - _set_submit_dir_env(); - - /* Set up slurmctld message handler */ - slurmctld_msg_init(); - - /* now global "opt" should be filled in and available, - * create a job from opt - */ - if (opt.test_only) { - int rc = allocate_test(); - if (rc) { - slurm_perror("allocation failure"); - exit (1); - } - exit (0); - - } else if (opt.no_alloc) { - info("do not allocate resources"); - job = job_create_noalloc(); - if (create_job_step(job, false) < 0) { - exit(error_exit); - } - } else if ((resp = existing_allocation())) { - select_g_alter_node_cnt(SELECT_APPLY_NODE_MAX_OFFSET, - &resp->node_cnt); - if (opt.nodes_set_env && !opt.nodes_set_opt && - (opt.min_nodes > resp->node_cnt)) { - /* This signifies the job used the --no-kill option - * and a node went DOWN or it used a node count range - * specification, was checkpointed from one size and - * restarted at a different size */ - error("SLURM_NNODES environment varariable " - "conflicts with allocated node count (%u!=%u).", - opt.min_nodes, resp->node_cnt); - /* Modify options to match resource allocation. - * NOTE: Some options are not supported */ - opt.min_nodes = resp->node_cnt; - xfree(opt.alloc_nodelist); - if (!opt.ntasks_set) - opt.ntasks = opt.min_nodes; - } - if (opt.alloc_nodelist == NULL) - opt.alloc_nodelist = xstrdup(resp->node_list); - if (opt.exclusive) - _step_opt_exclusive(); - _set_env_vars(resp); - if (_validate_relative(resp)) - exit(error_exit); - job = job_step_create_allocation(resp); - slurm_free_resource_allocation_response_msg(resp); - - if (opt.begin != 0) { - error("--begin is ignored because nodes" - " are already allocated."); - } - if (!job || create_job_step(job, false) < 0) - exit(error_exit); - } else { - /* Combined job allocation and job step launch */ -#if defined HAVE_FRONT_END && (!defined HAVE_BG || defined HAVE_BG_L_P || !defined HAVE_BG_FILES) - uid_t my_uid = getuid(); - if ((my_uid != 0) && - (my_uid != slurm_get_slurm_user_id())) { - error("srun task launch not supported on this system"); - exit(error_exit); - } -#endif - if (opt.relative_set && opt.relative) { - fatal("--relative option invalid for job allocation " - "request"); - } - - if (!opt.job_name_set_env && opt.job_name_set_cmd) - setenvfs("SLURM_JOB_NAME=%s", opt.job_name); - else if (!opt.job_name_set_env && opt.argc) - setenvfs("SLURM_JOB_NAME=%s", opt.argv[0]); - - if ( !(resp = allocate_nodes()) ) - exit(error_exit); - got_alloc = true; - _print_job_information(resp); - _set_env_vars(resp); - if (_validate_relative(resp)) { - slurm_complete_job(resp->job_id, 1); - exit(error_exit); - } - job = job_create_allocation(resp); - - opt.exclusive = false; /* not applicable for this step */ - opt.time_limit = NO_VAL;/* not applicable for step, only job */ - xfree(opt.constraints); /* not applicable for this step */ - if (!opt.job_name_set_cmd && opt.job_name_set_env) { - /* use SLURM_JOB_NAME env var */ - opt.job_name_set_cmd = true; - } - - /* - * Become --uid user - */ - if (_become_user () < 0) - info("Warning: Unable to assume uid=%u", opt.uid); - if (!job || create_job_step(job, true) < 0) { - slurm_complete_job(resp->job_id, 1); - exit(error_exit); - } - - slurm_free_resource_allocation_response_msg(resp); - } - - /* - * Become --uid user - */ - if (_become_user () < 0) - info("Warning: Unable to assume uid=%u", opt.uid); - - /* - * Spawn process to insure clean-up of job and/or step on abnormal - * termination - */ - shepard_fd = _shepard_spawn(job, got_alloc); + init_srun(ac, av, &logopt, debug_level, 0); + create_srun_job(&job, &got_alloc, 0); /* * Enhance environment for job @@ -425,6 +211,7 @@ int srun(int ac, char **av) env->plane_size = opt.plane_size; env->cpu_bind_type = opt.cpu_bind_type; env->cpu_bind = opt.cpu_bind; + env->cpu_freq = opt.cpu_freq; env->mem_bind_type = opt.mem_bind_type; env->mem_bind = opt.mem_bind; env->overcommit = opt.overcommit; @@ -471,199 +258,22 @@ int srun(int ac, char **av) xfree(env); _set_node_alias(); - if (!signal_thread) { - slurm_attr_init(&thread_attr); - while (pthread_create(&signal_thread, &thread_attr, - _srun_signal_mgr, NULL)) { - error("pthread_create error %m"); - sleep(1); - } - slurm_attr_destroy(&thread_attr); - } - -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P - _run_srun_prolog(job); - if (_call_spank_local_user (job) < 0) { - error("Failure in local plugin stack"); - exit(error_exit); - } - memset(&cio_fds, 0, sizeof(slurm_step_io_fds_t)); - _set_stdio_fds(job, &cio_fds); - msg_thread = _spawn_msg_handler(); - global_rc = runjob_launch(opt.argc, opt.argv, - cio_fds.in.fd, - cio_fds.out.fd, - cio_fds.err.fd); - _send_step_complete_rpc(global_rc); - if (msg_thread) { - srun_shutdown = true; - pthread_cancel(msg_thread); - pthread_join(msg_thread, NULL); - } -#else - re_launch: - task_state = task_state_create(opt.ntasks); - slurm_step_launch_params_t_init(&launch_params); - launch_params.gid = opt.gid; - launch_params.alias_list = job->alias_list; - launch_params.argc = opt.argc; - launch_params.argv = opt.argv; - launch_params.multi_prog = opt.multi_prog ? true : false; - launch_params.cwd = opt.cwd; - launch_params.slurmd_debug = opt.slurmd_debug; - launch_params.buffered_stdio = !opt.unbuffered; - launch_params.labelio = opt.labelio ? true : false; - launch_params.remote_output_filename =fname_remote_string(job->ofname); - launch_params.remote_input_filename = fname_remote_string(job->ifname); - launch_params.remote_error_filename = fname_remote_string(job->efname); - launch_params.task_prolog = opt.task_prolog; - launch_params.task_epilog = opt.task_epilog; - launch_params.cpu_bind = opt.cpu_bind; - launch_params.cpu_bind_type = opt.cpu_bind_type; - launch_params.mem_bind = opt.mem_bind; - launch_params.mem_bind_type = opt.mem_bind_type; - launch_params.open_mode = opt.open_mode; - if (opt.acctg_freq >= 0) - launch_params.acctg_freq = opt.acctg_freq; - launch_params.pty = opt.pty; - if (opt.cpus_set) - launch_params.cpus_per_task = opt.cpus_per_task; - else - launch_params.cpus_per_task = 1; - launch_params.task_dist = opt.distribution; - launch_params.ckpt_dir = opt.ckpt_dir; - launch_params.restart_dir = opt.restart_dir; - launch_params.preserve_env = opt.preserve_env; - launch_params.spank_job_env = opt.spank_job_env; - launch_params.spank_job_env_size = opt.spank_job_env_size; + /* re_launch: */ +relaunch: + pre_launch_srun_job(job, 0); - _set_stdio_fds(job, &launch_params.local_fds); + launch_common_set_stdio_fds(job, &cio_fds); - if (MPIR_being_debugged) { - launch_params.parallel_debug = true; - pmi_server_max_threads(1); - } else { - launch_params.parallel_debug = false; + if (!launch_g_step_launch(job, &cio_fds, &global_rc)) { + if (launch_g_step_wait(job, got_alloc) == -1) + goto relaunch; } - callbacks.task_start = _task_start; - callbacks.task_finish = _task_finish; - _run_srun_prolog(job); + fini_srun(job, got_alloc, &global_rc, signal_thread, 0); - mpir_init(job->ctx_params.task_count); - - if (_call_spank_local_user (job) < 0) { - error("Failure in local plugin stack"); - slurm_step_launch_abort(job->step_ctx); - exit(error_exit); - } - - update_job_state(job, SRUN_JOB_LAUNCHING); - launch_start_time = time(NULL); - if (slurm_step_launch(job->step_ctx, &launch_params, &callbacks) != - SLURM_SUCCESS) { - error("Application launch failed: %m"); - global_rc = 1; - slurm_step_launch_abort(job->step_ctx); - slurm_step_launch_wait_finish(job->step_ctx); - goto cleanup; - } - - update_job_state(job, SRUN_JOB_STARTING); - if (slurm_step_launch_wait_start(job->step_ctx) == SLURM_SUCCESS) { - update_job_state(job, SRUN_JOB_RUNNING); - /* Only set up MPIR structures if the step launched - * correctly. */ - if (opt.multi_prog) - mpir_set_multi_name(job->ctx_params.task_count, - launch_params.argv[0]); - else - mpir_set_executable_names(launch_params.argv[0]); - MPIR_debug_state = MPIR_DEBUG_SPAWNED; - if (opt.debugger_test) - mpir_dump_proctable(); - else - MPIR_Breakpoint(job); - } else { - info("Job step %u.%u aborted before step completely launched.", - job->jobid, job->stepid); - } - - slurm_step_launch_wait_finish(job->step_ctx); - if ((MPIR_being_debugged == 0) && retry_step_begin && - (retry_step_cnt < MAX_STEP_RETRIES)) { - retry_step_begin = false; - slurm_step_ctx_destroy(job->step_ctx); - if (got_alloc) { - if (create_job_step(job, true) < 0) - exit(error_exit); - } else { - if (create_job_step(job, false) < 0) - exit(error_exit); - } - task_state_destroy(task_state); - goto re_launch; - } -cleanup: -#endif - - if (got_alloc) { - cleanup_allocation(); - - /* send the controller we were cancelled */ - if (job->state >= SRUN_JOB_CANCELLED) - slurm_complete_job(job->jobid, NO_VAL); - else - slurm_complete_job(job->jobid, global_rc); - } - _shepard_notify(shepard_fd); - - if (signal_thread) { - srun_shutdown = true; - pthread_kill(signal_thread, SIGINT); - pthread_join(signal_thread, NULL); - } - _run_srun_epilog(job); - slurm_step_ctx_destroy(job->step_ctx); - mpir_cleanup(); - task_state_destroy(task_state); - log_fini(); - - if (WIFEXITED(global_rc)) - global_rc = WEXITSTATUS(global_rc); return (int)global_rc; } -static slurm_step_layout_t * -_get_slurm_step_layout(srun_job_t *job) -{ - job_step_create_response_msg_t *resp; - - if (!job || !job->step_ctx) - return (NULL); - - slurm_step_ctx_get(job->step_ctx, SLURM_STEP_CTX_RESP, &resp); - if (!resp) - return (NULL); - return (resp->step_layout); -} - -static int _call_spank_local_user (srun_job_t *job) -{ - struct spank_launcher_job_info info[1]; - - info->uid = opt.uid; - info->gid = opt.gid; - info->jobid = job->jobid; - info->stepid = job->stepid; - info->step_layout = _get_slurm_step_layout(job); - info->argc = opt.argc; - info->argv = opt.argv; - - return spank_local_user(info); -} - - static int _slurm_debug_env_val (void) { long int level = 0; @@ -722,95 +332,6 @@ static char *_uint16_array_to_str(int array_len, const uint16_t *array) return str; } -static void -_print_job_information(resource_allocation_response_msg_t *resp) -{ - int i; - char *str = NULL; - char *sep = ""; - - if (!_verbose) - return; - - xstrfmtcat(str, "jobid %u: nodes(%u):`%s', cpu counts: ", - resp->job_id, resp->node_cnt, resp->node_list); - - for (i = 0; i < resp->num_cpu_groups; i++) { - xstrfmtcat(str, "%s%u(x%u)", - sep, resp->cpus_per_node[i], - resp->cpu_count_reps[i]); - sep = ","; - } - verbose("%s", str); - xfree(str); -} - -/* Set SLURM_UMASK environment variable with current state */ -static int _set_umask_env(void) -{ - char mask_char[5]; - mode_t mask; - - if (getenv("SLURM_UMASK")) /* use this value */ - return SLURM_SUCCESS; - - mask = (int)umask(0); - umask(mask); - - sprintf(mask_char, "0%d%d%d", - ((mask>>6)&07), ((mask>>3)&07), mask&07); - if (setenvf(NULL, "SLURM_UMASK", "%s", mask_char) < 0) { - error ("unable to set SLURM_UMASK in environment"); - return SLURM_FAILURE; - } - debug ("propagating UMASK=%s", mask_char); - return SLURM_SUCCESS; -} - -/* Set SLURM_SUBMIT_DIR environment variable with current state */ -static void _set_submit_dir_env(void) -{ - char buf[MAXPATHLEN + 1]; - - if ((getcwd(buf, MAXPATHLEN)) == NULL) { - error("getcwd failed: %m"); - exit(error_exit); - } - - if (setenvf(NULL, "SLURM_SUBMIT_DIR", "%s", buf) < 0) { - error("unable to set SLURM_SUBMIT_DIR in environment"); - return; - } -} - -/* - * _set_prio_process_env - * - * Set the internal SLURM_PRIO_PROCESS environment variable to support - * the propagation of the users nice value and the "PropagatePrioProcess" - * config keyword. - */ -static void _set_prio_process_env(void) -{ - int retval; - - errno = 0; /* needed to detect a real failure since prio can be -1 */ - - if ((retval = getpriority (PRIO_PROCESS, 0)) == -1) { - if (errno) { - error ("getpriority(PRIO_PROCESS): %m"); - return; - } - } - - if (setenvf (NULL, "SLURM_PRIO_PROCESS", "%d", retval) < 0) { - error ("unable to set SLURM_PRIO_PROCESS in environment"); - return; - } - - debug ("propagating SLURM_PRIO_PROCESS=%d", retval); -} - static void _set_exit_code(void) { int i; @@ -833,113 +354,6 @@ static void _set_exit_code(void) } } -static void _set_env_vars(resource_allocation_response_msg_t *resp) -{ - char *tmp; - - if (!getenv("SLURM_JOB_CPUS_PER_NODE")) { - tmp = uint32_compressed_to_str(resp->num_cpu_groups, - resp->cpus_per_node, - resp->cpu_count_reps); - if (setenvf(NULL, "SLURM_JOB_CPUS_PER_NODE", "%s", tmp) < 0) { - error("unable to set SLURM_JOB_CPUS_PER_NODE in " - "environment"); - } - xfree(tmp); - } - - if (resp->alias_list) { - if (setenv("SLURM_NODE_ALIASES", resp->alias_list, 1) < 0) { - error("unable to set SLURM_NODE_ALIASES in " - "environment"); - } - } else { - unsetenv("SLURM_NODE_ALIASES"); - } - - return; -} - -static int _validate_relative(resource_allocation_response_msg_t *resp) -{ - - if (opt.relative_set && - ((opt.relative + opt.min_nodes) > resp->node_cnt)) { - if (opt.nodes_set_opt) { /* -N command line option used */ - error("--relative and --nodes option incompatible " - "with count of allocated nodes (%d+%d>%d)", - opt.relative, opt.min_nodes, resp->node_cnt); - } else { /* SLURM_NNODES option used */ - error("--relative and SLURM_NNODES option incompatible " - "with count of allocated nodes (%d+%d>%d)", - opt.relative, opt.min_nodes, resp->node_cnt); - } - return -1; - } - return 0; -} - -/* Set SLURM_RLIMIT_* environment variables with current resource - * limit values, reset RLIMIT_NOFILE to maximum possible value */ -static int _set_rlimit_env(void) -{ - int rc = SLURM_SUCCESS; - struct rlimit rlim[1]; - unsigned long cur; - char name[64], *format; - slurm_rlimits_info_t *rli; - - /* Modify limits with any command-line options */ - if (opt.propagate && parse_rlimits( opt.propagate, PROPAGATE_RLIMITS)){ - error( "--propagate=%s is not valid.", opt.propagate ); - exit(error_exit); - } - - for (rli = get_slurm_rlimits_info(); rli->name != NULL; rli++ ) { - - if (rli->propagate_flag != PROPAGATE_RLIMITS) - continue; - - if (getrlimit (rli->resource, rlim) < 0) { - error ("getrlimit (RLIMIT_%s): %m", rli->name); - rc = SLURM_FAILURE; - continue; - } - - cur = (unsigned long) rlim->rlim_cur; - snprintf(name, sizeof(name), "SLURM_RLIMIT_%s", rli->name); - if (opt.propagate && rli->propagate_flag == PROPAGATE_RLIMITS) - /* - * Prepend 'U' to indicate user requested propagate - */ - format = "U%lu"; - else - format = "%lu"; - - if (setenvf (NULL, name, format, cur) < 0) { - error ("unable to set %s in environment", name); - rc = SLURM_FAILURE; - continue; - } - - debug ("propagating RLIMIT_%s=%lu", rli->name, cur); - } - - /* - * Now increase NOFILE to the max available for this srun - */ - if (getrlimit (RLIMIT_NOFILE, rlim) < 0) - return (error ("getrlimit (RLIMIT_NOFILE): %m")); - - if (rlim->rlim_cur < rlim->rlim_max) { - rlim->rlim_cur = rlim->rlim_max; - if (setrlimit (RLIMIT_NOFILE, rlim) < 0) - return (error ("Unable to increase max no. files: %m")); - } - - return rc; -} - static void _set_node_alias(void) { char *aliases, *save_ptr = NULL, *tmp; @@ -963,838 +377,9 @@ static void _set_node_alias(void) xfree(aliases); } -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) { - xfree(user); - return (error ("Invalid user id %u: %m", opt.uid)); - } - - if (opt.uid == getuid ()) { - xfree(user); - return (0); - } - - if ((opt.egid != (gid_t) -1) && (setgid (opt.egid) < 0)) { - xfree(user); - return (error ("setgid: %m")); - } - - initgroups (user, gid); /* Ignore errors */ - xfree(user); - - if (setuid (opt.uid) < 0) - return (error ("setuid: %m")); - - return (0); -} - -static void _run_srun_prolog (srun_job_t *job) -{ - int rc; - - if (opt.prolog && strcasecmp(opt.prolog, "none") != 0) { - rc = _run_srun_script(job, opt.prolog); - debug("srun prolog rc = %d", rc); - } -} - -static void _run_srun_epilog (srun_job_t *job) -{ - int rc; - - if (opt.epilog && strcasecmp(opt.epilog, "none") != 0) { - rc = _run_srun_script(job, opt.epilog); - debug("srun epilog rc = %d", rc); - } -} - -static int _run_srun_script (srun_job_t *job, char *script) -{ - int status; - pid_t cpid; - int i; - char **args = NULL; - - if (script == NULL || script[0] == '\0') - return 0; - - if (access(script, R_OK | X_OK) < 0) { - info("Access denied for %s: %m", script); - return 0; - } - - if ((cpid = fork()) < 0) { - error ("run_srun_script: fork: %m"); - return -1; - } - if (cpid == 0) { - - /* set the scripts command line arguments to the arguments - * for the application, but shifted one higher - */ - args = xmalloc(sizeof(char *) * 1024); - args[0] = script; - for (i = 0; i < opt.argc; i++) { - args[i+1] = opt.argv[i]; - } - args[i+1] = NULL; - execv(script, args); - error("help! %m"); - exit(127); - } - - do { - if (waitpid(cpid, &status, 0) < 0) { - if (errno == EINTR) - continue; - error("waitpid: %m"); - return 0; - } else - return status; - } while(1); - - /* NOTREACHED */ -} - -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P -static void -_send_step_complete_rpc(int step_rc) -{ - slurm_msg_t req; - step_complete_msg_t msg; - int rc; - - memset(&msg, 0, sizeof(step_complete_msg_t)); - msg.job_id = job->jobid; - msg.job_step_id = job->stepid; - msg.range_first = 0; - msg.range_last = 0; - msg.step_rc = step_rc; - msg.jobacct = jobacct_gather_g_create(NULL); - - slurm_msg_t_init(&req); - req.msg_type = REQUEST_STEP_COMPLETE; - req.data = &msg; -/* req.address = step_complete.parent_addr; */ - - debug3("Sending step complete RPC to slurmctld"); - if (slurm_send_recv_controller_rc_msg(&req, &rc) < 0) - error("Error sending step complete RPC to slurmctld"); - jobacct_gather_g_destroy(msg.jobacct); -} - -static void -_handle_msg(slurm_msg_t *msg) -{ - static uint32_t slurm_uid = NO_VAL; - uid_t req_uid = g_slurm_auth_get_uid(msg->auth_cred, NULL); - uid_t uid = getuid(); - job_step_kill_msg_t *ss; - srun_user_msg_t *um; - - if (slurm_uid == NO_VAL) - slurm_uid = slurm_get_slurm_user_id(); - if ((req_uid != slurm_uid) && (req_uid != 0) && (req_uid != uid)) { - error ("Security violation, slurm message from uid %u", - (unsigned int) req_uid); - return; - } - - switch (msg->msg_type) { - 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"); - slurm_free_srun_job_complete_msg(msg->data); - runjob_signal(SIGKILL); - break; - case SRUN_USER_MSG: - um = msg->data; - info("%s", um->msg); - slurm_free_srun_user_msg(msg->data); - break; - case SRUN_STEP_SIGNAL: - ss = msg->data; - debug("received step signal %u RPC", ss->signal); - runjob_signal(ss->signal); - slurm_free_job_step_kill_msg(msg->data); - break; - default: - debug("received spurious message type: %u", - msg->msg_type); - break; - } - return; -} - -static void *_msg_thr_internal(void *arg) -{ - slurm_addr_t cli_addr; - slurm_fd_t newsockfd; - slurm_msg_t *msg; - int *slurmctld_fd_ptr = (int *)arg; - - (void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); - (void) pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); - - while (!srun_shutdown) { - newsockfd = slurm_accept_msg_conn(*slurmctld_fd_ptr, &cli_addr); - if (newsockfd == SLURM_SOCKET_ERROR) { - if (errno != EINTR) - error("slurm_accept_msg_conn: %m"); - continue; - } - msg = xmalloc(sizeof(slurm_msg_t)); - if (slurm_receive_msg(newsockfd, msg, 0) != 0) { - error("slurm_receive_msg: %m"); - /* close the new socket */ - slurm_close_accepted_conn(newsockfd); - continue; - } - _handle_msg(msg); - slurm_free_msg(msg); - slurm_close_accepted_conn(newsockfd); - } - return NULL; -} - -static pthread_t -_spawn_msg_handler(void) -{ - pthread_attr_t attr; - pthread_t msg_thread; - static int slurmctld_fd; - - slurmctld_fd = job->step_ctx->launch_state->slurmctld_socket_fd; - if (slurmctld_fd < 0) - return (pthread_t) 0; - job->step_ctx->launch_state->slurmctld_socket_fd = -1; - - slurm_attr_init(&attr); - if (pthread_create(&msg_thread, &attr, _msg_thr_internal, - (void *) &slurmctld_fd)) - error("pthread_create of message thread: %m"); - slurm_attr_destroy(&attr); - return msg_thread; -} -#endif - -static int -_is_local_file (fname_t *fname) -{ - if (fname->name == NULL) - return 1; - - if (fname->taskid != -1) - return 1; - - return ((fname->type != IO_PER_TASK) && (fname->type != IO_ONE)); -} - -static void -_set_stdio_fds(srun_job_t *job, slurm_step_io_fds_t *cio_fds) -{ - bool err_shares_out = false; - int file_flags; - - if (opt.open_mode == OPEN_MODE_APPEND) - file_flags = O_CREAT|O_WRONLY|O_APPEND; - else if (opt.open_mode == OPEN_MODE_TRUNCATE) - file_flags = O_CREAT|O_WRONLY|O_APPEND|O_TRUNC; - else { - slurm_ctl_conf_t *conf; - conf = slurm_conf_lock(); - if (conf->job_file_append) - file_flags = O_CREAT|O_WRONLY|O_APPEND; - else - file_flags = O_CREAT|O_WRONLY|O_APPEND|O_TRUNC; - slurm_conf_unlock(); - } - - /* - * create stdin file descriptor - */ - if (_is_local_file(job->ifname)) { - if ((job->ifname->name == NULL) || - (job->ifname->taskid != -1)) { - cio_fds->in.fd = STDIN_FILENO; - } else { - cio_fds->in.fd = open(job->ifname->name, O_RDONLY); - if (cio_fds->in.fd == -1) { - error("Could not open stdin file: %m"); - exit(error_exit); - } - } - if (job->ifname->type == IO_ONE) { - cio_fds->in.taskid = job->ifname->taskid; - cio_fds->in.nodeid = slurm_step_layout_host_id( - _get_slurm_step_layout(job), - job->ifname->taskid); - } - } - - /* - * create stdout file descriptor - */ - if (_is_local_file(job->ofname)) { - if ((job->ofname->name == NULL) || - (job->ofname->taskid != -1)) { - cio_fds->out.fd = STDOUT_FILENO; - } else { - cio_fds->out.fd = open(job->ofname->name, - file_flags, 0644); - if (cio_fds->out.fd == -1) { - error("Could not open stdout file: %m"); - exit(error_exit); - } - } - if (job->ofname->name != NULL - && job->efname->name != NULL - && !strcmp(job->ofname->name, job->efname->name)) { - err_shares_out = true; - } - } - - /* - * create seperate stderr file descriptor only if stderr is not sharing - * the stdout file descriptor - */ - if (err_shares_out) { - debug3("stdout and stderr sharing a file"); - cio_fds->err.fd = cio_fds->out.fd; - cio_fds->err.taskid = cio_fds->out.taskid; - } else if (_is_local_file(job->efname)) { - if ((job->efname->name == NULL) || - (job->efname->taskid != -1)) { - cio_fds->err.fd = STDERR_FILENO; - } else { - cio_fds->err.fd = open(job->efname->name, - file_flags, 0644); - if (cio_fds->err.fd == -1) { - error("Could not open stderr file: %m"); - exit(error_exit); - } - } - } -} - -/* Plugins must be able to resolve symbols. - * Since srun statically links with src/api/libslurmhelper rather than - * dynamicaly linking with libslurm, we need to reference all needed - * symbols within srun. None of the functions below are actually - * used, but we need to load the symbols. */ -static void _define_symbols(void) -{ - /* needed by mvapich and mpichgm */ - slurm_signal_job_step(NO_VAL, NO_VAL, 0); -} - static void _pty_restore(void) { /* STDIN is probably closed by now */ if (tcsetattr(STDOUT_FILENO, TCSANOW, &termdefaults) < 0) fprintf(stderr, "tcsetattr: %s\n", strerror(errno)); } - -/* opt.exclusive is set, disable user task layout controls */ -static void _step_opt_exclusive(void) -{ - if (!opt.ntasks_set) { - error("--ntasks must be set with --exclusive"); - exit(error_exit); - } - if (opt.relative_set) { - error("--relative disabled, incompatible with --exclusive"); - exit(error_exit); - } - if (opt.exc_nodes) { - error("--exclude is incompatible with --exclusive"); - exit(error_exit); - } -} - -static void -_terminate_job_step(slurm_step_ctx_t *step_ctx) -{ - uint32_t job_id, step_id; - - slurm_step_ctx_get(step_ctx, SLURM_STEP_CTX_JOBID, &job_id); - slurm_step_ctx_get(step_ctx, SLURM_STEP_CTX_STEPID, &step_id); - info("Terminating job step %u.%u", job_id, step_id); -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P - runjob_signal(SIGKILL); -#else - slurm_kill_job_step(job_id, step_id, SIGKILL); -#endif -} - -#if !defined HAVE_BG_FILES || defined HAVE_BG_L_P -static void -_task_start(launch_tasks_response_msg_t *msg) -{ - MPIR_PROCDESC *table; - int taskid; - int i; - - if (msg->count_of_pids) - verbose("Node %s, %d tasks started", - msg->node_name, msg->count_of_pids); - else - /* This message should be displayed through the api, - hense it is a debug2 instead of an error. - */ - debug2("No tasks started on node %s: %s", - msg->node_name, slurm_strerror(msg->return_code)); - - - for (i = 0; i < msg->count_of_pids; i++) { - taskid = msg->task_ids[i]; - table = &MPIR_proctable[taskid]; - table->host_name = xstrdup(msg->node_name); - /* table->executable_name is set elsewhere */ - table->pid = msg->local_pids[i]; - - if (msg->return_code == 0) { - task_state_update(task_state, taskid, TS_START_SUCCESS); - } else { - task_state_update(task_state, taskid, TS_START_FAILURE); - } - } - -} - -static char * -_hostset_to_string(hostset_t hs) -{ - size_t n = 1024; - size_t maxsize = 1024*64; - char *str = NULL; - - do { - str = xrealloc(str, n); - } while (hostset_ranged_string(hs, n*=2, str) < 0 && (n < maxsize)); - - /* - * If string was truncated, indicate this with a '+' suffix. - */ - if (n >= maxsize) - strcpy(str + (maxsize - 2), "+"); - - return str; -} - -/* Convert an array of task IDs into a list of host names - * RET: the string, caller must xfree() this value */ -static char * -_task_ids_to_host_list(int ntasks, uint32_t taskids[]) -{ - int i; - hostset_t hs; - char *hosts; - slurm_step_layout_t *sl; - - if ((sl = _get_slurm_step_layout(job)) == NULL) - return (xstrdup("Unknown")); - - hs = hostset_create(NULL); - for (i = 0; i < ntasks; i++) { - char *host = slurm_step_layout_host_name(sl, taskids[i]); - if (host) { - hostset_insert(hs, host); - free(host); - } else { - error("Could not identify host name for task %u", - taskids[i]); - } - } - - hosts = _hostset_to_string(hs); - hostset_destroy(hs); - - return (hosts); -} - -/* Convert an array of task IDs into a string. - * RET: the string, caller must xfree() this value - * NOTE: the taskids array is not necessarily in numeric order, - * so we use existing bitmap functions to format */ -static char * -_task_array_to_string(int ntasks, uint32_t taskids[]) -{ - bitstr_t *tasks_bitmap = NULL; - char *str; - int i; - - tasks_bitmap = bit_alloc(job->ntasks); - if (!tasks_bitmap) { - error("bit_alloc: memory allocation failure"); - exit(error_exit); - } - for (i=0; i slurm_get_msg_timeout()) - return 0; - return 1; -} - -static void -_handle_openmpi_port_error(const char *tasks, const char *hosts, - slurm_step_ctx_t *step_ctx) -{ - uint32_t job_id, step_id; - char *msg = "retrying"; - - if (!retry_step_begin) { - retry_step_begin = true; - retry_step_cnt++; - } - - if (retry_step_cnt >= MAX_STEP_RETRIES) - msg = "aborting"; - error("%s: tasks %s unable to claim reserved port, %s.", - hosts, tasks, msg); - - slurm_step_ctx_get(step_ctx, SLURM_STEP_CTX_JOBID, &job_id); - slurm_step_ctx_get(step_ctx, SLURM_STEP_CTX_STEPID, &step_id); - info("Terminating job step %u.%u", job_id, step_id); - slurm_kill_job_step(job_id, step_id, SIGKILL); -} - -static void -_task_finish(task_exit_msg_t *msg) -{ - char *tasks; - char *hosts; - uint32_t rc = 0; - int normal_exit = 0; - - const char *task_str = _taskstr(msg->num_tasks); - - verbose("Received task exit notification for %d %s (status=0x%04x).", - msg->num_tasks, task_str, msg->return_code); - - tasks = _task_array_to_string(msg->num_tasks, msg->task_id_list); - hosts = _task_ids_to_host_list(msg->num_tasks, msg->task_id_list); - - if (WIFEXITED(msg->return_code)) { - if ((rc = WEXITSTATUS(msg->return_code)) == 0) { - verbose("%s: %s %s: Completed", hosts, task_str, tasks); - normal_exit = 1; - } - else if (_is_openmpi_port_error(rc)) { - _handle_openmpi_port_error(tasks, hosts, - job->step_ctx); - } else { - error("%s: %s %s: Exited with exit code %d", - hosts, task_str, tasks, rc); - } - if (!WIFEXITED(global_rc) || (rc > WEXITSTATUS(global_rc))) - global_rc = msg->return_code; - } - else if (WIFSIGNALED(msg->return_code)) { - const char *signal_str = strsignal(WTERMSIG(msg->return_code)); - char * core_str = ""; -#ifdef WCOREDUMP - if (WCOREDUMP(msg->return_code)) - core_str = " (core dumped)"; -#endif - if (job->state >= SRUN_JOB_CANCELLED) { - verbose("%s: %s %s: %s%s", - hosts, task_str, tasks, signal_str, core_str); - } else { - rc = msg->return_code; - error("%s: %s %s: %s%s", - hosts, task_str, tasks, signal_str, core_str); - } - if (global_rc == 0) - global_rc = msg->return_code; - } - - xfree(tasks); - xfree(hosts); - - _update_task_exit_state(msg->num_tasks, msg->task_id_list, - !normal_exit); - - if (task_state_first_abnormal_exit(task_state) && _kill_on_bad_exit()) - _terminate_job_step(job->step_ctx); - - if (task_state_first_exit(task_state) && (opt.max_wait > 0)) - _setup_max_wait_timer(); -} -#endif - -/* Return the number of microseconds between tv1 and tv2 with a maximum - * a maximum value of 10,000,000 to prevent overflows */ -static long _diff_tv_str(struct timeval *tv1,struct timeval *tv2) -{ - long delta_t; - - delta_t = MIN((tv2->tv_sec - tv1->tv_sec), 10); - delta_t *= 1000000; - delta_t += tv2->tv_usec - tv1->tv_usec; - return delta_t; -} - -static void _handle_intr(void) -{ - static struct timeval last_intr = { 0, 0 }; - static struct timeval last_intr_sent = { 0, 0 }; - struct timeval now; - - gettimeofday(&now, NULL); - if (!opt.quit_on_intr && (_diff_tv_str(&last_intr, &now) > 1000000)) { - if (opt.disable_status) { - info("sending Ctrl-C to job %u.%u", - job->jobid, job->stepid); -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P - runjob_signal(SIGINT); -#else - slurm_step_launch_fwd_signal(job->step_ctx, SIGINT); -#endif - } else if (job->state < SRUN_JOB_FORCETERM) { - info("interrupt (one more within 1 sec to abort)"); - task_state_print(task_state, (log_f) info); - } else { - info("interrupt (abort already in progress)"); - task_state_print(task_state, (log_f) info); - } - last_intr = now; - } else { /* second Ctrl-C in half as many seconds */ - update_job_state(job, SRUN_JOB_CANCELLED); - /* terminate job */ - if (job->state < SRUN_JOB_FORCETERM) { - if (_diff_tv_str(&last_intr_sent, &now) < 1000000) { - job_force_termination(job); -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P - runjob_signal(SIGKILL); -#else - slurm_step_launch_abort(job->step_ctx); -#endif - return; - } - - info("sending Ctrl-C to job %u.%u", - job->jobid, job->stepid); - last_intr_sent = now; -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P - runjob_signal(SIGKILL); -#else - slurm_step_launch_fwd_signal(job->step_ctx, SIGINT); - slurm_step_launch_abort(job->step_ctx); -#endif - } else { - job_force_termination(job); -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P - runjob_signal(SIGKILL); -#else - slurm_step_launch_abort(job->step_ctx); -#endif - } - } -} -static void _default_sigaction(int sig) -{ - struct sigaction act; - if (sigaction(sig, NULL, &act)) { - error("sigaction(%d): %m", sig); - return; - } - if (act.sa_handler != SIG_IGN) - return; - - act.sa_handler = SIG_DFL; - if (sigaction(sig, &act, NULL)) - error("sigaction(%d): %m", sig); -} - -static void _handle_pipe(void) -{ - static int ending = 0; - - if (ending) - return; - ending = 1; -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P - runjob_signal(SIGKILL); -#else - slurm_step_launch_abort(job->step_ctx); -#endif -} - -/* _srun_signal_mgr - Process daemon-wide signals */ -static void *_srun_signal_mgr(void *no_data) -{ - int sig; - int i, rc; - sigset_t set; - - /* Make sure no required signals are ignored (possibly inherited) */ - for (i = 0; sig_array[i]; i++) - _default_sigaction(sig_array[i]); - while (!srun_shutdown) { - xsignal_sigset_create(sig_array, &set); - rc = sigwait(&set, &sig); - if (rc == EINTR) - continue; - switch (sig) { - case SIGINT: - if (!srun_shutdown) - _handle_intr(); - break; - case SIGQUIT: - info("Quit"); - /* continue with slurm_step_launch_abort */ - case SIGTERM: - case SIGHUP: - /* No need to call job_force_termination here since we - * are ending the job now and we don't need to update - * the state. */ - info("forcing job termination"); -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P - runjob_signal(SIGKILL); -#else - slurm_step_launch_abort(job->step_ctx); -#endif - break; - case SIGCONT: - info("got SIGCONT"); - break; - case SIGPIPE: - _handle_pipe(); - break; - case SIGALRM: - if (srun_max_timer) { - info("First task exited %ds ago", opt.max_wait); - task_state_print(task_state, (log_f) info); - _terminate_job_step(job->step_ctx); - } - break; - default: -#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P - runjob_signal(sig); -#else - slurm_step_launch_fwd_signal(job->step_ctx, sig); -#endif - break; - } - } - return NULL; -} - -static void _shepard_notify(int shepard_fd) -{ - int rc; - - while (1) { - rc = write(shepard_fd, "", 1); - if (rc == -1) { - if ((errno == EAGAIN) || (errno == EINTR)) - continue; - error("write(shepard): %m"); - } - break; - } - close(shepard_fd); -} - -static int _shepard_spawn(srun_job_t *job, bool got_alloc) -{ - int shepard_pipe[2], rc; - pid_t shepard_pid; - char buf[1]; - - if (pipe(shepard_pipe)) { - error("pipe: %m"); - return -1; - } - - shepard_pid = fork(); - if (shepard_pid == -1) { - error("fork: %m"); - return -1; - } - if (shepard_pid != 0) { - close(shepard_pipe[0]); - return shepard_pipe[1]; - } - - /* Wait for parent to notify of completion or I/O error on abort */ - close(shepard_pipe[1]); - while (1) { - rc = read(shepard_pipe[0], buf, 1); - if (rc == 1) { - exit(0); - } else if (rc == 0) { - break; /* EOF */ - } else if (rc == -1) { - if ((errno == EAGAIN) || (errno == EINTR)) - continue; - break; - } - } - - (void) slurm_terminate_job_step(job->jobid, job->stepid); - if (got_alloc) - slurm_complete_job(job->jobid, NO_VAL); - exit(0); - return -1; -} diff --git a/src/srun/srun_job.c b/src/srun/srun_job.c deleted file mode 100644 index d9caa723b2a492e26fbe48e8847168d71cb4518e..0000000000000000000000000000000000000000 --- a/src/srun/srun_job.c +++ /dev/null @@ -1,539 +0,0 @@ -/****************************************************************************\ - * srun_job.c - job data structure creation functions - ***************************************************************************** - * 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 Mark Grondona . - * CODE-OCEC-09-009. All rights reserved. - * - * This file is part of SLURM, a resource management program. - * For details, see . - * 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 -#include -#include -#include -#include -#include -#include -#include -#include - -#include "src/common/bitstring.h" -#include "src/common/cbuf.h" -#include "src/common/hostlist.h" -#include "src/common/log.h" -#include "src/common/read_config.h" -#include "src/common/slurm_protocol_api.h" -#include "src/common/xmalloc.h" -#include "src/common/xstring.h" -#include "src/common/io_hdr.h" -#include "src/common/forward.h" -#include "src/common/fd.h" - -#include "src/srun/srun_job.h" -#include "src/srun/opt.h" -#include "src/srun/fname.h" -#include "src/srun/debugger.h" - -/* - * allocation information structure used to store general information - * about node allocation to be passed to _job_create_structure() - */ -typedef struct allocation_info { - char *alias_list; - uint16_t *cpus_per_node; - uint32_t *cpu_count_reps; - uint32_t jobid; - uint32_t nnodes; - char *nodelist; - uint32_t num_cpu_groups; - dynamic_plugin_data_t *select_jobinfo; - uint32_t stepid; -} allocation_info_t; - -/* - * Prototypes: - */ -static inline int _estimate_nports(int nclients, int cli_per_port); -static int _compute_task_count(allocation_info_t *info); -static void _set_ntasks(allocation_info_t *info); -static srun_job_t *_job_create_structure(allocation_info_t *info); -static char * _normalize_hostlist(const char *hostlist); - - -/* - * Create an srun job structure w/out an allocation response msg. - * (i.e. use the command line options) - */ -srun_job_t * -job_create_noalloc(void) -{ - srun_job_t *job = NULL; - allocation_info_t *ai = xmalloc(sizeof(allocation_info_t)); - uint16_t cpn = 1; - hostlist_t hl = hostlist_create(opt.nodelist); - - if (!hl) { - error("Invalid node list `%s' specified", opt.nodelist); - goto error; - } - srand48(getpid()); - ai->jobid = MIN_NOALLOC_JOBID + - ((uint32_t) lrand48() % - (MAX_NOALLOC_JOBID - MIN_NOALLOC_JOBID + 1)); - ai->stepid = (uint32_t) (lrand48()); - ai->nodelist = opt.nodelist; - ai->nnodes = hostlist_count(hl); - - hostlist_destroy(hl); - - cpn = (opt.ntasks + ai->nnodes - 1) / ai->nnodes; - ai->cpus_per_node = &cpn; - ai->cpu_count_reps = &ai->nnodes; - - /* - * Create job, then fill in host addresses - */ - job = _job_create_structure(ai); - - job_update_io_fnames(job); - - error: - xfree(ai); - return (job); - -} - -/* - * Create an srun job structure for a step w/out an allocation response msg. - * (i.e. inside an allocation) - */ -srun_job_t * -job_step_create_allocation(resource_allocation_response_msg_t *resp) -{ - uint32_t job_id = resp->job_id; - srun_job_t *job = NULL; - allocation_info_t *ai = xmalloc(sizeof(allocation_info_t)); - hostlist_t hl = NULL; - char *buf = NULL; - int count = 0; - uint32_t alloc_count = 0; - - ai->jobid = job_id; - ai->stepid = NO_VAL; - ai->alias_list = resp->alias_list; - ai->nodelist = opt.alloc_nodelist; - hl = hostlist_create(ai->nodelist); - hostlist_uniq(hl); - alloc_count = hostlist_count(hl); - ai->nnodes = alloc_count; - hostlist_destroy(hl); - - if (opt.exc_nodes) { - hostlist_t exc_hl = hostlist_create(opt.exc_nodes); - hostlist_t inc_hl = NULL; - char *node_name = NULL; - - hl = hostlist_create(ai->nodelist); - if(opt.nodelist) { - inc_hl = hostlist_create(opt.nodelist); - } - hostlist_uniq(hl); - //info("using %s or %s", opt.nodelist, ai->nodelist); - while ((node_name = hostlist_shift(exc_hl))) { - int inx = hostlist_find(hl, node_name); - if (inx >= 0) { - debug("excluding node %s", node_name); - hostlist_delete_nth(hl, inx); - ai->nnodes--; /* decrement node count */ - } - if (inc_hl) { - inx = hostlist_find(inc_hl, node_name); - if (inx >= 0) { - error("Requested node %s is also " - "in the excluded list.", - node_name); - error("Job not submitted."); - hostlist_destroy(exc_hl); - hostlist_destroy(inc_hl); - goto error; - } - } - free(node_name); - } - hostlist_destroy(exc_hl); - - /* we need to set this here so if there are more nodes - * available than we requested we can set it - * straight. If there is no exclude list then we set - * the vars then. - */ - if (!opt.nodes_set) { - /* we don't want to set the number of nodes = - * to the number of requested processes unless we - * know it is less than the number of nodes - * in the allocation - */ - if(opt.ntasks_set && (opt.ntasks < ai->nnodes)) - opt.min_nodes = opt.ntasks; - else - opt.min_nodes = ai->nnodes; - opt.nodes_set = true; - } - if(!opt.max_nodes) - opt.max_nodes = opt.min_nodes; - if((opt.max_nodes > 0) && (opt.max_nodes < ai->nnodes)) - ai->nnodes = opt.max_nodes; - - count = hostlist_count(hl); - if(!count) { - error("Hostlist is now nothing! Can't run job."); - hostlist_destroy(hl); - goto error; - } - if(inc_hl) { - count = hostlist_count(inc_hl); - if(count < ai->nnodes) { - /* add more nodes to get correct number for - allocation */ - hostlist_t tmp_hl = hostlist_copy(hl); - int i=0; - int diff = ai->nnodes - count; - buf = hostlist_ranged_string_xmalloc(inc_hl); - hostlist_delete(tmp_hl, buf); - xfree(buf); - while ((node_name = hostlist_shift(tmp_hl)) && - (i < diff)) { - hostlist_push(inc_hl, node_name); - i++; - } - hostlist_destroy(tmp_hl); - } - buf = hostlist_ranged_string_xmalloc(inc_hl); - hostlist_destroy(inc_hl); - xfree(opt.nodelist); - opt.nodelist = buf; - } else { - if (count > ai->nnodes) { - /* remove more nodes than needed for - * allocation */ - int i; - for (i = count; i >= ai->nnodes; i--) - hostlist_delete_nth(hl, i); - } - xfree(opt.nodelist); - opt.nodelist = hostlist_ranged_string_xmalloc(hl); - } - - hostlist_destroy(hl); - } else { - if (!opt.nodes_set) { - /* we don't want to set the number of nodes = - * to the number of requested processes unless we - * know it is less than the number of nodes - * in the allocation - */ - if(opt.ntasks_set && (opt.ntasks < ai->nnodes)) - opt.min_nodes = opt.ntasks; - else - opt.min_nodes = ai->nnodes; - opt.nodes_set = true; - } - if(!opt.max_nodes) - opt.max_nodes = opt.min_nodes; - if((opt.max_nodes > 0) && (opt.max_nodes < ai->nnodes)) - ai->nnodes = opt.max_nodes; - /* Don't reset the ai->nodelist because that is the - * nodelist we want to say the allocation is under - * opt.nodelist is what is used for the allocation. - */ - /* xfree(ai->nodelist); */ - /* ai->nodelist = xstrdup(buf); */ - } - - /* get the correct number of hosts to run tasks on */ - if (opt.nodelist) { - hl = hostlist_create(opt.nodelist); - if (opt.distribution != SLURM_DIST_ARBITRARY) - hostlist_uniq(hl); - if (!hostlist_count(hl)) { - error("Hostlist is now nothing! Can not run job."); - hostlist_destroy(hl); - goto error; - } - - buf = hostlist_ranged_string_xmalloc(hl); - count = hostlist_count(hl); - hostlist_destroy(hl); - /* Don't reset the ai->nodelist because that is the - * nodelist we want to say the allocation is under - * opt.nodelist is what is used for the allocation. - */ - /* xfree(ai->nodelist); */ - /* ai->nodelist = xstrdup(buf); */ - xfree(opt.nodelist); - opt.nodelist = buf; - } - - if (opt.distribution == SLURM_DIST_ARBITRARY) { - if (count != opt.ntasks) { - error("You asked for %d tasks but specified %d nodes", - opt.ntasks, count); - goto error; - } - } - - if (ai->nnodes == 0) { - error("No nodes in allocation, can't run job"); - goto error; - } - - ai->num_cpu_groups = resp->num_cpu_groups; - ai->cpus_per_node = resp->cpus_per_node; - ai->cpu_count_reps = resp->cpu_count_reps; - -/* info("looking for %d nodes out of %s with a must list of %s", */ -/* ai->nnodes, ai->nodelist, opt.nodelist); */ - /* - * Create job - */ - job = _job_create_structure(ai); -error: - xfree(ai); - return (job); - -} - -/* - * Create an srun job structure from a resource allocation response msg - */ -extern srun_job_t * -job_create_allocation(resource_allocation_response_msg_t *resp) -{ - srun_job_t *job; - allocation_info_t *i = xmalloc(sizeof(allocation_info_t)); - - i->alias_list = resp->alias_list; - i->nodelist = _normalize_hostlist(resp->node_list); - i->nnodes = resp->node_cnt; - i->jobid = resp->job_id; - i->stepid = NO_VAL; - 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->select_jobinfo = select_g_select_jobinfo_copy(resp->select_jobinfo); - - job = _job_create_structure(i); - - xfree(i->nodelist); - xfree(i); - - return (job); -} - -void -update_job_state(srun_job_t *job, srun_job_state_t state) -{ - pthread_mutex_lock(&job->state_mutex); - if (job->state < state) { - job->state = state; - pthread_cond_signal(&job->state_cond); - - } - pthread_mutex_unlock(&job->state_mutex); - return; -} - -srun_job_state_t -job_state(srun_job_t *job) -{ - srun_job_state_t state; - slurm_mutex_lock(&job->state_mutex); - state = job->state; - slurm_mutex_unlock(&job->state_mutex); - return state; -} - - -void -job_force_termination(srun_job_t *job) -{ - static int kill_sent = 0; - static time_t last_msg = 0; - - if (kill_sent == 0) { - info("forcing job termination"); - /* Sends SIGKILL to tasks directly */ - update_job_state(job, SRUN_JOB_FORCETERM); - } else { - time_t now = time(NULL); - if (last_msg != now) { - info("job abort in progress"); - last_msg = now; - } - if (kill_sent == 1) { - /* Try sending SIGKILL through slurmctld */ - slurm_kill_job_step(job->jobid, job->stepid, SIGKILL); - } - } - kill_sent++; -} - -static inline int -_estimate_nports(int nclients, int cli_per_port) -{ - div_t d; - d = div(nclients, cli_per_port); - return d.rem > 0 ? d.quot + 1 : d.quot; -} - -static int -_compute_task_count(allocation_info_t *ainfo) -{ - int i, cnt = 0; -#if defined HAVE_BGQ -//#if defined HAVE_BGQ && HAVE_BG_FILES - /* always return the ntasks here for Q */ - info("returning %d", opt.ntasks); - return opt.ntasks; -#endif - if (opt.cpus_set) { - for (i = 0; i < ainfo->num_cpu_groups; i++) - cnt += ( ainfo->cpu_count_reps[i] * - (ainfo->cpus_per_node[i]/opt.cpus_per_task)); - } - return (cnt < ainfo->nnodes) ? ainfo->nnodes : cnt; -} - -static void -_set_ntasks(allocation_info_t *ai) -{ - if (!opt.ntasks_set) { - opt.ntasks = _compute_task_count(ai); - if (opt.cpus_set) - opt.ntasks_set = true; /* implicit */ - } -} - -/* - * Create an srun job structure from a resource allocation response msg - */ -static srun_job_t * -_job_create_structure(allocation_info_t *ainfo) -{ - srun_job_t *job = xmalloc(sizeof(srun_job_t)); - int i; - - _set_ntasks(ainfo); - debug2("creating job with %d tasks", opt.ntasks); - - slurm_mutex_init(&job->state_mutex); - pthread_cond_init(&job->state_cond, NULL); - job->state = SRUN_JOB_INIT; - - job->alias_list = xstrdup(ainfo->alias_list); - job->nodelist = xstrdup(ainfo->nodelist); - job->stepid = ainfo->stepid; - -#if defined HAVE_BGQ -//#if defined HAVE_BGQ && defined HAVE_BG_FILES - job->nhosts = ainfo->nnodes; - select_g_alter_node_cnt(SELECT_APPLY_NODE_MAX_OFFSET, &job->nhosts); -#elif defined HAVE_FRONT_END /* Limited job step support */ - opt.overcommit = true; - job->nhosts = 1; -#else - job->nhosts = ainfo->nnodes; -#endif - -#if !defined HAVE_FRONT_END || (defined HAVE_BGQ) -//#if !defined HAVE_FRONT_END || (defined HAVE_BGQ && defined HAVE_BG_FILES) - if(opt.min_nodes > job->nhosts) { - error("Only allocated %d nodes asked for %d", - job->nhosts, opt.min_nodes); - if (opt.exc_nodes) { - /* When resources are pre-allocated and some nodes - * are explicitly excluded, this error can occur. */ - error("Are required nodes explicitly excluded?"); - } - return NULL; - } - if ((ainfo->cpus_per_node == NULL) || - (ainfo->cpu_count_reps == NULL)) { - error("cpus_per_node array is not set"); - return NULL; - } -#endif - job->select_jobinfo = ainfo->select_jobinfo; - job->jobid = ainfo->jobid; - - job->ntasks = opt.ntasks; - for (i=0; inum_cpu_groups; i++) { - job->cpu_count += ainfo->cpus_per_node[i] * - ainfo->cpu_count_reps[i]; - } - - job->rc = -1; - - job_update_io_fnames(job); - - return (job); -} - -void -job_update_io_fnames(srun_job_t *job) -{ - job->ifname = fname_create(job, opt.ifname); - job->ofname = fname_create(job, opt.ofname); - job->efname = opt.efname ? fname_create(job, opt.efname) : job->ofname; -} - -static char * -_normalize_hostlist(const char *hostlist) -{ - char *buf = NULL; - hostlist_t hl = hostlist_create(hostlist); - - if (hl) { - buf = hostlist_ranged_string_xmalloc(hl); - hostlist_destroy(hl); - } - if (!buf) - return xstrdup(hostlist); - - return buf; -} - diff --git a/src/srun/srun_pty.c b/src/srun/srun_pty.c index 1034f9c927a79be414d1ef36fbcabdf962dc7d1b..daebf6302c7861c254ec1ced856abffe31883f5d 100644 --- a/src/srun/srun_pty.c +++ b/src/srun/srun_pty.c @@ -64,8 +64,8 @@ #include "src/common/xstring.h" #include "src/common/xsignal.h" -#include "src/srun/opt.h" -#include "src/srun/srun_job.h" +#include "opt.h" +#include "srun_job.h" #define MAX_RETRIES 3 diff --git a/src/srun/srun_pty.h b/src/srun/srun_pty.h index 41382afd5fa547f3cd072790e40844c9ad593315..5dcb1451c31f2a9847ffdb792127223fca05b384 100644 --- a/src/srun/srun_pty.h +++ b/src/srun/srun_pty.h @@ -40,7 +40,7 @@ #ifndef _SIGNALS_H #define _SIGNALS_H -#include "src/srun/srun_job.h" +#include "srun_job.h" typedef struct srun_job signal_job_t; diff --git a/src/srun_cr/Makefile.am b/src/srun_cr/Makefile.am index f4f3ec90384eae3b95292df5788c6c33a3cea020..baffd46287fa719d8ca285236d87f512e288ddd2 100644 --- a/src/srun_cr/Makefile.am +++ b/src/srun_cr/Makefile.am @@ -13,7 +13,8 @@ convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) srun_cr_LDADD = $(convenience_libs) $(BLCR_LIBS) -srun_cr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BLCR_LDFLAGS) +srun_cr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BLCR_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(convenience_libs) : force diff --git a/src/srun_cr/Makefile.in b/src/srun_cr/Makefile.in index 31a458c6a56b78841b342b24c9ed25e4f857576f..c4305d467ba2ce7d57eb67a38a467119d16cea5b 100644 --- a/src/srun_cr/Makefile.in +++ b/src/srun_cr/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -154,9 +153,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -164,9 +161,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -198,6 +194,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -225,6 +223,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -321,7 +320,9 @@ INCLUDES = -I$(top_srcdir) $(BLCR_CPPFLAGS) srun_cr_SOURCES = srun_cr.c convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) srun_cr_LDADD = $(convenience_libs) $(BLCR_LIBS) -srun_cr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BLCR_LDFLAGS) +srun_cr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BLCR_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -399,7 +400,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -srun_cr$(EXEEXT): $(srun_cr_OBJECTS) $(srun_cr_DEPENDENCIES) +srun_cr$(EXEEXT): $(srun_cr_OBJECTS) $(srun_cr_DEPENDENCIES) $(EXTRA_srun_cr_DEPENDENCIES) @rm -f srun_cr$(EXEEXT) $(srun_cr_LINK) $(srun_cr_OBJECTS) $(srun_cr_LDADD) $(LIBS) @@ -537,10 +538,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sshare/Makefile.am b/src/sshare/Makefile.am index 805f758484b2b849a21089ca78150e10bd32423b..59c3d566e76af5d2ca8c28c1377df3e38ec88de1 100644 --- a/src/sshare/Makefile.am +++ b/src/sshare/Makefile.am @@ -15,7 +15,8 @@ sshare_SOURCES = \ process.c \ sshare.c sshare.h -sshare_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sshare_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(sshare_LDADD) : force diff --git a/src/sshare/Makefile.in b/src/sshare/Makefile.in index 06b87e43709406bb08ff1213249cf00f2cf12fe7..f825a825885694727af041a39380b937518cd902 100644 --- a/src/sshare/Makefile.in +++ b/src/sshare/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -153,9 +152,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -163,9 +160,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -197,6 +193,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -224,6 +222,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -325,7 +324,9 @@ sshare_SOURCES = \ process.c \ sshare.c sshare.h -sshare_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sshare_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -403,7 +404,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sshare$(EXEEXT): $(sshare_OBJECTS) $(sshare_DEPENDENCIES) +sshare$(EXEEXT): $(sshare_OBJECTS) $(sshare_DEPENDENCIES) $(EXTRA_sshare_DEPENDENCIES) @rm -f sshare$(EXEEXT) $(sshare_LINK) $(sshare_OBJECTS) $(sshare_LDADD) $(LIBS) @@ -542,10 +543,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sstat/Makefile.am b/src/sstat/Makefile.am index b01ba0b0b7981e1c0737415a0795784deef53fa4..e84a6aeaef55ea72cc53130784c5391678e660ab 100644 --- a/src/sstat/Makefile.am +++ b/src/sstat/Makefile.am @@ -19,5 +19,6 @@ force: $(sstat_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sstat_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sstat_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/sstat/Makefile.in b/src/sstat/Makefile.in index 1fc71415a050d27fc6b8a9016e37708d92976a39..fcdd90b2abfa308cf3e8a216df661b289ccd3d81 100644 --- a/src/sstat/Makefile.in +++ b/src/sstat/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -154,9 +153,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -164,9 +161,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -198,6 +194,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -225,6 +223,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -325,7 +324,9 @@ sstat_SOURCES = \ sstat.c \ sstat.h -sstat_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sstat_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -403,7 +404,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sstat$(EXEEXT): $(sstat_OBJECTS) $(sstat_DEPENDENCIES) +sstat$(EXEEXT): $(sstat_OBJECTS) $(sstat_DEPENDENCIES) $(EXTRA_sstat_DEPENDENCIES) @rm -f sstat$(EXEEXT) $(sstat_LINK) $(sstat_OBJECTS) $(sstat_LDADD) $(LIBS) @@ -544,10 +545,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sstat/sstat.c b/src/sstat/sstat.c index 16b08d6d4746ee8ed6c27d397edb4437f52cec71..9198d255d58d7daf5950a045851d02de3ea8f45e 100644 --- a/src/sstat/sstat.c +++ b/src/sstat/sstat.c @@ -136,8 +136,7 @@ int _do_stat(uint32_t jobid, uint32_t stepid, char *nodelist) xfree(step.pid_str); } else { hostlist_push(hl, step_stat->step_pids->node_name); - jobacct_gather_g_2_stats(&temp_stats, - step_stat->jobacct); + jobacctinfo_2_stats(&temp_stats, step_stat->jobacct); ntasks += step_stat->num_tasks; aggregate_stats(&step.stats, &temp_stats); } diff --git a/src/strigger/Makefile.am b/src/strigger/Makefile.am index 90ddadcddb339d7529db5edcbe95ec94a8549411..d8816ac5fc9f30aa84586dd51da83bb19eeb8108 100644 --- a/src/strigger/Makefile.am +++ b/src/strigger/Makefile.am @@ -15,5 +15,6 @@ force: $(strigger_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -strigger_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +strigger_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/strigger/Makefile.in b/src/strigger/Makefile.in index 3195376df24be161411e5e1d498af37d54f400a5..4346da8df876afe2e95b771034d264a051831a8f 100644 --- a/src/strigger/Makefile.in +++ b/src/strigger/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -61,9 +61,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -71,6 +69,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -157,9 +156,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -167,9 +164,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -201,6 +197,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -228,6 +226,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -323,7 +322,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) strigger_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = strigger.h strigger_SOURCES = strigger.c opts.c -strigger_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +strigger_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: @@ -401,7 +402,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -strigger$(EXEEXT): $(strigger_OBJECTS) $(strigger_DEPENDENCIES) +strigger$(EXEEXT): $(strigger_OBJECTS) $(strigger_DEPENDENCIES) $(EXTRA_strigger_DEPENDENCIES) @rm -f strigger$(EXEEXT) $(strigger_LINK) $(strigger_OBJECTS) $(strigger_LDADD) $(LIBS) @@ -540,10 +541,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sview/Makefile.am b/src/sview/Makefile.am index 289638270619371d1cb61b2fff538222dd30a995..3e767db2b202cb37c20b680136c4d5ae4cef425d 100644 --- a/src/sview/Makefile.am +++ b/src/sview/Makefile.am @@ -21,7 +21,8 @@ force: $(sview_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sview_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BG_LDFLAGS) $(GTK_LIBS) +sview_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BG_LDFLAGS) $(GTK_LIBS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) sview_CFLAGS = $(GTK_CFLAGS) else diff --git a/src/sview/Makefile.in b/src/sview/Makefile.in index 21ab41b4ce056b95e7c6a5ae97b4ac62739e8e5f..3651b257fffa01b41116f2269c669f3dea5e5471 100644 --- a/src/sview/Makefile.in +++ b/src/sview/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -62,9 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -72,6 +70,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -181,9 +180,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -191,9 +188,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -225,6 +221,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -252,6 +250,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -351,7 +350,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) @BUILD_SVIEW_TRUE@ submit_info.c admin_info.c common.c \ @BUILD_SVIEW_TRUE@ config_info.c defaults.c -@BUILD_SVIEW_TRUE@sview_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BG_LDFLAGS) $(GTK_LIBS) +@BUILD_SVIEW_TRUE@sview_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BG_LDFLAGS) $(GTK_LIBS) \ +@BUILD_SVIEW_TRUE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + @BUILD_SVIEW_TRUE@sview_CFLAGS = $(GTK_CFLAGS) @BUILD_SVIEW_FALSE@EXTRA_sview_SOURCES = sview.h sview.c popups.c grid.c part_info.c job_info.c \ @BUILD_SVIEW_FALSE@ block_info.c front_end_info.c node_info.c resv_info.c \ @@ -434,7 +435,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -sview$(EXEEXT): $(sview_OBJECTS) $(sview_DEPENDENCIES) +sview$(EXEEXT): $(sview_OBJECTS) $(sview_DEPENDENCIES) $(EXTRA_sview_DEPENDENCIES) @rm -f sview$(EXEEXT) $(sview_LINK) $(sview_OBJECTS) $(sview_LDADD) $(LIBS) @@ -781,10 +782,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/sview/job_info.c b/src/sview/job_info.c index 270eac1016c99d04c499633e4d593e28f28909f5..cd995183d56ba1223e0cf798767ea684c69234cc 100644 --- a/src/sview/job_info.c +++ b/src/sview/job_info.c @@ -1211,7 +1211,17 @@ static int _get_node_cnt(job_info_t * job) { int node_cnt = 0; - if (IS_JOB_PENDING(job) || IS_JOB_COMPLETING(job)) { + /* For PENDING jobs, return the maximum of the requested nodelist, + * requested maximum number of nodes, or requested CPUs rounded + * to nearest node. + * + * For COMPLETING jobs, the job->nodes nodelist has already been + * altered to list only the nodes still in the comp state, and + * thus we count only those nodes toward the total nodes still + * allocated to this job. + */ + + if (IS_JOB_PENDING(job)) { node_cnt = _nodes_in_list(job->req_nodes); node_cnt = MAX(node_cnt, job->num_nodes); } else diff --git a/src/sview/node_info.c b/src/sview/node_info.c index cbaa3347bcb33076dfb72811fe9f4aee606ffd42..c9749f5916df7312f59d5515e61c46d4d4306c5b 100644 --- a/src/sview/node_info.c +++ b/src/sview/node_info.c @@ -42,6 +42,7 @@ int g_node_scaling = 1; enum { SORTID_POS = POS_LOC, SORTID_ARCH, + SORTID_BOARDS, SORTID_BOOT_TIME, SORTID_COLOR, SORTID_CPUS, @@ -108,10 +109,12 @@ static display_data_t display_data_node[] = { EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, {G_TYPE_STRING, SORTID_ERR_CPUS, "Error CPU Count", FALSE, EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, - {G_TYPE_INT, SORTID_CORES, "CoresPerSocket", FALSE, + {G_TYPE_INT, SORTID_BOARDS, "Boards", FALSE, EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, {G_TYPE_INT, SORTID_SOCKETS, "Sockets", FALSE, EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, + {G_TYPE_INT, SORTID_CORES, "CoresPerSocket", FALSE, + EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, {G_TYPE_INT, SORTID_THREADS, "ThreadsPerCore", FALSE, EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, {G_TYPE_STRING, SORTID_MEMORY, "Real Memory", FALSE, @@ -256,12 +259,11 @@ static void _layout_node_record(GtkTreeView *treeview, lower); xfree(lower); - - convert_num_unit((float)node_ptr->cores, tmp_cnt, sizeof(tmp_cnt), + convert_num_unit((float)node_ptr->boards, tmp_cnt, sizeof(tmp_cnt), UNIT_NONE); add_display_treestore_line(update, treestore, &iter, find_col_name(display_data_node, - SORTID_CORES), + SORTID_BOARDS), tmp_cnt); convert_num_unit((float)node_ptr->sockets, tmp_cnt, sizeof(tmp_cnt), @@ -271,6 +273,13 @@ static void _layout_node_record(GtkTreeView *treeview, SORTID_SOCKETS), tmp_cnt); + convert_num_unit((float)node_ptr->cores, tmp_cnt, sizeof(tmp_cnt), + UNIT_NONE); + 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); add_display_treestore_line(update, treestore, &iter, @@ -382,6 +391,7 @@ 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_ARCH, node_ptr->arch, + SORTID_BOARDS, node_ptr->boards, SORTID_BOOT_TIME, sview_node_info_ptr->boot_time, SORTID_COLOR, sview_colors[sview_node_info_ptr->pos diff --git a/src/sview/part_info.c b/src/sview/part_info.c index 421eb95f4c038c61287f9b1ef421ec0a8d8dc7ef..47f591737e0f5d779ccee93df38bcf8ba4a41288 100644 --- a/src/sview/part_info.c +++ b/src/sview/part_info.c @@ -1706,6 +1706,7 @@ static List _create_part_info_list(partition_info_msg_t *part_info_ptr, sview_part_info->sub_part_total.reason = sview_part_sub->reason; } + hostlist_sort(sview_part_sub->hl); } list_iterator_destroy(itr); } diff --git a/src/sview/popups.c b/src/sview/popups.c index 4d522ab03170a662ff4fce8ff5676ac83a9a2204..91dfc37af5719543a0a837bf13a94e0e15a04e08 100644 --- a/src/sview/popups.c +++ b/src/sview/popups.c @@ -551,7 +551,7 @@ extern void create_create_popup(GtkAction *action, gpointer user_data) "Specify either Accounts or Users.\n\n" "Supported Flags include: Maintenance, Overlap,\n" "Ignore_Jobs, Daily and Weekly, License_Only\n" - "and Static_Alloc.\n" + "Part_Nodes and Static_Alloc.\n" "All other fields are optional."); resv_msg = xmalloc(sizeof(resv_desc_msg_t)); slurm_init_resv_desc_msg(resv_msg); diff --git a/src/sview/resv_info.c b/src/sview/resv_info.c index f476b4367c718c45c6040eada8e354f6a6274d40..59fe372ad7fbb7009eee8c4ae51215bca2ec5631 100644 --- a/src/sview/resv_info.c +++ b/src/sview/resv_info.c @@ -188,8 +188,8 @@ static void _process_each_resv(GtkTreeModel *model, GtkTreePath *path, /* * _parse_flags is used to parse the Flags= option. It handles - * daily, weekly, and maint, optionally preceded by + or -, - * separated by a comma but no spaces. + * daily, weekly, maint, static_nodes and part_nodes optionally + * preceded by + or -, separated by a comma but no spaces. */ static uint32_t _parse_flags(const char *flagstr) { @@ -253,6 +253,13 @@ static uint32_t _parse_flags(const char *flagstr) outflags |= RESERVE_FLAG_NO_STATIC; else outflags |= RESERVE_FLAG_STATIC; + } else if (strncasecmp(curr, "Part_Nodes", MAX(taglen,1)) + == 0) { + curr += taglen; + if (flip) + outflags |= RESERVE_FLAG_NO_PART_NODES; + else + outflags |= RESERVE_FLAG_PART_NODES; } else { char *temp = g_strdup_printf("Error parsing flags %s.", flagstr); diff --git a/src/sview/sview.c b/src/sview/sview.c index 07ad51e85bef11b5dea30df3599d70ce16dbbcce..8bbbdf74de13cfc1e6f76e5535a5a266db5844a2 100644 --- a/src/sview/sview.c +++ b/src/sview/sview.c @@ -631,6 +631,14 @@ static void _get_current_debug_flags(GtkToggleAction *action) if (orig_state != new_state) gtk_toggle_action_set_active(toggle_action, new_state); + debug_action = gtk_action_group_get_action(menu_action_group, + "flags_switch"); + toggle_action = GTK_TOGGLE_ACTION(debug_action); + orig_state = gtk_toggle_action_get_active(toggle_action); + new_state = debug_flags & DEBUG_FLAG_SWITCH; + if (orig_state != new_state) + gtk_toggle_action_set_active(toggle_action, new_state); + debug_action = gtk_action_group_get_action(menu_action_group, "flags_triggers"); toggle_action = GTK_TOGGLE_ACTION(debug_action); @@ -751,6 +759,10 @@ static void _set_flags_steps(GtkToggleAction *action) { _set_flags(action, DEBUG_FLAG_STEPS); } +static void _set_flags_switch(GtkToggleAction *action) +{ + _set_flags(action, DEBUG_FLAG_SWITCH); +} static void _set_flags_triggers(GtkToggleAction *action) { _set_flags(action, DEBUG_FLAG_TRIGGERS); @@ -891,6 +903,7 @@ static char *_get_ui_description() " " " " " " + " " " " " " " " @@ -1134,6 +1147,8 @@ static GtkWidget *_get_menubar_menu(GtkWidget *window, GtkWidget *notebook) "SelectType", G_CALLBACK(_set_flags_select_type), FALSE}, {"flags_steps", NULL, "Steps", NULL, "Steps", G_CALLBACK(_set_flags_steps), FALSE}, + {"flags_switch", NULL, "Switch", NULL, + "Switch", G_CALLBACK(_set_flags_switch), FALSE}, {"flags_triggers", NULL, "Triggers", NULL, "Triggers", G_CALLBACK(_set_flags_triggers), FALSE}, {"flags_wiki", NULL, "Wiki", NULL, diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in index 35bad713ed7b89ba96c5890f0b2996bfe3b54d72..04768066edf4adcfc83c8a0f1a84156984bdebc4 100644 --- a/testsuite/Makefile.in +++ b/testsuite/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -171,9 +170,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -181,9 +178,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -215,6 +211,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -242,6 +240,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -515,7 +514,7 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-DEJAGNU: site.exp - srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \ + srcdir='$(srcdir)'; export srcdir; \ EXPECT=$(EXPECT); export EXPECT; \ runtest=$(RUNTEST); \ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ @@ -526,12 +525,12 @@ check-DEJAGNU: site.exp else echo "WARNING: could not find \`runtest'" 1>&2; :;\ fi; \ exit $$exit_status -site.exp: Makefile +site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @echo 'Making a new site.exp file...' @echo '## these variables are automatically generated by make ##' >site.tmp @echo '# Do not edit here. If you wish to override these values' >>site.tmp @echo '# edit the last section' >>site.tmp - @echo 'set srcdir $(srcdir)' >>site.tmp + @echo 'set srcdir "$(srcdir)"' >>site.tmp @echo "set objdir `pwd`" >>site.tmp @echo 'set build_alias "$(build_alias)"' >>site.tmp @echo 'set build_triplet $(build_triplet)' >>site.tmp @@ -539,9 +538,16 @@ site.exp: Makefile @echo 'set host_triplet $(host_triplet)' >>site.tmp @echo 'set target_alias "$(target_alias)"' >>site.tmp @echo 'set target_triplet $(target_triplet)' >>site.tmp - @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp - @test ! -f site.exp || \ - sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp + @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \ + echo "## Begin content included from file $$f. Do not modify. ##" \ + && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \ + && echo "## End content included from file $$f. ##" \ + || exit 1; \ + done >> site.tmp + @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp + @if test -f site.exp; then \ + sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \ + fi @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp @@ -626,10 +632,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/testsuite/expect/Makefile.am b/testsuite/expect/Makefile.am index 5f452d92992e903f0623454f69d8833c6d38d376..80378c97925d20ea846a49e5118d2969a9fd28e2 100644 --- a/testsuite/expect/Makefile.am +++ b/testsuite/expect/Makefile.am @@ -105,6 +105,10 @@ EXTRA_DIST = \ test1.94 \ test1.94.master.c \ test1.94.slave.c \ + test1.95 \ + test1.95.prog.upc \ + test1.96 \ + test1.96.prog.c \ test2.1 \ test2.2 \ test2.3 \ @@ -228,6 +232,8 @@ EXTRA_DIST = \ test9.7.bash \ test9.8 \ test9.9 \ + test9.9.bash \ + test9.9.prog.c \ test10.1 \ test10.2 \ test10.3 \ @@ -257,6 +263,7 @@ EXTRA_DIST = \ test12.4 \ test12.5 \ test13.1 \ + test13.2 \ test14.1 \ test14.2 \ test14.3 \ diff --git a/testsuite/expect/Makefile.in b/testsuite/expect/Makefile.in index e14fc6e9f02fd1f3cedad0b034dfce808e092426..aa44e3c6777d931de20011397b67469191cfa237 100644 --- a/testsuite/expect/Makefile.in +++ b/testsuite/expect/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -124,9 +123,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -134,9 +131,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -168,6 +164,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -195,6 +193,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -390,6 +389,10 @@ EXTRA_DIST = \ test1.94 \ test1.94.master.c \ test1.94.slave.c \ + test1.95 \ + test1.95.prog.upc \ + test1.96 \ + test1.96.prog.c \ test2.1 \ test2.2 \ test2.3 \ @@ -513,6 +516,8 @@ EXTRA_DIST = \ test9.7.bash \ test9.8 \ test9.9 \ + test9.9.bash \ + test9.9.prog.c \ test10.1 \ test10.2 \ test10.3 \ @@ -542,6 +547,7 @@ EXTRA_DIST = \ test12.4 \ test12.5 \ test13.1 \ + test13.2 \ test14.1 \ test14.2 \ test14.3 \ @@ -761,10 +767,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/testsuite/expect/README b/testsuite/expect/README index 04c6537666eaba498c3e1bf4d3eeeba49c8d5b79..718703a2a800219bc385da2a964fa1e99ba011c8 100644 --- a/testsuite/expect/README +++ b/testsuite/expect/README @@ -194,6 +194,8 @@ test1.91 Test of CPU affinity for multi-core systems. test1.92 Test of task distribution support on multi-core systems. test1.93 Test of LAM-MPI functionality test1.94 Test of MPICH2 task spawn logic +test1.95 Basic UPC (Unified Parallel C) test via srun. +test1.96 Basic SHMEM test via srun. **NOTE** The above tests for mutliple processor/partition systems only test2.# Testing of scontrol options (to be run as unprivileged user). @@ -204,7 +206,7 @@ test2.3 Validate scontrol ping command. test2.4 Validate scontrol exit, quit, and !! commands. test2.5 Validate scontrol show commands for configuation, daemons, nodes, frontends, and partitions. -test2.6 Validate scontrol verbose and quite options. +test2.6 Validate scontrol verbose and quiet options. test2.7 Validate scontrol pidinfo command. test2.8 Validate scontrol show commands for jobs and steps. test2.9 Validate scontrol completing command. @@ -352,7 +354,7 @@ test9.5 Stress test of per-task input files. test9.6 Stress test of per-task output files. test9.7 Stress test multiple simultaneous commands via multiple threads. test9.8 Stress test with maximum slurmctld message concurrency. -test9.9 Throughput test for 2000 jobs for timing +test9.9 Throughput test for 5000 jobs for timing test10.# Testing of smap options. @@ -398,6 +400,7 @@ test12.5 Test sacct --helpformat option. test13.# Testing of switch plugins ==================================== test13.1 Test that we avoid re-using active switch contexts. +test13.2 Test for switch/nrt's --network options. test14.# Testing of sbcast options. diff --git a/testsuite/expect/globals b/testsuite/expect/globals index b0fa6822d9fc33b7778cf7a94ab72d1713c3bde3..6497e0a9adfde3cd0a8f31b737c4ce2196ad9bb6 100755 --- a/testsuite/expect/globals +++ b/testsuite/expect/globals @@ -105,6 +105,7 @@ cset partition "" # OR for other versions of MPICH, use this cset mpicc "/usr/local/bin/mpicc" cset use_pmi 0 +cset upcc "/usr/local/bin/upcc" # If using XCPU job launch, specify directory location as needed cset xcpu_dir "/mnt/xcpu" @@ -654,10 +655,15 @@ proc wait_for_all_jobs { job_name incr_sleep } { global scancel squeue bin_sleep set matches 0 - set sleep_time 1 set my_delay 0 set last_matches 0 set timeout 30 + + if {$incr_sleep == 0} { + set sleep_time 0.2 + } else { + set sleep_time 1 + } send_user "Waiting for all jobs to terminate\n" for {set inx 0} {$inx < 600} {incr inx} { log_user 0 @@ -1275,6 +1281,65 @@ proc test_cray { } { return $cray } +################################################################ +# +# Proc: test_serial +# +# Purpose: Determine if the system runs only serial jobs +# +# Returns 1 if the system is serial, 0 otherwise +# +################################################################ + +proc test_serial { } { + global scontrol bin_bash bin_grep + + log_user 0 + set serial 0 + spawn -noecho $bin_bash -c "exec $scontrol show config | $bin_grep SelectType" + expect { + "select/serial" { + set serial 1 + exp_continue + } + eof { + wait + } + } + log_user 1 + + return $serial +} + +################################################################ +# +# Proc: test_switch_nrt +# +# Purpose: Determine if the system is using switch/nrt. +# +# Returns 1 if the system is running swtich/nrt, 0 otherwise +# +################################################################ + +proc test_switch_nrt { } { + global scontrol bin_bash bin_grep + + log_user 0 + set switch_nrt 0 + spawn -noecho $bin_bash -c "exec $scontrol show config | $bin_grep SwitchType" + expect { + "switch/nrt" { + set switch_nrt 1 + exp_continue + } + eof { + wait + } + } + log_user 1 + + return $switch_nrt +} ################################################################ # # Proc: test_emulated diff --git a/testsuite/expect/inc21.21.1 b/testsuite/expect/inc21.21.1 new file mode 100644 index 0000000000000000000000000000000000000000..84d81b2c7e05c8dee272808de57c20628f1946e9 --- /dev/null +++ b/testsuite/expect/inc21.21.1 @@ -0,0 +1,59 @@ +############################################################################ +# Purpose: Test for accounting records of specific job names with their ID +############################################################################ +# Copyright (C) 2012 SchedMD LLC. +# Written by Nathan Yee +# +# This file is part of SLURM, a resource management program. +# For details, see . +# 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. +############################################################################ + +# +# Test maxnode +# +proc inc21_21_1 { maxnode } { + + global number bin_id ta srun exit_code + +# +# Spawn a job testing maxnode +# + set matches 0 + spawn $srun -v -N$maxnode --account=$ta $bin_id + expect { + -re "launching ($number)" { + incr matches + exp_continue + } + timeout { + send_user "\nFAILURE: srun not responding\n" + set exit_code 1 + } + eof { + wait + } + } + + if { $matches != 1 } { + send_user "\nFAILURE: job dion't launch with correct limit\n" + set exit_code 1 + return $exit_code + } + + +} diff --git a/testsuite/expect/inc21.21.2 b/testsuite/expect/inc21.21.2 new file mode 100644 index 0000000000000000000000000000000000000000..aa0733b1a1e171d958c129a971dd87cd4f78ae92 --- /dev/null +++ b/testsuite/expect/inc21.21.2 @@ -0,0 +1,61 @@ +############################################################################ +# Purpose: Test for accounting records of specific job names with their ID +############################################################################ +# Copyright (C) 2012 SchedMD LLC. +# Written by Nathan Yee +# +# This file is part of SLURM, a resource management program. +# For details, see . +# 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. +############################################################################ + +# +# Test for maxnode+1 +# +proc inc21_21_2 {maxnode} { + + global number bin_id ta srun exit_code + +# +# Spawn a job testing maxnode+1 +# + spawn $srun -N[expr $maxnode + 1] --account=$ta $bin_id + expect { + -re "Job violates accounting policy" { + send_user "\nThis error is expected, not a problem\n" + exp_continue + } + -re "launching ($number)" { + send_user "\nFAILURE: job should not have run.\n" + set exit_code 1 + exp_continue + } + timeout { + send_user "\nFAILURE: srun not responding\n" + set exit_code 1 + } + eof { + wait + } + } + + if { $exit_code } { + return $exit_code + } + + +} diff --git a/testsuite/expect/inc21.21.3 b/testsuite/expect/inc21.21.3 new file mode 100644 index 0000000000000000000000000000000000000000..a43d64d2ce2382e8c76df7e3ebd9ed2f28b14ecd --- /dev/null +++ b/testsuite/expect/inc21.21.3 @@ -0,0 +1,60 @@ +############################################################################ +# Purpose: Test for accounting records of specific job names with their ID +############################################################################ +# Copyright (C) 2012 SchedMD LLC. +# Written by Nathan Yee +# +# This file is part of SLURM, a resource management program. +# For details, see . +# 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. +############################################################################ + +# +# Test for maxwall +# + +proc inc21_21_3 {maxwall } { + + global number bin_id ta srun exit_code + + # + # Spawn a job testing maxwall + # + set matches 0 + spawn $srun -v -t$maxwall --account=$ta $bin_id + expect { + -re "launching ($number)" { + incr matches + exp_continue + } + timeout { + send_user "\nFAILURE: srun not responding\n" + set exit_code 1 + } + eof { + wait + } + } + + if { $matches != 1 } { + send_user "\nFAILURE: job dion't launch with correct limit\n" + set exit_code 1 + return $exit_code + } + + +} diff --git a/testsuite/expect/inc21.21.4 b/testsuite/expect/inc21.21.4 new file mode 100644 index 0000000000000000000000000000000000000000..e74b6b72d48de3d2a0916af1ce1c4e4b7e314eaf --- /dev/null +++ b/testsuite/expect/inc21.21.4 @@ -0,0 +1,70 @@ +############################################################################ +# Purpose: Test for accounting records of specific job names with their ID +############################################################################ +# Copyright (C) 2012 SchedMD LLC. +# Written by Nathan Yee +# +# This file is part of SLURM, a resource management program. +# For details, see . +# 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. +############################################################################ + +# +# Tesing maxwall+1 +# + +proc inc21_21_4 {maxwall } { + + global number bin_id ta srun exit_code + + # + # Spawn a job testing maxwall+1 + # + spawn $srun -t[expr $maxwall + 1] --account=$ta $bin_id + expect { + -re "Job violates accounting policy" { + send_user "\nThis error is expected, not a problem\n" + exp_continue + } + -re "launching ($number)" { + send_user "\nFAILURE: job should not have run.\n" + set exit_code 1 + exp_continue + } + timeout { + send_user "\nFAILURE: srun not responding\n" + set exit_code 1 + } + eof { + wait + } + } + + if { $exit_code } { + return $exit_code + } + + + + +} + + + + + + diff --git a/testsuite/expect/test1.15 b/testsuite/expect/test1.15 index 54461c98ec6b670fe0c3fcc2a691d3af36f990ba..7d7f265431a6f0d0612049b86cab7ea0d1c883b7 100755 --- a/testsuite/expect/test1.15 +++ b/testsuite/expect/test1.15 @@ -42,10 +42,12 @@ print_header $test_id if {[test_bluegene]} { send_user "\nWARNING: This test is incompatible with Bluegene systems\n" exit $exit_code -} -if {[test_cray]} { +} elseif {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with serial systems\n" + exit $exit_code } # diff --git a/testsuite/expect/test1.19 b/testsuite/expect/test1.19 index a78410d1b5cf8530da1be2d0de4d77770f991dd8..933317e9174f552ed68ea6874d6e5349ee18b85a 100755 --- a/testsuite/expect/test1.19 +++ b/testsuite/expect/test1.19 @@ -45,13 +45,15 @@ set job_id 0 print_header $test_id -if {[test_cray]} { - send_user "\nWARNING: This test is incompatible with Cray systems\n" - exit $exit_code -} + if {[test_bluegene]} { # We never launch more than one task on emulated Bluegene set task_cnt 1 +} elseif {[test_cray]} { + send_user "\nWARNING: This test is incompatible with Cray systems\n" + exit $exit_code +} elseif {[test_serial]} { + set task_cnt 1 } else { set task_cnt 5 } @@ -184,7 +186,7 @@ set file_out_n_glob "test$test_id.n.$node_id.output" exec $bin_rm -f $file_out_n_glob set job_id 0 -set srun_pid [spawn $srun --output=$file_out_n -N1 -n2 -O -v -t1 $bin_printenv SLURMD_NODENAME] +set srun_pid [spawn $srun --output=$file_out_n -N1 -n$task_cnt -O -v -t1 $bin_printenv SLURMD_NODENAME] expect { -re "jobid ($number).*" { set job_id $expect_out(1,string) @@ -242,12 +244,14 @@ for {set step_id 0} {$step_id < 4} {incr step_id} { if { [test_bluegene] } { set node_cnt 32-2048 set task_cnt 32 +} elseif { [test_serial] } { + set node_cnt 1-1 + set task_cnt 1 +} elseif { [test_xcpu] } { + set node_cnt 1-1 + set task_cnt 4 } else { - if { [test_xcpu] } { - set node_cnt 1-1 - } else { - set node_cnt 1-4 - } + set node_cnt 1-4 set task_cnt 4 } diff --git a/testsuite/expect/test1.2 b/testsuite/expect/test1.2 index cce46c6f4c5132b978a454c49f3bb9422bfecb5f..b1d45412204a67ed893d03317587da6718448983 100755 --- a/testsuite/expect/test1.2 +++ b/testsuite/expect/test1.2 @@ -43,12 +43,13 @@ print_header $test_id if {[test_bluegene]} { # We never launch more than one task on emulated Bluegene set task_cnt 1 -} else { - set task_cnt 10 -} -if {[test_cray]} { +} elseif {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code +} elseif {[test_serial]} { + set task_cnt 1 +} else { + set task_cnt 10 } # diff --git a/testsuite/expect/test1.21 b/testsuite/expect/test1.21 index 631aad8bf37de419b60f5b2897db96973ff4c0f9..11ff005a71cd55c1be9037dc7fe722db46d8db20 100755 --- a/testsuite/expect/test1.21 +++ b/testsuite/expect/test1.21 @@ -38,23 +38,26 @@ set exit_code 0 set job_id 0 set matches 0 set task_id 3 +set task_num 10 print_header $test_id -if {[test_cray]} { - send_user "\nWARNING: This test is incompatible with Cray systems\n" - exit $exit_code -} if {[test_bluegene]} { send_user "\nWARNING: This test is incompatible with Bluegene systems\n" exit $exit_code +} elseif {[test_cray]} { + send_user "\nWARNING: This test is incompatible with Cray systems\n" + exit $exit_code +} elseif {[test_serial]} { + set task_id 0 + set task_num 1 } # # Spawn a shell via srun with stdout forwarding disabled # set timeout $max_job_delay -set srun_pid [spawn $srun --input=$task_id -N1 -n10 -O -v --wait=2 -t1 $bin_bash] +set srun_pid [spawn $srun --input=$task_id -N1 -n$task_num -O -v --wait=2 -t1 $bin_bash] expect { -re "launching ($number).0 on host" { set job_id $expect_out(1,string) @@ -107,7 +110,7 @@ if {$exit_code == 0} { # set job_id 0 set matches 0 -set srun_pid [spawn $srun --output=$task_id -N1 -n10 -O -v env] +set srun_pid [spawn $srun --output=$task_id -N1 -n$task_num -O -v env] expect { -re "launching ($number).0 on host" { set job_id $expect_out(1,string) diff --git a/testsuite/expect/test1.22 b/testsuite/expect/test1.22 index 10203bfeaeaa495969cb6b1cf9e595cb589ac425..1e0ba57526aa363f965defb54cb652760ad7ef3f 100755 --- a/testsuite/expect/test1.22 +++ b/testsuite/expect/test1.22 @@ -36,14 +36,14 @@ source ./globals set test_id "1.22" set exit_code 0 +set task_num 32 print_header $test_id if {[test_bluegene]} { send_user "\nWARNING: This test is incompatible with Bluegene systems\n" exit $exit_code -} -if {[test_cray]} { +} elseif {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code } @@ -53,14 +53,13 @@ if {[test_cray]} { # set host_0 "" set timeout $max_job_delay -if { [test_bluegene] } { - set node_cnt 32-32k +if { [test_xcpu] } { + set node_cnt 1-1 +} elseif {[test_serial]} { + set node_cnt 1 + set task_num 1 } else { - if { [test_xcpu] } { - set node_cnt 1-1 - } else { - set node_cnt 1-64 - } + set node_cnt 1-64 } set srun_pid [spawn $srun -N$node_cnt -l --threads=1 -t1 $bin_printenv SLURMD_NODENAME] @@ -92,7 +91,7 @@ if {[string compare $host_0 ""] == 0} { # set host_0 "" set timeout $max_job_delay -set srun_pid [spawn $srun -N$node_cnt -n32 -O -l --threads=32 -t1 $bin_printenv SLURMD_NODENAME] +set srun_pid [spawn $srun -N$node_cnt -n$task_num -O -l --threads=$task_num -t1 $bin_printenv SLURMD_NODENAME] expect { -re "Memory required by task is not available" { send_user "\nWARNING: DefMemPerTask is configured too high for this test\n" diff --git a/testsuite/expect/test1.26 b/testsuite/expect/test1.26 index 12b0e162aa1e8207e815a04a43b6990602dfd186..1ab88c0ea7124e747ff842abec28908da20a91b3 100755 --- a/testsuite/expect/test1.26 +++ b/testsuite/expect/test1.26 @@ -51,6 +51,12 @@ if {[test_front_end]} { exit $exit_code } +set switch [switch_type] +if {[string compare $switch "none"]} { + send_user "\nWARNING: This test is incompatible with switch/$switch\n" + exit $exit_code +} + # # Submit a 1 node job and record the node name # diff --git a/testsuite/expect/test1.31 b/testsuite/expect/test1.31 index 68f229007e310a2612903ad17b8c647dcd7f9653..e23cde2690c9827903fecc884df671f9d3c0883a 100755 --- a/testsuite/expect/test1.31 +++ b/testsuite/expect/test1.31 @@ -40,6 +40,8 @@ set env_name_debug "SLURM_DEBUG" set env_valu_debug 1 set env_name_nnodes "SLURM_NNODES" +print_header $test_id + if { [test_bluegene] } { set min_nodes 1 set max_nodes 1024 @@ -48,6 +50,13 @@ if { [test_bluegene] } { } else { set env_valu_nprocs 32 } +} elseif {[test_cray]} { + send_user "\nWARNING: This test is incompatible with Cray systems\n" + exit $exit_code +} elseif {[test_serial]} { + set min_nodes 1 + set max_nodes 1 + set env_valu_nprocs 1 } else { set min_nodes 1 set max_nodes 2 @@ -63,20 +72,10 @@ set exit_code 0 set job_id 0 set timeout $max_job_delay -global env -set env($env_name_debug) $env_valu_debug - -print_header $test_id - -# if the srun -o option worked this test would work. -if {[test_cray]} { - send_user "\nWARNING: This test is incompatible with Cray systems\n" - exit $exit_code -} - # # Set target environment variables # +global env set env($env_name_debug) $env_valu_debug set env($env_name_nnodes) $env_valu_nnodes send_user "$env_valu_nnodes $env_valu_nprocs\n"; diff --git a/testsuite/expect/test1.33 b/testsuite/expect/test1.33 index 4d238044a2eb88225736b11812d320b5e3d46271..492c4e141fd4fa56bb9591748d7f0dc9c2078d70 100755 --- a/testsuite/expect/test1.33 +++ b/testsuite/expect/test1.33 @@ -42,10 +42,17 @@ print_header $test_id if {[test_bluegene]} { send_user "\nWARNING: This test is incompatible with Bluegene systems\n" exit $exit_code -} -if {[test_cray]} { +} elseif {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code +} elseif {[test_serial]} { + set task_cnt 1 + set sum1 10 + set key2 "srun_exit_code_10" +} else { + set task_cnt 2 + set sum1 21 + set key2 "srun_exit_code_11" } # @@ -57,7 +64,7 @@ make_bash_script $exit_script " " make_bash_script $test_script " - $srun -N1 -n2 -O $exit_script + $srun -N1 -n $task_cnt -O $exit_script echo srun_exit_code_\$? " @@ -66,7 +73,7 @@ make_bash_script $test_script " # set sum 0 set timeout $max_job_delay -set srun_pid [spawn $srun -N1 -n2 -O $exit_script] +set srun_pid [spawn $srun -N1 -n $task_cnt -O $exit_script] expect { -re "exit code ($number)" { send_user "This error is expected, no worries\n" @@ -82,8 +89,8 @@ expect { wait } } -if {$sum != 21} { - send_user "\nFAILURE: srun failed to report exit code\n" +if {$sum != $sum1} { + send_user "\nFAILURE: srun failed to report exit code ($sum != $sum1)\n" set exit_code 1 } @@ -93,7 +100,7 @@ if {$sum != 21} { set matches 0 spawn $test_script expect { - -re "srun_exit_code_11" { + -re "$key2" { send_user "Above error are expected, no worries\n" incr matches exp_continue diff --git a/testsuite/expect/test1.36 b/testsuite/expect/test1.36 index 216a65e4b248113c243330e658acf0696269af0f..4555d72f83bde66bfe8386f987885a68dac68bfc 100755 --- a/testsuite/expect/test1.36 +++ b/testsuite/expect/test1.36 @@ -33,23 +33,14 @@ source ./globals set test_id "1.36" - set exit_code 0 -set mult 4 -set task_output 0 -if {[test_aix]} { - set task_cnt 3 -} else { - set task_cnt 4 -} print_header $test_id if {[test_bluegene]} { send_user "\nWARNING: This test is incompatible with Bluegene systems\n" exit $exit_code -} -if {[test_cray]} { +} elseif {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code } @@ -57,14 +48,23 @@ if {[test_cray]} { # # Spawn srun with $task_cnt tasks each of which runs a $mult way /bin/id # -set timeout $max_job_delay - -if { [test_xcpu] } { +set mult 4 +set task_output 0 +if {[test_aix]} { + set task_cnt 3 + set node_cnt 1-4 +} elseif {[test_serial]} { + set task_cnt 1 + set node_cnt 1-1 +} elseif { [test_xcpu] } { + set task_cnt 4 set node_cnt 1-1 } else { + set task_cnt 4 set node_cnt 1-4 } +set timeout $max_job_delay set srun_pid [spawn $srun -N$node_cnt -n$task_cnt -O -t1 $srun -l -n$mult -O $bin_id] expect { -re "($number): uid=" { diff --git a/testsuite/expect/test1.37 b/testsuite/expect/test1.37 index 2d7c004d7b0e5fd984b3f185bf2d05b6c290b3d4..54f1115cef677604debc6e987c57d72b23eb55d0 100755 --- a/testsuite/expect/test1.37 +++ b/testsuite/expect/test1.37 @@ -33,13 +33,18 @@ source ./globals set test_id "1.37" -set exit_code 0 +set exit_code 0 +set task_num 0 print_header $test_id if {[test_front_end]} { send_user "\nWARNING: This test is incompatible with front-end systems\n" exit $exit_code +} elseif {[test_serial]} { + set task_num 1 +} else { + set task_num 2 } # @@ -47,7 +52,7 @@ if {[test_front_end]} { # set task_output 0 set timeout $max_job_delay -set srun_pid [spawn $srun -N1 --tasks-per-node=2 -O -l $bin_id] +set srun_pid [spawn $srun -N1 --tasks-per-node=$task_num -O -l $bin_id] expect { -re "($number): uid=" { incr task_output @@ -63,7 +68,7 @@ expect { } } -if {$task_output != 2} { +if {$task_output != $task_num} { send_user "\nFAILURE: failed to get output from all tasks\n" set exit_code 1 } diff --git a/testsuite/expect/test1.41 b/testsuite/expect/test1.41 index e8d6862ee44836a5cc52f7e5a55d412ae3d6a143..255b6b4f2ed1eccddbf561c150df4237975b7f48 100755 --- a/testsuite/expect/test1.41 +++ b/testsuite/expect/test1.41 @@ -57,12 +57,13 @@ set timeout [expr $max_job_delay + 60 + 60 + 120] if { [test_bluegene] } { set node_cnt 1-1024 +} elseif {[test_serial]} { + set node_cnt 1-1 + set task_cnt 1 +} elseif { [test_xcpu] } { + set node_cnt 1-1 } else { - if { [test_xcpu] } { - set node_cnt 1-1 - } else { - set node_cnt 1-2 - } + set node_cnt 1-2 } set srun_pid [spawn $srun -N$node_cnt -n$task_cnt --overcommit --debugger-test -t1 $bin_id] diff --git a/testsuite/expect/test1.43 b/testsuite/expect/test1.43 index cbd3e691d438a9898fac10c7e30d9fae058962e6..35a69390d1729e0fe151f7a2df06cfbbb32175f1 100755 --- a/testsuite/expect/test1.43 +++ b/testsuite/expect/test1.43 @@ -46,6 +46,7 @@ if {[test_cray]} { # # Spawn a srun jobs with ever larger node counts # +set alloc_fail 0 set timeout 60 for {set node_cnt 1} {$node_cnt > 0} {set node_cnt [expr $node_cnt * 2]} { set srun_pid [spawn $srun --test-only -N$node_cnt -t1 $bin_printenv SLURMD_NODENAME] @@ -55,6 +56,7 @@ for {set node_cnt 1} {$node_cnt > 0} {set node_cnt [expr $node_cnt * 2]} { exp_continue } -re "allocation failure" { + set alloc_fail 1 set node_cnt 0 exp_continue } @@ -77,6 +79,8 @@ for {set node_cnt 1} {$node_cnt > 0} {set node_cnt [expr $node_cnt * 2]} { if {$jobs_run == 0} { send_user "\nFAILURE: No jobs run\n" set exit_code 1 +} elseif {$alloc_fail == 1} { + send_user "\nError expected. No worries.\n" } if {$exit_code == 0} { diff --git a/testsuite/expect/test1.45 b/testsuite/expect/test1.45 index 208355e79b73dac60317e7762486ecea30142b18..6f5796dfda8ca3ce54c536634c66cea52001ffa0 100755 --- a/testsuite/expect/test1.45 +++ b/testsuite/expect/test1.45 @@ -38,9 +38,6 @@ set exit_code 0 set file_in "test$test_id.input" set file_out "test$test_id.output" set job_id 0 -set min_nodes 1 -set max_nodes 3 -set num_procs 6 set num_nodes_test1 "" set num_nodes_test2 "" set num_nodes_test3 "" @@ -54,11 +51,17 @@ print_header $test_id if {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code -} - -if { [test_xcpu] } { +} elseif { [test_xcpu] } { send_user "\nWARNING: This test is incompatible with XCPU systems\n" - exit 0 + exit $exit_code +} elseif {[test_serial]} { + set min_nodes 1 + set max_nodes 1 + set num_procs 1 +} else { + set min_nodes 1 + set max_nodes 3 + set num_procs 6 } # diff --git a/testsuite/expect/test1.46 b/testsuite/expect/test1.46 index 53e775ab000e26e5c3caed748f3000257608205b..b5864e9d9206e185d0aa2596d9996f2de8f93326 100755 --- a/testsuite/expect/test1.46 +++ b/testsuite/expect/test1.46 @@ -42,10 +42,12 @@ print_header $test_id if {[test_bluegene]} { send_user "\nWARNING: This test is incompatible with Bluegene systems\n" exit $exit_code -} -if {[test_cray]} { +} elseif {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with a serial system\n" + exit 0 } # diff --git a/testsuite/expect/test1.49 b/testsuite/expect/test1.49 index 95f1b8bfd357876db5b3b05cc27b7f67c9187113..7c3540fc88bee8ec088fa4beab29075fbaf6f5b1 100755 --- a/testsuite/expect/test1.49 +++ b/testsuite/expect/test1.49 @@ -91,6 +91,9 @@ if { [test_bluegene] } { } else { set node_cnt 1-1024 } +} elseif { [test_serial] } { + set node_cnt 1 + set tasks 1 } else { set node_cnt 1-1 } diff --git a/testsuite/expect/test1.54 b/testsuite/expect/test1.54 index b8b73a4e95191a972d8ab12b0a7f918eb42d60a5..3ed332dae9cce5d198a0a321377d7899ca63b743 100755 --- a/testsuite/expect/test1.54 +++ b/testsuite/expect/test1.54 @@ -40,7 +40,10 @@ set exit_code 0 print_header $test_id if {[test_front_end] != 0} { - send_user "\nWARNING: This test is incompatible with front-end systems\n" + send_user "\nWARNING: This test is incompatible with front-end systems\n" + exit 0 +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with a serial system\n" exit 0 } diff --git a/testsuite/expect/test1.59 b/testsuite/expect/test1.59 index e3c0d4409520ea5a152b299da5b3408cf8423412..c087450d5219145dd0d812d4fd8da69d5699962f 100755 --- a/testsuite/expect/test1.59 +++ b/testsuite/expect/test1.59 @@ -49,7 +49,11 @@ exec $bin_rm -f $hostfile if { [test_front_end] } { send_user "\nWARNING: This test incompatible with front-end systems\n" exit $exit_code +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with a serial system\n" + exit 0 } + if {[string compare [switch_type] "elan"] == 0} { send_user "\nWARNING: This test incompatible with Elan switch\n" exit $exit_code diff --git a/testsuite/expect/test1.60 b/testsuite/expect/test1.60 index 46af3e4617ec67c2f6d773c5cfcd261f0defbe09..1bdf1441cfd4d4421bc197290cc455b7a51ef3d5 100755 --- a/testsuite/expect/test1.60 +++ b/testsuite/expect/test1.60 @@ -147,7 +147,11 @@ if {[test_front_end] != 0} { # Spawn a program that generates "node_id" (%n) in stdout file names # and confirm they are created # -set task_count [expr $node_count * 2] +if {[test_serial]} { + set task_count $node_count +} else { + set task_count [expr $node_count * 2] +} set timeout $max_job_delay set srun_pid [spawn $srun -l --output=$file_out_n -N $node_count -n $task_count -O -v -t1 $bin_echo hello] expect { diff --git a/testsuite/expect/test1.80 b/testsuite/expect/test1.80 index 1233faacc397c2d375eac4e5ee958c1e82f2c966..604382ae4684377b49575ac705d7cbc9aace2268 100755 --- a/testsuite/expect/test1.80 +++ b/testsuite/expect/test1.80 @@ -43,6 +43,9 @@ print_header $test_id if { [test_front_end] } { send_user "\nWARNING: This test is incompatible with front end systems\n" exit 0 +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with serial system\n" + exit 0 } # diff --git a/testsuite/expect/test1.81 b/testsuite/expect/test1.81 index 8c4efa784517635d56d1b58ab7d3e59b54fb7257..deed6256ac90979647486728dffbf955a955be7a 100755 --- a/testsuite/expect/test1.81 +++ b/testsuite/expect/test1.81 @@ -43,6 +43,9 @@ print_header $test_id if {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with serial system\n" + exit $exit_code } # diff --git a/testsuite/expect/test1.82 b/testsuite/expect/test1.82 index 94e3610ad53d87b312abe36fff4dbec1b924ab02..d00b53d44fcb734c932fe9df378ed89d7123296f 100755 --- a/testsuite/expect/test1.82 +++ b/testsuite/expect/test1.82 @@ -40,14 +40,15 @@ set exit_code 0 print_header $test_id -if { [test_xcpu] } { - send_user "\nWARNING: This test is incompatible with XCPU systems\n" - exit 0 -} - if {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with serial system\n" + exit 0 +} elseif { [test_xcpu] } { + send_user "\nWARNING: This test is incompatible with XCPU systems\n" + exit 0 } # diff --git a/testsuite/expect/test1.83 b/testsuite/expect/test1.83 index c46e62cfd23c75f2246f6f1ba71fab0ab9fa063b..96cf91c8e58f659992fa90b91e674de5928ce4d5 100755 --- a/testsuite/expect/test1.83 +++ b/testsuite/expect/test1.83 @@ -48,14 +48,15 @@ if {[test_wiki_sched] == 1} { send_user "\nWARNING: not compatable with sched/wiki (Maui)\n" send_user " or sched/wiki2 (Moab) schedulers\n" exit $exit_code -} -if {[test_front_end] != 0} { +} elseif {[test_front_end]} { send_user "\nWARNING: This test is incompatible with front-end systems\n" exit 0 -} -if {[test_topology] != 0} { +} elseif {[test_topology]} { send_user "\nWARNING: This test is incompatible topology configured systems\n" exit 0 +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with a serial system\n" + exit 0 } set available [available_nodes [default_partition]] diff --git a/testsuite/expect/test1.86 b/testsuite/expect/test1.86 index 984fd031b96454b32bae57269f3e2a726493584e..d86c96be7464a8db34ebfd2a0845a0899721a821 100755 --- a/testsuite/expect/test1.86 +++ b/testsuite/expect/test1.86 @@ -42,16 +42,18 @@ set prompt "PROMPT: " print_header $test_id -if {[test_front_end] != 0} { +if {[test_front_end]} { send_user "\nWARNING: This test is incompatible with front-end systems\n" exit 0 -} - -if {[test_multiple_slurmd] != 0} { +} elseif {[test_multiple_slurmd] != 0} { send_user "\nWARNING: This test is incompatible with multiple slurmd systems\n" exit 0 +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with a serial system\n" + exit 0 } + # # Build input script file # diff --git a/testsuite/expect/test1.87 b/testsuite/expect/test1.87 index 457ff29be0b476956fa828fdb5444a753a363267..24d9039271e8986def2458d669c32f733ed56c7c 100755 --- a/testsuite/expect/test1.87 +++ b/testsuite/expect/test1.87 @@ -45,6 +45,9 @@ print_header $test_id if {[test_front_end] != 0} { send_user "\nWARNING: This test is incompatible with front-end systems\n" exit 0 +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incomatible with front-end systems\n" + exit 0 } # @@ -76,6 +79,11 @@ expect { slow_kill $srun_pid exit 0 } + -re "Required node not available" { + send_user "\nWARNING: can't test srun task distribution\n" + exec $bin_rm -f $file_in + exit $exit_code + } -re "Unable to contact" { send_user "\nFAILURE: slurm appears to be down\n" exit 1 diff --git a/testsuite/expect/test1.88 b/testsuite/expect/test1.88 index 0419555e140a55956f6344250bccae6a044c1bff..24d5f2a18c9d094306b790a33111b18c0dec4251 100755 --- a/testsuite/expect/test1.88 +++ b/testsuite/expect/test1.88 @@ -54,13 +54,15 @@ if {[file executable $mpicc] == 0} { send_user "\nWARNING: $mpicc does not exists\n" exit 0 } -if {[test_front_end] != 0} { +if {[test_front_end]} { send_user "\nWARNING: This test is incompatible with front-end systems\n" exit 0 -} -if {[test_aix] == 1} { +} elseif {[test_aix]} { send_user "WARNING: Test is incompatible with AIX\n" exit 0 +} elseif {[test_serial]} { + send_user "WARNING: Test is incompatible with serial system\n" + exit 0 } # @@ -69,7 +71,7 @@ if {[test_aix] == 1} { exec $bin_rm -f $test_prog ${test_prog}.o if {$use_pmi} { set pmi_link "-rpath $slurm_dir/lib -L $slurm_dir/lib -lpmi" - exec $mpicc -Xlinker $pmi_link -o $test_prog ${test_prog}.c + eval exec $mpicc -Xlinker $pmi_link -o $test_prog ${test_prog}.c } else { exec $mpicc -o $test_prog ${test_prog}.c } diff --git a/testsuite/expect/test1.9 b/testsuite/expect/test1.9 index 7fc2c2f077aa06875e1cb0deb20d0f3ee6a57e06..9dc84f5a93cd57b55fe2441914ab25762f9e8eb9 100755 --- a/testsuite/expect/test1.9 +++ b/testsuite/expect/test1.9 @@ -42,12 +42,13 @@ print_header $test_id if {[test_bluegene]} { # We never launch more than one task on emulated Bluegene set task_cnt 1 -} else { - set task_cnt 5 -} -if {[test_cray]} { +} elseif {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code +} elseif {[test_serial]} { + set task_cnt 1 +} else { + set task_cnt 5 } # diff --git a/testsuite/expect/test1.93 b/testsuite/expect/test1.93 index 15bfde412ad92ccad650274a4cb51feb003f7ad1..c5bf81f3eeb74157e59357e90741cbc3d7bf3883 100755 --- a/testsuite/expect/test1.93 +++ b/testsuite/expect/test1.93 @@ -43,6 +43,9 @@ print_header $test_id if {[test_front_end] != 0} { send_user "\nWARNING: This test is incompatible with front-end systems\n" exit 0 +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with serial system\n" + exit 0 } # diff --git a/testsuite/expect/test1.94 b/testsuite/expect/test1.95 similarity index 53% rename from testsuite/expect/test1.94 rename to testsuite/expect/test1.95 index d8574516fe5f7e6ab96f7bbbf72815f497209437..93aab08cfa37e5d39247f8163c3cb3bd5f76ba99 100755 --- a/testsuite/expect/test1.94 +++ b/testsuite/expect/test1.95 @@ -1,17 +1,15 @@ #!/usr/bin/expect ############################################################################ # Purpose: Test of SLURM functionality -# Test of MPICH2 task spawn logic +# Basic UPC (Unified Parallel C) test via srun. # # Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR # "WARNING: ..." with an explanation of why the test can't be made, OR # "FAILURE: ..." otherwise with an explanation of the failure, OR # anything else indicates a failure mode that must be investigated. ############################################################################ -# Copyright (C) 2002 The Regents of the University of California. -# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). -# Written by Morris Jette -# CODE-OCEC-09-009. All rights reserved. +# Copyright (C) 2012 SchedMD LLC. +# Written by Morris Jette # # This file is part of SLURM, a resource management program. # For details, see . @@ -33,61 +31,44 @@ ############################################################################ source ./globals -set test_id "1.94" +set test_id "1.95" set exit_code 0 set file_in "test$test_id.input" set file_out "test$test_id.output" set file_err "test$test_id.error" -set master_prog "test$test_id.master" -set slave_prog "test$test_id.slave" +set test_prog "test$test_id.prog" set job_id 0 +set task_cnt 6 print_header $test_id # -# Test for existence of mpi compiler +# Test for existence of UPC compiler # -if {[info exists mpicc] == 0} { - send_user "\nWARNING: mpicc not defined, can't perform mpi testing\n" +if {[info exists upcc] == 0} { + send_user "\nWARNING: upcc not defined, can't perform mpi testing\n" exit 0 } -if {[file executable $mpicc] == 0} { - send_user "\nWARNING: $mpicc does not exists\n" +if {[file executable $upcc] == 0} { + send_user "\nWARNING: $upcc does not exists\n" exit 0 } -# -# Test is only works with mpi/pmi2 plugin. -# -set invalid 1 -log_user 0 -spawn $scontrol show config -expect { - -re "pmi2" { - set invalid 0 - exp_continue - } - timeout { - send_user "\nFAILURE: scontrol not responding\n" - set exit_code 1 - } - eof { - wait - } -} -log_user 1 -if {$invalid == 1} { - send_user "\nWARNING: test compatible only with mpi/pmi2\n" - exit $exit_code +if {[test_front_end]} { + send_user "\nWARNING: This test is incompatible with front-end systems\n" + exit 0 +} elseif {[test_aix]} { + send_user "WARNING: Test is incompatible with AIX\n" + exit 0 +} elseif {[test_serial]} { + send_user "WARNING: Test is incompatible with serial system\n" + exit 0 } # # Delete left-over program and rebuild it # -exec $bin_rm -f $file_in $file_out $file_err -exec $bin_rm -f $master_prog ${master_prog}.o -exec $bin_rm -f $slave_prog ${slave_prog}.o -exec $mpicc -o $master_prog ${master_prog}.c -exec $mpicc -o $slave_prog ${slave_prog}.c +exec $bin_rm -f $test_prog ${test_prog}.o +exec $upcc -o $test_prog ${test_prog}.upc # Delete left-over stdout/err files file delete $file_out $file_err @@ -96,7 +77,7 @@ file delete $file_out $file_err # Build input script file # make_bash_script $file_in " - $srun -n1 $master_prog $slave_prog + $srun -n $task_cnt $test_prog " # @@ -104,7 +85,7 @@ make_bash_script $file_in " # set timeout $max_job_delay set no_start 0 -set sbatch_pid [spawn $sbatch -n4 --output=$file_out --error=$file_err -t1 $file_in] +set sbatch_pid [spawn $sbatch -N1-3 -n $task_cnt --output=$file_out --error=$file_err -t1 $file_in] expect { -re "Submitted batch job ($number)" { set job_id $expect_out(1,string) @@ -151,35 +132,38 @@ if {[wait_for_job $job_id "DONE"] != 0} { # # Check for desired output in stdout # -set expected_msg 4 -set expected_sum 12 if {[wait_for_file $file_out] == 0} { - set complete 0 - set matches 0 - set rank_sum 0 + set matches 0 + set sum 0 + set total 0 spawn $bin_cat $file_out expect { - -re "Rank.($number). on $alpha_numeric_under just received msg from Rank ($number)" { - incr rank_sum $expect_out(1,string) - incr rank_sum $expect_out(2,string) + -re "Hello from ($number) of $task_cnt" { incr matches - exp_continue - } - eof { + incr sum $expect_out(1,string) + exp_continue + } + -re "Total is ($number)" { + set total $expect_out(1,string) + exp_continue + } + -re "Failed to mmap" { + send_user "\nFAILURE: insufficient shared memory. " + send_user "Rebuild UPCC with --disable-pshm option.\n" + exp_continue + } + eof { wait - } - } + } + } if {$matches == 0} { - send_user "\nFAILURE: No MPI communications occurred\n" - send_user " The version of MPI you are using may be incompatible " - send_user "with the configured switch\n" - send_user " Core files may be present from failed MPI tasks\n\n" + send_user "\nFAILURE: No UPC communications occurred\n" set exit_code 1 - } elseif {$matches != $expected_msg} { - send_user "\nFAILURE: unexpected output ($matches of $expected_msg)\n" + } elseif {$matches != $task_cnt} { + send_user "\nFAILURE: unexpected output ($matches of $task_cnt)\n" set exit_code 1 - } elseif {$rank_sum != $expected_sum} { - send_user "\nFAILURE: Invalid rank values ($rank_sum != $expected_sum)\n" + } elseif {$sum != $total} { + send_user "\nFAILURE: Problem with global variables ($sum != $total)\n" set exit_code 1 } } else { @@ -187,29 +171,10 @@ if {[wait_for_file $file_out] == 0} { } if {$exit_code == 0} { - exec $bin_rm -f $file_in $file_out $file_err - exec $bin_rm -f $master_prog ${master_prog}.o - exec $bin_rm -f $slave_prog ${slave_prog}.o + exec $bin_rm -f $file_in $file_out $file_err $test_prog ${test_prog}.o send_user "\nSUCCESS\n" } else { - set matches 0 - spawn head $file_err - expect { - -re "Error creating CQ" { - incr matches - exp_continue - } - eof { - wait - } - } - if {$matches != 0} { - send_user "WARNING: If using MVAPICH then\n" - send_user " Configure \"PropagateResourceLimitsExcept=MEMLOCK\"\n" - send_user " Also start slurmd with \"ulimit -l unlimited\"\n" - } else { - send_user "Check contents of $file_err\n" - } + send_user "Check contents of $file_err\n" } exit $exit_code diff --git a/src/srun/srun.h b/testsuite/expect/test1.95.prog.upc similarity index 61% rename from src/srun/srun.h rename to testsuite/expect/test1.95.prog.upc index 135b631b68bbec80083356b0e6233631976524bc..49f1ec8213147ebeba5b3ec32ce949daaa67896e 100644 --- a/src/srun/srun.h +++ b/testsuite/expect/test1.95.prog.upc @@ -1,10 +1,8 @@ /*****************************************************************************\ - * src/srun/srun.h - header for external functions in srun.c + * test1.95.prog.upc - Basic UPC (Unified Parallel C) test via srun. ***************************************************************************** - * Copyright (C) 2006 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Mark Grondona . - * CODE-OCEC-09-009. All rights reserved. + * Copyright (C) 2012 SchedMD LLC + * Written by Morris Jette * * This file is part of SLURM, a resource management program. * For details, see . @@ -22,22 +20,26 @@ * * 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. + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifndef _HAVE_SRUN_H -#define _HAVE_SRUN_H +#include +#include -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +shared int inx[THREADS]; -#include -#include - -#include "src/api/step_io.h" -#include "src/srun/srun_job.h" - -void srun_set_stdio_fds(srun_job_t *job, slurm_step_io_fds_t *cio_fds); - -#endif /* !_HAVE_SRUN_H */ +int main(int argc, char * argv[]) +{ + printf("Hello from %d of %d\n", MYTHREAD, THREADS); + inx[MYTHREAD] = MYTHREAD; + upc_barrier; + if (MYTHREAD == 0) { + int i, total = 0; + for (i = 0; i < THREADS; i++) + total += inx[i]; + /* Make sure "Total" message is last for Expect parsing*/ + sleep(1); + printf("Total is %d\n", total); + } + return 0; +} diff --git a/testsuite/expect/test1.96 b/testsuite/expect/test1.96 new file mode 100755 index 0000000000000000000000000000000000000000..d59fe6d3356fd1e8c7698ab0369e6ffe16f2d3b5 --- /dev/null +++ b/testsuite/expect/test1.96 @@ -0,0 +1,156 @@ +#!/usr/bin/expect +############################################################################ +# Purpose: Test of SLURM functionality +# Basic SHMEM test via srun. +# +# Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR +# "WARNING: ..." with an explanation of why the test can't be made, OR +# "FAILURE: ..." otherwise with an explanation of the failure, OR +# anything else indicates a failure mode that must be investigated. +############################################################################ +# Copyright (C) 2012 SchedMD LLC. +# Written by Morris Jette +# +# This file is part of SLURM, a resource management program. +# For details, see . +# 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.96" +set exit_code 0 +set file_in "test$test_id.input" +set file_out "test$test_id.output" +set file_err "test$test_id.error" +set test_prog "test$test_id.prog" +set job_id 0 +set task_cnt 4 + +print_header $test_id + +if {[test_front_end]} { + send_user "\nWARNING: This test is incompatible with front-end systems\n" + exit 0 +} elseif {[test_aix]} { + send_user "WARNING: Test is incompatible with AIX\n" + exit 0 +} elseif {[test_serial]} { + send_user "WARNING: Test is incompatible with serial system\n" + exit 0 +} elseif {![file exists /usr/include/mpp/shmem.h]} { + send_user "\nWARNING: /usr/include/mpp/shmem.h does not exists\n" + exit 0 +} + +# +# Delete left-over program and rebuild it +# +exec $bin_rm -f $test_prog ${test_prog}.o +exec $bin_cc -o $test_prog ${test_prog}.c -lshmem + +# Delete left-over stdout/err files +file delete $file_out $file_err + +# +# Build input script file +# +make_bash_script $file_in " + $srun -n $task_cnt $test_prog +" + +# +# Spawn an sbatch job that uses stdout/err and confirm their contents +# +set timeout $max_job_delay +set no_start 0 +set sbatch_pid [spawn $sbatch -N1 -n $task_cnt --output=$file_out --error=$file_err -t1 $file_in] +expect { + -re "Submitted batch job ($number)" { + set job_id $expect_out(1,string) + exp_continue + } + -re "Batch job submission failed" { + set no_start 1 + exp_continue + } + -re "Unable to contact" { + send_user "\nFAILURE: slurm appears to be down\n" + exit 1 + } + timeout { + send_user "\nFAILURE: srun not responding\n" + slow_kill $sbatch_pid + set exit_code 1 + } + eof { + wait + } +} + +if {$no_start != 0} { + send_user "\nWARNING: partition too small for test\n" + if {$job_id != 0} { + cancel_job $job_id + } + exit 0 +} +if {$job_id == 0} { + send_user "\nFAILURE: batch submit failure\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 in stdout +# +if {[wait_for_file $file_out] == 0} { + set matches 0 + + spawn $bin_cat $file_out + expect { + -re "PE ($number): 1,2,3,4,5,6,7,8" { + incr matches + exp_continue + } + eof { + wait + } + } + incr task_cnt -1 + if {$matches != $task_cnt} { + send_user "\nFAILURE: unexpected output ($matches of $task_cnt)\n" + set exit_code 1 + } +} else { + set exit_code 1 +} + +if {$exit_code == 0} { + exec $bin_rm -f $file_in $file_out $file_err $test_prog ${test_prog}.o + send_user "\nSUCCESS\n" +} else { + send_user "Check contents of $file_err\n" +} + +exit $exit_code diff --git a/testsuite/expect/test1.96.prog.c b/testsuite/expect/test1.96.prog.c new file mode 100644 index 0000000000000000000000000000000000000000..12f2dc198599e45a1b9aec0c54cd36c9a20f66ab --- /dev/null +++ b/testsuite/expect/test1.96.prog.c @@ -0,0 +1,42 @@ +/*****************************************************************************\ + * test1.96.prog.upc - Basic SHMEM test via srun. + ***************************************************************************** + * Based upon "Code Example" in "SHMEM Tutorial" + * By Hung-Hsun Su, UPC Group, HSC Lab, Spring 2010 +\*****************************************************************************/ + +#include +#include +#include + +int me, npes, i; +int src[8], dest[8]; + +int main(int argc, char * argv[]) +{ + /* Get PE information */ + me = _my_pe(); + npes = _num_pes(); + + /* Initialize and send on PE 0 */ + if (me == 0) { + for (i = 0; i < 8; i++) + src[i] = i + 1; + /* Put source date at PE 0 to dest at PE 1+ */ + for (i = 1; i < npes; i++) + shmem_put64(dest, src, 8 * sizeof(int) / 8, i); + } + + /* Make sure the transfer is complete */ + shmem_barrier_all(); + + /* Print from PE 1+ */ + if (me > 0) { + printf("PE %d: %d", me, dest[0]); + for (i = 1; i < 8; i++) + printf(",%d", dest[i]); + printf("\n"); + } + + return 0; +} diff --git a/testsuite/expect/test12.2 b/testsuite/expect/test12.2 index 7c18248d1b01658d83a1a9995f2b86e956c9eb4e..f1fc880e5d435741929400c67870e252aaac8ea6 100755 --- a/testsuite/expect/test12.2 +++ b/testsuite/expect/test12.2 @@ -116,7 +116,7 @@ proc _get_mem {prog} { # Compute error in KB set diff_mem [expr $mem_used - $mem_size] set error_mem [expr abs($diff_mem)] - if {$error_mem > 4100} { + if {($mem_used < $mem_size) || ($error_mem > 4200)} { send_user "\nFAILURE: sstat memory use discrepancy of $error_mem KB\n" send_user " Wanted $mem_size KB, got $mem_used KB\n" return 1 @@ -221,7 +221,7 @@ if {[wait_for_job $job_id "RUNNING"] != 0} { } # Wait for data to get logged -exec $bin_sleep 5 +exec $bin_sleep 10 if {[_get_mem $sstat] != 0} { set exit_code 1 diff --git a/testsuite/expect/test12.3 b/testsuite/expect/test12.3 index 31b3c27055bb2a46430370fa9f002b3bc79f2ef0..b71db5330600b4a01404a1126ba8634acffd6653 100755 --- a/testsuite/expect/test12.3 +++ b/testsuite/expect/test12.3 @@ -53,6 +53,9 @@ print_header $test_id if {[test_bluegene]} { send_user "\nWARNING: This test can't be run on a blue gene\n" exit $exit_code +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with serial systems\n" + exit $exit_code } # diff --git a/testsuite/expect/test12.4 b/testsuite/expect/test12.4 index da865f91911cb91a48dc1d8af201f5d99688c491..da3624c161e49b4d87823cd10e593e0ae7555a16 100755 --- a/testsuite/expect/test12.4 +++ b/testsuite/expect/test12.4 @@ -186,7 +186,7 @@ if {$job_id == 0} { } if { $using_slurmdbd } { - sleep 5 + sleep 10 } diff --git a/testsuite/expect/test13.2 b/testsuite/expect/test13.2 new file mode 100755 index 0000000000000000000000000000000000000000..5492940d063dd41bc3d6b2a6e0d8d17b0f657437 --- /dev/null +++ b/testsuite/expect/test13.2 @@ -0,0 +1,176 @@ +#!/usr/bin/expect +############################################################################ +# Purpose: Test of NRT functionality +# Test of switch/nrt options (--network 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) 2012 SchedMD LLC +# +# This file is part of SLURM, a resource management program. +# For details, see . +# 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 exit_code 0 +set test_code 0 +set fail 0 + +if {[test_switch_nrt] == 0} { + send_user "\nWARNING: This test is only compatable with switch/nrt systems\n" + exit 0 +} + + +# +# This tests a few options that should and should not work for NRT +# +proc create_nrtparams {nrt_params} { + + global bin_id srun fail + + set fail 0 + eval spawn $srun -N1-2 -n2 -O --network=$nrt_params $bin_id + expect { + -re "error" { + set fail 1 + exp_continue + } + timeout { + send_user "\nFAILURE: srun not responding\n" + set exit_code 1 + exp_continue + } + eof { + wait + } + } + +} + +proc create_nrtparams_4tasks {nrt_params} { + + global bin_id srun fail + + set fail 0 + eval spawn $srun -N1-2 -n4 -O --network=$nrt_params $bin_id + expect { + -re "error" { + set fail 1 + exp_continue + } + timeout { + send_user "\nFAILURE: srun not responding\n" + set exit_code 1 + exp_continue + } + eof { + wait + } + } +} + + +# +# This makes a list of all the bad test to be tested. +# +send_user "\n===============Bad Tests===================\n" + +set badtest " +{sn_all,devtype=hfi} +{sn_single,devtype=hfi} +{sn_single,devtype=iponly,us} +" + +foreach test $badtest { + set test_code [create_nrtparams $test] + if {$fail == 1} { + send_user "Error expected here, don't worry :)\n" + send_user "fail_code = $fail\n\n" + } else { + send_user "FAILURE: This test should have failed but did not.\n" + send_user "fail_code = $fail\n\n" + set exit_code 1 + } + +} + +# +# This test a list of all the good tests that should succeed. +# +send_user "\n===============Good Tests================\n" +set goodtest " +{sn_all,devtype=ib} +{sn_all,devtype=iponly} +{sn_single,devtype=ib} +{sn_single,devtype=ib,us} +{sn_single,devtype=iponly,ipv4} +{sn_single,devtype=iponly,ipv6} +{sn_all,ipv6} +{devname=mlx4_0} +{devname=eth0} +{devname=mlx4_0,mpi,lapi} +{devname=mlx4_0,mpi,lapi,us} +{devname=mlx4_0,mpi,lapi,instances=3} +{sn_all} +{sn_all,mpi,lapi} +{sn_all,mpi,lapi} +{devname=mlx4_0,bulk_xfer,us} +" + +foreach test $goodtest { + set test_code [create_nrtparams $test] + if {$fail == 0} { + send_user "This test should work :)\n" + send_user "fail_code = $fail\n\n" + } else { + send_user "FAILURE: This test should not have failed\n" + send_user "fail_code = $fail\n\n" + set exit_code 1 + } +} + +# +# This test a list of all the good test with 4 tasks +# +send_user "\n============Good Tests With 4 Tasks============\n" +set good4task " +{devname=mlx4_0,mpi,lapi,us,instances=3} +{sn_all,mpi,lapi,instances=2} +{sn_all,mpi,lapi,instances=3,us} +" + +foreach test $good4task { + set test_code [create_nrtparams_4tasks $test] + if {$fail == 0} { + send_user "This test should work :)\n" + send_user "fail_code = $fail\n\n" + } else { + send_user "FAILURE: This test should not have failed\n" + send_user "fail_code = $fail\n\n" + set exit_code 1 + } +} + +if {$exit_code != 0} { + send_user "\nFAILURE\n" +} else { + send_user "\nSUCCESS\n" +} diff --git a/testsuite/expect/test14.4 b/testsuite/expect/test14.4 index 7bd04533661bc2067392ec7ff2156656500fac9d..ecb950b2a6a37ed7adcfde19fe6c6a5fac55845e 100755 --- a/testsuite/expect/test14.4 +++ b/testsuite/expect/test14.4 @@ -111,6 +111,7 @@ if {$job_id == 0} { # if {[wait_for_job $job_id "DONE"] != 0} { send_user "\nFAILURE: waiting for job to complete\n" + exec $scancel --quiet $job_id set exit_code 1 } diff --git a/testsuite/expect/test14.8 b/testsuite/expect/test14.8 index 1dc45717d10b2fd1e999ca9a6fa2bd667c27f038..a3a7016e6218c977bd94989fd55ed3013a29ed64 100755 --- a/testsuite/expect/test14.8 +++ b/testsuite/expect/test14.8 @@ -109,6 +109,7 @@ if {$job_id == 0} { # if {[wait_for_job $job_id "DONE"] != 0} { send_user "\nFAILURE: waiting for job to complete\n" + exec $scancel --quiet $job_id set exit_code 1 } diff --git a/testsuite/expect/test15.19 b/testsuite/expect/test15.19 index b7500ca3de5a9f2418c3421cf8be5503bf3496d4..0c5613f62d50aae8d873f1cf0f7344d32aab0721 100755 --- a/testsuite/expect/test15.19 +++ b/testsuite/expect/test15.19 @@ -43,6 +43,9 @@ print_header $test_id if {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with serial systems\n" + exit $exit_code } # diff --git a/testsuite/expect/test15.20 b/testsuite/expect/test15.20 index f7f32603bc46bacde45503da54c27b28df27c339..2e7d2917056c2de9e3497adcf8ad8b540ec8ce48 100755 --- a/testsuite/expect/test15.20 +++ b/testsuite/expect/test15.20 @@ -42,9 +42,11 @@ print_header $test_id if {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" - exit $exit_code -} -if { [test_xcpu] } { + exit 0 +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with serial systems\n" + exit 0 +} elseif { [test_xcpu] } { send_user "\nWARNING: This test is incompatible with XCPU systems\n" exit 0 } diff --git a/testsuite/expect/test15.24 b/testsuite/expect/test15.24 index faa4addff95634a45db6eacf86f8a6795f113851..f8b68a7c33e2f0d4cdb6f137af18e6f9070befd1 100755 --- a/testsuite/expect/test15.24 +++ b/testsuite/expect/test15.24 @@ -43,13 +43,14 @@ print_header $test_id if {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code -} -if { [test_bluegene] } { +} elseif { [test_bluegene] } { if { [test_emulated] } { set task_cnt 1 } else { set task_cnt 10 } +} elseif {[test_serial]} { + set task_cnt 1 } else { set task_cnt 10 } diff --git a/testsuite/expect/test17.27 b/testsuite/expect/test17.27 index f7c541c6501c4b9ebacf45efe795818a265e675a..0182a050a766a23da01d1e39a959de68fd928053 100755 --- a/testsuite/expect/test17.27 +++ b/testsuite/expect/test17.27 @@ -45,10 +45,12 @@ print_header $test_id if {[test_cray]} { send_user "\nWARNING: This test is incompatible with Cray systems\n" exit $exit_code -} -if { [test_xcpu] } { +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with serial systems\n" + exit $exit_code +} elseif { [test_xcpu] } { send_user "\nWARNING: This test is incompatible with XCPU systems\n" - exit 0 + exit $exit_code } # diff --git a/testsuite/expect/test17.32 b/testsuite/expect/test17.32 index 6762483fbc620ed9abd3b44fa8158334d48f4a80..38567d3df57f1f8e303c4facc0d8c355cdb3fe17 100755 --- a/testsuite/expect/test17.32 +++ b/testsuite/expect/test17.32 @@ -62,6 +62,8 @@ if { [test_bluegene] } { } else { set task_cnt 10 } +} elseif { [test_serial] } { + set task_cnt 1 } else { set task_cnt 10 } @@ -93,6 +95,7 @@ if {[wait_for_job $job_id "DONE"] != 0} { cancel_job $job_id set exit_code 1 } + set matches 0 set tasks 0 if {[wait_for_file $file_out] == 0} { @@ -116,12 +119,13 @@ if {[wait_for_file $file_out] == 0} { } } if {$matches != 2} { - send_user "\nFAILURE: Did not set desired allocation env vars\n" + send_user "\nFAILURE: Did not set desired allocation env vars: " + send_user "($matches != 2)\n" set exit_code 1 } -if {$task_cnt != $tasks} { +if {$tasks != $task_cnt} { send_user "\nFAILURE: Did not get proper number of tasks: " - send_user "($task_cnt != $tasks)\n" + send_user "($task != $task_cnt)\n" set exit_code 1 } diff --git a/testsuite/expect/test2.14 b/testsuite/expect/test2.14 index a873739fc5537c843d4ddae07d414cef847ae9f1..68f5f52787ba49d3a93601bbfe12b9f528799263 100755 --- a/testsuite/expect/test2.14 +++ b/testsuite/expect/test2.14 @@ -39,20 +39,22 @@ set file_in "test$test_id.input" set file_out "test$test_id.output" set file_out2 "test$test_id.output2" set job_id 0 +set node_cnt 2 print_header $test_id if { [test_xcpu] } { send_user "\nWARNING: This test is incompatible with XCPU systems\n" exit 0 -} - -if {[test_front_end]} { +} elseif {[test_front_end]} { send_user "\nWARNING: This test is incompatible with front-end systems\n" exit $exit_code +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with serial systems\n" + exit $exit_code } -set node_cnt 2 + set available [available_nodes [default_partition]] if {$available < $node_cnt} { send_user "\nWARNING: not enough nodes currently available ($available avail, $node_cnt needed)\n" @@ -64,14 +66,14 @@ if {$available < $node_cnt} { # exec $bin_rm -f $file_in $file_out $file_out2 make_bash_script $file_in " -$srun -l $bin_id -$scontrol show job \${SLURM_JOBID} >${file_out2} -$scontrol update JobId=\${SLURM_JOBID} NumNodes=1 -. slurm_job_\${SLURM_JOBID}_resize.sh -$scontrol show job \${SLURM_JOBID} >>${file_out2} -$srun -l $bin_id -$bin_rm -f slurm_job_\${SLURM_JOBID}_resize.csh -$bin_rm -f slurm_job_\${SLURM_JOBID}_resize.sh" + $srun -l $bin_id + $scontrol show job \${SLURM_JOBID} >${file_out2} + $scontrol update JobId=\${SLURM_JOBID} NumNodes=1 + . slurm_job_\${SLURM_JOBID}_resize.sh + $scontrol show job \${SLURM_JOBID} >>${file_out2} + $srun -l $bin_id + $bin_rm -f slurm_job_\${SLURM_JOBID}_resize.csh + $bin_rm -f slurm_job_\${SLURM_JOBID}_resize.sh" # # Run job to determine what nodes are available diff --git a/testsuite/expect/test2.15 b/testsuite/expect/test2.15 index 6631bd3e42cfcc794fd9cdc225bb0b103654c661..40e462616202093e1928c41bd3ce6c40ff414f1b 100755 --- a/testsuite/expect/test2.15 +++ b/testsuite/expect/test2.15 @@ -43,10 +43,12 @@ print_header $test_id if { [test_xcpu] } { send_user "\nWARNING: This test is incompatible with XCPU systems\n" exit 0 -} -if {[test_front_end] != 0} { +} elseif {[test_front_end] != 0} { send_user "\nWARNING: This test is incompatible with front-end systems\n" exit 0 +} elseif {[test_serial]} { + send_user "\nWARNING: This test is incompatible with serial systems\n" + exit 0 } set node_cnt 2 diff --git a/testsuite/expect/test2.6 b/testsuite/expect/test2.6 index f1c32c56dee7f5456fc30328d035c921650c152b..5a995a612f1c15aab75e71074a5b3323990427f7 100755 --- a/testsuite/expect/test2.6 +++ b/testsuite/expect/test2.6 @@ -1,7 +1,7 @@ #!/usr/bin/expect ############################################################################ # Purpose: Test of SLURM functionality -# Validate scontrol verbose and quite options. +# Validate scontrol verbose and quiet options. # # Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR # "FAILURE: ..." otherwise with an explanation of the failure, OR diff --git a/testsuite/expect/test2.8 b/testsuite/expect/test2.8 index b06e6bb232475469f295d4d9cd5af45a173a4895..48323ee2a3819c309b04fd7511147da80ad54a3e 100755 --- a/testsuite/expect/test2.8 +++ b/testsuite/expect/test2.8 @@ -102,6 +102,9 @@ exec $bin_rm -f $file_in # NOTE: Running "scontrol show job" and looking for these job IDs # may not work due to a bug in awk not scanning large output buffers # +# NOTE: Match "JobId=" only +# +send_user "\nGetting more info for job id 1 ($job_id1)\n" set matches 0 spawn $scontrol show job $job_id1 expect { @@ -109,6 +112,14 @@ expect { incr matches exp_continue } + -re "CPU_IDs=" { + incr matches + exp_continue + } + -re "BatchScript=" { + incr matches + exp_continue + } timeout { send_user "\nFAILURE: scontrol not responding\n" set exit_code 1 @@ -117,12 +128,21 @@ expect { wait } } +send_user "\nGetting more info for job id 2 ($job_id2)\n" spawn $scontrol show job $job_id2 expect { -re "JobId=$job_id2 " { incr matches exp_continue } + -re "CPU_IDs=" { + incr matches + exp_continue + } + -re "BatchScript=" { + incr matches + exp_continue + } timeout { send_user "\nFAILURE: scontrol not responding\n" set exit_code 1 @@ -131,8 +151,122 @@ expect { wait } } + + if {$matches != 2} { - send_user "\nFAILURE: scontrol found $matches of 2 jobs\n" + send_user "\nFAILURE: scontrol failed to find matching job ($matches != 2)\n" + set exit_code 1 +} + +# +# using the scontrol -d option to display more info about job +# +send_user "\nGetting more info for job id 1 ($job_id1) with -d option\n" +set matches 0 +spawn $scontrol -d show job $job_id1 +expect { + -re "JobId=$job_id1 " { + incr matches + exp_continue + } + -re "CPU_IDs=" { + incr matches + exp_continue + } + -re "BatchScript=" { + incr matches + exp_continue + } + timeout { + send_user "\n FAILURE scontrol not responding\n" + set exit_code 1 + } + eof { + wait + } +} +send_user "\nGetting more info for job id 2 ($job_id2) with -d option\n" +spawn $scontrol -d show job $job_id2 +expect { + -re "JobId=$job_id2 " { + incr matches + exp_continue + } + -re "CPU_IDs=" { + incr matches + exp_continue + } + -re "BatchScript=" { + incr matches + exp_continue + } + timeout { + send_user "\nFAILURE: scontrol not responding\n" + set exit_code 1 + } + eof { + wait + } + +} +if {$matches != 4} { + send_user "\nFAILURE: scontrol failed to find matching job ($matches != 4)\n" + set exit_code 1 +} + +# +# using the scontrol -dd option to display more info about job +# +send_user "\nGetting more info for job id 1 ($job_id1) with -dd option\n" +set matches 0 +spawn $scontrol -dd show job $job_id1 +expect { + -re "JobId=$job_id1 " { + incr matches + exp_continue + } + -re "CPU_IDs=" { + incr matches + exp_continue + } + -re "BatchScript=" { + incr matches + exp_continue + } + timeout { + send_user "\n FAILURE scontrol not responding\n" + set exit_code 1 + } + eof { + wait + } +} +send_user "\nGetting more info for job id 2 ($job_id2) with -dd option\n" +spawn $scontrol -dd show job $job_id2 +expect { + -re "JobId=$job_id2 " { + incr matches + exp_continue + } + -re "CPU_IDs=" { + incr matches + exp_continue + } + -re "BatchScript=" { + incr matches + exp_continue + } + timeout { + send_user "\nFAILURE: scontrol not responding\n" + set exit_code 1 + } + eof { + wait + } + +} +if {$matches != 6} { + send_user "\nFAILURE: scontrol failed to find matching job ($matches != 6)\n" set exit_code 1 } diff --git a/testsuite/expect/test21.21 b/testsuite/expect/test21.21 index 6679631613050576f553b48edea5b5ca5c9b43ba..cd93224b09b0e442e53a852661d9c92b5b6c8424 100755 --- a/testsuite/expect/test21.21 +++ b/testsuite/expect/test21.21 @@ -33,6 +33,10 @@ ############################################################################ source ./globals source ./globals_accounting +source ./inc21.21.1 +source ./inc21.21.2 +source ./inc21.21.3 +source ./inc21.21.4 set test_id "21.21" set exit_code 0 @@ -41,6 +45,11 @@ set ta slurm_test-account.1 set timeout 60 print_header $test_id +if {[test_serial]} { + send_user "\nWARNING: This test is not compatible with serial system\n" + exit 0 +} + proc _test_limits { } { global file_in srun sbatch squeue scancel bin_id number bin_sleep bin_rm ta # test maxcpumin maxcpu maxjob maxnode maxsubmit maxwall @@ -56,113 +65,33 @@ proc _test_limits { } { if { $exit_code } { return $exit_code } + # - # Spawn a job testing maxnode + # Start sub-test: test for maxnode # - set matches 0 - spawn $srun -v -N$maxnode --account=$ta $bin_id - expect { - -re "launching ($number)" { - incr matches - exp_continue - } - timeout { - send_user "\nFAILURE: srun not responding\n" - set exit_code 1 - } - eof { - wait - } - } + inc21_21_1 $maxnode - if { $matches != 1 } { - send_user "\nFAILURE: job dion't launch with correct limit\n" - set exit_code 1 - return $exit_code - } # - # Spawn a job testing maxnode+1 + # Start sub-test: test for maxnode+1 # - spawn $srun -N[expr $maxnode + 1] --account=$ta $bin_id - expect { - -re "Job violates accounting policy" { - send_user "\nThis error is expected, not a problem\n" - exp_continue - } - -re "launching ($number)" { - send_user "\nFAILURE: job should not have run.\n" - set exit_code 1 - exp_continue - } - timeout { - send_user "\nFAILURE: srun not responding\n" - set exit_code 1 - } - eof { - wait - } - } - - if { $exit_code } { - return $exit_code - } + inc21_21_2 $maxnode # - # Spawn a job testing maxwall + # Start sub-test: testing maxwall # - set matches 0 - spawn $srun -v -t$maxwall --account=$ta $bin_id - expect { - -re "launching ($number)" { - incr matches - exp_continue - } - timeout { - send_user "\nFAILURE: srun not responding\n" - set exit_code 1 - } - eof { - wait - } - } + inc21_21_3 $maxwall - if { $matches != 1 } { - send_user "\nFAILURE: job dion't launch with correct limit\n" - set exit_code 1 - return $exit_code - } # - # Spawn a job testing maxwall+1 + # Start sub-test: testing maxwall+1 # - spawn $srun -t[expr $maxwall + 1] --account=$ta $bin_id - expect { - -re "Job violates accounting policy" { - send_user "\nThis error is expected, not a problem\n" - exp_continue - } - -re "launching ($number)" { - send_user "\nFAILURE: job should not have run.\n" - set exit_code 1 - exp_continue - } - timeout { - send_user "\nFAILURE: srun not responding\n" - set exit_code 1 - } - eof { - wait - } - } + inc21_21_4 $maxwall - if { $exit_code } { - return $exit_code - } # This should overwrite the old file_in which has already been used, # so no big deal. make_bash_script $file_in " $bin_sleep 5 - " + " # test job max cnt and submit for {set inx 0} {$inx < $maxsubmit} {incr inx} { @@ -211,7 +140,7 @@ proc _test_limits { } { exp_continue } -re "Submitted batch job ($number)" { - send_user "\nFAILURE: job should not have run.\n" + send_user "\nFAILURE: job should not have run 3.\n" set exit_code 1 exp_continue } diff --git a/testsuite/expect/test23.2 b/testsuite/expect/test23.2 index aa73aeeb6c637fa9a1a12e2cc23a131d9850db96..3cc9eefce8fe88a7a3b6594d8c5abad1e65f361a 100755 --- a/testsuite/expect/test23.2 +++ b/testsuite/expect/test23.2 @@ -170,7 +170,7 @@ expect { # Build input script file1 # make_bash_script $file_in1 " -$srun $file_in2 +$srun --mem=2 $file_in2 " @@ -178,7 +178,7 @@ $srun $file_in2 # Build input script file2 # make_bash_script $file_in2 " -$srun $file_in3 +$srun --mem=2 $file_in3 " @@ -186,15 +186,17 @@ $srun $file_in3 # Build input script file3 # make_bash_script $file_in3 " -$srun sleep 10 +$srun --mem=2 sleep 10 " # # Spawn a job via srun using this account +# NOTE: --mem option here and in scripts above to permit running more than one +# step per job if DefMemPerCPU or DefMemPerNode is configured. # set job_id3 0 -spawn $sbatch -N1 -t1 -v --account=$test_acct --output=/dev/null $file_in1 +spawn $sbatch -N1 -t1 -v --mem=10 --account=$test_acct --output=/dev/null $file_in1 expect { -re "Submitted batch job ($number)" { set job_id3 $expect_out(1,string) diff --git a/testsuite/expect/test24.1 b/testsuite/expect/test24.1 index f101411a585b4bd4001c5a5f065ea871b636569e..f1dcc7bf67430d03615056d91964a90ff987dc1f 100755 --- a/testsuite/expect/test24.1 +++ b/testsuite/expect/test24.1 @@ -48,11 +48,11 @@ file delete $test_prog send_user "build_dir is $build_dir\n" if {[test_aix]} { - send_user "$bin_cc ${test_prog}.c -ldl -lm -lntbl -fno-gcse -fno-strict-aliasing -Wl,-brtl -Wl,-bgcbypass:1000 -Wl,-bexpfull -Wl,-bmaxdata:0x70000000 -Wl,-brtl -g -lpthreads -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o ${build_dir}/src/sshare/process.o\n" - exec $bin_cc ${test_prog}.c -ldl -lm -lntbl -fno-gcse -fno-strict-aliasing -Wl,-brtl -Wl,-bgcbypass:1000 -Wl,-bexpfull -Wl,-bmaxdata:0x70000000 -Wl,-brtl -g -lpthreads -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o ${build_dir}/src/sshare/process.o + send_user "$bin_cc ${test_prog}.c -ldl -lm -lntbl -fno-gcse -fno-strict-aliasing -Wl,-brtl -Wl,-bgcbypass:1000 -Wl,-bexpfull -Wl,-bmaxdata:0x70000000 -Wl,-bhwloc -g -lpthreads -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o ${build_dir}/src/sshare/process.o\n" + exec $bin_cc ${test_prog}.c -ldl -lm -lntbl -fno-gcse -fno-strict-aliasing -Wl,-brtl -Wl,-bgcbypass:1000 -Wl,-bexpfull -Wl,-bmaxdata:0x70000000 -Wl,-bhwloc -g -lpthreads -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o ${build_dir}/src/sshare/process.o } else { - send_user "$bin_cc ${test_prog}.c -g -pthread -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o ${build_dir}/src/sshare/process.o -ldl -lm -export-dynamic \n" - exec $bin_cc ${test_prog}.c -g -pthread -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o ${build_dir}/src/sshare/process.o -ldl -lm -export-dynamic + send_user "$bin_cc ${test_prog}.c -g -pthread -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o ${build_dir}/src/sshare/process.o -ldl -lm -lhwloc-export-dynamic \n" + exec $bin_cc ${test_prog}.c -g -pthread -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o ${build_dir}/src/sshare/process.o -ldl -lm -lhwloc -export-dynamic } exec $bin_chmod 700 $test_prog diff --git a/testsuite/expect/test4.12 b/testsuite/expect/test4.12 index 7832b683c5155a77edbdf2c1ba3c6037f1df818b..e7a4d6a9c007243a6d60b25b2181b6b668cefa25 100755 --- a/testsuite/expect/test4.12 +++ b/testsuite/expect/test4.12 @@ -348,10 +348,10 @@ set inode_threads_per_core 0 set fd [open "|$scontrol --oneliner show node $def_hostlist"] exp_internal 1 while {[gets $fd line] != -1} { - if {[regexp {NodeName=(\w+).*CoresPerSocket=(\d+).*CPUTot=(\d+)(K?).*Sockets=(\d+) State=IDLE ThreadsPerCore=(\d+)} $line frag inode_name inode_cores_per_socket inode_procs units inode_sockets inode_threads_per_core] == 1} { + if {[regexp {NodeName=(\w+).*CoresPerSocket=(\d+).*CPUTot=(\d+)(K?).*Sockets=(\d+).*Boards=(\d+) State=IDLE ThreadsPerCore=(\d+)} $line frag inode_name inode_cores_per_socket inode_procs units inode_sockets inode_threads_per_core] == 1} { break } - if {[regexp {NodeName=(\w+).*CoresPerSocket=(\d+).*CPUTot=(\d+)(K?).*Sockets=(\d+) State=IDLE.CLOUD ThreadsPerCore=(\d+)} $line frag inode_name inode_cores_per_socket inode_procs units inode_sockets inode_threads_per_core] == 1} { + if {[regexp {NodeName=(\w+).*CoresPerSocket=(\d+).*CPUTot=(\d+)(K?).*Sockets=(\d+).*Boards=(\d+) State=IDLE.CLOUD ThreadsPerCore=(\d+)} $line frag inode_name inode_cores_per_socket inode_procs units inode_sockets inode_threads_per_core] == 1} { break } } diff --git a/testsuite/expect/test7.15 b/testsuite/expect/test7.15 index a8d56debd3eb574073a0f2f7da253fe627f1c7cd..99ca7e2d6fbdac8ba2506b63a06f3be1b3e048b4 100755 --- a/testsuite/expect/test7.15 +++ b/testsuite/expect/test7.15 @@ -47,13 +47,17 @@ exec $bin_cc -O -o $file_prog ${file_prog}.c # is intermittent. # if { $partition == "" } { - if {[info exists env(SLURM_PARTITION)] } { - set partition $env(SLURM_PARTITION) - } else { - set partition [default_partition] - } + if {[info exists env(SLURM_PARTITION)] } { + set partition $env(SLURM_PARTITION) + } else { + set partition [default_partition] + } +} +if {[test_serial]} { + set nnodes 1 +} else { + set nnodes [available_nodes $partition] } -set nnodes [available_nodes $partition] # # Run the test_prog to ensure that no signals are blocked by diff --git a/testsuite/expect/test7.2 b/testsuite/expect/test7.2 index 49c5e69f0bed6de852287a078642489e33338417..cb82bd3a28803399352348fbb412307ccfe442fd 100755 --- a/testsuite/expect/test7.2 +++ b/testsuite/expect/test7.2 @@ -94,16 +94,20 @@ if { [test_bluegene] } { set node_cnt 1-1024 set task_cnt 8 } +} elseif {[test_xcpu] } { + set node_cnt 1-1 + set task_cnt 8 + +} elseif {[test_serial]} { + set node_cnt 1 + set task_cnt 1 + } else { - if { [test_xcpu] } { - set node_cnt 1-1 - set task_cnt 8 - } else { - set node_cnt 1-4 - set task_cnt 8 - } + set node_cnt 1-4 + set task_cnt 8 } + # Test uses srun based task launch # Adjust time limits as needed for large task counts */ # times are here vv diff --git a/testsuite/expect/test7.3.prog.c b/testsuite/expect/test7.3.prog.c index b7352ee229996c939ce3653d587be6745de098a1..f7aa51eb56529555d63f3132df320f39530b7847 100644 --- a/testsuite/expect/test7.3.prog.c +++ b/testsuite/expect/test7.3.prog.c @@ -28,6 +28,8 @@ * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ +#include +#include #include #include #include @@ -42,6 +44,41 @@ static void _do_task_work(int *fd_array, int tasks); +node_info_msg_t *node_info = NULL; +static void _load_node_info(void) +{ + slurm_load_node(0, &node_info, SHOW_ALL); +} + +static char *_get_host_addr(char *node_name) +{ + int i; + char *node_addr = NULL; + struct hostent *host; + + if (!node_info) + return NULL; + for (i = 0; i < node_info->record_count; i++) { + if (strcmp(node_name, node_info->node_array[i].name)) + continue; + host = gethostbyname2(node_info->node_array[i].node_addr, AF_INET); + if (host && host->h_length) { + node_addr = calloc(128, 1); + inet_ntop(AF_INET, (void *)host->h_addr_list[0], + node_addr, 128); + } + break; + } + + return node_addr; +} + +static void _free_node_info(void) +{ + if (node_info) + slurm_free_node_info_msg(node_info); +} + int main (int argc, char *argv[]) { int i, min_nodes = 1, max_nodes = 1, nodes, tasks = 0, rc = 0; @@ -51,6 +88,8 @@ int main (int argc, char *argv[]) slurm_step_ctx_t *ctx = NULL; slurm_step_launch_params_t launch[1]; char *task_argv[3]; + char **node_addr; + hostlist_t hl; int *fd_array = NULL; int num_fd; @@ -141,9 +180,26 @@ int main (int argc, char *argv[]) * Hack to run one task per node, regardless of what we set up * when we created the job step context. */ - if (slurm_step_ctx_daemon_per_node_hack(ctx) != SLURM_SUCCESS) { + node_addr = calloc(sizeof(char *), job_resp->node_cnt); + hl = slurm_hostlist_create(job_resp->node_list); + _load_node_info(); + for (i = 0; i < nodes; i++) { + char *hostname = slurm_hostlist_shift(hl); + if (hostname) { + node_addr[i] = _get_host_addr(hostname); + free(hostname); + } + } + _free_node_info(); + slurm_hostlist_destroy(hl); + rc = slurm_step_ctx_daemon_per_node_hack(ctx, node_addr, + job_resp->node_cnt); + for (i = 0; i < nodes; i++) { + if (node_addr[i]) + free(node_addr[i]); + } + if (rc != SLURM_SUCCESS) { slurm_perror("slurm_step_ctx_daemon_per_node_hack"); - rc = 1; goto done; } diff --git a/testsuite/expect/test9.1 b/testsuite/expect/test9.1 index e3bf2689ec7abaf73d40f2c6b4de4e3a6f41477d..aaa56576b67f19b6c1c09a457e17380c37945ecc 100755 --- a/testsuite/expect/test9.1 +++ b/testsuite/expect/test9.1 @@ -50,12 +50,13 @@ if { [test_bluegene] } { } else { set node_cnt 1-2048 } +} elseif { [test_serial] } { + set node_cnt 1 + set task_cnt 1 +} elseif { [test_xcpu] } { + set node_cnt 1-1 } else { - if { [test_xcpu] } { - set node_cnt 1-1 - } else { - set node_cnt 1-6 - } + set node_cnt 1-6 } set other_opts "-O" diff --git a/testsuite/expect/test9.2 b/testsuite/expect/test9.2 index c7b9535d6e0bf16849e0ca86ef7d1e24c748b453..7df6c0b0edbb731a19c8f31d3dd72e3e99bfe71a 100755 --- a/testsuite/expect/test9.2 +++ b/testsuite/expect/test9.2 @@ -49,12 +49,13 @@ if { [test_bluegene] } { } else { set node_cnt 1-2048 } +} elseif { [test_serial] } { + set node_cnt 1 + set task_cnt 1 +} elseif { [test_xcpu] } { + set node_cnt 1-1 } else { - if { [test_xcpu] } { - set node_cnt 1-1 - } else { - set node_cnt 1-4 - } + set node_cnt 1-4 } set other_opts "-O" diff --git a/testsuite/expect/test9.3 b/testsuite/expect/test9.3 index 7e41c4db73b552ecc25ace21ac1656331d03fb14..81a5e9a4d6f5d53b49139743cd91fb03c936d75e 100755 --- a/testsuite/expect/test9.3 +++ b/testsuite/expect/test9.3 @@ -50,12 +50,13 @@ if { [test_bluegene] } { } else { set node_cnt 1-2048 } +} elseif { [test_serial] } { + set node_cnt 1 + set task_cnt 1 +} elseif { [test_xcpu] } { + set node_cnt 1-1 } else { - if { [test_xcpu] } { - set node_cnt 1-1 - } else { - set node_cnt 1-4 - } + set node_cnt 1-4 } set other_opts "-O" diff --git a/testsuite/expect/test9.4 b/testsuite/expect/test9.4 index 6f6f4635c5ced2484eacbfb76a73b89535a762f6..fe16076cb1efc048b294b10742280ee25f88f138 100755 --- a/testsuite/expect/test9.4 +++ b/testsuite/expect/test9.4 @@ -56,12 +56,13 @@ if { [test_bluegene] } { } else { set node_cnt 1-2048 } +} elseif { [test_serial] } { + set node_cnt 1 + set task_cnt 1 +} elseif { [test_xcpu] } { + set node_cnt 1-1 } else { - if { [test_xcpu] } { - set node_cnt 1-1 - } else { - set node_cnt 1-4 - } + set node_cnt 1-4 } set other_opts "-O" diff --git a/testsuite/expect/test9.5 b/testsuite/expect/test9.5 index b8f2936c2b167d500726cc9886393cab2714868a..8608cc1e817a602415d173b94c6ae5a1dfd1c752 100755 --- a/testsuite/expect/test9.5 +++ b/testsuite/expect/test9.5 @@ -48,12 +48,13 @@ if { [test_bluegene] } { } else { set node_cnt 1-2048 } +} elseif { [test_serial] } { + set node_cnt 1 + set task_cnt 1 +} elseif { [test_xcpu] } { + set node_cnt 1-1 } else { - if { [test_xcpu] } { - set node_cnt 1-1 - } else { - set node_cnt 1-4 - } + set node_cnt 1-4 } set other_opts "-O" diff --git a/testsuite/expect/test9.6 b/testsuite/expect/test9.6 index 9c50cbc9ade0b3ddb3120778c48de6c0e2318f07..83c22d31bf7527750bd5b1c4811685b6f988ff44 100755 --- a/testsuite/expect/test9.6 +++ b/testsuite/expect/test9.6 @@ -50,12 +50,13 @@ if { [test_bluegene] } { } else { set node_cnt 1-2048 } +} elseif { [test_serial] } { + set node_cnt 1 + set task_cnt 1 +} elseif { [test_xcpu] } { + set node_cnt 1-1 } else { - if { [test_xcpu] } { - set node_cnt 1-1 - } else { - set node_cnt 1-4 - } + set node_cnt 1-4 } set other_opts "-O" diff --git a/testsuite/expect/test9.9 b/testsuite/expect/test9.9 index 0d92145c47580b01ea9ec47854d0ac968bd9faf7..bbd2d30f691db31f5c09e106c276717a8d335769 100755 --- a/testsuite/expect/test9.9 +++ b/testsuite/expect/test9.9 @@ -1,6 +1,6 @@ #!/usr/bin/expect ############################################################################ -# Purpose: Timing test for 2000 jobs. +# Purpose: Timing test for 5000 jobs. # # Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR # "FAILURE: ..." otherwise with an explanation of the failure, OR @@ -31,41 +31,49 @@ source ./globals set test_id "9.9" set exit_code 0 -set job_cnt 2000 +set test_script "./test$test_id.bash" + +# job_blocks Submit jobs in blocks of this size (job count) +set job_blocks 5000 + +# job_cnt Number of batch jobs to be submitted +set job_cnt 1000 print_header $test_id -# if {[test_front_end] != 0 || $enable_memory_leak_debug != 0} { -# set job_cnt 2 -# } +if {[test_front_end] || $enable_memory_leak_debug != 0} { + set job_cnt 2 +} elseif {[test_serial]} { + set job_cnt 5000 +} +# +# NOTE: test9.9.bash seems to have trouble running out of process IDs when +# more than about 5000 jobs are submitted at one time, so we can execute the +# script multiple times if necessary. A more reliable alternative would be +# to catch the fork() failures and retry. +# +# NOTE: The throughput rate is highly dependent upon configuration +# proc _submit_jobs { job_name test_file } { - global exit_code job_cnt sbatch srun number + global exit_code job_blocks job_cnt sbatch test_script log_user 0 - for {set inx 0} {$inx < $job_cnt} {incr inx} { - spawn -nottyinit -nottycopy $sbatch -J $job_name -o $test_file --wrap $job_name - #spawn $srun -J $job_name -o $test_file $job_name + for {set jobs_rem $job_cnt} {$jobs_rem > 0} { } { + if {$jobs_rem > $job_blocks} { + set submit_cnt $job_blocks + } else { + set submit_cnt $jobs_rem + } + spawn -nottyinit -nottycopy $test_script $sbatch "/bin/hostname" $job_name $submit_cnt expect { -# -re "Submitted batch job ($number)" { -# exp_continue -# } -# -re "Unable to contact" { -# send_user "\nFAILURE: slurm appears to be down\n" -# exp_continue -# } -# timeout { -# send_user "\nFAILURE: sbatch not responding\n" -# slow_kill $sbatch_pid -# set exit_code 1 -# } eof { wait } } + set jobs_rem [expr $jobs_rem - $job_blocks] } log_user 1 - sleep 1 if {[wait_for_all_jobs $job_name 0] != 0} { send_user "\nFAILURE: some submitted jobs failed to terminate\n" set exit_code 1 @@ -73,9 +81,8 @@ proc _submit_jobs { job_name test_file } { } set time_took [string trim [time {_submit_jobs "hostname" "/dev/null"}] " per iteration microseconds"] -set time_took_sec [expr $time_took / 1000000] -set time_per_job [expr $job_cnt / $time_took_sec] -send_user "test 1 took $time_took microseconds == $time_took_sec seconds, $time_per_job jobs a sec\n" +set jobs_per_sec [expr $job_cnt * 1000000 / $time_took] +send_user "Ran $job_cnt jobs in $time_took microseconds or $jobs_per_sec jobs per second\n" if { $exit_code != 0 } { exit $exit_code diff --git a/testsuite/expect/test9.9.bash b/testsuite/expect/test9.9.bash new file mode 100755 index 0000000000000000000000000000000000000000..f0420f02166e00c95ae45db6a188a37d672d64ef --- /dev/null +++ b/testsuite/expect/test9.9.bash @@ -0,0 +1,39 @@ +#!/bin/bash + +if [ $# != 4 ] +then + echo "Usage: test9.9.bash " + exit 1 +fi + +sbatch=$1 +prog=$2 +job_name=$3 +job_cnt=$4 +inx=0 +iterations=$[job_cnt/10] +while [ $inx -lt $iterations ] +do + $sbatch -J $job_name -o /dev/null --wrap $prog & + $sbatch -J $job_name -o /dev/null --wrap $prog & + $sbatch -J $job_name -o /dev/null --wrap $prog & + $sbatch -J $job_name -o /dev/null --wrap $prog & + $sbatch -J $job_name -o /dev/null --wrap $prog & + + $sbatch -J $job_name -o /dev/null --wrap $prog & + $sbatch -J $job_name -o /dev/null --wrap $prog & + $sbatch -J $job_name -o /dev/null --wrap $prog & + $sbatch -J $job_name -o /dev/null --wrap $prog & + $sbatch -J $job_name -o /dev/null --wrap $prog & + wait + inx=$((inx+1)) +done + +inx=0 +iterations=$[job_cnt%10] +while [ $inx -lt $iterations ] +do + $sbatch -J $job_name -o /dev/null --wrap $prog + inx=$((inx+1)) +done +exit 0 diff --git a/testsuite/expect/test9.9.prog.c b/testsuite/expect/test9.9.prog.c new file mode 100644 index 0000000000000000000000000000000000000000..95a68e9368f3701636b07c14ec2cfb0a81b3986a --- /dev/null +++ b/testsuite/expect/test9.9.prog.c @@ -0,0 +1,88 @@ +/*****************************************************************************\ + * test9.9.prog.c - link and test algo of the multifactor plugin. + * + * Usage: test9.9.prog + * + * NOTE: This is a variant of test9.9.bash. It seems to have the ability to + * run more jobs without problems running out of process IDs (it tests the + * fork call for errors and retries), but run slower than test9.9.bash. + ***************************************************************************** + * Copyright (C) 2012 SchedMD LLC. + * Written by Morris Jette + * + * This file is part of SLURM, a resource management program. + * For details, see . + * 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. +\*****************************************************************************/ +#include +#include +#include +#include +#include + +static inline void _spawn_job(char *path, char **argv) +{ + int status; + pid_t pid; + + while ((pid = fork()) < 0) + usleep(100); + if (pid == 0) { + close(1); + close(2); + execv(path, argv); + exit(0); + } + waitpid(-1, &status, WNOHANG); /* reap processes when possible */ + + //system(command); +} + +int main (int argc, char **argv) +{ + char *command[10]; + int iterations, status; + int i; + + if (argc != 5) { + printf("FAILURE: Usage: test9.9.prog " + " \n"); + exit(1); + } + iterations = atoi(argv[4]); + if (iterations < 1) { + printf("FAILURE: Invalid iterations count (%s)\n", argv[4]); + exit(1); + } + + command[0] = "sbatch"; + command[1] = "-J"; + command[2] = argv[3]; + command[3] = "-o"; + command[4] = "/dev/null"; + command[5] = "--wrap"; + command[6] = argv[2]; + command[7] = NULL; + + for (i = 0; i < iterations; i++) { + _spawn_job(argv[1], command); + } + + while ((wait(&status) >= 0)) ; + + return 0; +} diff --git a/testsuite/slurm_unit/Makefile.in b/testsuite/slurm_unit/Makefile.in index 191ebd658419e2efa84a9eb1634fe93cdf2371bd..265ec594bb21e594b6ee63ff9200d08c55335dda 100644 --- a/testsuite/slurm_unit/Makefile.in +++ b/testsuite/slurm_unit/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -54,9 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -64,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -164,9 +163,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -174,9 +171,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -208,6 +204,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -235,6 +233,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -575,10 +574,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/testsuite/slurm_unit/api/Makefile.in b/testsuite/slurm_unit/api/Makefile.in index 277f8a9f3b02be3bbb61c2dbaf9f334f4d8fc021..ca2d10f273b577a7475956cd06bf369c9263dcb5 100644 --- a/testsuite/slurm_unit/api/Makefile.in +++ b/testsuite/slurm_unit/api/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -187,9 +186,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -197,9 +194,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -231,6 +227,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -258,6 +256,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -397,7 +396,7 @@ clean-checkPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -api-test$(EXEEXT): $(api_test_OBJECTS) $(api_test_DEPENDENCIES) +api-test$(EXEEXT): $(api_test_OBJECTS) $(api_test_DEPENDENCIES) $(EXTRA_api_test_DEPENDENCIES) @rm -f api-test$(EXEEXT) $(LINK) $(api_test_OBJECTS) $(api_test_LDADD) $(LIBS) @@ -652,14 +651,15 @@ check-TESTS: $(TESTS) fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ + col="$$grn"; \ else \ - echo "$$red$$dashes"; \ + col="$$red"; \ fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi @@ -738,10 +738,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/testsuite/slurm_unit/api/manual/Makefile.in b/testsuite/slurm_unit/api/manual/Makefile.in index 91ae78f8dbb79cf767872b043326825ae8943494..7fb6a01e97de9e8e2b50e5b9c477d101f87dd3d3 100644 --- a/testsuite/slurm_unit/api/manual/Makefile.in +++ b/testsuite/slurm_unit/api/manual/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -58,9 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -68,6 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -179,9 +178,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -189,9 +186,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -223,6 +219,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -250,6 +248,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -386,28 +385,28 @@ clean-checkPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -cancel-tst$(EXEEXT): $(cancel_tst_OBJECTS) $(cancel_tst_DEPENDENCIES) +cancel-tst$(EXEEXT): $(cancel_tst_OBJECTS) $(cancel_tst_DEPENDENCIES) $(EXTRA_cancel_tst_DEPENDENCIES) @rm -f cancel-tst$(EXEEXT) $(LINK) $(cancel_tst_OBJECTS) $(cancel_tst_LDADD) $(LIBS) -complete-tst$(EXEEXT): $(complete_tst_OBJECTS) $(complete_tst_DEPENDENCIES) +complete-tst$(EXEEXT): $(complete_tst_OBJECTS) $(complete_tst_DEPENDENCIES) $(EXTRA_complete_tst_DEPENDENCIES) @rm -f complete-tst$(EXEEXT) $(LINK) $(complete_tst_OBJECTS) $(complete_tst_LDADD) $(LIBS) -job_info-tst$(EXEEXT): $(job_info_tst_OBJECTS) $(job_info_tst_DEPENDENCIES) +job_info-tst$(EXEEXT): $(job_info_tst_OBJECTS) $(job_info_tst_DEPENDENCIES) $(EXTRA_job_info_tst_DEPENDENCIES) @rm -f job_info-tst$(EXEEXT) $(LINK) $(job_info_tst_OBJECTS) $(job_info_tst_LDADD) $(LIBS) -node_info-tst$(EXEEXT): $(node_info_tst_OBJECTS) $(node_info_tst_DEPENDENCIES) +node_info-tst$(EXEEXT): $(node_info_tst_OBJECTS) $(node_info_tst_DEPENDENCIES) $(EXTRA_node_info_tst_DEPENDENCIES) @rm -f node_info-tst$(EXEEXT) $(LINK) $(node_info_tst_OBJECTS) $(node_info_tst_LDADD) $(LIBS) -partition_info-tst$(EXEEXT): $(partition_info_tst_OBJECTS) $(partition_info_tst_DEPENDENCIES) +partition_info-tst$(EXEEXT): $(partition_info_tst_OBJECTS) $(partition_info_tst_DEPENDENCIES) $(EXTRA_partition_info_tst_DEPENDENCIES) @rm -f partition_info-tst$(EXEEXT) $(LINK) $(partition_info_tst_OBJECTS) $(partition_info_tst_LDADD) $(LIBS) -reconfigure-tst$(EXEEXT): $(reconfigure_tst_OBJECTS) $(reconfigure_tst_DEPENDENCIES) +reconfigure-tst$(EXEEXT): $(reconfigure_tst_OBJECTS) $(reconfigure_tst_DEPENDENCIES) $(EXTRA_reconfigure_tst_DEPENDENCIES) @rm -f reconfigure-tst$(EXEEXT) $(LINK) $(reconfigure_tst_OBJECTS) $(reconfigure_tst_LDADD) $(LIBS) -submit-tst$(EXEEXT): $(submit_tst_OBJECTS) $(submit_tst_DEPENDENCIES) +submit-tst$(EXEEXT): $(submit_tst_OBJECTS) $(submit_tst_DEPENDENCIES) $(EXTRA_submit_tst_DEPENDENCIES) @rm -f submit-tst$(EXEEXT) $(LINK) $(submit_tst_OBJECTS) $(submit_tst_LDADD) $(LIBS) -update_config-tst$(EXEEXT): $(update_config_tst_OBJECTS) $(update_config_tst_DEPENDENCIES) +update_config-tst$(EXEEXT): $(update_config_tst_OBJECTS) $(update_config_tst_DEPENDENCIES) $(EXTRA_update_config_tst_DEPENDENCIES) @rm -f update_config-tst$(EXEEXT) $(LINK) $(update_config_tst_OBJECTS) $(update_config_tst_LDADD) $(LIBS) @@ -550,10 +549,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/testsuite/slurm_unit/common/Makefile.am b/testsuite/slurm_unit/common/Makefile.am index a7975876f30110a90ef4e17eb032e51058f9a9c0..93d81fe884a86cc6a285f2dc7723d7b0a89dd274 100644 --- a/testsuite/slurm_unit/common/Makefile.am +++ b/testsuite/slurm_unit/common/Makefile.am @@ -1,20 +1,10 @@ AUTOMAKE_OPTIONS = foreign -if HAVE_ELAN -elan_testprogs = runqsw -elan_lib = $(top_builddir)/src/plugins/switch/elan/switch_elan.la -else -elan_testprogs = -elan_lib = -endif - INCLUDES = -I$(top_srcdir) -LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS)\ - $(elan_lib) +LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) check_PROGRAMS = \ - $(TESTS) \ - $(elan_testprogs) + $(TESTS) TESTS = \ pack-test \ diff --git a/testsuite/slurm_unit/common/Makefile.in b/testsuite/slurm_unit/common/Makefile.in index 92d412b9959214005c2d896e082cd09a8e72cea8..8e35f4ef130ac019011f5cdafe26b29655e74e6d 100644 --- a/testsuite/slurm_unit/common/Makefile.in +++ b/testsuite/slurm_unit/common/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -34,7 +34,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) +check_PROGRAMS = $(am__EXEEXT_1) TESTS = pack-test$(EXEEXT) log-test$(EXEEXT) bitstring-test$(EXEEXT) subdir = testsuite/slurm_unit/common DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in @@ -56,9 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_elan.m4 \ $(top_srcdir)/auxdir/x_ac_env.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ $(top_srcdir)/auxdir/x_ac_hwloc.m4 \ $(top_srcdir)/auxdir/x_ac_iso.m4 \ @@ -66,6 +64,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.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_nrt.m4 \ $(top_srcdir)/auxdir/x_ac_pam.m4 \ $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ @@ -85,29 +84,22 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = pack-test$(EXEEXT) log-test$(EXEEXT) \ bitstring-test$(EXEEXT) -@HAVE_ELAN_TRUE@am__EXEEXT_2 = runqsw$(EXEEXT) bitstring_test_SOURCES = bitstring-test.c bitstring_test_OBJECTS = bitstring-test.$(OBJEXT) bitstring_test_LDADD = $(LDADD) am__DEPENDENCIES_1 = -@HAVE_ELAN_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/src/plugins/switch/elan/switch_elan.la bitstring_test_DEPENDENCIES = $(top_builddir)/src/api/libslurm.o \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) + $(am__DEPENDENCIES_1) log_test_SOURCES = log-test.c log_test_OBJECTS = log-test.$(OBJEXT) log_test_LDADD = $(LDADD) log_test_DEPENDENCIES = $(top_builddir)/src/api/libslurm.o \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) + $(am__DEPENDENCIES_1) pack_test_SOURCES = pack-test.c pack_test_OBJECTS = pack-test.$(OBJEXT) pack_test_LDADD = $(LDADD) pack_test_DEPENDENCIES = $(top_builddir)/src/api/libslurm.o \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) -runqsw_SOURCES = runqsw.c -runqsw_OBJECTS = runqsw.$(OBJEXT) -runqsw_LDADD = $(LDADD) -runqsw_DEPENDENCIES = $(top_builddir)/src/api/libslurm.o \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) + $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp am__depfiles_maybe = depfiles @@ -121,8 +113,8 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = bitstring-test.c log-test.c pack-test.c runqsw.c -DIST_SOURCES = bitstring-test.c log-test.c pack-test.c runqsw.c +SOURCES = bitstring-test.c log-test.c pack-test.c +DIST_SOURCES = bitstring-test.c log-test.c pack-test.c ETAGS = etags CTAGS = ctags am__tty_colors = \ @@ -168,9 +160,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ EXEEXT = @EXEEXT@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -178,9 +168,8 @@ GTK_LIBS = @GTK_LIBS@ HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ HAVEPGCONFIG = @HAVEPGCONFIG@ HAVE_AIX = @HAVE_AIX@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_FEDERATION = @HAVE_FEDERATION@ HAVE_MAN2HTML = @HAVE_MAN2HTML@ +HAVE_NRT = @HAVE_NRT@ HAVE_OPENSSL = @HAVE_OPENSSL@ HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ @@ -212,6 +201,8 @@ MYSQL_LIBS = @MYSQL_LIBS@ NCURSES = @NCURSES@ NM = @NM@ NMEDIT = @NMEDIT@ +NRT_CPPFLAGS = @NRT_CPPFLAGS@ +NRT_LDFLAGS = @NRT_LDFLAGS@ NUMA_LIBS = @NUMA_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -239,6 +230,7 @@ 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@ RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@ @@ -330,14 +322,8 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign -@HAVE_ELAN_FALSE@elan_testprogs = -@HAVE_ELAN_TRUE@elan_testprogs = runqsw -@HAVE_ELAN_FALSE@elan_lib = -@HAVE_ELAN_TRUE@elan_lib = $(top_builddir)/src/plugins/switch/elan/switch_elan.la INCLUDES = -I$(top_srcdir) -LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS)\ - $(elan_lib) - +LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) all: all-am .SUFFIXES: @@ -381,18 +367,15 @@ clean-checkPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -bitstring-test$(EXEEXT): $(bitstring_test_OBJECTS) $(bitstring_test_DEPENDENCIES) +bitstring-test$(EXEEXT): $(bitstring_test_OBJECTS) $(bitstring_test_DEPENDENCIES) $(EXTRA_bitstring_test_DEPENDENCIES) @rm -f bitstring-test$(EXEEXT) $(LINK) $(bitstring_test_OBJECTS) $(bitstring_test_LDADD) $(LIBS) -log-test$(EXEEXT): $(log_test_OBJECTS) $(log_test_DEPENDENCIES) +log-test$(EXEEXT): $(log_test_OBJECTS) $(log_test_DEPENDENCIES) $(EXTRA_log_test_DEPENDENCIES) @rm -f log-test$(EXEEXT) $(LINK) $(log_test_OBJECTS) $(log_test_LDADD) $(LIBS) -pack-test$(EXEEXT): $(pack_test_OBJECTS) $(pack_test_DEPENDENCIES) +pack-test$(EXEEXT): $(pack_test_OBJECTS) $(pack_test_DEPENDENCIES) $(EXTRA_pack_test_DEPENDENCIES) @rm -f pack-test$(EXEEXT) $(LINK) $(pack_test_OBJECTS) $(pack_test_LDADD) $(LIBS) -runqsw$(EXEEXT): $(runqsw_OBJECTS) $(runqsw_DEPENDENCIES) - @rm -f runqsw$(EXEEXT) - $(LINK) $(runqsw_OBJECTS) $(runqsw_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -403,7 +386,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitstring-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack-test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runqsw.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -565,14 +547,15 @@ check-TESTS: $(TESTS) fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ + col="$$grn"; \ else \ - echo "$$red$$dashes"; \ + col="$$red"; \ fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi @@ -622,10 +605,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: