From 70542f071de220bb7a9d9c27c8c30cfd35b9dab1 Mon Sep 17 00:00:00 2001 From: Moe Jette <jette1@llnl.gov> Date: Mon, 18 Sep 2006 17:56:19 +0000 Subject: [PATCH] Remove sched/wiki plugin (use sched/wiki2 for now) --- NEWS | 1 + configure | 4 +- configure.ac | 2 - slurm.spec | 2 +- src/common/slurm_protocol_api.c | 25 + src/common/slurm_protocol_api.h | 8 + src/plugins/sched/Makefile.am | 2 +- src/plugins/sched/Makefile.in | 2 +- src/plugins/sched/backfill/backfill.c | 4 +- src/plugins/sched/maui/Makefile.am | 3 - src/plugins/sched/maui/Makefile.in | 557 --------------- src/plugins/sched/maui/agent.cpp | 230 ------- src/plugins/sched/maui/agent.h | 141 ---- src/plugins/sched/maui/comparator.h | 240 ------- src/plugins/sched/maui/condition.h | 153 ----- src/plugins/sched/maui/courier.cpp | 109 --- src/plugins/sched/maui/courier.h | 162 ----- src/plugins/sched/maui/dstring.cpp | 130 ---- src/plugins/sched/maui/dstring.h | 233 ------- src/plugins/sched/maui/mailbag.h | 349 ---------- src/plugins/sched/maui/message.h | 142 ---- src/plugins/sched/maui/prefix_courier.cpp | 124 ---- src/plugins/sched/maui/prefix_courier.h | 83 --- src/plugins/sched/maui/receptionist.cpp | 143 ---- src/plugins/sched/maui/receptionist.h | 114 --- src/plugins/sched/maui/wiki/Makefile.am | 43 -- src/plugins/sched/maui/wiki/Makefile.in | 648 ------------------ .../sched/maui/wiki/wiki_canceljob.cpp | 89 --- src/plugins/sched/maui/wiki/wiki_command.cpp | 64 -- src/plugins/sched/maui/wiki/wiki_mailbag.cpp | 114 --- src/plugins/sched/maui/wiki/wiki_mailbag.h | 194 ------ src/plugins/sched/maui/wiki/wiki_message.cpp | 84 --- src/plugins/sched/maui/wiki/wiki_message.h | 399 ----------- src/plugins/sched/maui/wiki/wiki_parser.cpp | 139 ---- src/plugins/sched/maui/wiki/wiki_parser.h | 162 ----- src/plugins/sched/maui/wiki/wiki_request.cpp | 616 ----------------- src/plugins/sched/maui/wiki/wiki_response.cpp | 81 --- src/plugins/sched/maui/wiki/wiki_startjob.cpp | 127 ---- src/plugins/sched/maui/wiki/wiki_status.cpp | 265 ------- src/plugins/sched/maui/wiki/wiki_wrapper.cpp | 302 -------- src/plugins/sched/wiki2/msg.c | 2 +- src/plugins/sched/wiki2/msg.h | 2 +- src/slurmctld/Makefile.am | 1 - src/slurmctld/Makefile.in | 4 +- src/slurmctld/agent.c | 15 +- src/slurmctld/sched_plugin.h | 231 +------ src/slurmctld/sched_upcalls.c | 37 - 47 files changed, 48 insertions(+), 6534 deletions(-) delete mode 100644 src/plugins/sched/maui/Makefile.am delete mode 100644 src/plugins/sched/maui/Makefile.in delete mode 100644 src/plugins/sched/maui/agent.cpp delete mode 100644 src/plugins/sched/maui/agent.h delete mode 100644 src/plugins/sched/maui/comparator.h delete mode 100644 src/plugins/sched/maui/condition.h delete mode 100644 src/plugins/sched/maui/courier.cpp delete mode 100644 src/plugins/sched/maui/courier.h delete mode 100644 src/plugins/sched/maui/dstring.cpp delete mode 100644 src/plugins/sched/maui/dstring.h delete mode 100644 src/plugins/sched/maui/mailbag.h delete mode 100644 src/plugins/sched/maui/message.h delete mode 100644 src/plugins/sched/maui/prefix_courier.cpp delete mode 100644 src/plugins/sched/maui/prefix_courier.h delete mode 100644 src/plugins/sched/maui/receptionist.cpp delete mode 100644 src/plugins/sched/maui/receptionist.h delete mode 100644 src/plugins/sched/maui/wiki/Makefile.am delete mode 100644 src/plugins/sched/maui/wiki/Makefile.in delete mode 100644 src/plugins/sched/maui/wiki/wiki_canceljob.cpp delete mode 100644 src/plugins/sched/maui/wiki/wiki_command.cpp delete mode 100644 src/plugins/sched/maui/wiki/wiki_mailbag.cpp delete mode 100644 src/plugins/sched/maui/wiki/wiki_mailbag.h delete mode 100644 src/plugins/sched/maui/wiki/wiki_message.cpp delete mode 100644 src/plugins/sched/maui/wiki/wiki_message.h delete mode 100644 src/plugins/sched/maui/wiki/wiki_parser.cpp delete mode 100644 src/plugins/sched/maui/wiki/wiki_parser.h delete mode 100644 src/plugins/sched/maui/wiki/wiki_request.cpp delete mode 100644 src/plugins/sched/maui/wiki/wiki_response.cpp delete mode 100644 src/plugins/sched/maui/wiki/wiki_startjob.cpp delete mode 100644 src/plugins/sched/maui/wiki/wiki_status.cpp delete mode 100644 src/plugins/sched/maui/wiki/wiki_wrapper.cpp diff --git a/NEWS b/NEWS index 23f83227840..936ea31e56d 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ documents those changes that are of interest to users and admins. -- new forwarding logic. New recieve_msg functions depending on what you are expecting to get back. No srun_node_id anymore passed around in a slurm_msg_t + -- Remove sched/wiki plugin (use sched/wiki2 for now) * Changes in SLURM 1.2.0-pre2 ============================= diff --git a/configure b/configure index 215c2927789..ce8b777dd2d 100755 --- a/configure +++ b/configure @@ -25568,7 +25568,7 @@ _ACEOF - ac_config_files="$ac_config_files Makefile config.xml auxdir/Makefile src/Makefile src/api/Makefile src/common/Makefile src/sacct/Makefile src/salloc/Makefile src/sbatch/Makefile src/sattach/Makefile src/srun/Makefile src/slaunch/Makefile src/slurmd/Makefile src/slurmd/slurmd/Makefile src/slurmd/slurmstepd/Makefile src/slurmctld/Makefile src/sbcast/Makefile src/scontrol/Makefile src/scancel/Makefile src/squeue/Makefile src/sinfo/Makefile src/smap/Makefile src/sview/Makefile src/plugins/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/jobacct/Makefile src/plugins/jobacct/linux/Makefile src/plugins/jobacct/aix/Makefile src/plugins/jobacct/none/Makefile src/plugins/jobcomp/Makefile src/plugins/jobcomp/filetxt/Makefile src/plugins/jobcomp/none/Makefile src/plugins/jobcomp/script/Makefile src/plugins/proctrack/Makefile src/plugins/proctrack/aix/Makefile src/plugins/proctrack/pgid/Makefile src/plugins/proctrack/linuxproc/Makefile src/plugins/proctrack/rms/Makefile src/plugins/proctrack/sgi_job/Makefile src/plugins/sched/Makefile src/plugins/sched/backfill/Makefile src/plugins/sched/builtin/Makefile src/plugins/sched/hold/Makefile src/plugins/sched/maui/Makefile src/plugins/sched/maui/wiki/Makefile src/plugins/sched/wiki2/Makefile src/plugins/select/Makefile src/plugins/select/bluegene/Makefile src/plugins/select/bluegene/block_allocator/Makefile src/plugins/select/bluegene/plugin/Makefile src/plugins/select/linear/Makefile src/plugins/select/cons_res/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/mpichgm/Makefile src/plugins/mpi/mvapich/Makefile src/plugins/mpi/lam/Makefile src/plugins/mpi/none/Makefile src/plugins/task/Makefile src/plugins/task/affinity/Makefile src/plugins/task/none/Makefile doc/Makefile doc/man/Makefile doc/html/Makefile testsuite/Makefile testsuite/expect/Makefile testsuite/slurm_unit/Makefile testsuite/slurm_unit/common/Makefile testsuite/slurm_unit/slurmctld/Makefile testsuite/slurm_unit/slurmd/Makefile testsuite/slurm_unit/api/Makefile testsuite/slurm_unit/api/manual/Makefile" + ac_config_files="$ac_config_files Makefile config.xml auxdir/Makefile src/Makefile src/api/Makefile src/common/Makefile src/sacct/Makefile src/salloc/Makefile src/sbatch/Makefile src/sattach/Makefile src/srun/Makefile src/slaunch/Makefile src/slurmd/Makefile src/slurmd/slurmd/Makefile src/slurmd/slurmstepd/Makefile src/slurmctld/Makefile src/sbcast/Makefile src/scontrol/Makefile src/scancel/Makefile src/squeue/Makefile src/sinfo/Makefile src/smap/Makefile src/sview/Makefile src/plugins/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/jobacct/Makefile src/plugins/jobacct/linux/Makefile src/plugins/jobacct/aix/Makefile src/plugins/jobacct/none/Makefile src/plugins/jobcomp/Makefile src/plugins/jobcomp/filetxt/Makefile src/plugins/jobcomp/none/Makefile src/plugins/jobcomp/script/Makefile src/plugins/proctrack/Makefile src/plugins/proctrack/aix/Makefile src/plugins/proctrack/pgid/Makefile src/plugins/proctrack/linuxproc/Makefile src/plugins/proctrack/rms/Makefile src/plugins/proctrack/sgi_job/Makefile src/plugins/sched/Makefile src/plugins/sched/backfill/Makefile src/plugins/sched/builtin/Makefile src/plugins/sched/hold/Makefile src/plugins/sched/wiki2/Makefile src/plugins/select/Makefile src/plugins/select/bluegene/Makefile src/plugins/select/bluegene/block_allocator/Makefile src/plugins/select/bluegene/plugin/Makefile src/plugins/select/linear/Makefile src/plugins/select/cons_res/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/mpichgm/Makefile src/plugins/mpi/mvapich/Makefile src/plugins/mpi/lam/Makefile src/plugins/mpi/none/Makefile src/plugins/task/Makefile src/plugins/task/affinity/Makefile src/plugins/task/none/Makefile doc/Makefile doc/man/Makefile doc/html/Makefile testsuite/Makefile testsuite/expect/Makefile testsuite/slurm_unit/Makefile testsuite/slurm_unit/common/Makefile testsuite/slurm_unit/slurmctld/Makefile testsuite/slurm_unit/slurmd/Makefile testsuite/slurm_unit/api/Makefile testsuite/slurm_unit/api/manual/Makefile" cat >confcache <<\_ACEOF @@ -26295,8 +26295,6 @@ do "src/plugins/sched/backfill/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/plugins/sched/backfill/Makefile" ;; "src/plugins/sched/builtin/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/plugins/sched/builtin/Makefile" ;; "src/plugins/sched/hold/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/plugins/sched/hold/Makefile" ;; - "src/plugins/sched/maui/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/plugins/sched/maui/Makefile" ;; - "src/plugins/sched/maui/wiki/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/plugins/sched/maui/wiki/Makefile" ;; "src/plugins/sched/wiki2/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/plugins/sched/wiki2/Makefile" ;; "src/plugins/select/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/plugins/select/Makefile" ;; "src/plugins/select/bluegene/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/plugins/select/bluegene/Makefile" ;; diff --git a/configure.ac b/configure.ac index 86ba4c1e823..0e83886e80c 100644 --- a/configure.ac +++ b/configure.ac @@ -269,8 +269,6 @@ AC_CONFIG_FILES([Makefile src/plugins/sched/backfill/Makefile src/plugins/sched/builtin/Makefile src/plugins/sched/hold/Makefile - src/plugins/sched/maui/Makefile - src/plugins/sched/maui/wiki/Makefile src/plugins/sched/wiki2/Makefile src/plugins/select/Makefile src/plugins/select/bluegene/Makefile diff --git a/slurm.spec b/slurm.spec index 42408709ec2..f1e07fac09e 100644 --- a/slurm.spec +++ b/slurm.spec @@ -14,7 +14,7 @@ Source: %{name}-%{version}-%{release}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} URL: http://www.llnl.gov/linux/slurm %ifos linux -BuildRequires: gcc-c++ python openssl-devel >= 0.9.6 +BuildRequires: python openssl-devel >= 0.9.6 %endif # diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c index e94d46e741d..69a1c522755 100644 --- a/src/common/slurm_protocol_api.c +++ b/src/common/slurm_protocol_api.c @@ -422,6 +422,31 @@ uint32_t slurm_get_slurm_user_id(void) return slurm_uid; } +/* slurm_get_root_filter + * RET uint16_t - Value of SchedulerRootFilter */ +extern uint16_t slurm_get_root_filter(void) +{ + uint16_t root_filter; + slurm_ctl_conf_t *conf; + + conf = slurm_conf_lock(); + root_filter = conf->schedrootfltr; + slurm_conf_unlock(); + return root_filter; +} +/* slurm_get_sched_port + * RET uint16_t - Value of SchedulerPort */ +extern uint16_t slurm_get_sched_port(void) +{ + uint16_t port; + slurm_ctl_conf_t *conf; + + conf = slurm_conf_lock(); + port = conf->schedport; + slurm_conf_unlock(); + return port; +} + /* slurm_get_sched_type * get sched type from slurmctld_conf object * RET char * - sched type, MUST be xfreed by caller diff --git a/src/common/slurm_protocol_api.h b/src/common/slurm_protocol_api.h index bdaba225f26..e5447108231 100644 --- a/src/common/slurm_protocol_api.h +++ b/src/common/slurm_protocol_api.h @@ -193,6 +193,14 @@ extern uint16_t slurm_get_propagate_prio_process(void); */ char *slurm_get_proctrack_type(void); +/* slurm_get_root_filter + * RET uint16_t - Value of SchedulerRootFilter */ +extern uint16_t slurm_get_root_filter(void); + +/* slurm_get_sched_port + * RET uint16_t - Value of SchedulerPort */ +extern uint16_t slurm_get_sched_port(void); + /* slurm_get_slurmd_port * returns slurmd port from slurmctld_conf object * RET uint16_t - slurmd port diff --git a/src/plugins/sched/Makefile.am b/src/plugins/sched/Makefile.am index 2276a58a7e7..8a1b9ba6a06 100644 --- a/src/plugins/sched/Makefile.am +++ b/src/plugins/sched/Makefile.am @@ -1,3 +1,3 @@ # Makefile for scheduler plugins -SUBDIRS = backfill builtin hold maui wiki2 +SUBDIRS = backfill builtin hold wiki2 diff --git a/src/plugins/sched/Makefile.in b/src/plugins/sched/Makefile.in index 1a605bb421e..7eeac83fb20 100644 --- a/src/plugins/sched/Makefile.in +++ b/src/plugins/sched/Makefile.in @@ -255,7 +255,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ -SUBDIRS = backfill builtin hold maui wiki2 +SUBDIRS = backfill builtin hold wiki2 all: all-recursive .SUFFIXES: diff --git a/src/plugins/sched/backfill/backfill.c b/src/plugins/sched/backfill/backfill.c index 34111fa4c75..cf731f13fb4 100644 --- a/src/plugins/sched/backfill/backfill.c +++ b/src/plugins/sched/backfill/backfill.c @@ -59,10 +59,10 @@ #include "slurm/slurm_errno.h" #include "src/common/list.h" #include "src/common/macros.h" +#include "src/common/slurm_protocol_api.h" #include "src/common/xmalloc.h" #include "src/common/xstring.h" #include "src/slurmctld/locks.h" -#include "src/slurmctld/sched_plugin.h" #include "src/slurmctld/slurmctld.h" typedef struct part_specs { @@ -173,7 +173,7 @@ backfill_agent(void *args) slurmctld_lock_t all_locks = { READ_LOCK, WRITE_LOCK, READ_LOCK, READ_LOCK }; - if (sched_get_root_filter()) + if (slurm_get_root_filter()) filter_root = true; while (1) { sleep(SLEEP_TIME); /* don't run continuously */ diff --git a/src/plugins/sched/maui/Makefile.am b/src/plugins/sched/maui/Makefile.am deleted file mode 100644 index 1a9938c7a13..00000000000 --- a/src/plugins/sched/maui/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -# Makefile for scheduler plugins - -SUBDIRS = wiki diff --git a/src/plugins/sched/maui/Makefile.in b/src/plugins/sched/maui/Makefile.in deleted file mode 100644 index b063ea6badc..00000000000 --- a/src/plugins/sched/maui/Makefile.in +++ /dev/null @@ -1,557 +0,0 @@ -# Makefile.in generated by automake 1.9 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 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 scheduler plugins -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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 = : -host_triplet = @host@ -subdir = src/plugins/sched/maui -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/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_bluegene.m4 \ - $(top_srcdir)/auxdir/x_ac_debug.m4 \ - $(top_srcdir)/auxdir/x_ac_elan.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ - $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ - $(top_srcdir)/auxdir/x_ac_gtk.m4 \ - $(top_srcdir)/auxdir/x_ac_munge.m4 \ - $(top_srcdir)/auxdir/x_ac_ncurses.m4 \ - $(top_srcdir)/auxdir/x_ac_pam.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_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 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTHD_CFLAGS = @AUTHD_CFLAGS@ -AUTHD_LIBS = @AUTHD_LIBS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BG_INCLUDES = @BG_INCLUDES@ -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@ -DEBUG_MODULES_FALSE = @DEBUG_MODULES_FALSE@ -DEBUG_MODULES_TRUE = @DEBUG_MODULES_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ -FFLAGS = @FFLAGS@ -GTK2_CFLAGS = @GTK2_CFLAGS@ -GTK2_LIBS = @GTK2_LIBS@ -HAVEPKGCONFIG = @HAVEPKGCONFIG@ -HAVE_AIX = @HAVE_AIX@ -HAVE_AIX_FALSE = @HAVE_AIX_FALSE@ -HAVE_AIX_PROCTRACK_FALSE = @HAVE_AIX_PROCTRACK_FALSE@ -HAVE_AIX_PROCTRACK_TRUE = @HAVE_AIX_PROCTRACK_TRUE@ -HAVE_AIX_TRUE = @HAVE_AIX_TRUE@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_ELAN_FALSE = @HAVE_ELAN_FALSE@ -HAVE_ELAN_TRUE = @HAVE_ELAN_TRUE@ -HAVE_FEDERATION = @HAVE_FEDERATION@ -HAVE_FEDERATION_FALSE = @HAVE_FEDERATION_FALSE@ -HAVE_FEDERATION_TRUE = @HAVE_FEDERATION_TRUE@ -HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ -HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ -HAVE_NUMA_FALSE = @HAVE_NUMA_FALSE@ -HAVE_NUMA_TRUE = @HAVE_NUMA_TRUE@ -HAVE_PAM_FALSE = @HAVE_PAM_FALSE@ -HAVE_PAM_TRUE = @HAVE_PAM_TRUE@ -HAVE_SCHED_SETAFFINITY_FALSE = @HAVE_SCHED_SETAFFINITY_FALSE@ -HAVE_SCHED_SETAFFINITY_TRUE = @HAVE_SCHED_SETAFFINITY_TRUE@ -HAVE_SGI_JOB_FALSE = @HAVE_SGI_JOB_FALSE@ -HAVE_SGI_JOB_TRUE = @HAVE_SGI_JOB_TRUE@ -HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ -HAVE_SOME_CURSES_FALSE = @HAVE_SOME_CURSES_FALSE@ -HAVE_SOME_CURSES_TRUE = @HAVE_SOME_CURSES_TRUE@ -HAVE_UNSETENV_FALSE = @HAVE_UNSETENV_FALSE@ -HAVE_UNSETENV_TRUE = @HAVE_UNSETENV_TRUE@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_DIRS = @INSTALL_DIRS@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIB_LDFLAGS = @LIB_LDFLAGS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@ -MUNGE_LDFLAGS = @MUNGE_LDFLAGS@ -MUNGE_LIBS = @MUNGE_LIBS@ -NCURSES = @NCURSES@ -NUMA_LIBS = @NUMA_LIBS@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PAM_LIBS = @PAM_LIBS@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PROCTRACKDIR = @PROCTRACKDIR@ -PROJECT = @PROJECT@ -PTHREAD_CC = @PTHREAD_CC@ -PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ -RELEASE = @RELEASE@ -SEMAPHORE_LIBS = @SEMAPHORE_LIBS@ -SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SLURMCTLD_PORT = @SLURMCTLD_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_VERSION = @SLURM_VERSION@ -SO_LDFLAGS = @SO_LDFLAGS@ -SSL_CPPFLAGS = @SSL_CPPFLAGS@ -SSL_LDFLAGS = @SSL_LDFLAGS@ -SSL_LIBS = @SSL_LIBS@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WITH_AUTHD_FALSE = @WITH_AUTHD_FALSE@ -WITH_AUTHD_TRUE = @WITH_AUTHD_TRUE@ -WITH_GNU_LD_FALSE = @WITH_GNU_LD_FALSE@ -WITH_GNU_LD_TRUE = @WITH_GNU_LD_TRUE@ -WITH_MUNGE_FALSE = @WITH_MUNGE_FALSE@ -WITH_MUNGE_TRUE = @WITH_MUNGE_TRUE@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -SUBDIRS = wiki -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 \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/plugins/sched/maui/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/plugins/sched/maui/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 - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# 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): - @set fnord $$MAKEFLAGS; amf=$$2; \ - 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; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - 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; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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 || \ - tags="$$tags $$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; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && 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)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$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; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - 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: - $(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 -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -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: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-libtool \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-info-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/sched/maui/agent.cpp b/src/plugins/sched/maui/agent.cpp deleted file mode 100644 index e38918a83d8..00000000000 --- a/src/plugins/sched/maui/agent.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/*****************************************************************************\ - * agent.cpp - manages a single connection-defined transaction. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * 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. -\*****************************************************************************/ - -extern "C" { -# include "src/common/log.h" -# include "src/common/macros.h" -} - -#include "agent.h" -#include "mailbag.h" - -// ************************************************************************** -// TAG( agent_t ) -// ************************************************************************** -agent_t::agent_t( const receptionist_t *recep, - courier_t *courier, - const mailbag_factory_t * const mailbag_factory ) : - m_recep( recep ), - m_courier( courier ), - m_mailbag_factory( mailbag_factory ) -{ - // * - // Check that all required specialization objects are provided. - // * - if ( ! m_recep ) throw "agent_t: no receptionist specified"; - if ( ! m_courier ) throw "agent_t: no courier specified"; - if ( ! m_mailbag_factory ) throw "agent_t: no mailbag factory specified"; -} - - -// ************************************************************************** -// TAG( ~agent_t ) -// ************************************************************************** -agent_t::~agent_t() -{ - delete m_courier; - debug3( "agent_t thread exiting" ); - pthread_exit( 0 ); -} - - -// ************************************************************************** -// TAG( start ) -// ************************************************************************** -int -agent_t::start( void ) -{ - pthread_attr_t attr; - int rc; - - slurm_attr_init( &attr ); - pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); - rc = pthread_create( &m_thread, - &attr, - agent_t::thread_entry, - this ); - slurm_attr_destroy( &attr ); - return rc; -} - - -// ************************************************************************** -// TAG( thread_entry ) -// -// The required static entry point for the thread. The agent is passed as -// the anonymous pointer which is downcast. -// ************************************************************************** -void * -agent_t::thread_entry( void *me ) -{ - agent_t *agent = (agent_t *) me; - debug3( "agent_t thread created" ); - agent->thread_main(); - return NULL; -} - - -// ************************************************************************** -// TAG( thread_main ) -// -// The thread main() function. -// ************************************************************************** -void -agent_t::thread_main( void ) -{ - // * - // FIXME: Here is where we would flush to the courier - // any messages pending from previous sessions. - // * - - // * Do the main loop. - spin(); - - - // * - // A bit dangerous, but it's the only way to assure we won't - // leak agents. - // * - - delete this; -} - - - -// ************************************************************************** -// TAG( spin ) -// -// The main loop of the thread. Obtains mailbags from the courier and acts -// on them. If the connection goes down the courier stops delivering mail- -// bags and we exit. -// ************************************************************************** -void -agent_t::spin( void ) -{ - mailbag_t *in_bag, *out_bag; - mailbag_iterator_t *it; - message_t *msg, *response; - - // * Allocate an initial mailbag. - out_bag = m_mailbag_factory->mailbag(); - - // * - // Wait for the courier to deliver mailbags until it decides not - // to anymore. Pull messages out of the mailbag and then call - // each one's action method to get a reply. - // * - for ( in_bag = m_courier->receive(); - in_bag; - in_bag = m_courier->receive() ) { - - it = in_bag->iterator(); - if ( it == NULL ) { - debug2( "agent_t::spin: warning - empty packet" ); - delete in_bag; - continue; - } - - for ( it->first(); ! it->at_end(); it->next() ) { - - msg = in_bag->message( it ); - if ( msg == NULL ) { - debug2( "agent_t::spin: warning - empty message" ); - continue; - } - - // * - // Call the message's action method. That - // should do the work suggested by the message - // and return a response message containing - // the answer. It is perfectly acceptable for - // action methods not to return a response, - // such as when the message itself is a - // response and we only need to acknowledge - // having received it. - // * - response = msg->action(); - if ( response ) { - if ( out_bag->is_full() ) { - if ( m_courier->send( out_bag ) < 0 ) { - delete out_bag; - throw "agent: can't send mailbag"; - } - out_bag = m_mailbag_factory->mailbag(); - } - - if ( out_bag->add( response ) < 0 ) { - throw "agent: can't add last response to mailbag"; - } - - if ( out_bag->is_full() ) { - if ( m_courier->send( out_bag ) < 0 ) { - delete out_bag; - throw "agent: can't send mailbag"; - } - out_bag = m_mailbag_factory->mailbag(); - } - } - - delete msg; - } - - delete it; - delete in_bag; - } - - delete out_bag; - -#if 0 - // * Attempt to send any pending messages. - if ( out_bag->num_items() > 0 ) { - if ( m_courier->send( out_bag ) < 0 ) { - delete out_bag; - } - } -#endif -} diff --git a/src/plugins/sched/maui/agent.h b/src/plugins/sched/maui/agent.h deleted file mode 100644 index 69d7b5a695f..00000000000 --- a/src/plugins/sched/maui/agent.h +++ /dev/null @@ -1,141 +0,0 @@ -/*****************************************************************************\ - * agent.h - manages a single connection-oriented session. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#ifndef __SLURM_PLUGIN_AGENT_H__ -#define __SLURM_PLUGIN_AGENT_H__ - -#include <pthread.h> - -#include "receptionist.h" -#include "courier.h" -#include "message.h" - -// ************************************************************************** -// TAG( agent_t ) -// -// Abstractly encapsulates the process of receiving over a network -// connection messages that indicate work should be done, then -// responding with a message to inform the sender how the work went. -// An agent_t is created by a receptionist_t that waits on incoming -// connection requests at a single address, one agent_t for each -// connection. The agent_t spawns a thread to handle the transaction -// on this connection, leaving the receptionist to handle more -// incoming connections. -// -// A courier_t (see courier.h) unpacks the "payload" from its -// transport-specific packaging (e.g., HTTP) and produces a mailbag_t -// (see mailbag.h> that contains the logical contents of the payload -// divided into one or more message_t objects. By iterating over the -// mailbag_t using its generalized iterator, the agent_t calls the -// action() method of each message in turn and arranges for any reply -// to be transmitted. -// -// The courier_t accumulates these replies in a return mailbag_t and -// transmits them as dictated by the mailbag_t's policy. -// -// ************************************************************************** -class agent_t -{ -protected: - pthread_t m_thread; - const receptionist_t *m_recep; - courier_t *m_courier; - const mailbag_factory_t * const m_mailbag_factory; - -public: - - // ************************************************************** - // TAG( agent_t ) - // ************************************************************** - // DESCRIPTION - // Constructor. - // - // ARGUMENTS - // recep (in) - The parent receptionist. - // courier (in, owns) - The specialized courier for this type - // of delivery. - // num_types (in) - The number of message types (and therefore - // the number of message factories) this agent must - // deal with. - // - // ASSUMPTIONS - // None. - // - // SIDE EFFECTS - // Throws string literals as exceptions for improper arguments. - // - // ************************************************************** - agent_t( const receptionist_t *recep, - courier_t *courier, - const mailbag_factory_t * const mailbag_factory ); - - ~agent_t(); - - // ************************************************************** - // TAG( start ) - // ************************************************************** - // DESCRIPTION - // Instruct the agent to begin receiving and processing - // communications. This is explicitly a separate step so that - // message factories can be set up prior to accepting intput. - // This method returns immediately. - // - // ARGUMENTS - // None. - // - // RETURNS - // Zero if the processing thread was started successfully, - // non-zero otherwise. - // - // ASSUMPTIONS - // None. - // - // SIDE EFFECTS - // A new thread is started. - // - // ************************************************************** - int start( void ); - -protected: - static void *thread_entry( void *me ); - void thread_main( void ); - -private: - void spin( void ); -}; - -#endif /*__SLURM_PLUGIN_AGENT_H__*/ diff --git a/src/plugins/sched/maui/comparator.h b/src/plugins/sched/maui/comparator.h deleted file mode 100644 index d49f2065ad4..00000000000 --- a/src/plugins/sched/maui/comparator.h +++ /dev/null @@ -1,240 +0,0 @@ -/*****************************************************************************\ - * comparator.h - a condition evaluated by comparison to a constant. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#ifndef __SLURM_PLUGIN_COMPARATOR_H__ -#define __SLURM_PLUGIN_COMPARATOR_H__ - -#include "condition.h" - -extern "C" { -# include "src/slurmctld/sched_plugin.h" -} - -// ************************************************************************** -// TAG( comparator_t ) -// -// A condition which is evaluated according to a comparison between -// requested attributes and actual attributes. This is a leaf in the -// expression tree. -// -// The comparator is specialized into the cross-product of comparison -// operators and data types. These can be determined when the -// expression specification is parsed, saving them from being -// evaluated from the data on each comparison. The specialized -// comparators are instantiated with the table of values for one -// attribute of a node or a job (i.e., all the memory sizes in an -// ordered array). The eval() method is called with the node or job -// index. -// -// ************************************************************************** -class comparator_t : public condition_t -{ -protected: - sched_accessor_fn_t m_func; -public: - - comparator_t( sched_accessor_fn_t fn ) : - m_func( fn ) - { - if ( m_func == NULL ) throw "comparator: no such field"; - } - - virtual const bool eval( sched_obj_list_t obj_data, int32_t idx ) = 0; -}; - - -// ************************************************************************** -// TAG( int_eq_comparator_t ) -// -// Compares numerical equality. -// ************************************************************************** -class int_eq_comparator_t : public comparator_t -{ -protected: - time_t m_val; -public: - int_eq_comparator_t( sched_accessor_fn_t fn, - time_t expected ) : - comparator_t( fn ), - m_val( expected ) - { - } - - const bool eval( sched_obj_list_t obj_data, int32_t idx ) - { - return (time_t) m_func( obj_data, - idx, - NULL ) == m_val; - } -}; - - -// ************************************************************************** -// TAG( int_lt_comparator_t ) -// -// Compares for values less than the expected value. -// ************************************************************************** -class int_lt_comparator_t : public comparator_t -{ -protected: - time_t m_val; -public: - int_lt_comparator_t( sched_accessor_fn_t fn, - time_t expected ) : - comparator_t( fn ), - m_val( expected ) - { - } - - const bool eval( sched_obj_list_t obj_data, int32_t idx ) - { - return (time_t) m_func( obj_data, idx, NULL ) < m_val; - } -}; - - -// ************************************************************************** -// TAG( int_gt_comparator_t ) -// -// Compares for values greater than the expected value. -// ************************************************************************** -class int_gt_comparator_t : public comparator_t -{ -protected: - time_t m_val; -public: - int_gt_comparator_t( sched_accessor_fn_t fn, - time_t expected ) : - comparator_t( fn ), - m_val( expected ) - { - } - - const bool eval( sched_obj_list_t obj_data, int32_t idx ) - { - return (time_t) m_func( obj_data, idx, NULL ) > m_val; - } -}; - - -// ************************************************************************** -// TAG( string_comparator_t ) -// -// Base class for string comparators, to embody strcmp(). -// ************************************************************************** -class string_comparator_t : public comparator_t -{ -protected: - char *m_string; - -public: - string_comparator_t( sched_accessor_fn_t fn, - char *expected_value ) : - comparator_t( fn ), - m_string( expected_value ) - { - } - -protected: - int cmp( sched_obj_list_t obj_data, int32_t idx ) - { - return strcmp( (char *) m_func( obj_data, - idx, - NULL ), - m_string ); - } - -}; - - -// ************************************************************************** -// TAG( string_eq_comparator_t ) -// ************************************************************************** -class string_eq_comparator_t : public string_comparator_t -{ -public: - string_eq_comparator_t( sched_accessor_fn_t fn, - char *expected ) : - string_comparator_t( fn, expected ) - { - } - - const bool eval( sched_obj_list_t obj_data, int32_t idx ) - { - return cmp( obj_data, idx ) == 0; - } -}; - - -// ************************************************************************** -// TAG( string_lt_comparator_t ) -// ************************************************************************** -class string_lt_comparator_t : public string_comparator_t -{ -public: - string_lt_comparator_t( sched_accessor_fn_t fn, - char *expected ) : - string_comparator_t( fn, expected ) - { - } - - const bool eval( sched_obj_list_t obj_data, int32_t idx ) - { - return cmp( obj_data, idx ) < 0; - } -}; - - -// ************************************************************************** -// TAG( string_gt_comparator_t ) -// ************************************************************************** -class string_gt_comparator_t : public string_comparator_t -{ -public: - string_gt_comparator_t( sched_accessor_fn_t fn, - char *expected ) : - string_comparator_t( fn, expected ) - { - } - - const bool eval( sched_obj_list_t obj_data, int32_t idx ) - { - return cmp( obj_data, idx ) > 0; - } -}; - -#endif /*__SLURM_PLUGIN_COMPARATOR_H__*/ diff --git a/src/plugins/sched/maui/condition.h b/src/plugins/sched/maui/condition.h deleted file mode 100644 index 41bd4818256..00000000000 --- a/src/plugins/sched/maui/condition.h +++ /dev/null @@ -1,153 +0,0 @@ -/*****************************************************************************\ - * condition.h - a testable condition for arbitrary expressions. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#ifndef __SLURM_PLUGIN_CONDITION_H__ -#define __SLURM_PLUGIN_CONDITION_H__ - - -// ************************************************************************** -// TAG( condition_t ) -// -// A condition_t is a node in an expression tree. Specializations are -// either comparators (leaves) or conjunctions (branches). The represented -// boolean-valued expression establishes the criteria against which -// individual nodes can be matched. -// -// The default implementation is a tautology which can be useful to select -// all nodes with generic traversal code (albeit inefficiently). -// ************************************************************************** -class condition_t -{ -public: - virtual const bool eval( void *obj_data, int32_t node_idx ) - { - return true; - } -}; - - -// ************************************************************************** -// TAG( negation_t ) -// -// A condition which negates its subexpression: -// -// ( ! EXPR ) -// -// ************************************************************************** -class negation_t : public condition_t -{ -protected: - condition_t *m_expr; - -public: - negation_t( condition_t *expr ) : - m_expr( expr ) - { - } - - ~negation_t() - { - delete m_expr; - } - - const bool eval( void *obj_data, int32_t node_idx ) - { - return ! m_expr->eval( obj_data, node_idx ); - } -}; - - -// ************************************************************************** -// TAG( conjunction_t ) -// -// A condition which is evaluated according to its left and right operands -// conjoined or disjoined by a boolean operator. This is a branch in the -// expression tree. Short-circuiting should be performed when appropriate. -// -// ( EXPR1 && EXPR2 ) -// -// or -// -// ( EXPR1 || EXPR2 ) -// -// ************************************************************************** -class conjunction_t : public condition_t -{ -public: - - enum op_t { - AND, - OR - }; - -protected: - op_t m_op; - condition_t *m_left; - condition_t *m_right; - - -public: - - conjunction_t( op_t op, condition_t *left, condition_t *right ) : - m_op( op ), - m_left( left ), - m_right( right ) - { - } - - ~conjunction_t() - { - delete m_left; - delete m_right; - } - - virtual const bool eval( void *obj_data, int32_t idx ) - { - switch ( m_op ) { - case AND: - return m_left->eval( obj_data, idx ) - && m_right->eval( obj_data, idx ); - case OR: - return m_left->eval( obj_data, idx ) - || m_right->eval( obj_data, idx ); - default: - return false; - } - } -}; - -#endif /*__SLURM_PLUGIN_CONDITION_H__*/ diff --git a/src/plugins/sched/maui/courier.cpp b/src/plugins/sched/maui/courier.cpp deleted file mode 100644 index dd20f8ff147..00000000000 --- a/src/plugins/sched/maui/courier.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/*****************************************************************************\ - * courier.cpp - generalized message packager for wire protocols. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * 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 <stdlib.h> - -#include "courier.h" -#include "mailbag.h" - - -// ************************************************************************** -// TAG( send ) -// -// The default implementation assumes no framing is needed and the text -// representation of the mailbag contents is suitable for the wire. -// ************************************************************************** -int -courier_t::send( mailbag_t *bag ) -{ - if ( write_bytes( bag->text(), bag->text_length() ) == 0 ) { - debug( "courier_t::send: cannot write to output socket" ); - return -1; - } else { - delete bag; - return 0; - } -} - -// * -// These following two functions really need to migrate themselves into -// the SLURM library, or equivalents for them already existing need to -// be used. -// * - -// ************************************************************************** -// TAG( write_bytes ) -// ************************************************************************** -size_t -courier_t::write_bytes( char * const buf, const size_t size ) -{ - ssize_t bytes_remaining, bytes_written; - char *ptr; - - bytes_remaining = size; - ptr = buf; - while ( bytes_remaining > 0 ) { - bytes_written = write( m_fd, ptr, size ); - if ( bytes_written < 0 ) return 0; - bytes_remaining -= bytes_written; - ptr += bytes_written; - } - return size; -} - - -// ************************************************************************** -// TAG( read_bytes ) -// ************************************************************************** -size_t -courier_t::read_bytes( char *buf, const size_t size ) -{ - ssize_t bytes_remaining, bytes_read; - char *ptr; - - bytes_remaining = size; - ptr = buf; - while ( bytes_remaining > 0 ) { - bytes_read = read( m_fd, ptr, bytes_remaining ); - if ( bytes_read == 0 ) return 0; - if ( bytes_read < 0 ) return 0; - bytes_remaining -= bytes_read; - ptr += bytes_read; - } - - return size; -} diff --git a/src/plugins/sched/maui/courier.h b/src/plugins/sched/maui/courier.h deleted file mode 100644 index 82742de2368..00000000000 --- a/src/plugins/sched/maui/courier.h +++ /dev/null @@ -1,162 +0,0 @@ -/*****************************************************************************\ - * courier.h - general wire-protocol driver for messages. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#ifndef __SLURM_PLUGIN_COURIER_H__ -#define __SLURM_PLUGIN_COURIER_H__ - -#include <unistd.h> - -extern "C" { -# include "src/common/log.h" -} - -// * Forward declarations. -class mailbag_t; -class mailbag_factory_t; - - -// ************************************************************************** -// TAG( courier_t ) -// -// In the chain of data-handling objects, this one is closest to the actual -// wire, so it holds the file descriptor. The courier delivers network -// data as a mailbag: the payload portion of each logical message with its -// packaging stripped. It transmits mailbags after wrapping them in -// a transport-specific package. -// -// This class must be abstract because it is not possible to construct a -// generic mailbag in receive(). -// ************************************************************************** -class courier_t -{ -protected: - const int m_fd; - const mailbag_factory_t * const m_factory; - -public: - - // ************************************************************** - // TAG( courier_t ) - // ************************************************************** - // DESCRIPTION - // Courier constructor. - // - // ARGUMENTS - // fd (in) - The file descriptor corresponding to the realized - // wire connection. - // factory (in) - The mailbag factory which will create concrete - // mailbag objects given raw data from the packet. - // The caller retains ownership of the factory. - // - // ************************************************************** - courier_t( const int fd, const mailbag_factory_t * const factory ) : - m_fd( fd ), - m_factory( factory ) - { - } - - virtual ~courier_t() - { - (void) close( m_fd ); - } - - - // ************************************************************** - // TAG( receive ) - // ************************************************************** - // DESCRIPTION - // Reads data from the wire and produces a mailbag to - // represent it. This method *must* block if no data is - // available, but will likely become available. - // - // ARGUMENTS - // None. - // - // RETURNS - // A mailbag corresponding to the payload portion of the - // incoming data with the framing, if any, stripped away. The - // caller becomes the owner of the mailbag. Returns NULL if - // the state of the underlying connection is such that no - // further mailbags will be delivered (e.g., the peer closed - // the connection). - // - // ************************************************************** - virtual mailbag_t *receive( void ) = 0; - - - - // ************************************************************** - // TAG( send ) - // ************************************************************** - // DESCRIPTION - // Send a mailbag to the remote peer after first wrapping it - // in the appropriate framing or packaging. - // - // ARGUMENTS - // mailbag (in) - The mailbag to send. The courier becomes the - // owner of the mailbag if the call succeeds, - // otherwise the caller retains ownership of the - // mailbag. - // - // RETURNS - // Zero if the mailbag was sent (or queued for sending, if - // appropriate) successfully, and a negative number if it was - // not. - // - // ************************************************************** - virtual int send( mailbag_t *bag ); - -protected: - size_t write_bytes( char * const buf, const size_t size ); - size_t read_bytes( char *buf, const size_t size ); -}; - - -// ************************************************************************** -// TAG( courier_factory_t ) -// -// Factory for couriers, chiefly used by the receptionist to configure -// the connection agent. -// ************************************************************************** -class courier_factory_t -{ -public: - virtual courier_t *courier( int fd, - const mailbag_factory_t * const factory ) const = 0; -}; - -#endif /*__SLURM_PLUGIN_COURIER_H__*/ diff --git a/src/plugins/sched/maui/dstring.cpp b/src/plugins/sched/maui/dstring.cpp deleted file mode 100644 index 75cab667adf..00000000000 --- a/src/plugins/sched/maui/dstring.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/*****************************************************************************\ - * dstring.cpp - dynamically growable string. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#include <string.h> -#include <stdlib.h> - -#include "dstring.h" - -dstring_t::dstring_t() -{ - m_allocated = ALLOCATION_INCREMENT; - m_population = 0; - m_buf = (char *) malloc( m_allocated ); - if ( ! m_buf ) throw "dstring_t: unable to allocate"; -} - -dstring_t::dstring_t( const char *str ) -{ - m_population = strlen( str ); - m_allocated = m_population + 1; - m_buf = (char *) malloc( m_allocated ); - if ( ! m_buf ) throw "dstring_t: unable to allocate"; - strncpy( m_buf, str, m_population ); -} - - -dstring_t::dstring_t( const char *str, const size_t len ) -{ - m_population = len; - m_allocated = len + ALLOCATION_INCREMENT; - m_buf = (char *) malloc( m_allocated ); - if ( ! m_buf ) throw "dstring_t: cannot allocate"; - memcpy( m_buf, str, len ); -} - - -dstring_t::dstring_t( const dstring_t &str ) -{ - m_allocated = str.m_allocated; - m_buf = (char *) malloc( m_allocated ); - m_population = str.m_population; - strncpy( m_buf, str.m_buf, m_population ); -} - - -dstring_t::dstring_t( const size_t len ) -{ - m_allocated = len; - m_population = 0; - m_buf = (char *) malloc( m_allocated ); - if ( ! m_buf ) throw "dstring_t: cannot allocate"; -} - - -void -dstring_t::append( const dstring_t &str ) -{ - size_t bigger_size = m_population + str.m_population + 1; - - if ( bigger_size > m_allocated ) { - m_buf = (char *) - realloc( m_buf, bigger_size + ALLOCATION_INCREMENT ); - m_allocated = bigger_size; - } - memcpy( &m_buf[ m_population ], str.m_buf, str.m_population ); - m_population += str.m_population; -} - -dstring_t & -dstring_t::operator = ( const dstring_t &str ) -{ - free( m_buf ); - m_buf = (char *) malloc( str.m_allocated ); - memcpy( m_buf, str.m_buf, str.m_population ); - m_allocated = str.m_allocated; - m_population = str.m_population; - return *this; -} - -void -dstring_t::append( const char * const str, size_t len ) -{ - if ( ( m_population + len ) >= m_allocated ) { - m_allocated += (len + ALLOCATION_INCREMENT); - m_buf = (char *) realloc( m_buf, m_allocated ); - } - strncpy( &m_buf[ m_population ], str, len ); - m_population += len; -} - - -void -dstring_t::append( const char *const str ) -{ - append( str, strlen( str ) ); -} diff --git a/src/plugins/sched/maui/dstring.h b/src/plugins/sched/maui/dstring.h deleted file mode 100644 index 775ee16223e..00000000000 --- a/src/plugins/sched/maui/dstring.h +++ /dev/null @@ -1,233 +0,0 @@ -/*****************************************************************************\ - * dstring.h - yet another dynamic string class. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#ifndef __SLURM_DYNAMIC_STRING_H__ -#define __SLURM_DYNAMIC_STRING_H__ - -#include <stdio.h> -#include <stdlib.h> - -// ************************************************************************** -// TAG( dstring_t ) -// -// Yet Another Dynamic String. Mostly an abstraction of reallocation to -// grow the string as needed. This will probably go away in favor of -// growable C strings from the SLURM library. -// ************************************************************************** -class dstring_t -{ -protected: - char *m_buf; - size_t m_population; - size_t m_allocated; - - static const size_t ALLOCATION_INCREMENT = 64; - -public: - - dstring_t(); - dstring_t( const char *str ); - dstring_t( const char *str, const size_t len ); - dstring_t( const dstring_t &str ); - dstring_t( const size_t len ); - - ~dstring_t() - { - free( m_buf ); - } - - - // ************************************************************** - // TAG( s ) - // ************************************************************** - // DESCRIPTION - // Produce a version of the string compatible with the C library. - // - // ARGUMENTS - // None. - // - // RETURNS - // Pointer to a non-modifiable version of the string. - // - // ASSUMPTIONS - // No embedded ASCII NUL characters. - // ************************************************************** - char * const s( void ) - { - m_buf[ m_population ] = 0; - return m_buf; - } - - - // ************************************************************** - // TAG( c ) - // ************************************************************** - // DESCRIPTION - // Access a character in the string. - // - // ARGUMENTS - // idx (in) - Zero-based index of the character in the string. - // - // RETURNS - // The character at the given position in the string. - // - // ASSUMPTIONS - // idx is not tested for boundaries. - // - // ************************************************************** - const char c( const u_int32_t idx ) const - { - return m_buf[ idx ]; - } - - // ************************************************************** - // TAG( operator = ) - // ************************************************************** - // DESCRIPTION - // Assign the value of a string to the receiver. - // - // ARGUMENTS - // str (in) - the string from which the assignment is made. - // - // RETURNS - // The newly-assigned string, so as to be compatible with - // assignments in C/C++ expressions. - // - // SIDE EFFECTS - // The existing contents of the receiver, if any, are deallocated - // and lost. - // ************************************************************** - dstring_t & operator = ( const dstring_t &str ); - - - // ************************************************************** - // TAG( append ) - // ************************************************************** - // DESCRIPTION - // Append one string to the receiver. - // - // ARGUMENTS - // str (in) - the string to append. - // len (in, optional) - the length of the string to append, if - // known. - // - // RETURNS - // None. - // - // ************************************************************** - void append( const dstring_t &str ); - void operator += ( const dstring_t &str ) - { - append( str ); - } - - void append( const char * const str ); - void append( const char * const str, const size_t len ); - void operator += ( const char * const str ) - { - append( str ); - } - - - // ************************************************************** - // TAG( append ) - // ************************************************************** - // DESCRIPTION - // Append a text version of a numerical argument to the receiver. - // - // ARGUMENTS - // val (in) - The value to convert to ASCII and append. Options - // are provided for signed and unsigned values. - // fmt (in, optional) - the printf() format to use for converting - // val to ASCII. Avoid lengthy formats. - // - // RETURNS - // None. - // - // ************************************************************** - void append( const u_int32_t val, const char *fmt = NULL ) - { - char buf[ 32 ]; - sprintf( buf, fmt ? fmt : "%lu", val ); - append( buf ); - } - - void append( const int32_t val, const char *fmt = NULL ) - { - char buf[ 32 ]; - sprintf( buf, fmt ? fmt : "%ld", val ); - append( buf ); - } - - void append( const long int val, const char *fmt = NULL ) - { - char buf[ 64 ]; - sprintf( buf, fmt ? fmt : "%ld", val ); - append( buf ); - } - - void append( const unsigned long int val, const char *fmt = NULL ) - { - char buf[ 64 ]; - sprintf( buf, fmt ? fmt : "%lu", val ); - append( buf ); - } - - void operator += ( const u_int32_t val ) - { - append( val ); - } - void operator += ( const int32_t val ) - { - append( val ); - } - void operator += ( const long int val ) - { - append( val ); - } - void operator += ( const unsigned long int val ) - { - append( val ); - } - const size_t length( void ) const - { - return m_population; - } -}; - - -#endif /*__SLURM_DYNAMIC_STRING_H__*/ diff --git a/src/plugins/sched/maui/mailbag.h b/src/plugins/sched/maui/mailbag.h deleted file mode 100644 index a04022aab10..00000000000 --- a/src/plugins/sched/maui/mailbag.h +++ /dev/null @@ -1,349 +0,0 @@ -/*****************************************************************************\ - * mailbag.h - one or more messages as concatenated on the wire. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#ifndef __SLURM_PLUGIN_MAILBAG_H__ -#define __SLURM_PLUGIN_MAILBAG_H__ - -#include <sys/types.h> - -#include "message.h" - -class mailbag_iterator_t; - -// ************************************************************************** -// TAG( mailbag_t ) -// -// A mailbag is the representation of an incoming message after it arrives -// on the wire and after it is stripped of any framing apparatus. It -// represents the format of an outgoing message before the framing apparatus -// is added. Whether the mailbag contains more than one message is -// implementation-dependent. -// ************************************************************************** -class mailbag_t -{ -public: - friend class mailbag_iterator_t; - -protected: - int m_num_items; - -public: - - mailbag_t() - { - m_num_items = 0; - } - - // ************************************************************** - // TAG( mailbag_t ) - // ************************************************************** - // DESCRIPTION - // Construct a mailbag given a pointer to data obtained from the - // wire. - // - // ARGUMENTS - // buf (in) - The data obtained from the wire. - // len (in) - The number of bytes pointed to by buf. - // - // ************************************************************** - mailbag_t( char *buf, size_t len ) - { - } - - virtual ~mailbag_t() - { - } - - const int num_items( void ) const { return m_num_items; } - - // ************************************************************** - // TAG( iterator ) - // ************************************************************** - // DESCRIPTION - // Produce an interator suitable for iterating over this object. - // - // ARGUMENTS - // None. - // - // RETURNS - // An uninitialized iterator, or NULL if an error occurs. - // - // ************************************************************* - virtual mailbag_iterator_t *iterator( void ) = 0; - - // ************************************************************** - // TAG( message ) - // ************************************************************** - // DESCRIPTION - // Message factory method. Given an iterator over the mailbag, - // deference the iterator in terms of a message - // - // ARGUMENTS - // it (in) - The iterator to the mailbag. It is presumed that - // the iterator is defined over the receiver, but - // this does not necesarily have to be tested. - // - // RETURNS - // A message corresponding to the data at the current position - // of the iterator, or NULL if the data is garbled, the iterator - // is invalid, etc. - // - // ************************************************************** - virtual message_t *message( mailbag_iterator_t *it ) = 0; - - // ************************************************************* - // TAG( is_full ) - // ************************************************************* - // DESCRIPTION - // Tells whether a call to add() would fail because there is - // no more room left in the mailbag. - // - // ARGUMENTS - // None. - // - // RETURNS - // <bool> true if the mailbag is currently full. - // - // ************************************************************* - virtual bool is_full( void ) const = 0; - - - // ************************************************************* - // TAG( add ) - // ************************************************************* - // DESCRIPTION - // Add a message to the mailbag. - // - // ARGUMENTS - // msg (in/owns) - The message to add. If the message is - // successfully added then the mailbag becomes - // the owner of the message. - // - // RETURNS - // Zero if the message was added successfully, and a negative number - // otherwise. - // - // ************************************************************* - virtual int add( message_t *msg ) = 0; - - - // ************************************************************* - // TAG( text ) - // ************************************************************* - // DESCRIPTION - // Export the contents of the mailbag as text suitable for - // transmission on the wire. "Text" does not necessarily assume - // human-readable text. - // - // ARGUMENTS - // None. - // - // RETURNS - // Const pointer to the wire representation of the contents of the - // mailbag. - // - // SIDE EFFECTS - // The text() method may have the side effect of translating the - // internal representation of the mailbag to a textual format and - // this may be computationally expensive. The caller may cache - // the results of this method, but the data accessed by this method - // is not guaranteed to be consistent if messages are added to the - // mailbag after the caching has occurred. - // - // ************************************************************** - virtual char *text( void ) = 0; - - - // ************************************************************** - // TAG( text_length ) - // ************************************************************** - // DESCRIPTION - // Give the length of the data pointed to by the text() method. - // - // ARGUMENTS - // None. - // - // RETURNS - // The length of the text representation exported by text(). - // - // ASSUMPTIONS - // The text() method may have the side effect of translating - // the internal representation into textual form. The value - // returned by this method is expected to be consistent with - // prior or subsequent calls to text(), provided that no - // messages are added between the calls. Thus this method and - // text() may be called in either order, but any intervening - // changes to the mailbag are allowed to render the results - // inconsistent. - // - // SIDE EFFECTS - // None. - // - // ************************************************************** - virtual size_t text_length( void ) = 0; -}; - - - - -// ************************************************************************** -// TAG( mailbag_iterator_t ) -// -// An iterator over a mailbag. For mailbags that contain, or can contain, -// multiple elements, this object successively accesses subsets of the -// mailbag raw data that can be used to construct individual messages. -// ************************************************************************** -class mailbag_iterator_t -{ -public: - - // * - // The constructor is written here to take an argument because we - // don't want to create orphaned iterators. There is no meaningful - // default constructor. - // * - mailbag_iterator_t( const mailbag_t *bag ) - { - } - - - // ************************************************************** - // TAG( first ) - // ************************************************************** - // DESCRIPTION - // Set the iterator to point at the first message in the mailbag. - // This must be done explicitly before the iterator can be used. - // - // ARGUMENTS - // None. - // - // RETURNS - // None. - // - // ************************************************************** - virtual void first( void ) = 0; - - // ************************************************************** - // TAG( next ) - // ************************************************************** - // DESCRIPTION - // Advance the iterator to the next message. - // - // ARGUMENTS - // None. - // - // RETURNS - // None. - // - // ************************************************************** - virtual void next( void ) = 0; - - // ************************************************************** - // TAG( at_end ) - // ************************************************************** - // DESCRIPTION - // Determines whether the iterator has reached the end of the - // mailbag. - // - // ARGUMENTS - // None. - // - // RETURNS - // <bool> true if a call to current() will return NULL because the - // iterator has reached the end of the mailbag. - // - // ************************************************************** - virtual bool at_end( void ) = 0; - void operator ++( void ) { next(); } - - // ************************************************************** - // TAG( current ) - // ************************************************************** - // DESCRIPTION - // Dereferences the iterator to arrive at the subset of the data - // that corresponds to the current message. - // - // ARGUMENTS - // None. - // - // RETURNS - // An opaque pointer, expected to be meaningful to the caller. - // The caller does not own the memory at the end of the - // pointer -- it is managed by the iterator in cooperation - // with the mailbag. This pointer is acceptable as input to - // the message factory functions. - // - // ************************************************************** - virtual void *current( void ) = 0; -}; - - -// ************************************************************************** -// TAG( mailbag_factory_t ) -// -// Used by the concrete courier classes to create mailbags from packets which -// the courier has just unframed. Mailbag implementations must provide -// one of these so that it can be installed in the courier. This is so that -// the full cross-section of couriers and mailbags need not be supported -// statically as multiply-inherited classes. -// ************************************************************************** -class mailbag_factory_t -{ -public: - - // ************************************************************** - // TAG( mailbag ) - // ************************************************************** - // DESCRIPTION - // Create a new mailbag in the free store. - // - // ARGUMENTS - // data (in, owns) - The unframed data from the wire, retrieved - // and unpacked by the courier. - // len (in) - The length of the data portion of the packet. - // - // RETURNS - // A concrete mailbag class, or NULL if an error occurs. The - // caller owns the produced mailbag. - // - // ************************************************************** - virtual mailbag_t *mailbag( void *data, size_t len ) const = 0; - - virtual mailbag_t *mailbag( void ) const = 0; -}; - -#endif /*__SLURM_PLUGIN_MAILBAG_H__*/ diff --git a/src/plugins/sched/maui/message.h b/src/plugins/sched/maui/message.h deleted file mode 100644 index 5e3639526ce..00000000000 --- a/src/plugins/sched/maui/message.h +++ /dev/null @@ -1,142 +0,0 @@ -/*****************************************************************************\ - * message.h - statement in a scheduler conversation. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#ifndef __SLURM_PLUGIN_MESSAGE_H__ -#define __SLURM_PLUGIN_MESSAGE_H__ - -#include <stdio.h> - -extern "C" { -# include "src/common/log.h" -} - -// ************************************************************************** -// TAG( message_t ) -// -// This is the atomic representation of a directive or missive to/from -// the scheduler. You receive a sequence of these from the wire, and -// you place a sequence of these back on the wire in response. The -// mapping of input data to any internal representation (i.e., textual -// message parsing) is done in the constructor. The action() method -// carries out the operations suggested by the message contents and -// optionally produces a return message in response. The action() -// "script" of such a reply should return NULL, as in the default -// below. Message types are simple integers and are -// implementation-specific. -// ************************************************************************** -class message_t -{ -protected: - int m_type; - -public: - message_t( int type ) : m_type( type ) - { - } - - virtual ~message_t() - { - } - - int type( void ) { return m_type; } - - - // ************************************************************** - // TAG( action ) - // ************************************************************** - // DESCRIPTION - // Carry out the actions suggested by the contents of the message. - // - // ARGUMENTS - // None. - // - // RETURNS - // A message to send back to whoever sent the command, or NULL - // if no response is warranted. The caller owns the message - // created by this method. - // - // ASSUMPTIONS - // None. - // - // SIDE EFFECTS - // Many and varied; that's the point. - // - // ************************************************************** - virtual message_t *action( void ) - { - debug3( "message::action: default message action attempted" ); - return NULL; - } - - - // ************************************************************** - // TAG( text ) - // ************************************************************** - // DESCRIPTION - // Produce a "textual" representation of this message. "Text" - // does not necessarily mean human-readable text, but rather a - // representation of how this portion of the enclosing mailbag - // might look when its text() method is called. - // - // ARGUMENTS - // None. - // - // RETURNS - // Pointer to the text representation of the message. - // - // ************************************************************** - virtual char *text( void ) = 0; - - - // ************************************************************** - // TAG( text_length ) - // ************************************************************** - // DESCRIPTION - // Give the size of the textual representation produced by text(). - // - // ARGUMENTS - // None. - // - // RETURNS - // Number of bytes pointed to by text(). - // - // ************************************************************** - virtual size_t text_length( void ) = 0; -}; - - -#endif /*__SLURM_PLUGIN_MESSAGE_H__*/ diff --git a/src/plugins/sched/maui/prefix_courier.cpp b/src/plugins/sched/maui/prefix_courier.cpp deleted file mode 100644 index a9ad9f18e9d..00000000000 --- a/src/plugins/sched/maui/prefix_courier.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/*****************************************************************************\ - * prefix_courier.cpp - message packager for length-prefixed messages. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * 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 - -#if HAVE_STDINT_H -# include <stdint.h> -#endif -#if HAVE_INTTYPES_H -# include <inttypes.h> -#endif - -#include <stdio.h> -#include <stdlib.h> - -extern "C" { -# include "src/common/log.h" -# include "src/common/xassert.h" -} - -#include "prefix_courier.h" - - -// ************************************************************************ -// TAG( receive ) -// ************************************************************************ -mailbag_t * -prefix_courier_t::receive( void ) -{ - char header[ 10 ]; - uint32_t size; - char *buf; - mailbag_t *bag; - - // * Read the packet size. - if ( courier_t::read_bytes( header, 9 ) != 9 ) { - if ( errno != 0 ) - debug( "prefix_courier::receive: malformed header (wire)" ); - return NULL; - } - - // * Convert to binary. - if ( sscanf( header, "%ul", &size ) != 1 ) { - if ( errno != 0 ) - debug( "prefix_courier::receive: malformed header (decode)" ); - return NULL; - } - - // * Allocate a buffer - buf = new char [ size ]; - xassert( buf ); - - // * Read the actual packet data. - if ( courier_t::read_bytes( buf, size ) != size ) { - debug( "prefix_courier::receive: unable to receive fixed-length data" ); - delete [] buf; - return NULL; - } - - // * Invoke the factory to return the proper concrete object. - bag = m_factory->mailbag( buf, size ); - delete [] buf; - return bag; -} - - -// ************************************************************************** -// TAG( send ) -// ************************************************************************** -int -prefix_courier_t::send( mailbag_t *bag ) -{ - char header[ 10 ]; - size_t size = bag->text_length(); - - // * Write the packet size. - (void) sprintf( header, "%08ul\n", size ); - if ( write_bytes( header, 9 ) != 9 ) { - debug( "prefix_courier::send: unable to send fixed-length data" ); - return 0; - } - - // * - // Write the mailbag contents. The mailbag is deleted in this - // call if it succeeds. - // * - return courier_t::send( bag ); -} diff --git a/src/plugins/sched/maui/prefix_courier.h b/src/plugins/sched/maui/prefix_courier.h deleted file mode 100644 index 16ba13821d6..00000000000 --- a/src/plugins/sched/maui/prefix_courier.h +++ /dev/null @@ -1,83 +0,0 @@ -/*****************************************************************************\ - * prefix_courier.h - message packer for length-prefixed packets. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * 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 __PREFIX_COURIER_H__ -#define __PREFIX_COURIER_H__ - -#include "courier.h" -#include "mailbag.h" - -// ************************************************************************** -// TAG( prefix_courier_t ) -// -// Specialization of the courier_t for Maui Wiki sessions in which the -// content is framed by prefixing it with length data, as in -// -// 00000325\n -// <stuff> -// -// ************************************************************************** -class prefix_courier_t : public courier_t -{ -public: - - prefix_courier_t( const int fd, - const mailbag_factory_t * const factory ) : - courier_t( fd, factory ) - { - } - - virtual mailbag_t *receive( void ); - virtual int send( mailbag_t *bag ); -}; - - -// ************************************************************************** -// TAG( prefix_courier_factory_t ) -// ************************************************************************** -class prefix_courier_factory_t : public courier_factory_t -{ -public: - courier_t *courier( int fd, - const mailbag_factory_t * const factory ) const - { - return new prefix_courier_t( fd, factory ); - } -}; - - -#endif /*__PREFIX_COURIER_H__*/ diff --git a/src/plugins/sched/maui/receptionist.cpp b/src/plugins/sched/maui/receptionist.cpp deleted file mode 100644 index de971fde1ad..00000000000 --- a/src/plugins/sched/maui/receptionist.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/*****************************************************************************\ - * receptionist.cpp - connection manager for scheduling plugins. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#include <stdio.h> -#include <unistd.h> -#include <sys/socket.h> -#include <string.h> -#include <errno.h> - -extern "C" { -# include "src/common/log.h" -} - -#include "receptionist.h" -#include "agent.h" - -// ************************************************************************** -// TAG( receptionist_t ) -// ************************************************************************** -receptionist_t::receptionist_t( const courier_factory_t * const courier_factory, - const mailbag_factory_t * const mailbag_factory, - const struct sockaddr_in *addr ) : - m_courier_factory( courier_factory ), - m_mailbag_factory( mailbag_factory ), - m_addr( addr ) -{ - int dummy = 1; - int rc; - - // * Open a socket. - if ( ( m_sock = socket( PF_INET, SOCK_STREAM, 0 ) ) < 0 ) { - throw strerror( errno ); - } - - // * - // Bind the socket to the given address and set it to close immediately - // on error or when released. Either of these operations should close - // the socket if it fails. - // * - try { - if ( bind( m_sock, - (const sockaddr *) m_addr, - sizeof( struct sockaddr_in ) ) < 0 ) { - throw strerror( errno ); - } - - if ( setsockopt( m_sock, - SOL_SOCKET, - SO_REUSEADDR, - &dummy, sizeof( dummy ) ) < 0 ) { - throw strerror( errno ); - } - - - } catch ( const char *msg ) { - // * Close the socket and then propagate the exception upward. - (void) close( m_sock ); - throw msg; - } -} - - -// ************************************************************************** -// TAG( listen ) -// ************************************************************************** -int -receptionist_t::listen( void ) -{ - struct sockaddr_in caller; - socklen_t caller_len; - int accepted; - agent_t *agent; - - if ( ::listen( m_sock, 5 ) == -1 ) return -1; - - while ( 1 ) { - - // * Wait for a connection. - if ( ( accepted = accept( m_sock, - (sockaddr *) &caller, - &caller_len ) ) < 0 ) { - if ( errno != EINTR ) { - error( "Wiki: accept() failed" ); - return -1; - } - break; - } - - // * Build an agent to handle this connection. - agent = new agent_t( this, - m_courier_factory->courier( accepted, - m_mailbag_factory ), - m_mailbag_factory ); - - // * Start the agent. - if ( agent->start() < 0 ) { - // * Panic, or something. - error( "Wiki: starting the agent failed" ); - } - - // * - // N.B. The agent deletes itself when its thread exits; - // it is not leaked from here, as casual inspection suggests. - // * - - } - - return 0; -} diff --git a/src/plugins/sched/maui/receptionist.h b/src/plugins/sched/maui/receptionist.h deleted file mode 100644 index 57e30cdfd4a..00000000000 --- a/src/plugins/sched/maui/receptionist.h +++ /dev/null @@ -1,114 +0,0 @@ -/*****************************************************************************\ - * receptionist.h - connection manager for passive scheduler plugins. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#ifndef __SLURM_PLUGIN_RECEPTIONIST_H__ -#define __SLURM_PLUGIN_RECEPTIONIST_H__ - -#include <netinet/in.h> - -#include "courier.h" - -// ************************************************************************** -// TAG( receptionist_t ) -// -// Objects of this class listen on the given socket and spawn agent_t objects -// to deal with the actual connections. You need only one of these objects -// per incoming socket. -// -// The courier_factor_t component produces an appropriate courier which the -// agent uses to speak the appropriate packaging protocol on the wire. -// -// The mailbag_factory_t component produces mailbags. The receptionist does -// not use this directly, but a mailbag_factory must be supplied to the -// courier, and hence to the courier's factory. The courier -// knows how to frame a logical message for transport over the wire. -// ************************************************************************** -class receptionist_t -{ -protected: - const courier_factory_t * const m_courier_factory; - const mailbag_factory_t * const m_mailbag_factory; - const struct sockaddr_in *m_addr; - int m_sock; - -public: - - // ************************************************************************ - // TAG( receptionist_t ) - // ************************************************************************ - // DESCRIPTION - // Create a receptionist to listen on the socket. - // - // ARGUMENTS - // courier_factory (in, owns) - An appropriate factory for the type of - // courier needed to frame/unframe a set of messages according - // to the protocol spoken on this wire. - // mailbag_factory_t (in, owns) - An appropriate factory for the type of - // content encodings arriving on this wire. - // - // SIDE EFFECTS - // None. - // - // ************************************************************************ - receptionist_t( const courier_factory_t * const courier_factory, - const mailbag_factory_t * const mailbag_factory, - const struct sockaddr_in *addr ); - - ~receptionist_t() - { - (void) close( m_sock ); - delete m_courier_factory; - } - - - // ************************************************************************ - // TAG( listen ) - // ************************************************************************ - // DESCRIPTION - // Begin listening on the connection. - // - // ARGUMENTS - // None. - // - // RETURNS - // SLURM return code. - // - // ************************************************************************ - virtual int listen( void ); -}; - -#endif /*__SLURM_PLUGIN_RECEPTIONIST_H__*/ diff --git a/src/plugins/sched/maui/wiki/Makefile.am b/src/plugins/sched/maui/wiki/Makefile.am deleted file mode 100644 index 9fd68d6e96e..00000000000 --- a/src/plugins/sched/maui/wiki/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -# Makefile for sched/wiki plugins - -AUTOMAKE_OPTIONS = foreign - -CXXFLAGS = -fexceptions - -PLUGIN_FLAGS = -module -avoid-version --export-dynamic - -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common - -wiki_src = ../agent.cpp \ - ../agent.h \ - ../comparator.h \ - ../condition.h \ - ../courier.cpp \ - ../courier.h \ - ../dstring.cpp \ - ../dstring.h \ - ../mailbag.h \ - ../message.h \ - ../prefix_courier.cpp \ - ../prefix_courier.h \ - ../receptionist.cpp \ - ../receptionist.h \ - wiki_canceljob.cpp \ - wiki_command.cpp \ - wiki_mailbag.cpp \ - wiki_mailbag.h \ - wiki_message.cpp \ - wiki_message.h \ - wiki_parser.cpp \ - wiki_parser.h \ - wiki_request.cpp \ - wiki_response.cpp \ - wiki_startjob.cpp \ - wiki_status.cpp \ - wiki_wrapper.cpp - - -pkglib_LTLIBRARIES = sched_wiki.la -sched_wiki_la_SOURCES = $(wiki_src) -sched_wiki_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) -sched_wiki_la_LIBADD = -lstdc++ diff --git a/src/plugins/sched/maui/wiki/Makefile.in b/src/plugins/sched/maui/wiki/Makefile.in deleted file mode 100644 index 56f5eddfd67..00000000000 --- a/src/plugins/sched/maui/wiki/Makefile.in +++ /dev/null @@ -1,648 +0,0 @@ -# Makefile.in generated by automake 1.9 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 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 sched/wiki plugins - -SOURCES = $(sched_wiki_la_SOURCES) - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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 = : -host_triplet = @host@ -subdir = src/plugins/sched/maui/wiki -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/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_bluegene.m4 \ - $(top_srcdir)/auxdir/x_ac_debug.m4 \ - $(top_srcdir)/auxdir/x_ac_elan.m4 \ - $(top_srcdir)/auxdir/x_ac_federation.m4 \ - $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ - $(top_srcdir)/auxdir/x_ac_gtk.m4 \ - $(top_srcdir)/auxdir/x_ac_munge.m4 \ - $(top_srcdir)/auxdir/x_ac_ncurses.m4 \ - $(top_srcdir)/auxdir/x_ac_pam.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_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 = -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 = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(pkglibdir)" -pkglibLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(pkglib_LTLIBRARIES) -sched_wiki_la_DEPENDENCIES = -am__objects_1 = agent.lo courier.lo dstring.lo prefix_courier.lo \ - receptionist.lo wiki_canceljob.lo wiki_command.lo \ - wiki_mailbag.lo wiki_message.lo wiki_parser.lo wiki_request.lo \ - wiki_response.lo wiki_startjob.lo wiki_status.lo \ - wiki_wrapper.lo -am_sched_wiki_la_OBJECTS = $(am__objects_1) -sched_wiki_la_OBJECTS = $(am_sched_wiki_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/slurm -depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(sched_wiki_la_SOURCES) -DIST_SOURCES = $(sched_wiki_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTHD_CFLAGS = @AUTHD_CFLAGS@ -AUTHD_LIBS = @AUTHD_LIBS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BG_INCLUDES = @BG_INCLUDES@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CMD_LDFLAGS = @CMD_LDFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = -fexceptions -CYGPATH_W = @CYGPATH_W@ -DEBUG_MODULES_FALSE = @DEBUG_MODULES_FALSE@ -DEBUG_MODULES_TRUE = @DEBUG_MODULES_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ELAN_LIBS = @ELAN_LIBS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ -FFLAGS = @FFLAGS@ -GTK2_CFLAGS = @GTK2_CFLAGS@ -GTK2_LIBS = @GTK2_LIBS@ -HAVEPKGCONFIG = @HAVEPKGCONFIG@ -HAVE_AIX = @HAVE_AIX@ -HAVE_AIX_FALSE = @HAVE_AIX_FALSE@ -HAVE_AIX_PROCTRACK_FALSE = @HAVE_AIX_PROCTRACK_FALSE@ -HAVE_AIX_PROCTRACK_TRUE = @HAVE_AIX_PROCTRACK_TRUE@ -HAVE_AIX_TRUE = @HAVE_AIX_TRUE@ -HAVE_ELAN = @HAVE_ELAN@ -HAVE_ELAN_FALSE = @HAVE_ELAN_FALSE@ -HAVE_ELAN_TRUE = @HAVE_ELAN_TRUE@ -HAVE_FEDERATION = @HAVE_FEDERATION@ -HAVE_FEDERATION_FALSE = @HAVE_FEDERATION_FALSE@ -HAVE_FEDERATION_TRUE = @HAVE_FEDERATION_TRUE@ -HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ -HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ -HAVE_NUMA_FALSE = @HAVE_NUMA_FALSE@ -HAVE_NUMA_TRUE = @HAVE_NUMA_TRUE@ -HAVE_PAM_FALSE = @HAVE_PAM_FALSE@ -HAVE_PAM_TRUE = @HAVE_PAM_TRUE@ -HAVE_SCHED_SETAFFINITY_FALSE = @HAVE_SCHED_SETAFFINITY_FALSE@ -HAVE_SCHED_SETAFFINITY_TRUE = @HAVE_SCHED_SETAFFINITY_TRUE@ -HAVE_SGI_JOB_FALSE = @HAVE_SGI_JOB_FALSE@ -HAVE_SGI_JOB_TRUE = @HAVE_SGI_JOB_TRUE@ -HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ -HAVE_SOME_CURSES_FALSE = @HAVE_SOME_CURSES_FALSE@ -HAVE_SOME_CURSES_TRUE = @HAVE_SOME_CURSES_TRUE@ -HAVE_UNSETENV_FALSE = @HAVE_UNSETENV_FALSE@ -HAVE_UNSETENV_TRUE = @HAVE_UNSETENV_TRUE@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_DIRS = @INSTALL_DIRS@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIB_LDFLAGS = @LIB_LDFLAGS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@ -MUNGE_LDFLAGS = @MUNGE_LDFLAGS@ -MUNGE_LIBS = @MUNGE_LIBS@ -NCURSES = @NCURSES@ -NUMA_LIBS = @NUMA_LIBS@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PAM_LIBS = @PAM_LIBS@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PROCTRACKDIR = @PROCTRACKDIR@ -PROJECT = @PROJECT@ -PTHREAD_CC = @PTHREAD_CC@ -PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ -RELEASE = @RELEASE@ -SEMAPHORE_LIBS = @SEMAPHORE_LIBS@ -SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SLURMCTLD_PORT = @SLURMCTLD_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_VERSION = @SLURM_VERSION@ -SO_LDFLAGS = @SO_LDFLAGS@ -SSL_CPPFLAGS = @SSL_CPPFLAGS@ -SSL_LDFLAGS = @SSL_LDFLAGS@ -SSL_LIBS = @SSL_LIBS@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WITH_AUTHD_FALSE = @WITH_AUTHD_FALSE@ -WITH_AUTHD_TRUE = @WITH_AUTHD_TRUE@ -WITH_GNU_LD_FALSE = @WITH_GNU_LD_FALSE@ -WITH_GNU_LD_TRUE = @WITH_GNU_LD_TRUE@ -WITH_MUNGE_FALSE = @WITH_MUNGE_FALSE@ -WITH_MUNGE_TRUE = @WITH_MUNGE_TRUE@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -AUTOMAKE_OPTIONS = foreign -PLUGIN_FLAGS = -module -avoid-version --export-dynamic -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common -wiki_src = ../agent.cpp \ - ../agent.h \ - ../comparator.h \ - ../condition.h \ - ../courier.cpp \ - ../courier.h \ - ../dstring.cpp \ - ../dstring.h \ - ../mailbag.h \ - ../message.h \ - ../prefix_courier.cpp \ - ../prefix_courier.h \ - ../receptionist.cpp \ - ../receptionist.h \ - wiki_canceljob.cpp \ - wiki_command.cpp \ - wiki_mailbag.cpp \ - wiki_mailbag.h \ - wiki_message.cpp \ - wiki_message.h \ - wiki_parser.cpp \ - wiki_parser.h \ - wiki_request.cpp \ - wiki_response.cpp \ - wiki_startjob.cpp \ - wiki_status.cpp \ - wiki_wrapper.cpp - -pkglib_LTLIBRARIES = sched_wiki.la -sched_wiki_la_SOURCES = $(wiki_src) -sched_wiki_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) -sched_wiki_la_LIBADD = -lstdc++ -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .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 \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/sched/maui/wiki/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/plugins/sched/maui/wiki/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 -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ - else :; fi; \ - done - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ - 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 -sched_wiki.la: $(sched_wiki_la_OBJECTS) $(sched_wiki_la_DEPENDENCIES) - $(CXXLINK) -rpath $(pkglibdir) $(sched_wiki_la_LDFLAGS) $(sched_wiki_la_OBJECTS) $(sched_wiki_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agent.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/courier.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dstring.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prefix_courier.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/receptionist.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wiki_canceljob.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wiki_command.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wiki_mailbag.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wiki_message.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wiki_parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wiki_request.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wiki_response.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wiki_startjob.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wiki_status.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wiki_wrapper.Plo@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@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 $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@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) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@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 $@ $< - -agent.lo: ../agent.cpp -@am__fastdepCXX_TRUE@ if $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT agent.lo -MD -MP -MF "$(DEPDIR)/agent.Tpo" -c -o agent.lo `test -f '../agent.cpp' || echo '$(srcdir)/'`../agent.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/agent.Tpo" "$(DEPDIR)/agent.Plo"; else rm -f "$(DEPDIR)/agent.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../agent.cpp' object='agent.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o agent.lo `test -f '../agent.cpp' || echo '$(srcdir)/'`../agent.cpp - -courier.lo: ../courier.cpp -@am__fastdepCXX_TRUE@ if $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT courier.lo -MD -MP -MF "$(DEPDIR)/courier.Tpo" -c -o courier.lo `test -f '../courier.cpp' || echo '$(srcdir)/'`../courier.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/courier.Tpo" "$(DEPDIR)/courier.Plo"; else rm -f "$(DEPDIR)/courier.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../courier.cpp' object='courier.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o courier.lo `test -f '../courier.cpp' || echo '$(srcdir)/'`../courier.cpp - -dstring.lo: ../dstring.cpp -@am__fastdepCXX_TRUE@ if $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dstring.lo -MD -MP -MF "$(DEPDIR)/dstring.Tpo" -c -o dstring.lo `test -f '../dstring.cpp' || echo '$(srcdir)/'`../dstring.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/dstring.Tpo" "$(DEPDIR)/dstring.Plo"; else rm -f "$(DEPDIR)/dstring.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../dstring.cpp' object='dstring.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dstring.lo `test -f '../dstring.cpp' || echo '$(srcdir)/'`../dstring.cpp - -prefix_courier.lo: ../prefix_courier.cpp -@am__fastdepCXX_TRUE@ if $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT prefix_courier.lo -MD -MP -MF "$(DEPDIR)/prefix_courier.Tpo" -c -o prefix_courier.lo `test -f '../prefix_courier.cpp' || echo '$(srcdir)/'`../prefix_courier.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/prefix_courier.Tpo" "$(DEPDIR)/prefix_courier.Plo"; else rm -f "$(DEPDIR)/prefix_courier.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../prefix_courier.cpp' object='prefix_courier.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o prefix_courier.lo `test -f '../prefix_courier.cpp' || echo '$(srcdir)/'`../prefix_courier.cpp - -receptionist.lo: ../receptionist.cpp -@am__fastdepCXX_TRUE@ if $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT receptionist.lo -MD -MP -MF "$(DEPDIR)/receptionist.Tpo" -c -o receptionist.lo `test -f '../receptionist.cpp' || echo '$(srcdir)/'`../receptionist.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/receptionist.Tpo" "$(DEPDIR)/receptionist.Plo"; else rm -f "$(DEPDIR)/receptionist.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../receptionist.cpp' object='receptionist.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o receptionist.lo `test -f '../receptionist.cpp' || echo '$(srcdir)/'`../receptionist.cpp - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && 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)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$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: - $(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 -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-info: install-info-am - -install-man: - -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-info-am uninstall-pkglibLTLIBRARIES - -.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-exec \ - install-exec-am install-info install-info-am install-man \ - install-pkglibLTLIBRARIES 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-info-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/sched/maui/wiki/wiki_canceljob.cpp b/src/plugins/sched/maui/wiki/wiki_canceljob.cpp deleted file mode 100644 index fbd4fdc4bed..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_canceljob.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/*****************************************************************************\ - * wiki_canceljob.cpp - Wiki command to stop a job. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#include <string.h> - -extern "C" { -# include "src/common/log.h" -# include "src/slurmctld/sched_plugin.h" -} - -#include "wiki_message.h" -#include "wiki_parser.h" - -// ************************************************************************** -// TAG( wiki_canceljob_t ) -// ************************************************************************** -wiki_canceljob_t::wiki_canceljob_t( char *data, size_t len ) : - wiki_command_t( data, len, wiki_message_t::CANCELJOB ) -{ - ListIterator j; - wiki_relation_t *relation; - char *reason; - - // * Get the reason. - relation = (wiki_relation_t *) list_next( m_arg_iterator ); - if ( relation == NULL ) - throw "malformed command (type missing)"; - if ( strcmp( relation->name(), "TYPE" ) != 0 ) - throw "malformed command (expected TYPE=<type>)"; - j = list_iterator_create( relation->values() ); - - reason = (char *) list_next( j ); - list_iterator_destroy( j ); - if ( reason && strcmp( reason, "ADMIN" ) == 0 ) { - m_reason = ADMIN; - } else if ( reason && strcmp( reason, "WALLCLOCK" ) == 0 ) { - m_reason = WALLCLOCK; - } else { - throw "unknown cancel mode"; - } -} - - -// ************************************************************************** -// TAG( action ) -// ************************************************************************** -message_t * -wiki_canceljob_t::action( void ) -{ - u_int32_t id = (u_int32_t) atol( m_jobid ); - int rc; - verbose( "Wiki canceling job %s", m_jobid ); - rc = sched_cancel_job( id ); - return new wiki_status_t( ( rc == SLURM_SUCCESS ) ? 0 : -rc ); -} diff --git a/src/plugins/sched/maui/wiki/wiki_command.cpp b/src/plugins/sched/maui/wiki/wiki_command.cpp deleted file mode 100644 index 6c89ca624c8..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_command.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/*****************************************************************************\ - * wiki_command.cpp - generic Wiki command (as opposed to request for info). - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * 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 "wiki_message.h" - -wiki_command_t::wiki_command_t( char *data, size_t len, int type ) : - wiki_message_t( data, len, type ) -{ - ListIterator j; - wiki_relation_t *relation; - char *node; - - // * Skip over "CMD=STARTJOB". - m_arg_iterator = list_iterator_create( m_expr.relations() ); - (void) list_next( m_arg_iterator ); - - // * Get the job ID. - relation = (wiki_relation_t *) list_next( m_arg_iterator ); - if ( relation == NULL ) - throw "malformed command (missing argument)"; - if ( strcmp( relation->name(), "ARG" ) != 0 ) - throw "malformed command (expected ARG=<job>)"; - j = list_iterator_create( relation->values() ); - m_jobid = (char *) list_next( j ); - if ( m_jobid == NULL ) - throw "missing job ID"; - list_iterator_destroy( j ); -} - - diff --git a/src/plugins/sched/maui/wiki/wiki_mailbag.cpp b/src/plugins/sched/maui/wiki/wiki_mailbag.cpp deleted file mode 100644 index a54e22f3f23..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_mailbag.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/*****************************************************************************\ - * wiki_mailbag.cpp - logical message holder for Wiki messages. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#include <string.h> -#include "wiki_mailbag.h" -#include "wiki_message.h" - - -// ************************************************************************** -// TAG( message ) -// ************************************************************************** -message_t * -wiki_mailbag_t::message( mailbag_iterator_t *base_it ) -{ - char *cmd, *text; - size_t text_len; - wiki_mailbag_iterator_t *it = (wiki_mailbag_iterator_t *) base_it; - static const char marker[] = "CMD="; - - // * Verify that the iterator refers to this instance. - if ( it->m_bag != this ) { - debug3( "Wiki mailbag: misdirected iterator" ); - return NULL; - } - - // * - // Now we can peek into the iterator to find out what we - // need to know. - // * - if ( it->m_pos == NULL ) { - debug3( "Wiki mailbag: malformed iterator" ); - return NULL; - } - text_len = m_str.length(); - - // * Find the start of the command signalled by "CMD=". - if ( ( text = strstr( it->m_pos, marker ) ) == NULL ) { - debug( "Wiki mailbag: can't find start of payload" ); - return NULL; - } - cmd = text + strlen( marker ); - text_len -= (text - it->m_pos); - - // * - // Can't do STATUS because it doesn't have a CMD= prefix. - // Even though we won't receive any, there's nothing in the - // message API that says you can't call this on an outgoing - // mailbox. - // * - if ( strncmp( cmd, "GETNODES", 8 ) == 0 ) { - return new wiki_getnodes_t( text, text_len ); - } else if ( strncmp( cmd, "GETJOBS", 7 ) == 0 ) { - return new wiki_getjobs_t( text, text_len ); - } else if ( strncmp( cmd, "STARTJOB", 8 ) == 0 ) { - return new wiki_startjob_t( text, text_len ); - } else if ( strncmp( cmd, "CANCELJOB", 9 ) == 0 ) { - return new wiki_canceljob_t( text, text_len ); - } else { - return NULL; - } -} - - -// ************************************************************************** -// TAG( add ) -// ************************************************************************** -int wiki_mailbag_t::add( message_t *msg ) -{ - // * Wiki mailbags can only hold one message. - if ( m_num_items >= 1 ) { - return -1; - } - - // * Add the message text and then get rid of the message. - m_str.append( msg->text(), msg->text_length() ); - delete msg; - m_num_items++; - return 0; -} - diff --git a/src/plugins/sched/maui/wiki/wiki_mailbag.h b/src/plugins/sched/maui/wiki/wiki_mailbag.h deleted file mode 100644 index 06c589db62b..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_mailbag.h +++ /dev/null @@ -1,194 +0,0 @@ -/*****************************************************************************\ - * wiki_mailbag.h - Wiki implementation of mailbag_t. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * 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 __WIKI_MAILBAG_H__ -#define __WIKI_MAILBAG_H__ - -extern "C" { -# include "src/common/log.h" -} - -#include "../mailbag.h" -#include "wiki_message.h" -#include "../dstring.h" - -// ************************************************************************** -// TAG( wiki_mailbag_t ) -// -// The Wiki implementation of the mailbag. There's only one message per -// bag in the Wiki world, so a lot of this is overkill. -// ************************************************************************** -class wiki_mailbag_t : public mailbag_t -{ -protected: - dstring_t m_str; - -public: - - wiki_mailbag_t() : - mailbag_t(), - m_str() - { - } - - wiki_mailbag_t( char *buf, size_t len ) : - m_str( buf, len ) - { - debug3( "wiki_mailbag: created with contents (%s)", m_str.s() ); - } - - // ************************************************************** - // TAG( wiki_mailbag_iterator_t ) - // - // The (largely useless) iterator for the Wiki mailbag. - // There's only one message in a Wiki mailbag. - // ************************************************************* - class wiki_mailbag_iterator_t : public mailbag_iterator_t - { - public: - friend class wiki_mailbag_t; - - protected: - wiki_mailbag_t *m_bag; // The mailbag. - char *m_pos; // Position in mailbag buffer. - - public: - wiki_mailbag_iterator_t( mailbag_t *bag ) : - mailbag_iterator_t( bag ), - m_pos( NULL ) - { - m_bag = (wiki_mailbag_t *) bag; - } - - void first( void ) - { - // * - // m_pos has only three normal values. It's - // either NULL, meaning it's uninitialized. - // Or it's a pointer to the text of the - // mailbag. Or it's (char *) -1, meaning it's - // gone off the end. This last value is so we - // can distinguish between the uninitialized - // and exhausted states of the iterator, if - // that's important. - // * - m_pos = (char *) m_bag->text(); - } - - void next( void ) - { - // * - // If it's NULL, keep it NULL because it's not - // initialized. - // * - - if ( m_pos == m_bag->text() ) - m_pos = (char *) -1; - } - - bool at_end( void ) - { - // * - // This interprets at_end() strictly. It - // returns true only if the iterator has truly - // gone off the end, not merely if the - // iterator is not currently dereferenceable. - // This may pose problems. - // * - return ( m_pos == (char *) -1 ); - } - - void *current( void ) - { - // * - // It will either be a valid pointer, or NULL, - // or the sentinel. Anything but the sentinel - // is a valid return value. - // * - if ( m_pos != (char *) -1 ) return m_pos; - } - - int type( void ); - }; - - // * wiki_mailbag_t resumes ... - - mailbag_iterator_t *iterator( void ) - { - return new wiki_mailbag_iterator_t( this ); - } - - message_t *message( mailbag_iterator_t *it ); - - bool is_full( void ) const - { - return m_num_items >= 1; - } - - int add( message_t *msg ); - char *text( void ) { return m_str.s(); } - size_t text_length( void ) { return m_str.length(); } -}; - - - -// ************************************************************************ -// TAG( wiki_mailbag_factory_t ) -// ************************************************************************ -class wiki_mailbag_factory_t : public mailbag_factory_t -{ -public: - - mailbag_t *mailbag( void *data, size_t len ) const - { - return new wiki_mailbag_t( (char *) data, len ); - } - - mailbag_t *mailbag( void ) const - { - return new wiki_mailbag_t; - } - - const int num_message_types( void ) const - { - return wiki_message_t::NUM_MESSAGE_TYPES; - } - -}; - - -#endif /*__WIKI_MAILBAG_H__*/ diff --git a/src/plugins/sched/maui/wiki/wiki_message.cpp b/src/plugins/sched/maui/wiki/wiki_message.cpp deleted file mode 100644 index 0608ba56d63..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_message.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/*****************************************************************************\ - * wiki_message.cpp - base class for all Wiki messages, see wiki_message.h - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * 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 <ctype.h> -#include <string.h> - -extern "C" { -# include "src/slurmctld/sched_plugin.h" -} - -#include "wiki_message.h" - - -// ************************************************************************ -// TAG( atotime ) -// ************************************************************************ -// DESCRIPTION -// Converts a string of digits representing a time epoch into a time_t -// value. We do it this way because the size of time_t is somewhat -// nondeterministic. -// -// ARGUMENTS -// str (in) - A string of (presumably) digits. The prefix of the string -// consisting of base-10 digits is converted to its unsigned integer -// value and placed in a data object of type <time_t>. -// -// RETURNS -// The time epoch, or 0 if the string does not contain a prefix of base -// 10 digits. Note that 0 will also be returned if the string validly -// contains "0" as the epoch. -// -// ASSUMPTIONS -// No explicit test is made for the suitability of the input. Zero may -// be a valid function value, or it may indicate an error. -// -// SIDE EFFECTS -// None. -// -// ************************************************************************ -const time_t wiki_message_t::atotime( char * const str ) -{ - char *p; - time_t time = 0; - - for ( p = str; *p && isdigit( *p ); ++p ) { - time = time * 10 + ( *p - '0' ); - } - - return time; -} diff --git a/src/plugins/sched/maui/wiki/wiki_message.h b/src/plugins/sched/maui/wiki/wiki_message.h deleted file mode 100644 index 32d9257fbb4..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_message.h +++ /dev/null @@ -1,399 +0,0 @@ -/*****************************************************************************\ - * wiki_message.h - base class for all Wiki messages, coming or going. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * 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 __WIKI_MESSAGE_H__ -#define __WIKI_MESSAGE_H__ - -#include <sys/types.h> -#include <string.h> - -extern "C" { -# include "list.h" -# include "src/common/log.h" -# include "src/common/xmalloc.h" -# include "src/common/xstring.h" -# include "src/slurmctld/sched_plugin.h" -} - -#include "../message.h" -#include "wiki_parser.h" -#include "../dstring.h" -#include "../condition.h" - -// * -// -// Inheritance map. The significant similarity in the procedure for -// responding to GETJOBS and GETNODES commands ("requests") suggested -// centralizing their code into an intermediate abstract object. -// -// message_t (abstract) -// + -// | -// +---- wiki_message_t (abstract) -// | -// +---- wiki_request_t (abstract) -// | | -// | +---- wiki_getnodes_t -// | | -// | +---- wiki_getjobs_t -// | -// +---- wiki_command_t -// | + -// | | -// | +---- wiki_startjob_t -// | | -// | +---- wiki_canceljob_t -// | -// +---- wiki_status_t -// | -// +---- wiki_response_t -// -// * - - - -// ************************************************************************** -// TAG( wiki_message_t ) -// -// Base class for all Wiki messages, both incoming and outgoing. -// ************************************************************************** -class wiki_message_t : public message_t -{ -public: - - // * - // Message types, to be used as indices for the message factory. - // * - static const int GETNODES = 0; - static const int GETJOBS = 1; - static const int STARTJOB = 2; - static const int CANCELJOB = 3; - static const int STATUS = 4; - - static const int NUM_MESSAGE_TYPES = 5; - - -protected: - char * m_text; - size_t m_text_len; - wiki_expression_t m_expr; - time_t m_epoch; - -public: - wiki_message_t( char *data, size_t len, int type ) : - message_t( type ), - m_text( data ), - m_text_len( len ), - m_expr( data, len ), - m_epoch( 0 ) - { - } - - virtual ~wiki_message_t() - { - } - - virtual message_t *action( void ) = 0; - - virtual char *text( void ) { return m_text; } - virtual size_t text_length( void ) { return m_text_len; } - -protected: - const time_t atotime( char * const str ); -}; - - -// ************************************************************************** -// TAG( wiki_request_t ) -// -// A general message to encapsulate requests made by the scheduler for -// information. In order to satisfy that request, some list of data -// must be obtained from the SLURM controller, filtered according to -// criteria contained in the Wiki request, and then a response message -// is created with the resulting list of controller data. Whether -// this uses node data or job data is determined by the specialized -// classes, wiki_getnodes_t wiki_getjobs_t. -// -// Wiki GETJOBS and GETNODES messages fall into this category. -// ************************************************************************** -class wiki_request_t : public wiki_message_t -{ -public: - friend class wiki_response_t; - -protected: - // * - // Convert between Wiki and SLURM field names. This is filled - // in by the specialized constructor. - // * - struct field_name_map { - char *wiki_field; - char *slurm_field; - }; - struct field_name_map *m_field_map; - - // * - // m_match - Expression for selecting nodes from the global - // list according to some criteria specified by the - // scheduler. Wiki requires at least selection by - // modification time. - // m_list_retriever - Function for retrieving the appropriate - // object list from the controller. - // m_name_accessor - Accessor for retrieving the primary - // key for objects in the object list. - // m_fields - Argv-like list of SLURM field names for the - // underlying object, that will be reported back to the - // scheduler. I.e., not everything we know about is - // interesting to the scheduler. - // * - condition_t *m_match; - sched_objlist_fn_t m_list_retriever; - sched_accessor_fn_t m_name_accessor; - const char **m_fields; - -public: - - // ************************************************************** - // TAG( wiki_request_t ) - // ************************************************************** - // DESCRIPTION - // Constructor for request. - // - // ARGUMENTS - // data, len, type - arguments for wiki_message_t. - // epoch_field (in) - field name for the epoch (modification - // time) in whatever underlying object list we will get - // from the controller in order to satisfy this request. - // name_field (in) - field name for the primary ID for items - // in the underlying controller object list. This should - // be the first entry in the "fields" to retrieve from - // the controller. - // list_retriever (in) - function for retrieving the - // appropriate object list from the controller (either the - // node list or the job queue). - // - // ************************************************************** - wiki_request_t( char *data, - size_t len, - int type, - char *epoch_field, - char *name_field, - sched_objlist_fn_t list_retriever ); - - virtual ~wiki_request_t() - { - delete m_match; - } - - message_t *action( void ); - - virtual char * const map_enum( char * const field, - char * const val ) const = 0; - -private: - - void compose_response( wiki_request_t *request, - dstring_t &str, - int32_t idx, - char * const * const fields, - sched_obj_list_t obj_data ); - - - const char * const slurm2wiki( char * const field ) const; - - char * postproc_string( char * const field, - const char * const val ); - - static char *colonify_commas( const char * const val ); - -}; - - -// ************************************************************************** -// TAG( wiki_getnodes_t ) -// -// The Wiki GETNODES message. -// ************************************************************************** -class wiki_getnodes_t : public wiki_request_t -{ - -public: - wiki_getnodes_t( char *data, size_t len ); - char * const map_enum( char * const field, char * const val ) const; -}; - - - -// ************************************************************************** -// TAG( wiki_getjobs_t ) -// -// The Wiki GETJOBS message. -// ************************************************************************** -class wiki_getjobs_t : public wiki_request_t -{ -public: - wiki_getjobs_t( char *data, size_t len ); - char * const map_enum( char * const field, char * const val ) const; -}; - - - -// ************************************************************************** -// TAG( wiki_command_t ) -// -// A Wiki command to alter the runnability of a job. This includes -// STARTJOB and CANCELJOB. -// ************************************************************************** -class wiki_command_t : public wiki_message_t -{ -protected: - char *m_jobid; - ListIterator m_arg_iterator; - -public: - wiki_command_t( char *data, size_t len, int type ); - - virtual ~wiki_command_t() - { - if ( m_arg_iterator ) - list_iterator_destroy( m_arg_iterator ); - } -}; - - -// ************************************************************************** -// TAG( wiki_startjob_t ) -// -// The Wiki STARTJOB message. -// ************************************************************************** -class wiki_startjob_t : public wiki_command_t -{ -protected: - - List m_nodelist; - -public: - wiki_startjob_t( char *data, size_t len ); - ~wiki_startjob_t() - { - list_destroy( m_nodelist ); - } - - message_t *action( void ); -}; - - - - -// ************************************************************************** -// TAG( wiki_canceljob_t ) -// -// The Wiki CANCELJOB message. -// ************************************************************************** -class wiki_canceljob_t : public wiki_command_t -{ -public: - - enum reason_t { - ADMIN, - WALLCLOCK - }; - -protected: - - reason_t m_reason; - -public: - wiki_canceljob_t( char *data, size_t len ); - - message_t *action( void ); -}; - -// ************************************************************************** -// TAG( wiki_status_t ) -// -// The return message from a Wiki command, giving either the requested -// data (wiki_response_t) or the completion status of a command. -// ************************************************************************** -class wiki_status_t : public wiki_message_t -{ -protected: - dstring_t m_str; - -public: - wiki_status_t( int status, char * const msg = NULL ); - - virtual ~wiki_status_t() - { - } - - virtual message_t *action( void ) { return NULL; } - char *text( void ) { return m_str.s(); } - size_t text_length( void ) { return m_str.length(); } - -protected: - void prefix_with_checksum( void ); - -private: - void des( u_int32_t *lword, u_int32_t *irword ) const; - const u_int16_t compute_crc( u_int16_t crc, u_int8_t onch ) const; - void checksum( dstring_t &sum, const char * const key ); - const char * get_user_name( void ) const; -}; - - -// ************************************************************************** -// TAG( wiki_response_t ) -// -// A Wiki response to a wiki_request_t message. A response contains the -// information that the request asked for. -// ************************************************************************** -class wiki_response_t : public wiki_status_t -{ -public: - wiki_response_t( wiki_request_t *request, - char * const * const fields, - int32_t obj_count, - int32_t obj_hits, - sched_obj_list_t obj_data, - bool *matches ); - -}; - - - -#endif /*__WIKI_MESSAGE_H__*/ diff --git a/src/plugins/sched/maui/wiki/wiki_parser.cpp b/src/plugins/sched/maui/wiki/wiki_parser.cpp deleted file mode 100644 index 501753aa528..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_parser.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/*****************************************************************************\ - * wiki_parser.cpp - parse resource-matching expressions from Wiki msg. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#include <stdio.h> -#include <string.h> -#include "wiki_parser.h" - -// ************************************************************************** -// TAG( wiki_expression_t ) -// ************************************************************************** -wiki_expression_t::wiki_expression_t( char *data, size_t len ) -{ - char *tail; - char *p; - - m_relations = list_create( wiki_relation_t::dtor ); - - // * Make a copy of the string so we can modify it. - if ( ( data != NULL ) && ( len > 0 ) ) { - m_raw = new char[ len + 1 ]; - strncpy( m_raw, data, len ); - m_raw[ len ] = 0; - } else { - m_raw = NULL; - return; - } - - - // * Find the space-delimited relations. - p = tail = m_raw; - while ( 1 ) { - if ( *p == 0 ) { - (void) list_append( m_relations, - new wiki_relation_t( tail ) ); - break; - } - if ( *p == ' ' ) { - *p = 0; - (void) list_append( m_relations, - new wiki_relation_t( tail ) ); - tail = p + 1; - } - ++p; - } -} - -// ************************************************************************** -// TAG( wiki_relation_t ) -// ************************************************************************** -wiki_relation_t::wiki_relation_t( char *relstr ) -{ - char *tail; - char *p; - - // * - // The input string is (or should be) a copy of the original string - // obtained off the wire. We presume we can modify it. - // * - m_raw = relstr; - - m_values = list_create( NULL ); - - // * - // Find the "=". If found, remember where it was and then - // null-terminate that prefix so we can use it as the <name> - // in a relation. - // * - m_name = NULL; - for ( tail = m_raw; *tail; ++tail ) { - if ( *tail == '=' ) { - *tail = 0; - ++tail; - m_name = m_raw; - break; - } - } - if ( m_name == NULL ) throw "malformed Wiki expression"; - - // * - // Now iteratively look for the elements in the tail. - // * - p = tail; - while ( 1 ) { - if ( *p == 0 ) { - (void) list_append( m_values, tail ); - break; - } - if ( *p == ':' ) { - *p = 0; - (void) list_append( m_values, tail ); - tail = p + 1; - } - ++p; - } -} - - -// ************************************************************************** -// TAG( wiki_relation_t::dtor ) -// ************************************************************************** -void -wiki_relation_t::dtor( void *doomed ) -{ - delete (wiki_relation_t *) doomed; -} diff --git a/src/plugins/sched/maui/wiki/wiki_parser.h b/src/plugins/sched/maui/wiki/wiki_parser.h deleted file mode 100644 index 716c25d90e8..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_parser.h +++ /dev/null @@ -1,162 +0,0 @@ -/*****************************************************************************\ - * wiki_parser.h - parse Wiki selection expressions. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-217948. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * 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 __WIKI_PARSER_H__ -#define __WIKI_PARSER_H__ - -extern "C" { -# include "src/common/list.h" -} - -// ************************************************************************** -// TAG( wiki_expression_t ) -// -// A Wiki command line, of the form -// -// NAME1=VAL[:VAL]... [NAME2=VAL[:VAL]...] ... -// -// Each space-delimited element of this input line is "relation" represented -// by the wiki_relation_t object below. -// ************************************************************************** -class wiki_expression_t -{ -protected: - List m_relations; - char *m_raw; - -public: - - // ************************************************************** - // TAG( wiki_expression_t ) - // ************************************************************** - // DESCRIPTION - // Parse the input line. - // - // ARGUMENTS - // data (in) - the input data as it came off the wire. It is - // copied here so that it can be modified in place, - // if necessary, by the parser. - // len (in) - length of input data. - // - // ************************************************************** - wiki_expression_t( char *data, size_t len ); - - ~wiki_expression_t() - { - list_destroy( m_relations ); - if ( m_raw ) delete [] m_raw; - } - - // ************************************************************** - // TAG( relations ) - // ************************************************************** - // DESCRIPTION - // Produce a list of wiki_relation_t objects that pertain to - // this Wiki expression. - // - // ARGUMENTS - // None. - // - // RETURNS - // <List> of wiki_relation_t objects. The list is owned by - // this object and should not be modified by the caller. - // - // ************************************************************** - List relations( void ) { return m_relations; } -}; - - - -// ************************************************************************** -// TAG( wiki_relation_t ) -// -// The portion of the Wiki command line that looks like -// -// NAME=VAL[:VAL]... -// -// ************************************************************************** -class wiki_relation_t -{ -public: - friend class wiki_expression_t; - -protected: - List m_values; - char *m_raw; - char *m_name; - -public: - - // ************************************************************** - // TAG( wiki_relation_t ) - // ************************************************************** - // DESCRIPTION - // Parse a Wiki relation. - // - // ARGUMENTS - // relstr (in) - The pointer to the Wiki relation. This is a - // pointer to a substring in a copy of the original - // data; the relation object may modify it, but users - // of the object shouldn't. - // - // ************************************************************** - wiki_relation_t( char *relstr ); - - ~wiki_relation_t() - { - list_destroy( m_values ); - } - - // * - // Accessors. name() returns the name in the name-value(s) - // pair expressed in this relation. values() returns a <List> - // of the values. - // * - const char * const name( void ) { return m_name; } - List values( void ) { return m_values; } - -private: - - // * - // A static destructor. Passed to the list_create() function - // as a non-C++ way of getting rid of relations when the - // expression to which they belong is destroyed. - // * - static void dtor( void *doomed ); -}; - -#endif /*__WIKI_PARSER_H__*/ diff --git a/src/plugins/sched/maui/wiki/wiki_request.cpp b/src/plugins/sched/maui/wiki/wiki_request.cpp deleted file mode 100644 index 27b43d525d7..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_request.cpp +++ /dev/null @@ -1,616 +0,0 @@ -/*****************************************************************************\ - * wiki_request - message from scheduler to ask for resource status. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#include <string.h> -#include <slurm/slurm_errno.h> - -extern "C" { -# include "src/common/log.h" -# include "src/common/xassert.h" -# include "src/slurmctld/sched_plugin.h" -} - -#include "wiki_message.h" -#include "../comparator.h" - - -// ************************************************************************** -// TAG( wiki_request_t ) -// ************************************************************************** -wiki_request_t::wiki_request_t( char *data, - size_t len, - int type, - char *epoch_field, - char *name_field, - sched_objlist_fn_t list_retriever ) : - wiki_message_t( data, len, type ), - m_list_retriever ( list_retriever ), - m_name_accessor( sched_get_accessor( name_field ) ) -{ - wiki_status_t *response = NULL; - wiki_relation_t *relation = NULL; - sched_accessor_fn_t epoch_accessor = NULL; - char *arg = NULL; - int j; - ListIterator i; - - // * First relation is always "CMD=GET<whatever>". - i = list_iterator_create( m_expr.relations() ); - (void) list_next( i ); - - // * Get ARG= term. - relation = (wiki_relation_t *) list_next( i ); - list_iterator_destroy( i ); - if ( relation == NULL ) - throw "malformed command (missing argument)"; - if ( strcmp( relation->name(), "ARG" ) != 0 ) - throw "malformed command (expected ARG=)"; - - // * First argument is always the epoch. - i = list_iterator_create( relation->values() ); - arg = (char *) list_next( i ); - if ( arg == NULL ) - throw "malformed command (missing epoch)"; - m_epoch = atotime( arg ); - - // * Get "ALL" or object list. - arg = (char *) list_next( i ); - if ( arg == NULL ) - throw "malformed command (expected object list or ALL)"; - - // * Create expression to match the epoch. - epoch_accessor = sched_get_accessor( epoch_field ); - m_match = new int_eq_comparator_t( epoch_accessor, m_epoch ); - m_match = new conjunction_t( conjunction_t::OR, - m_match, - new int_gt_comparator_t( epoch_accessor, - m_epoch ) ); - - // * If there are no specific object names given, we're done. - if ( strcmp( arg, "ALL" ) == 0 ) return; - - // * Include any names in match expression. - while ( arg ) { - m_match = new conjunction_t( conjunction_t::OR, - m_match, - new string_eq_comparator_t( m_name_accessor, - arg ) ); - arg = (char *) list_next( i ); - } - list_iterator_destroy( i ); -} - - -// ************************************************************************** -// TAG( action ) -// ************************************************************************** -message_t * -wiki_request_t::action( void ) -{ - sched_obj_list_t obj_data = NULL; - int32_t obj_count = 0; - bool *obj_matches = NULL; - int32_t obj_hits = 0; - int32_t i; - - // * - // Get object list from controller. This will be either - // the node list or the job queue. - // * - if ( ( obj_data = (*m_list_retriever)() ) == NULL ) { - error( "Wiki scheduler: can't get job queue from controller" ); - return new wiki_status_t( -1 ); - } - // * See if there is actually any data. - obj_count = sched_get_obj_count( obj_data ); - if ( obj_count == 0 ) { - debug3( "Wiki scheduler: empty resource list" ); - sched_free_obj_list( obj_data ); - return new wiki_response_t( NULL, NULL, 0, 0, NULL, NULL ); - } - - // * Allocate array of flags for matches. - obj_matches = new bool[ obj_count ]; - xassert( obj_matches ); - - // * Run the matching expression against the object list. - for ( i = 0; i < obj_count; ++i ) { - obj_matches[ i ] = m_match->eval( obj_data, i ); - if ( obj_matches[ i ] ) ++obj_hits; - } - - // * - // Create a list of matching objects to return to the scheduler. - // This must be done even if the list is empty. - // * - return new wiki_response_t( this, - (char * const *) m_fields, - obj_count, - obj_hits, - obj_data, - obj_matches ); -} - - - -// ************************************************************************** -// TAG( compose_response ) -// ************************************************************************** -void -wiki_request_t::compose_response( wiki_request_t *request, - dstring_t &str, - int32_t idx, - char * const * const fields, - sched_obj_list_t obj_data ) -{ - int i; - sched_accessor_fn_t field_accessor; - void *val; - const char *field_str; - char *val_str; - char type; - - // * - // Give primary key: name for node, job ID for job. The data - // member m_name_accessor is a pointer to a function in the - // plugin API that will do the right thing for this contoller - // object list. - // * - str += "#"; - str += (char *) (*m_name_accessor)( obj_data, idx, &type ); - str += ":"; - - for ( i = 1; fields[ i ]; ++i ) { - - // * Get the accessor for this field and call it. - field_accessor = sched_get_accessor( fields[ i ] ); - if ( ! field_accessor ) { - debug3( "Wiki request: no field accessor for %s", - fields[ i ] ); - continue; - } - val = (*field_accessor)( obj_data, idx, &type ); - - field_str = request->slurm2wiki( fields[ i ] ); - - // * - // Based on the return type of the accessor, add the - // value to the entry. Why not factor out the code - // that writes the field name? Because after getting - // the value back from the accessor and cooking it if - // necessary we might discover that we don't want to - // say anything at all about that particular field. - // If we've already written the field name then we - // have to back that out again. - // * - switch ( type ) { - - // * - // Enumerations are passed back as - // self-describing strings. This is so we - // don't have to try to keep integers - // synchronized across the plugin interface. - // There are qualitative differences in the - // meaning of enumerated values between SLURM - // and the scheduler, so we have to - // programmatically convert the meaning of an - // enumerated value into its Wiki equivalent. - // This has to happen in the plugin, not in - // the accessor, because different schedulers - // will have different ideas of, for example, - // a "job state". - // * - case 'e': - val_str = request->map_enum( fields[ i ], - (char *) val ); - if ( val_str && *val_str ) { - str += field_str; - str += "="; - str += val_str; - str += ";"; - } - break; - case 's': - if ( val && *( (char *)val ) ) { - str += field_str; - str += "="; - str += (char *) val; - str += ";"; - } - break; - case 'S': - if ( val && *( (char *)val ) ) { - char *cooked = request->postproc_string( fields[ i ], - (char *) val ); - str += field_str; - str += "="; - if ( cooked ) { - str += cooked; - xfree( cooked ); - } else { - str += (char *) val; - } - str += ";"; - } - break; - case 't': - if ( (*(time_t *) val) != (time_t) NO_VAL ) { - str += field_str; - str += "="; - str += (*(time_t *) val); - str += ";"; - } - break; - case 'i': - if ( (uint16_t) (*(int16_t *) val) != - (uint16_t) NO_VAL ) { - str += field_str; - str += "="; - str += (*(int16_t *) val); - str += ";"; - } - break; - case 'I': - if ( (*(int32_t *) val) != NO_VAL ) { - str += field_str; - str += "="; - str += (*(int32_t *) val); - str += ";"; - } - break; - - case 'u': - if ( (uint16_t) (*(uint16_t *) val) != - (uint16_t) NO_VAL ) { - str += field_str; - str += "="; - str += (*(uint16_t *) val); - str += ";"; - } - break; - case 'U': - if ( (*(uint32_t *) val) != NO_VAL ) { - str += field_str; - str += "="; - str += (*(uint32_t *) val); - str += ";"; - } - break; - default: - str += field_str; - str += "UNKNOWN"; - str += ";"; - } - } -} - - - -// ************************************************************** -// TAG( slurm2wiki ) -// ************************************************************** -// DESCRIPTION -// Map a SLURM field name into a Wiki field name. -// -// ARGUMENTS -// field (in) - The SLURM field name. -// -// RETURNS -// Pointer to the equivalent Wiki field name, or NULL if no -// equivalent exists. -// -// ************************************************************** -const char * const -wiki_request_t::slurm2wiki( char * const field ) const -{ - struct field_name_map *p; - - for ( p = m_field_map; p->slurm_field != NULL; ++p ) { - if ( strcmp( field, p->slurm_field ) == 0 ) { - return p->wiki_field; - } - } - error( "No Wiki-equivalent name for field %s", field ); - return NULL; -} - - -// ************************************************************** -// TAG( postproc_string ) -// ************************************************************** -// DESCRIPTION -// Post-process a string returned by the plugin upcall. The -// scheduling plugin returns string-valued attributes in SLURM's -// internal format. Very often this is not suitable for the -// external scheduler, in this case Wiki. This is somewhat -// different than post-processing a string-valued enumeration, -// although it may be advantageous in the future to consolidate -// those functions. -// -// ARGUMENTS -// field (in) - the SLURM object field whose string value is to -// be post-processed. -// val (in) - the value returned by the SLURM scheduler plugin -// interface. -// -// RETURNS -// An xmalloc-allocated string contained the "corrected" version -// of the input string. The caller owns this string and should -// free it with xfree when finished. -// -// ************************************************************** -char * -wiki_request_t::postproc_string( char * const field, - const char * const val ) -{ - static struct post_proc_map_struct { - char *field_name; - char * (*post_processor)( const char * const val ); - } post_proc_map [] = { - { JOB_FIELD_REQ_NODES, wiki_request_t::colonify_commas }, - { JOB_FIELD_ALLOC_NODES,wiki_request_t::colonify_commas }, - { NULL, NULL } - }; - - struct post_proc_map_struct *p; - - for ( p = post_proc_map; p->field_name != NULL; ++p ) { - if ( strcmp( p->field_name, field ) == 0 ) { - return (*(p->post_processor))( val ); - } - } - return NULL; -} - -// ************************************************************** -// TAG( colonify_commas ) -// ************************************************************** -// DESCRIPTION -// A string post-processor which replaces commas with colons. -// Most SLURM lists are comma-separated whereas most Wiki lists -// want to be colon-delimited. -// -// ARGUMENTS -// val (in) - The original string. -// -// RETURNS -// A heap-allocated string that is a copy of <val> with the -// commas translated to strings. The caller owns the returned -// string. -// -// ************************************************************** -char * -wiki_request_t::colonify_commas( const char * const val ) -{ - char *str = xstrdup( val ); - - for ( char *p = str; *p; ++p ) - if ( *p == ',' ) *p = ':'; - - return str; -} - -// ************************************************************************** -// TAG( wiki_getnodes_t ) -// ************************************************************************** -wiki_getnodes_t::wiki_getnodes_t( char *data, size_t len ) : - wiki_request_t( data, - len, - wiki_message_t::GETNODES, - NODE_FIELD_MOD_TIME, - NODE_FIELD_NAME, - sched_get_node_list ) -{ - // * - // Fields from the SLURM node structure that we will supply via Wiki. - // * - static const char *node_fields[] = { - NODE_FIELD_NAME, - NODE_FIELD_STATE, - NODE_FIELD_REAL_MEM, - NODE_FIELD_TMP_DISK, - NODE_FIELD_NUM_CPUS, - - NULL - }; - - // * - // Mapping between SLURM node field names and Wiki node field names. - // * - static struct wiki_request_t::field_name_map node_field_map[] = { - // Wiki name SLURM name - { "UPDATETIME", NODE_FIELD_MOD_TIME }, - { "STATE", NODE_FIELD_STATE }, - { "CMEMORY", NODE_FIELD_REAL_MEM }, - { "CDISK", NODE_FIELD_TMP_DISK }, - { "CPROC", NODE_FIELD_NUM_CPUS }, - - { NULL, NULL } - }; - - m_fields = node_fields; - m_field_map = node_field_map; -} - - -// ************************************************************************** -// TAG( wiki_getnodes_t::map_enum ) -// ************************************************************************** -char * const -wiki_getnodes_t::map_enum( char * const field, - char * const val ) const -{ - struct string_map { - char *slurm_label; - char *wiki_label; - }; - - static struct string_map node_state_map[] = { - { NODE_STATE_LABEL_DOWN, "Down" }, - { NODE_STATE_LABEL_UNKNOWN, "Unknown" }, - { NODE_STATE_LABEL_IDLE, "Idle" }, - { NODE_STATE_LABEL_DRAINED, "Draining" }, - { NODE_STATE_LABEL_DRAINING, "Draining" }, - { NODE_STATE_LABEL_ALLOCATED, "Running" }, - { NODE_STATE_LABEL_COMPLETING, "Busy" }, - - { NULL, NULL } - }; - - if ( strcmp( field, NODE_FIELD_STATE ) == 0 ) { - for ( struct string_map *p = node_state_map; - p->slurm_label != NULL; - ++p ) { - if ( strcmp( p->slurm_label, val ) == 0 ) { - return p->wiki_label; - } - } - return "Unknown"; - } else { - return "Unknown"; - } -} - - - -// ************************************************************************** -// TAG( wiki_getjobs_t ) -// ************************************************************************** -wiki_getjobs_t::wiki_getjobs_t( char *data, size_t len ) : - wiki_request_t( data, - len, - wiki_message_t::GETJOBS, - JOB_FIELD_LAST_ACTIVE, - JOB_FIELD_ID, - sched_get_job_list ) -{ - // * - // Fields from the SLURM job data structures that we will - // supply via Wiki. - // - // XXX - consolidate this list with the following one. - // * - static const char *job_fields[] = { - JOB_FIELD_ID, - JOB_FIELD_LAST_ACTIVE, - JOB_FIELD_STATE, - JOB_FIELD_TIME_LIMIT, - JOB_FIELD_NUM_TASKS, - JOB_FIELD_SUBMIT_TIME, - JOB_FIELD_START_TIME, - // JOB_FIELD_END_TIME, -- this confuses Maui - JOB_FIELD_USER_ID, - JOB_FIELD_GROUP_ID, - JOB_FIELD_ALLOC_NODES, - JOB_FIELD_REQ_NODES, - JOB_FIELD_PARTITION, - JOB_FIELD_MIN_NODES, - JOB_FIELD_MIN_MEMORY, - JOB_FIELD_MIN_DISK, - - NULL - }; - - // * - // Mapping between SLURM job field names and Wiki job - // field names. - // * - static struct wiki_request_t::field_name_map job_field_map[] = { - // Wiki name SLURM name - { "UPDATETIME", JOB_FIELD_LAST_ACTIVE }, - { "STATE", JOB_FIELD_STATE }, - { "WCLIMIT", JOB_FIELD_TIME_LIMIT }, - { "TASKS", JOB_FIELD_NUM_TASKS }, - { "QUEUETIME", JOB_FIELD_SUBMIT_TIME }, - { "STARTTIME", JOB_FIELD_START_TIME }, - { "COMPLETIONTIME", JOB_FIELD_END_TIME }, - { "UNAME", JOB_FIELD_USER_ID }, - { "GNAME", JOB_FIELD_GROUP_ID }, - { "HOSTLIST", JOB_FIELD_REQ_NODES }, - { "TASKLIST", JOB_FIELD_ALLOC_NODES }, - { "PARTITIONMASK", JOB_FIELD_PARTITION }, - { "NODES", JOB_FIELD_MIN_NODES }, - { "RMEM", JOB_FIELD_MIN_MEMORY }, - { "RDISK", JOB_FIELD_MIN_DISK }, - - { NULL, NULL } - }; - - m_fields = job_fields; - m_field_map = job_field_map; -} - - -// ************************************************************************** -// TAG( wiki_getjobs_t::map_enum ) -// ************************************************************************** -char * const -wiki_getjobs_t::map_enum( char * const field, - char * const val ) const -{ - struct string_map { - char *slurm_label; - char *wiki_label; - }; - - static struct string_map job_state_map[] = { - { JOB_STATE_LABEL_PENDING, "Idle" }, - { JOB_STATE_LABEL_RUNNING, "Running" }, - { JOB_STATE_LABEL_COMPLETE, "Completed" }, - { JOB_STATE_LABEL_FAILED, "Removed" }, - { JOB_STATE_LABEL_TIMEOUT, "Removed" }, - { JOB_STATE_LABEL_NODE_FAIL, "Removed" }, - { "UNKNOWN", "Removed" }, - - { NULL, NULL } - }; - - if ( strcmp( field, JOB_FIELD_STATE ) == 0 ) { - for ( struct string_map *p = job_state_map; - p->slurm_label != NULL; - ++p ) { - if ( strcmp( p->slurm_label, val ) == 0 ) { - return p->wiki_label; - } - } - error( "Wiki scheduler: no mapping for job state '%s'", val ); - return "Unknown"; - } else { - return "Unknown"; - } - -} diff --git a/src/plugins/sched/maui/wiki/wiki_response.cpp b/src/plugins/sched/maui/wiki/wiki_response.cpp deleted file mode 100644 index 1e929b0d4d6..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_response.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/*****************************************************************************\ - * wiki_response.cpp - respond to a Wiki request for resource status. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * 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 "wiki_message.h" - -// ************************************************************************** -// TAG( wiki_response_t ) -// ************************************************************************** -wiki_response_t::wiki_response_t( wiki_request_t *request, - char * const * const fields, - int32_t obj_count, - int32_t obj_hits, - sched_obj_list_t obj_data, - bool *matches ) : - wiki_status_t( 0 ) -{ - int32_t i; - - // * Encode argument count. - m_str += " ARG="; - m_str += obj_hits; - - // * If there were no matches found, we're done. - if ( obj_hits == 0 ) { - prefix_with_checksum(); - debug3( "Wiki plugin response = \"%s\"", m_str.s() ); - return; - } - - // * List all the matches. - for ( i = 0; i < obj_count; ++i ) { - if ( matches[ i ] ) { - request->compose_response( request, - m_str, - i, - fields, - obj_data ); - } - } - - sched_free_obj_list( obj_data ); - delete [] matches; - - // * Do the Wiki checksumming. - prefix_with_checksum(); - debug3( "Wiki plugin response = \"%s\"", m_str.s() ); -} diff --git a/src/plugins/sched/maui/wiki/wiki_startjob.cpp b/src/plugins/sched/maui/wiki/wiki_startjob.cpp deleted file mode 100644 index 4265a34d273..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_startjob.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/*****************************************************************************\ - * wiki_startjob.cpp - handle a Wiki STARTJOB command. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#include <string.h> - -extern "C" { -# include "src/common/log.h" -# include "src/common/xassert.h" -} - -#include "wiki_message.h" -#include "wiki_parser.h" - - -// ************************************************************************** -// TAG( wiki_startjob.cpp ) -// ************************************************************************** -wiki_startjob_t::wiki_startjob_t( char *data, size_t len ) : - wiki_command_t( data, len, wiki_message_t::STARTJOB ) -{ - wiki_relation_t *relation; - char *node; - ListIterator j; - - // * Get the node list. - relation = (wiki_relation_t *) list_next( m_arg_iterator ); - if ( relation == NULL ) - throw "malformed command (missing task list)"; - if ( strcmp( relation->name(), "TASKLIST" ) != 0 ) - throw "malformed command (expected TASKLIST=<nodes>)"; - - m_nodelist = list_create( NULL ); - j = list_iterator_create( relation->values() ); - while ( ( node = (char *) list_next( j ) ) != NULL ) { - list_append( m_nodelist, node ); - } - list_iterator_destroy( j ); -} - - -// ************************************************************************** -// TAG( action ) -// ************************************************************************** -message_t * -wiki_startjob_t::action( void ) -{ - u_int32_t id = (u_int32_t) atol( m_jobid ); - int rc; - char status_msg[128]; - - // * - // If Maui has specified a node list to run on, change the - // controller's requested node list so that it matches. - // * - if ( list_count( m_nodelist ) > 0 ) { - char *node; - dstring_t node_list; - ListIterator i = list_iterator_create( m_nodelist ); - - // * There's at least one node. - node = (char *) list_next( i ); - xassert( i ); - node_list += node; - - // * Add the rest of the nodes. - while ( ( node = (char *) list_next( i ) ) != NULL ) { - node_list += ","; - node_list += node; - } - list_iterator_destroy( i ); - - if ( sched_set_nodelist( id, node_list.s() ) == SLURM_ERROR ) { - error( "Wiki cannot assign nodes to job %d", id ); - } - } - - verbose( "Wiki starting job %s", m_jobid ); - - rc = sched_start_job( id, (u_int32_t) 1 ); - - if (rc == SLURM_SUCCESS) - { - snprintf(status_msg, sizeof(status_msg), - "SUCCESS: job %s started successfully", m_jobid); - return new wiki_status_t( 0, status_msg); - } - else - { - snprintf(status_msg, sizeof(status_msg), - "ERROR: job %s failed to start", m_jobid); - return new wiki_status_t( -1, status_msg); - } -} diff --git a/src/plugins/sched/maui/wiki/wiki_status.cpp b/src/plugins/sched/maui/wiki/wiki_status.cpp deleted file mode 100644 index 5af1ba5ae0b..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_status.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/*****************************************************************************\ - * wiki_status.cpp - return a status message to the Wiki scheduler. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#include <string.h> -#include <unistd.h> -#include <pwd.h> - -extern "C" { -# include "src/common/log.h" -# include "src/slurmctld/sched_plugin.h" -} - -#include "wiki_message.h" - - -// ************************************************************************** -// TAG( wiki_status_t ) -// ************************************************************************** -wiki_status_t::wiki_status_t( int status, char * const msg ) : - wiki_message_t( NULL, 0, wiki_message_t::STATUS ) -{ - m_str += "TS="; - m_str += (u_int32_t) time( NULL ); - m_str += " AUTH="; - m_str += get_user_name(); - m_str += " DT=SC="; - m_str += status; - if ( msg ) { - m_str += " RESPONSE="; - m_str += msg; - } - - debug3( "Wiki plugin status = \"%s\"", m_str.s() ); -} - -// ************************************************************** -// TAG( prefix_with_checksum ) -// ************************************************************** -// DESCRIPTION -// Prefixes the current string representation of the response -// with the Wiki checksum. -// -// ARGUMENTS -// key (in) - the DES key used to create the checksum. -// -// RETURNS -// None. -// -// ASSUMPTIONS -// The current response string starts with "TS=" and is the -// otherwise fully-formatted reply. -// -// SIDE EFFECTS -// Replaces the receiver's string; any cached C versions will -// be dangling pointers. -// -// ************************************************************** -void -wiki_status_t::prefix_with_checksum( void ) -{ - dstring_t sum; - const char * const key = sched_get_auth(); - - checksum( sum, key ); - sum += " "; - sum += m_str; - m_str = sum; -} - - -// ************************************************************** -// TAG( des ) -// ************************************************************** -// DESCRIPTION -// Compute a DES digest for a CRC according to a particular -// key. -// -// ARGUMENTS -// lword (in/out) - The CRC to encode, which becomes the first -// lexical segment of the checksum. -// irword (in/out ) - The key with which to encode the CRC, -// which becomes the second lexical segment of -// the checksum. -// -// RETURNS -// None. -// -// SOURCE -// Cluster Resources, Inc., no rights reserved. -// -// ************************************************************** -void -wiki_status_t::des( u_int32_t *lword, u_int32_t *irword ) const -{ - int idx; - u_int32_t ia, ib, iswap, itmph, itmpl; - - static const int MAX_ITERATION = 4; - static uint32_t c1[ MAX_ITERATION ] = { - 0xcba4e531, - 0x537158eb, - 0x145cdc3c, - 0x0d3fdeb2 - }; - static uint32_t c2[ MAX_ITERATION ] = { - 0x12be4590, - 0xab54ce58, - 0x6954c7a6, - 0x15a2ca46 - }; - - itmph = 0; - itmpl = 0; - - for ( idx = 0; idx < MAX_ITERATION; ++idx ) { - iswap = *irword; - ia = iswap ^ c1[ idx ]; - itmpl = ia & 0xffff; - itmph = ia >> 16; - ib = itmpl * itmpl + ~( itmph * itmph ); - ia = (ib >> 16) | ( (ib & 0xffff) << 16 ); - *irword = (*lword) ^ ( (ia ^c2[ idx ]) + (itmpl * itmph) ); - *lword = iswap; - } -} - - -// ************************************************************** -// TAG( compute_crc ) -// ************************************************************** -// DESCRIPTION -// Compute a cyclic redundancy check (CRC) character-wise. -// -// ARGUMENTS -// crc (in) - The CRC computed thus far. -// onech (in) - The character to be added to the CRC. -// -// RETURNS -// The new CRC value. -// -// SOURCE -// Cluster Resources, Inc., no rights reserved. -// -// ************************************************************** -const u_int16_t -wiki_status_t::compute_crc( u_int16_t crc, u_int8_t onech ) const -{ - int idx; - u_int32_t ans = ( crc ^ onech << 8 ); - - for ( idx = 0; idx < 8; ++idx ) { - if ( ans & 0x8000 ) { - ans = (ans <<= 1) ^ 4129; - } else { - ans <<= 1; - } - } - - return ans; -} - - -// ************************************************************** -// TAG( checksum ) -// ************************************************************** -// DESCRIPTION -// Compute a Wiki checksum for the current message contents -// and return the result as a Wiki name-value pair. -// -// ARGUMENTS -// sum (out) - The dynamic string in which to store the -// resulting checksum. -// key(in) - The seed value for the checksum. This must be -// coordinated with the scheduler so that they -// both use the same value. It is a string of -// ASCII decimal digits. -// -// RETURNS -// None. -// -// ************************************************************** -void -wiki_status_t::checksum( dstring_t &sum, const char * const key ) -{ - u_int32_t crc = 0; - u_int32_t lword, irword; - int idx; - u_int32_t seed = (u_int32_t) strtol( key, NULL, 0 ); - - for ( idx = 0; idx < m_str.length(); ++idx ) { - crc = (u_int32_t) compute_crc( crc, m_str.c( idx ) ); - } - - lword = crc; - irword = seed; - - des( &lword, &irword ); - - sum = "CK="; - sum.append( lword, "%08x" ); - sum.append( irword, "%08x" ); -} - - -// ************************************************************** -// TAG( get_user_name ) -// ************************************************************** -// DESCRIPTION -// Retrieves the system's idea of the user name under which -// the controller is running. -// -// ARGUMENTS -// None. -// -// RETURNS -// A pointer to a possibly static string containing the user -// name. It is not owned by the caller. -// -// ASSUMPTIONS -// Not know to be thread-safe. -// -// ************************************************************** -const char * -wiki_status_t::get_user_name( void ) const -{ - struct passwd *pw; - - pw = getpwuid( getuid() ); - if ( ! pw ) return NULL; - return pw->pw_name; -} diff --git a/src/plugins/sched/maui/wiki/wiki_wrapper.cpp b/src/plugins/sched/maui/wiki/wiki_wrapper.cpp deleted file mode 100644 index 291e3917ecd..00000000000 --- a/src/plugins/sched/maui/wiki/wiki_wrapper.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/*****************************************************************************\ - * wiki_wrapper.c - provides the scheduler plugin API. - ***************************************************************************** - * Copyright (C) 2002 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Kevin Tew <tew1@llnl.gov> et. al. - * UCRL-CODE-2002-040. - * - * This file is part of SLURM, a resource management program. - * For details, see <http://www.llnl.gov/linux/slurm/>. - * - * SLURM is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do - * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in - * the program, then also delete it here. - * - * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along - * with SLURM; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -\*****************************************************************************/ - -#include <stdio.h> -#include <pthread.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <unistd.h> - -#include <slurm/slurm_errno.h> - -extern "C" { -# include "src/common/log.h" -# include "src/common/plugin.h" -# include "src/common/read_config.h" -# include "src/common/xmalloc.h" -} - -#include "../receptionist.h" -#include "../prefix_courier.h" -#include "wiki_mailbag.h" - -/* - * Don't make these "const". G++ won't generate external symbols - * if you do. Grr. - */ -extern "C" { - char plugin_name[] = "SLURM Maui Scheduler plugin"; - char plugin_type[] = "sched/wiki"; - uint32_t plugin_version = 90; -} - -/* A plugin-global errno. */ -static int plugin_errno = SLURM_SUCCESS; - -static pthread_t receptionist_thread; -static bool thread_running = false; -static pthread_mutex_t thread_flag_mutex = PTHREAD_MUTEX_INITIALIZER; - -extern "C" void _get_wiki_conf_path(char *buf, int size); -extern "C" void _parse_wiki_config(void); -#define PRIO_HOLD 0 -#define PRIO_DECREMENT 1 -static int init_prio_mode = PRIO_HOLD; - -// ************************************************************************** -// TAG( receptionist_thread_entry ) -// ************************************************************************** -static void * -receptionist_thread_entry( void *dummy ) -{ - prefix_courier_factory_t courier_factory; - wiki_mailbag_factory_t mailbag_factory; - receptionist_t *receptionist = NULL; - struct sockaddr_in sockaddr; - - // * Set up Wiki scheduler address. - sockaddr.sin_family = AF_INET; - - sockaddr.sin_addr.s_addr = INADDR_ANY; - sockaddr.sin_port = htons( sched_get_port() ); - - try { - receptionist = new receptionist_t( &courier_factory, - &mailbag_factory, - &sockaddr ); - } catch ( const char *msg ) { - error( "Wiki scheduler plugin: %s", msg ); - pthread_exit( 0 ); - } - - // * - // * The receptionist listen() method does not return if it - // * obtains a connection. - // * - verbose( "Wiki scheduler interface starting ..." ); - try { - if ( receptionist->listen() < 0 ) { - error( "Wiki: unable to listen on connection\n" ); - } - } catch ( const char *msg ) { - error( "Wiki scheduler plugin: %s", msg ); - } - - delete receptionist; - - pthread_mutex_lock( &thread_flag_mutex ); - thread_running = false; - pthread_mutex_unlock( &thread_flag_mutex ); - return NULL; -} - - -// ************************************************************************** -// TAG( init ) -// ************************************************************************** -extern "C" -int init( void ) -{ - pthread_attr_t attr; - - verbose( "Wiki scheduler plugin loaded" ); - - pthread_mutex_lock( &thread_flag_mutex ); - if ( thread_running ) { - debug2( "Wiki thread already running, not starting another" ); - pthread_mutex_unlock( &thread_flag_mutex ); - return SLURM_ERROR; - } - - _parse_wiki_config( ); - pthread_attr_init( &attr ); - pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); - pthread_create( &receptionist_thread, - NULL, - receptionist_thread_entry, - NULL ); - thread_running = true; - pthread_mutex_unlock( &thread_flag_mutex ); - - return SLURM_SUCCESS; -} - -// ************************************************************************** -// TAG( _get_wiki_conf_path ) -// ************************************************************************** -extern "C" void _get_wiki_conf_path(char *buf, int size) -{ - char *val = getenv("SLURM_CONF"); - int i; - - if (!val) - val = default_slurm_config_file; - - /* Replace file name on end of path */ - i = strlen(val) - strlen("slurm.conf") + strlen("wiki.conf") + 1; - if (i > size) - fatal("_get_wiki_conf_path: buffer too small"); - strcpy(buf, val); - val = strrchr(buf, (int)'/'); - if (val) /* absolute path */ - val++; - else /* not absolute path */ - val = buf; - strcpy(val, "wiki.conf"); - - return; -} - -// ************************************************************************** -// TAG( _parse_wiki_config ) -// ************************************************************************** -extern "C" void _parse_wiki_config(void) -{ - s_p_options_t options[] = { {"JobPriority", S_P_STRING}, {NULL} }; - s_p_hashtbl_t *tbl; - char *priority_mode; - struct stat buf; - - /* need to define wiki_conf as static array rather than perform - * malloc due to memory corruption problem in gcc v3.2 */ - static char wiki_conf[256]; - - _get_wiki_conf_path(wiki_conf, sizeof(wiki_conf)); - if (stat(wiki_conf, &buf) == -1) { - debug("No wiki.conf file (%s)", wiki_conf); - return; - } - - debug("Reading wiki.conf file (%s)",wiki_conf); - tbl = s_p_hashtbl_create(options); - if (s_p_parse_file(tbl, wiki_conf) == SLURM_ERROR) - fatal("something wrong with opening/reading wiki.conf file"); - - if (s_p_get_string(&priority_mode, "JobPriority", tbl)) { - if (strcasecmp(priority_mode, "hold") == 0) - init_prio_mode = PRIO_HOLD; - else if (strcasecmp(priority_mode, "run") == 0) - init_prio_mode = PRIO_DECREMENT; - else - error("Invalid value for JobPriority in wiki.conf"); - xfree(priority_mode); - } - s_p_hashtbl_destroy(tbl); - - return; -} - -// ************************************************************************** -// TAG( fini ) -// ************************************************************************** -extern "C" void fini( void ) -{ - pthread_mutex_lock( &thread_flag_mutex ); - if ( thread_running ) { - verbose( "Wiki scheduler plugin shutting down" ); - // pthread_mutex_unlock( &thread_flag_mutex ); -- ??? - pthread_cancel( receptionist_thread ); - thread_running = false; - } - pthread_mutex_unlock( &thread_flag_mutex ); -} - - -// ************************************************************************** -// TAG( slurm_sched_plugin_schedule ) -// ************************************************************************** -extern "C" int -slurm_sched_plugin_schedule( void ) -{ - verbose( "Wiki plugin: schedule() is a NO-OP" ); - return SLURM_SUCCESS; -} - - -// ************************************************************************** -// TAG( slurm_sched_plugin_initial_priority ) -// ************************************************************************** -extern "C" u_int32_t -slurm_sched_plugin_initial_priority( u_int32_t last_prio ) -{ - // Two modes of operation are currently supported: - // - // PRIO_HOLD: Wiki is a polling scheduler, so the initial priority - // is always zero to keep SLURM from spontaneously starting the - // job. The scheduler will suggest which job's priority should - // be made non-zero and thus allowed to proceed. - // - // PRIO_DECREMENT: Set the job priority to one less than the last - // job and let Wiki change priorities of jobs as desired to re-order - // the queue) - // - if (init_prio_mode == PRIO_DECREMENT) { - if (last_prio >= 2) - return (last_prio - 1); - else - return 1; - } else - return 0; -} - -// ************************************************************************** -// TAG( slurm_sched_plugin_job_is_pending ) -// ************************************************************************** -extern "C" void slurm_sched_plugin_job_is_pending( void ) -{ - // Wiki does not respond to pending job -} - -// ************************************************************************* -// TAG( slurm_sched_get_errno ) -// ************************************************************************* -extern "C" int -slurm_sched_get_errno( void ) -{ - return plugin_errno; -} - -// ************************************************************************ -// TAG( slurm_sched_strerror ) -// ************************************************************************ -extern "C" char * -slurm_sched_strerror( int errnum ) -{ - return NULL; -} - diff --git a/src/plugins/sched/wiki2/msg.c b/src/plugins/sched/wiki2/msg.c index 1058f033263..96aa9ef8ab5 100644 --- a/src/plugins/sched/wiki2/msg.c +++ b/src/plugins/sched/wiki2/msg.c @@ -110,7 +110,7 @@ static void *_msg_thread(void *no_data) int sig_array[] = {SIGUSR1, 0}; char *msg; - if ((sock_fd = slurm_init_msg_engine_port(sched_get_port())) + if ((sock_fd = slurm_init_msg_engine_port(slurm_get_sched_port())) == SLURM_SOCKET_ERROR) fatal("wiki: slurm_init_msg_engine_port %m"); diff --git a/src/plugins/sched/wiki2/msg.h b/src/plugins/sched/wiki2/msg.h index be698491216..72e0f6bbe37 100644 --- a/src/plugins/sched/wiki2/msg.h +++ b/src/plugins/sched/wiki2/msg.h @@ -74,10 +74,10 @@ #include "src/common/read_config.h" #include "src/common/slurm_protocol_api.h" #include "src/common/slurm_protocol_interface.h" +#include "src/common/uid.h" #include "src/common/xmalloc.h" #include "src/common/xsignal.h" #include "src/common/xstring.h" -#include "src/slurmctld/sched_plugin.h" #define PRIO_HOLD 0 #define PRIO_DECREMENT 1 diff --git a/src/slurmctld/Makefile.am b/src/slurmctld/Makefile.am index e694ca7d66e..3af8031d4d4 100644 --- a/src/slurmctld/Makefile.am +++ b/src/slurmctld/Makefile.am @@ -33,7 +33,6 @@ slurmctld_SOURCES = \ read_config.h \ sched_plugin.c \ sched_plugin.h \ - sched_upcalls.c \ slurmctld.h \ srun_comm.c \ srun_comm.h \ diff --git a/src/slurmctld/Makefile.in b/src/slurmctld/Makefile.in index dad69ffda7f..5d62e5890db 100644 --- a/src/slurmctld/Makefile.in +++ b/src/slurmctld/Makefile.in @@ -78,7 +78,7 @@ am_slurmctld_OBJECTS = agent.$(OBJEXT) backup.$(OBJEXT) \ locks.$(OBJEXT) node_mgr.$(OBJEXT) node_scheduler.$(OBJEXT) \ partition_mgr.$(OBJEXT) ping_nodes.$(OBJEXT) \ proc_req.$(OBJEXT) read_config.$(OBJEXT) \ - sched_plugin.$(OBJEXT) sched_upcalls.$(OBJEXT) \ + sched_plugin.$(OBJEXT) \ srun_comm.$(OBJEXT) state_save.$(OBJEXT) step_mgr.$(OBJEXT) slurmctld_OBJECTS = $(am_slurmctld_OBJECTS) slurmctld_DEPENDENCIES = $(top_builddir)/src/common/libcommon.la \ @@ -304,7 +304,6 @@ slurmctld_SOURCES = \ read_config.h \ sched_plugin.c \ sched_plugin.h \ - sched_upcalls.c \ slurmctld.h \ srun_comm.c \ srun_comm.h \ @@ -399,7 +398,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc_req.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read_config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_plugin.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_upcalls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srun_comm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state_save.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/step_mgr.Po@am__quote@ diff --git a/src/slurmctld/agent.c b/src/slurmctld/agent.c index b79f4772906..37ee15efecb 100644 --- a/src/slurmctld/agent.c +++ b/src/slurmctld/agent.c @@ -86,6 +86,7 @@ #include "src/common/xstring.h" #include "src/common/slurm_protocol_api.h" #include "src/common/slurm_protocol_interface.h" +#include "src/common/uid.h" #include "src/common/forward.h" #include "src/slurmctld/agent.h" #include "src/slurmctld/locks.h" @@ -1385,17 +1386,9 @@ extern void mail_job_info (struct job_record *job_ptr, uint16_t mail_type) { mail_info_t *mi = _mail_alloc(); - if (!job_ptr->mail_user) { - struct passwd *pw; - pw = getpwuid((uid_t) job_ptr->user_id); - if (pw && pw->pw_name) - mi->user_name = xstrdup(pw->pw_name); - else { - error("getpwuid(%u): %m", job_ptr->user_id); - _mail_free(mi); - return; - } - } else + if (!job_ptr->mail_user) + mi->user_name = xstrdup(uid_to_string((uid_t)job_ptr->user_id)); + else mi->user_name = xstrdup(job_ptr->mail_user); mi->message = xmalloc(sizeof(char)*128); diff --git a/src/slurmctld/sched_plugin.h b/src/slurmctld/sched_plugin.h index 860a91333a9..44f6d332488 100644 --- a/src/slurmctld/sched_plugin.h +++ b/src/slurmctld/sched_plugin.h @@ -1,7 +1,7 @@ /*****************************************************************************\ * sched_plugin.h - Define scheduler plugin functions. ***************************************************************************** - * Copyright (C) 2004 The Regents of the University of California. + * Copyright (C) 2004-2006 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jay Windley <jwindley@lnxi.com> * UCRL-CODE-217948. @@ -85,233 +85,4 @@ int slurm_sched_p_get_errno( void ); */ char *slurm_sched_p_strerror( int errnum ); -/* - ************************************************************************** - * U P C A L L S * - ************************************************************************** - */ - -/* - * Returns the port number associated with the remote scheduler. The - * port may either be the remote port on which the scheduler listens, - * or the local port upon which the controller should listen for - * scheduler requests. The interpretation of this value depends on - * the scheduler type. The value is returned in host byte order. - */ -uint16_t sched_get_port( void ); - -/* - * Returns the authentication credentials. - */ -const char * sched_get_auth( void ); - -/* - * RootOnly partitions are typically exempted from external scheduling - * because these partitions are expected to be directly maintained by - * the root user (or some external meta-scheduler) that may have it's - * own mechanisms for scheduling. However some cluster configurations - * may want to use RootOnly partitions simply to prevent non-root - * access, and would still like normal external scheduler operation to - * occur. - * - * This procedure reflects the "SchedulerRootFilter" setting in - * slurm.conf which allows the SLURM configuration to request how - * external schedulers handle RootOnly partition, if supported by - * the external scheduler. Currently only the SLURM backfill - * scheduler makes use of this. - * - * Returns non-zero if RootOnly partitions are to be filtered from - * any external scheduling efforts. - */ -uint16_t sched_get_root_filter( void ); - -/* - * Opaque type for a list of objects supplied by the controller. - * These objects are either jobs in the job queue, or nodes in the - * cluster. - */ -typedef struct sched_obj_list *sched_obj_list_t; - -/* Functional type for a field accessor. */ -typedef void * (*sched_accessor_fn_t)( sched_obj_list_t, - int32_t, - char * ); - -/* - * Functional type for an object list (i.e., job queue or node list) - * retriever. This is for abstracting sched_get_node_list() and - * sched_get_job_list() to facilitate any plugin that may wish to - * consolidate code. - */ -typedef sched_obj_list_t (*sched_objlist_fn_t)( void ); - -/* - * Retrieve a pointer to a function that will, when called with an - * object index, return a poiner to the value of the named field in - * the opaque object structure. This accessor is guaranteed to be - * valid for the time in which the plugin is loaded and so can be - * dereferenced once at plugin load time. The return value is always - * to be interpreted as a pointer, regardless of the size of the - * pointed-to type. - * - * field (in) - the name of the field whose accessor is to be returned. - * - * Returns a pointer to a function of type - * - * void *func( void *data, uint32_t idx, char *type ); - * - * where "data" is the opaque data provided by sched_get_<some>_list(), - * "idx" is the index of the node in "data" whose attribute value is - * desired, and "type" is an optional pointer to a byte in which is - * placed a value identifying the data type of the returned value. - * "type" may be NULL. Returns NULL if no accessor can be provided - * for the named field. - * - * The values placed into "type", if addressable, are ASCII-encoded - * characters with the following meanings: - * - * 'e' - An enumeration encoded as a string. This is for data that is - * stored internally in SLURM as a C enum, but which for version skew - * reasons we do not want to transmit in its underyling numerical - * representation. The strings used are defined below in conjunction - * with the objects and fields to which they apply. - * - * 's' - A string value that should probably be passed to the - * scheduler without further interpretation. - * - * 'S' - A string value that may require interpretation by the plugin - * prior to passing it to the scheduler. This includes strings that - * have embedded delimetersor other structure. The difference between - * 's' and 'S' is fairly arbitrary and merely serves as a hint to the - * plugin about the format of the returned string. - * - * 't' - A value of type "time_t" as defined on the SLURM controller. - * - * 'i' - A 16-bit signed integer. - * - * 'I' - A 32-bit signed integer. - * - * 'u' - A 16-bit unsigned integer. - * - * 'U' - a 32-bit unsigned integer. - * - * TESTED: 16 May 2003 - */ -extern sched_accessor_fn_t sched_get_accessor( char *field ); - -/* - * Return the number of items in the object list. - */ -extern int32_t sched_get_obj_count( sched_obj_list_t data ); - -/* - * Free an object list produced by any function of type - * sched_objlist_fn_t. - * - * data (in) - A block of data supplied by sched_get_<whatever>_list(). - * - * Returns SLURM_SUCCESS if successful and SLURM_ERROR otherwise. - * - * TESTED: 16 May 2003 - */ -extern int sched_free_obj_list( sched_obj_list_t data ); - - -/* - * Retrieve a snapshot of node data from the controller. The data returned - * is guaranteed to be self-consistent. That is, it is guaranteed that the - * data will not have been modified during the acquisition of the snapshot. - * However it is not guaranteed to be persistently accurate. It is accurate - * at the time at which it is delivered to the plugin, but after delivery - * the controller's node list is made available for subsequent operations. - * - * TESTED: 16 May 2003 - */ -extern sched_obj_list_t sched_get_node_list( void ); - -#define NODE_FIELD_NAME "node.name" -#define NODE_FIELD_STATE "node.state" -#define NODE_FIELD_REAL_MEM "node.real_mem" -#define NODE_FIELD_TMP_DISK "node.tmp_disk" -#define NODE_FIELD_NUM_CPUS "node.num_cpus" -#define NODE_FIELD_MOD_TIME "node.mod_time" -#define NODE_FIELD_PARTITION "node.partition" - -#define NODE_STATE_LABEL_DOWN "DOWN" -#define NODE_STATE_LABEL_UNKNOWN "UNKNOWN" -#define NODE_STATE_LABEL_IDLE "IDLE" -#define NODE_STATE_LABEL_ALLOCATED "ALLOCATED" -#define NODE_STATE_LABEL_DRAINED "DRAINED" -#define NODE_STATE_LABEL_DRAINING "DRAINING" -#define NODE_STATE_LABEL_COMPLETING "COMPLETING" - - -/* - * Retrieve a snapshot of the job queue from the controller. The data - * returned is guarantted to be self-consistent. (See - * sched_get_node_list() above.) - * - * data (in/out) - place to store an opaque chunk of job data. - * - * count (in/out ) - place to store the number of jobs that the opaque - * data represents. - * - * Returns SLURM_SUCCESS if successful and SLURM_ERROR otherwise. - * - */ -extern sched_obj_list_t sched_get_job_list( void ); - -#define JOB_FIELD_ID "job.id" -#define JOB_FIELD_NAME "job.name" -#define JOB_FIELD_LAST_ACTIVE "job.last_active" -#define JOB_FIELD_STATE "job.state" -#define JOB_FIELD_TIME_LIMIT "job.time_limit" -#define JOB_FIELD_NUM_TASKS "job.num_tasks" -#define JOB_FIELD_SUBMIT_TIME "job.submit_time" -#define JOB_FIELD_START_TIME "job.start_time" -#define JOB_FIELD_END_TIME "job.end_time" -#define JOB_FIELD_USER_ID "job.user_id" -#define JOB_FIELD_GROUP_ID "job.group_id" -#define JOB_FIELD_MIN_NODES "job.min_nodes" -#define JOB_FIELD_FEATURES "job.features" -#define JOB_FIELD_PRIORITY "job.priority" -#define JOB_FIELD_WORK_DIR "job.work_dir" -#define JOB_FIELD_PARTITION "job.partition" -#define JOB_FIELD_MIN_DISK "job.min_disk" -#define JOB_FIELD_MIN_MEMORY "job.min_mem" -#define JOB_FIELD_REQ_NODES "job.req_nodes" -#define JOB_FIELD_ALLOC_NODES "job.alloc_nodes" -#define JOB_FIELD_MIN_NODES "job.min_nodes" - -#define JOB_STATE_LABEL_PENDING "PENDING" -#define JOB_STATE_LABEL_RUNNING "RUNNING" -#define JOB_STATE_LABEL_SUSPENDED "SUSPENDED" -#define JOB_STATE_LABEL_COMPLETE "COMPLETE" -#define JOB_STATE_LABEL_FAILED "FAILED" -#define JOB_STATE_LABEL_TIMEOUT "TIMEOUT" -#define JOB_STATE_LABEL_NODE_FAIL "NODE_FAIL" - - -/* - * Set the list of nodes on which the job will run. - * - * nodes is a comma-separated string of node names. It is - * copied by sched_set_nodelist(). - */ -extern int sched_set_nodelist( const uint32_t job_id, char *nodes ); - -/* - * Start the job identified by the job ID. - * - * Returns a SLURM errno. - */ -extern int sched_start_job( const uint32_t job_id, const uint32_t new_prio ); - -/* - * Stop the job identified by the job ID. - * - * Returns a SLURM errno. - */ -extern int sched_cancel_job( const uint32_t job_id ); - #endif /*__SLURM_CONTROLLER_SCHED_PLUGIN_API_H__*/ diff --git a/src/slurmctld/sched_upcalls.c b/src/slurmctld/sched_upcalls.c index 7ffea3912a7..b87b54c684c 100644 --- a/src/slurmctld/sched_upcalls.c +++ b/src/slurmctld/sched_upcalls.c @@ -146,25 +146,6 @@ static void * sched_get_node_partition( sched_obj_list_t, int32_t, char * ); static void * sched_get_node_mod_time( sched_obj_list_t, int32_t, char * ); - -/* ************************************************************************ */ -/* TAG( sched_get_port ) */ -/* ************************************************************************ */ -u_int16_t -sched_get_port( void ) -{ - u_int16_t port; - /* Locks: Read config */ - slurmctld_lock_t config_read_lock = { - READ_LOCK, NO_LOCK, NO_LOCK, NO_LOCK }; - - lock_slurmctld(config_read_lock); - port = slurmctld_conf.schedport; - unlock_slurmctld(config_read_lock); - - return port; -} - /* ************************************************************************ */ /* TAG( sched_get_auth ) */ /* ************************************************************************ */ @@ -176,24 +157,6 @@ sched_get_auth( void ) return auth; } -/* ************************************************************************ */ -/* TAG( sched_get_root_filter ) */ -/* ************************************************************************ */ -u_int16_t -sched_get_root_filter( void ) -{ - u_int16_t root_filter; - /* Locks: Read config */ - slurmctld_lock_t config_read_lock = { - READ_LOCK, NO_LOCK, NO_LOCK, NO_LOCK }; - - lock_slurmctld(config_read_lock); - root_filter = slurmctld_conf.schedrootfltr; - unlock_slurmctld(config_read_lock); - - return root_filter; -} - /* ************************************************************************ */ /* TAG( sched_get_obj_count ) */ /* ************************************************************************ */ -- GitLab