Skip to content
Snippets Groups Projects
Commit b172d331 authored by Moe Jette's avatar Moe Jette
Browse files

Added stub for AIX kernel extension process tracking plugin (just uses sid

 for now).
parent 3c0c2a68
No related branches found
No related tags found
No related merge requests found
...@@ -206,6 +206,7 @@ AC_CONFIG_FILES([Makefile ...@@ -206,6 +206,7 @@ AC_CONFIG_FILES([Makefile
src/plugins/jobcomp/none/Makefile src/plugins/jobcomp/none/Makefile
src/plugins/jobcomp/script/Makefile src/plugins/jobcomp/script/Makefile
src/plugins/proctrack/Makefile src/plugins/proctrack/Makefile
src/plugins/proctrack/aix/Makefile
src/plugins/proctrack/sid/Makefile src/plugins/proctrack/sid/Makefile
src/plugins/sched/Makefile src/plugins/sched/Makefile
src/plugins/sched/backfill/Makefile src/plugins/sched/backfill/Makefile
......
...@@ -186,7 +186,7 @@ The default value is "/usr/local/lib/slurm". ...@@ -186,7 +186,7 @@ The default value is "/usr/local/lib/slurm".
Identifies the plugin to be used for process tracking. Identifies the plugin to be used for process tracking.
The slurmd daemon uses this mechanism to identify all processes The slurmd daemon uses this mechanism to identify all processes
which are children of processes it spawns for a user job. which are children of processes it spawns for a user job.
Acceptable vlues at present include "proctrack/kern_ext" (which Acceptable values at present include "proctrack/aix" (which
is the default for AIX systems) and "proctrack/sid" (which is the default for AIX systems) and "proctrack/sid" (which
is the default for all other systems). is the default for all other systems).
The slurmd daemon must be restarted for a change in ProctrackType The slurmd daemon must be restarted for a change in ProctrackType
......
...@@ -202,11 +202,11 @@ ...@@ -202,11 +202,11 @@
# #
# o Define the process tracking mechanism in use. # o Define the process tracking mechanism in use.
# #
# "ProctrackType" : the type of process tracking mechanism # "ProctrackType" : the type of process tracking mechanism
# "proctrack/kern_ext" : use AIX kernel extension for process tracking, # "proctrack/aix" : use AIX kernel extension for process tracking,
# the default value on AIX computers # the default value on AIX computers
# "proctrack/sid" : use Unix session ID for process tracking, # "proctrack/sid" : use Unix session ID for process tracking,
# the default value on all other computers # the default value on all other computers
# #
# ProctrackType=proctrack/sid # ProctrackType=proctrack/sid
......
...@@ -181,6 +181,7 @@ rm -rf $RPM_BUILD_ROOT ...@@ -181,6 +181,7 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/slurm/jobcomp_none.so %{_libdir}/slurm/jobcomp_none.so
%{_libdir}/slurm/jobcomp_filetxt.so %{_libdir}/slurm/jobcomp_filetxt.so
%{_libdir}/slurm/jobcomp_script.so %{_libdir}/slurm/jobcomp_script.so
%{_libdir}/slurm/proctrack_aix.so
%{_libdir}/slurm/proctrack_sid.so %{_libdir}/slurm/proctrack_sid.so
%{_libdir}/slurm/sched_backfill.so %{_libdir}/slurm/sched_backfill.so
%{_libdir}/slurm/sched_builtin.so %{_libdir}/slurm/sched_builtin.so
...@@ -268,6 +269,8 @@ fi ...@@ -268,6 +269,8 @@ fi
%changelog %changelog
* Fri Mar 04 2005 Morris Jette <jette1@llnl.gov>
- added proctrack_aix plugin
* Fri Feb 25 2005 Morris Jette <jette1@llnl.gov> * Fri Feb 25 2005 Morris Jette <jette1@llnl.gov>
- added proctrack_sid plugin - added proctrack_sid plugin
* Thu Feb 24 2005 Morris Jette <jette1@llnl.gov> * Thu Feb 24 2005 Morris Jette <jette1@llnl.gov>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#define DEFAULT_MIN_JOB_AGE 300 #define DEFAULT_MIN_JOB_AGE 300
#define DEFAULT_MPICH_GM_DIR 0 #define DEFAULT_MPICH_GM_DIR 0
#ifdef HAVE_AIX /* AIX specific default configuration parameters */ #ifdef HAVE_AIX /* AIX specific default configuration parameters */
# define DEFAULT_PROCTRACK_TYPE "proctrack/ker_ext" # define DEFAULT_PROCTRACK_TYPE "proctrack/aix"
#else #else
# define DEFAULT_PROCTRACK_TYPE "proctrack/sid" # define DEFAULT_PROCTRACK_TYPE "proctrack/sid"
#endif #endif
......
# $Id$ # $Id$
# Makefile for proctrack plugins # Makefile for proctrack plugins
SUBDIRS = sid SUBDIRS = aix sid
# $Id$
# Makefile for proctrack/aix plugin
AUTOMAKE_OPTIONS = foreign
PLUGIN_FLAGS = -module -avoid-version --export-dynamic
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common
pkglib_LTLIBRARIES = proctrack_aix.la
# AIX process tracking kernel extension plugin.
proctrack_aix_la_SOURCES = proctrack_aix.c
proctrack_aix_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
if HAVE_AIX
proctrack_aix_la_LIBADD = $(top_builddir)/src/common/libcommon.la
endif
/*****************************************************************************\
* proctrack_aix.c - process tracking via AIX kernel extension.
*****************************************************************************
* Copyright (C) 2005 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Morris Jette <jette1@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.
*
* SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with SLURM; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
\*****************************************************************************/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#include <sys/types.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <slurm/slurm.h>
#include <slurm/slurm_errno.h>
#include "src/common/log.h"
#ifndef __USE_XOPEN_EXTENDED
extern pid_t getsid(pid_t pid); /* missing from <unistd.h> */
extern pid_t setsid(void); /* missing from <unistd.h> */
#endif
/*
* These variables are required by the generic plugin interface. If they
* are not found in the plugin, the plugin loader will ignore it.
*
* plugin_name - a string giving a human-readable description of the
* plugin. There is no maximum length, but the symbol must refer to
* a valid string.
*
* plugin_type - a string suggesting the type of the plugin or its
* applicability to a particular form of data or method of data handling.
* If the low-level plugin API is used, the contents of this string are
* unimportant and may be anything. SLURM uses the higher-level plugin
* interface which requires this string to be of the form
*
* <application>/<method>
*
* where <application> is a description of the intended application of
* the plugin (e.g., "jobcomp" for SLURM job completion logging) and <method>
* is a description of how this plugin satisfies that application. SLURM will
* only load job completion logging plugins if the plugin_type string has a
* prefix of "jobcomp/".
*
* plugin_version - an unsigned 32-bit integer giving the version number
* of the plugin. If major and minor revisions are desired, the major
* version number may be multiplied by a suitable magnitude constant such
* as 100 or 1000. Various SLURM versions will likely require a certain
* minimum versions for their plugins as the job completion logging API
* matures.
*/
const char plugin_name[] = "Process tracking via AIX kernel extension plugin";
const char plugin_type[] = "proctrack/aix";
const uint32_t plugin_version = 90;
/*
* init() is called when the plugin is loaded, before any other functions
* are called. Put global initialization here.
*/
extern int init ( void )
{
return SLURM_SUCCESS;
}
extern int fini ( void )
{
return SLURM_SUCCESS;
}
/*
* For this plugin, we ignore the job_id.
* To generate a unique container ID, we use setsid.
*/
extern uint32_t slurm_create_container ( uint32_t job_id )
{
pid_t pid = setsid();
(void) setpgrp();
if (pid < 0) {
error("slurm_create_container: setpsid: %m");
return (uint32_t) 0;
}
return (uint32_t) pid;
}
extern int slurm_add_container ( uint32_t id )
{
return SLURM_SUCCESS;
}
extern int slurm_signal_container ( uint32_t id, int signal )
{
pid_t pid = (pid_t) id;
if (!id) /* no container ID */
return ESRCH;
return killpg(pid, signal);
}
extern int slurm_destroy_container ( uint32_t id )
{
return SLURM_SUCCESS;
}
extern uint32_t
slurm_find_container(pid_t pid)
{
return (uint32_t) getsid(pid);
}
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "src/common/log.h" #include "src/common/log.h"
#ifndef __USE_XOPEN_EXTENDED #ifndef __USE_XOPEN_EXTENDED
extern pid_t getsid(pid_t pid); /* missing from <unistd.h> */
extern pid_t setsid(void); /* missing from <unistd.h> */ extern pid_t setsid(void); /* missing from <unistd.h> */
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment