Initial revision

git-svn-id: svn://opensvn.adaptivecomputing.com/maui/trunk@2 3f5042e3-fb1d-0410-be18-d6ca2573e517
This commit is contained in:
dev
2005-07-12 21:12:53 +00:00
parent bfddd1f871
commit 9a0042c61e
165 changed files with 176132 additions and 0 deletions

47
CHANGELOG Normal file
View File

@@ -0,0 +1,47 @@
Maui 3.2.6p14
Features
- Added support for NODEMEMOVERCOMMITFACTOR on TORQUE
- Integrated latest DOE S3 communications library
Maui 3.2.6p11
Scalability
- Added client data compression
Inter-operability
- Added support for SSS 3.0.3 job structure
- Added support for SSS suspend-resume features
- Support PBS 'state-unknown' mapping
- Improved TORQUE 'status' attribute auto-detection
Security
- Added client data encryption
- Added client bounds checking to prevent buffer overflow
- Enhanced group ID mapping support
Features
- Added scheduler-level config based node feature specification
- Enabled Dynamic Hostlist Modification
- Enabled AM Job Failure Action Support
- Added support for class/queue level feature requirement defaults
- Added support for dedicated resource specification w/in standing reservations
Fault Tolerance
- Fixed TORQUE server data auto-detect
- Fixed data corruption server crash
- Improved logic for stale job handling with failing resource managers
Useability
- Improved Node State Diagnostics
Accounting

155
LICENSE Normal file
View File

@@ -0,0 +1,155 @@
Moab Scheduling System - End User Open Source License
This software is based on the Moab Scheduling System which was created by
Cluster Resources, Inc.
Copyright (C) 1999-2004 Cluster Resources, Inc., all rights reserved.
Moab Scheduling System is a trademark of Cluster Resources, Inc.
This SOFTWARE is bound by an 'End User Open Source' LICENSE from Cluster
Resources Inc. The conditions of the 'End User Open Source' LICENSE include,
but are not limited to the conditions described below.
THE SOFTWARE IS PROVIDED AS IS, AND CLUSTER RESOURCES, INC. (CRI) AND ALL
CONTRIBUTING PARTIES DISCLAIM ALL WARRANTIES RELATING TO THE SOFTWARE,
WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. NEITHER
CRI NOR ANYONE INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THE
SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT, CONSEQUENTIAL, OR INCIDENTAL
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE EVEN IF CRI
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT
SHALL CRI'S LIABILITY FOR ANY DAMAGES EXCEED THE CONSIDERATION PAID FOR THE
LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM OF CLAIM. THE PERSON OR
ENTITY USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE
OF THE SOFTWARE.
By installing or using this SOFTWARE you are accepting a non-exclusive 'End
User Open Source' LICENSE from Cluster Resources Inc. and are bound to abide by the following conditions:
1. Inclusion of Notice and Disclaimer
All copies of the SOFTWARE, whether or not for redistribution and whether
or not in source code or in binary form must include a conspicuous and
appropriate publication of the above copyright notice and disclaimer.
2. Usage
Source and/or binary forms of this SOFTWARE may be used by any 'End User'
organization pursuant to the conditions of this and other associated LICENSES
at no charge and for an unlimited period of time. An 'End User' organization
is defined as an organization that is using this SOFTWARE on their own
systems and is not commercially redistributing, modifying, supporting, or
providing other services specific to this SOFTWARE to other organizations
for profit.
3. Modifications
SOFTWARE may be freely modified by the 'End User' as necessary to meet the
needs of the 'End User' LICENSEE'S system. 'End User' may solicit the
services of Cluster Resources Inc. or 'Authorized Distribution and Services
Partners' of Cluster Resources Inc. that have received express prior written
authorization to redistribute, modify or provide services for SOFTWARE.
Available services include but are not limited to technical support,
training, consultation or optimization services. 'End User' may not
solicit or receive this SOFTWARE or services associated to the use,
customization, training, development, or support on this SOFTWARE from any
organization that is not an 'Authorized Distribution and Services Partner'
of Cluster Resources Inc. Any organization that desires to become an
'Authorized Distribution and Services Partner' of Cluster Resources, Inc.
may contact us at support@clusterresources.com. 'End User' organizations
that desire services from Cluster Resources Inc., or an 'Authorized
Distribution and Services Partner' may contact us using the same email
listed above.
4. Distribution
'End User' organizations that are academic and government agencies may
redistribute this SOFTWARE subject to the condition that the distribution
contains conspicuous publication of the acknowledgement statement found
within the LICENSE agreement distributed with this SOFTWARE.
Organizations that are not academic and government agencies including
commercial and other for-profit organizations may not redistribute this code
or derivations of this code in any form whatsoever, including parts of
SOFTWARE incorporated into other software programs without express written
permission from Cluster Resources, Inc.
Redistribution of the SOFTWARE in any form whatsoever, including parts of
the code that are incorporated into other software programs, must include a
conspicuous and appropriate publication of the following acknowledgement:
'This product was developed by Cluster Resources, Inc. Moab Scheduling
System is a trademark of Cluster Resources, Inc.'
Any redistribution or modification of the SOFTWARE must, when installed,
display the above language, the copyright notice, and the warranty
disclaimer.
Each time the SOFTWARE (or any work based on the SOFTWARE) is
redistributed, the recipient must automatically receive this LICENSE,
copyright notice, and the warranty disclaimer as described in this license
agreement, which govern the ability to copy, distribute or modify the
SOFTWARE subject to these terms and conditions, and have the choice of
accepting or declining the LICENSE.
As the LICENSEE, you shall automatically provide the recipient with a
copy of this LICENSE. Further restrictions are not to be imposed on
recipients of the SOFTWARE by the LICENSEE beyond those expressly described
herein.
5. Use of Modifications
LICENSEES with a redistribution agreement that wish to distribute their
modifications (including government and academic institutions) must first
send a copy of the modifications along with a brief explanation of why the
modification was made and the resulting performance or functionality of the
modifications to Cluster Resources, Inc. at support@clusterresources.com.
Failure to send a copy of distributed modifications renders the LICENSE
invalid, as well as any LICENSES granted to third parties subsequent to the
incorporation of the modifications into SOFTWARE. Any such modification of
the SOFTWARE must, when installed, display the LICENSE, the copyright
notice, and the warranty disclaimer as described in the LICENSE agreement/s
distributed with this SOFTWARE. Those without a LICENSE to redistribute may
send modifications to Cluster Resources for evaluation and possible
incorporation into SOFTWARE.
Copyright owners of modifications to SOFTWARE hereby grant Cluster
Resources, Inc. a non-exclusive, royalty-free, worldwide, irrevocable right
and LICENSE to install, use, distribute, sublicense, and prepare derivative
works of said modifications. Only organizations receiving an express prior
written exclusion to this condition are exempted from providing these
non-exclusive rights to Cluster Resources, Inc.
6. Communications about and Endorsement of SOFTWARE and Products/Software
Derived from the SOFTWARE
The name 'Moab Scheduling System', 'Moab Scheduler', or any of its
variants must not otherwise be used to endorse or to promote products
derived from the SOFTWARE without prior written permission from CRI.
Products derived from or incorporating the SOFTWARE in whole or in part
shall not contain as part of the product's name any form of the terms
'Cluster Resources, Inc.', 'CRI', 'Moab', 'Moab Scheduling System',
'Moab Scheduler', or 'Supercluster Development Group' unless prior written
permission has been received from Cluster Resources, Inc.
All advertising materials for products that use or incorporate features of
the SOFTWARE must display the following acknowledgement: 'This product
includes software developed by Cluster Resources, Inc. for use in the Moab
Scheduling System.'
7. Acceptance of this LICENSE
It is not required that you accept this LICENSE; however, if you do not
accept the terms of this LICENSE, you are prohibited by law from installing,
using, modifying or distributing the SOFTWARE or any of its derivative
works. Therefore, by installing, using, modifying or distributing the
SOFTWARE (or any of its derivative works), you have agreed to this LICENSE
and have accepted all its terms and conditions.
If any portion of this LICENSE is held invalid or unenforceable under any
particular circumstance, the balance of the LICENSE will continue to apply.

49
LICENSE.mcompat Normal file
View File

@@ -0,0 +1,49 @@
Maui Scheduler General Public License
This product includes software developed for The University of New Mexico High Performance Computing Education and Research Center for use in the Maui Scheduler software. Copyright (C) 2000 Science and Technology Corporation @ UNM, Software developed for The University of New Mexico. All Rights Reserved.
Maui Scheduler is a trademark of Science & Technology Corporation @ UNM
THE SOFTWARE IS PROVIDED AS IS AND SCIENCE & TECHNOLOGY CORPORATION @ UNM (STC) AND THE UNIVERSITY OF NEW MEXICO (UNM) DISCLAIM ALL WARRANTIES RELATING TO THE SOFTWARE, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. NEITHER UNM,
STC, NOR ANYONE INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THE SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT, CONSEQUENTIAL, OR INCIDENTAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE EVEN IF UNM OR STC HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT SHALL UNM'S
LIABILITY FOR ANY DAMAGES EXCEED THE CONSIDERATION PAID FOR THE LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM OF CLAIM. THE PERSON OR ENTITY USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE.
By installing or using this software you are accepting a non-exclusive license
to install, use, modify, and redistribute, and make modifications to the
SOFTWARE ('LICENSE' pursuant to the following conditions:
1. All copies of the SOFTWARE, whether or not for redistribution and whether or not in source code or in binary form must include a conspicuous and appropriate publication of the above copyright notice and disclaimer.
2. Redistribution of the SOFTWARE in any form whatsoever, including parts of the code that are incorporated into other software programs, must include a conspicuous and appropriate publication of the following acknowledgement:
'This product includes software developed for The University of New Mexico
High Performance Computing Education and Research Center for use in the Maui
Scheduler software. Maui Scheduler is a trademark of Science & Technology
Corporation @ UNM'
Any such modification of the SOFTWARE must, when installed, display the above language, the copyright notice, and the warranty disclaimer.
3. A copy of any modifications to the SOFTWARE beyond those necessary for the SOFTWARE to function with licensee's system must be forwarded as source code to the Maui High Performance Computing Center at webmaster@mhpcc.edu. The forwarded modifications are to be accompanied with a brief explanation of why the modification was made and resulting performance of the modifications. Failure to do so renders the license invalid, as well as any licenses you grant to third parties subsequent to the incorporation of the modifications into the SOFTWARE.
4. Copyright owners of modifications to SOFTWARE hereby grant HPCERC a non-exclusive, royalty-free, world-wide, irrevocable right and license to install, use, distribute, sublicense, and prepare derivative works of said modifications.
5. The name 'Maui Scheduler' or its variants must not otherwise be used to endorse or to promote products derived from the SOFTWARE without prior written permission from STC.
6. Products derived from or incorporating the SOFTWARE in whole or in part
shall not contain as part of the product's name any form of the terms 'High
Performance Computing Education and Research Center', 'HPCERC' 'Maui',
'University of New Mexico', 'UNM', 'Maui High Performance Computing Center',
or 'MPHCC', unless prior written permission has been received from the University of New Mexico Patent Administration Office.
7. All advertising materials for products that use or incorporate features of
the SOFTWARE must display the following acknowledgement: 'This product
includes software developed for The University of New Mexico for use in the
Maui Scheduler Software.'
8. It is not required that you accept this LICENSE; however, if you do not accept the terms of this LICENSE, you are prohibited by law from installing, using, modifying or distributing the SOFTWARE or any of its derivative works. Therefore, by installing, using, modifying or distributing the SOFTWARE (or any of its derivative works), you have agreed to this LICENSE and have accepted all its terms and conditions.
9. Each time the SOFTWARE is redistributed (or any work based on the SOFTWARE), the recipient automatically receives this license from STC to copy, distribute or modify the SOFTWARE subject to these terms and conditions, and has the choice of accepting or declining the license. As the LICENSEE, you shall automatically provide the recipient with a copy of this license. Further restrictions are not to be imposed on recipients of the SOFTWARE by the LICENSEE beyond those expressly described herein. The LICENSEE is not responsible for enforcing compliance with this LICENSE by recipients.
10. If any portion of this LICENSE is held invalid or unenforceable under any particular circumstance, the balance of the LICENSE will continue to apply.
NOTE: This license only covers the software located in the src/server subdirectory. This distribution requires the Moab Scheduling System, which is covered by the license located in the main directory.

52
Makefile.in Normal file
View File

@@ -0,0 +1,52 @@
# Makefile @PACKAGE_NAME@ v @PACKAGE_VERSION@
# Copyright: (C) 2002-2005 Cluster Resources, Inc, All Rights Reserved
#
# Generated by configure
BUILDROOT=
export MSCHED_HOME=${BUILDROOT}@SPOOLDIR@
export INST_DIR=${BUILDROOT}@prefix@
export OPSYS=@OPSYS@
export OS=@OS@
export CC=@CC@
export OSCCFLAGS=@CFLAGS@
export OSLDFLAGS=@LDFLAGS@
#SECDEC =-D__MMD5 -D__MOPENSSL
#SECLIB =-lcrypto -lssl
# ============================
# Resource Manager section
# ============================
@ll_definitions@@sdr_definitions@@pbs_definitions@@sge_definitions@@lsf_definitions@@mx_definitions@@pcre_definitions@
# ============================
# Master Makefile for @PACKAGE_NAME@-@PACKAGE_VERSION@
# ============================
all:
${MAKE} -C src/moab all
${MAKE} -C src/mcom all
${MAKE} -C src/server all
${MAKE} -C src/server setup
clean:
${MAKE} -C src/moab clean
${MAKE} -C src/mcom clean
${MAKE} -C src/server clean
install:
${MAKE} -C src/moab install
${MAKE} -C src/mcom install
${MAKE} -C src/server install
uninstall:
${MAKE} -C src/moab uninstall
${MAKE} -C src/mcom uninstall
${MAKE} -C src/server uninstall
setup:
${MAKE} -C src/server setup
distclean: clean
rm -f Makefile maui.cfg.dist include/Makefile.inc.*[!i][!n] include/maui.cfg.dist.inc.*[!i][!n]

46
README Normal file
View File

@@ -0,0 +1,46 @@
Maui Scheduler, Release 3.2.6 (patch 14)
This package contains the Maui Scheduler, an advance reservation based HPC
batch scheduler with extensive job management and resource optimization
features. This version of Maui requires the Moab Local Scheduling System
(2.3 or higher) from Cluster Resources, Inc, which is also bundled in this
distribution.
Source and/or binary forms of this software may be used by any 'End User'
organization pursuant to the condition's of the constraints in the LICENSE
file at no charge and for an unlimited period of time. 'End User'
organizations are defined as organizations which use this software on their
own systems and are not redistributing, modifying, supporting, or providing
other services specific to this software to other organizations for profit.
software may be modified for internal use and/or supported by the licensee
as necessary to meet the needs of the licensee's system. For the full
license conditions for 'End User' and non-End User organizations see the
license agreement/s distributed with this software.
To build this package, run './configure' followed by 'gmake' as the user
under which the software should run.
General documentation can be found at the Official Maui Homepage at
http://clusterresources.com/maui
For integration with various resources managers, please see
PBS - http://clusterresources.com/mauidocs/pbsintegration.html
Loadleveler - http://clusterresources.com/mauidocs/llintegration.html
SGE - http://clusterresources.com/mauidocs/sgeintegration.html
Professional services (installation, configuration, development, consultation,
and support) are available through Cluster Resources, Inc at
http://clusterresources.com
General questions and bug reports may be submitted to the Maui users mailing
list address at
mauiusers@supercluster.org
The Moab Workload Manager is based upon the next generation of the Moab
Scheduling System. If you need increased functionality or scalability, you
may want to consider this tool (see http://clusterresources.com/moab)

7477
configure vendored Executable file

File diff suppressed because it is too large Load Diff

510
configure.ac Normal file
View File

@@ -0,0 +1,510 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(maui, 3.2p8, help@supercluster.org)
AC_CONFIG_SRCDIR([src/mcom/MConst.c])
#AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CC
#AC_PROG_INSTALL
AC_PROG_LN_S
# Assign desired prefix default
AC_PREFIX_DEFAULT([/usr/local/maui])
# Handle spooldir (homedir)
AC_ARG_WITH(spooldir,
[ --with-spooldir=DIR where config files, log and stat directories are maintained [[/usr/local/maui]]],
SPOOLDIR=$withval, SPOOLDIR=/usr/local/maui)
AC_SUBST(SPOOLDIR)
# Machine Name
MACHINENAME=`echo ${ac_hostname} | tr '[[:lower:]]' '[[:upper:]]'`
AC_ARG_WITH(machine,
[ --with-machine=NAME system name (defaults to uppercased hostname)],
MACHINE=$withval, MACHINE=$MACHINENAME)
AC_SUBST(MACHINE)
# Handle Checksum seed
AC_ARG_WITH(key,
[ --with-key=SEED security checksum key (defaults to a random integer)], SEED=$withval, SEED=$RANDOM)
AC_SUBST(SEED)
# Determine OPSYS
OS=`uname`
if test "$OS" = "AIX"; then
if test `uname -v` = 4; then
if test `uname -r` = 1; then
OPSYS="AIX41"
elif test `uname -r` = 2; then
OPSYS="AIX42"
elif test `uname -r` = 3; then
OPSYS="AIX43"
else
OPSYS="AIX43"
RELEASE=`uname -r`
AC_MSG_WARN([Unexpected OS release 'AIX4$(RELEASE)', attempting build with OPSYS=$(OPSYS)])
fi
else
OPSYS=AIX43
OSLEVEL=`oslevel`
AC_MSG_WARN([Unexpected AIX level: $(OSLEVEL), attempting build with OPSYS=$(OPSYS)])
fi
elif test "$OS" = "Linux"; then
OPSYS="LINUX"
elif test "$OS" = "HP-UX"; then
OPSYS="HPUX"
elif test "$OS" = "HP-UX"; then
OPSYS="HPUX"
elif test "$OS" = "IRIX" -o "$OS" = "IRIX64"; then
OPSYS="IRIX"
OS="IRIX"
elif test "$OS" = "NT"; then
OPSYS="NT"
OS="NT"
elif test "$OS" = "OSF1"; then
OPSYS="OSF"
OS="OSF"
else
OPSYS="LINUX"
OS="LINUX"
AC_MSG_WARN([Unsupported OS: $(OS), attempting build with OPSYS=$(OPSYS)])
fi
AC_SUBST(OPSYS)
AC_SUBST(OS)
# Make generic variable Substitutions
AC_SUBST([PACKAGE_NAME])
AC_SUBST([PACKAGE_VERSION])
AC_SUBST([PACKAGE_TARNAME])
AC_SUBST([HOSTNAME], ${ac_hostname})
AC_SUBST([USER], `whoami`)
AC_SUBST([BUILDDATE], `date`)
AC_SUBST([BUILDDIR], `pwd`)
# LoadLeveler
AC_ARG_WITH(loadl,
[ --with-loadl[[=VERSION]] use LoadLeveler Resource Manager (version [[3]])],
[LLVERSION=$withval],
[LLVERSION='FALSE'])
if test "$LLVERSION" != 'FALSE'; then
if test "$LLVERSION" = 'yes'; then
LLVERSION=3;
else
LLVERSION=${withval%.*};
fi
if test "$RMTYPE" = ''; then
RMTYPE=LL
AC_SUBST(RMTYPE)
AC_SUBST_FILE(rm_config)
rm_config=include/maui.cfg.dist.inc.rm
else
AC_MSG_ERROR([Only one Resource Manager can be specified (LL, $RMTYPE)])
fi
if test "$LLVERSION" -lt "3"; then
LLDIR="/usr/lpp/LoadL/full"
LLDEF="-D__MLL22"
else
LLDIR="/home/loadl"
LLDEF="-D__MLL31"
fi
AC_SUBST(LLDIR)
AC_SUBST(LLDEF)
AC_SUBST_FILE(ll_definitions)
ll_definitions=include/Makefile.inc.ll
fi
# SDR
AC_ARG_WITH(sdr,
[ --with-sdr use the IBM SP2 SDR to obtain node info],
[USESDR='TRUE'],
[USESDR='FALSE'])
if test "$USESDR" != 'FALSE'; then
AC_SUBST_FILE(sdr_definitions)
sdr_definitions=include/Makefile.inc.sdr
fi
# PBS
AC_ARG_WITH(pbs,
[ --with-pbs[[=DIR]] use PBS Resource Manager (target directory (location of pbs lib dir) [[/usr/local]])],
[PBSTARGETDIR=$withval],
[PBSTARGETDIR='FALSE'])
if test "$PBSTARGETDIR" != 'FALSE'; then
if test "$PBSTARGETDIR" = 'yes'; then
PBSTARGETDIR='/usr/local';
fi
if test "$RMTYPE" = ''; then
RMTYPE=PBS
AC_SUBST(RMTYPE)
AC_SUBST_FILE(rm_config)
rm_config=include/maui.cfg.dist.inc.rm
else
AC_MSG_ERROR([Only one Resource Manager can be specified (PBS, $RMTYPE)])
fi
if test "$OS" = "OSF"; then
PBSLIBS="$PBSTARGETDIR/ilib/libnet.a -lpbs"
else
PBSLIBS="-lnet -lpbs"
fi
AC_SUBST(PBSTARGETDIR)
AC_SUBST(PBSLIBS)
AC_SUBST_FILE(pbs_definitions)
pbs_definitions=include/Makefile.inc.pbs
fi
# RMS
AC_ARG_WITH(rms,
[ --with-rms[[=standalone]] use Quadrics RMS (default is not as a standalone Resource Manager [[]])],
[USERMS=$withval],
[USERMS='FALSE'])
if test "$USERMS" != 'FALSE'; then
if test "$USERMS" = 'yes'; then
USERMS='supporting';
fi
if test "$USERMS" = 'standalone'; then
if test "$RMTYPE" = ''; then
RMTYPE=RMS
else
AC_MSG_ERROR([Only one Resource Manager can be specified (RMS, $RMTYPE)])
fi
#AC_SUBST_FILE(rms_definitions)
#rms_definitions=include/Makefile.inc.rms
fi
fi
# SGE
AC_ARG_WITH(sge,
[ --with-sge[[=DIR]] use SGE Resource Manager (build directory (location of SGE include and lib directories) [[/usr/local/sge/source]])],
[SGEBUILDDIR=$withval],
[SGEBUILDDIR='FALSE'])
if test "$SGEBUILDDIR" != 'FALSE'; then
if test "$SGEBUILDDIR" = 'yes'; then
SGEBUILDDIR='/usr/local/sge/source';
fi
if test "$RMTYPE" = ''; then
RMTYPE=SGE
AC_SUBST(RMTYPE)
AC_SUBST_FILE(rm_config)
rm_config=include/maui.cfg.dist.inc.rm
else
AC_MSG_ERROR([Only one Resource Manager can be specified (SGE, $RMTYPE)])
fi
SGEOSDIR=`(cd $SGEBUILDDIR; ./aimk -no-mk)`
AC_SUBST(SGEBUILDDIR)
AC_SUBST(SGEOSDIR)
AC_SUBST_FILE(sge_definitions)
sge_definitions=include/Makefile.inc.sge
fi
# LSF
AC_ARG_WITH(lsf,
[ --with-lsf[[=DIR]] use LSF Resource Manager (install directory (location of LSF include and lib directories) [[/usr/local/lsf]])],
[LSFDIR=$withval],
[LSFDIR='FALSE'])
if test "$LSFDIR" != 'FALSE'; then
if test "$LSFDIR" = 'yes'; then
LSFDIR='/usr/local/lsf';
fi
if test "$RMTYPE" = ''; then
RMTYPE=LSF
AC_SUBST(RMTYPE)
AC_SUBST_FILE(rm_config)
rm_config=include/maui.cfg.dist.inc.rm
else
AC_MSG_ERROR([Only one Resource Manager can be specified (LSF, $RMTYPE)])
fi
if test "$USERMS" = 'supporting'; then
LSFLIBS="-lextsch -lbat -llsf -lrmsemu -lnsl -ldl"
LSFDEFS="-D__MLSF -D__MLSFRMS"
else
LSFLIBS="-lextsch -lbat -llsf -lnsl -ldl"
LSFDEFS="-D__MLSF"
fi
AC_SUBST(LSFDIR)
AC_SUBST(LSFLIBS)
AC_SUBST(LSFDEFS)
AC_SUBST_FILE(lsf_definitions)
lsf_definitions=include/Makefile.inc.lsf
fi
# Wiki
AC_ARG_WITH(wiki,
[ --with-wiki use Wiki Resource Manager],
[USEWIKI='TRUE'],
[USEWIKI='FALSE'])
if test "$USEWIKI" != 'FALSE'; then
if test "$RMTYPE" != ''; then
AC_MSG_ERROR([Only one Resource Manager can be specified (WIKI, $RMTYPE)])
fi
RMTYPE=WIKI
fi
# Bamboo Job Manager
AC_ARG_WITH(bamboo,
[ --with-bamboo use Bamboo Resource Manager],
[USEBAMBOO='TRUE'],
[USEBAMBOO='FALSE'])
if test "$USEBAMBOO" != 'FALSE'; then
if test "$RMTYPE" != ''; then
AC_MSG_ERROR([Only one Resource Manager can be specified (BAMBOO, $RMTYPE)])
fi
RMTYPE=SSS
RMPORT=" PORT=4204"
RMHOST=" HOST=$HOSTNAME"
RMSOCKETPROTOCOL=" SOCKETPROTOCOL=HTTP"
RMWIREPROTOCOL=" WIREPROTOCOL=SSS2"
RMVERSION=" VERSION=SSS2.0"
fi
# Other SSS Resource Manager
AC_ARG_WITH(sss-rm,
[ --with-sss-rm[[=PORT]] use SSS Resource Manager (default port [[7865]])],
[SSSRMPORT=$withval],
[SSSRMPORT='FALSE'])
if test "$SSSRMPORT" != 'FALSE'; then
if test "$SSSRMPORT" = 'yes'; then
SSSRMPORT='7865';
fi
if test "$RMTYPE" != ''; then
AC_MSG_ERROR([Only one Resource Manager can be specified (SSS-RM, $RMTYPE)])
fi
RMTYPE=SSS
RMPORT=" PORT=$SSSRMPORT"
RMHOST=" HOST=$HOSTNAME"
RMSOCKETPROTOCOL=" SOCKETPROTOCOL=HTTP"
RMWIREPROTOCOL=" WIREPROTOCOL=SSS2"
RMVERSION=" VERSION=SSS2.0"
fi
if test "$RMTYPE" = ''; then
AC_MSG_WARN([Resource Manager not specified - attempting build with pbs])
RMTYPE=PBS
AC_SUBST(RMTYPE)
AC_SUBST_FILE(rm_config)
rm_config=include/maui.cfg.dist.inc.rm
if test "$OS" = "OSF"; then
PBSLIBS="$PBSTARGETDIR/ilib/libnet.a -lpbs"
else
PBSLIBS="-lnet -lpbs"
fi
AC_SUBST(PBSTARGETDIR)
AC_SUBST(PBSLIBS)
AC_SUBST_FILE(pbs_definitions)
pbs_definitions=include/Makefile.inc.pbs
fi
# Warehouse Node Monitor
AC_ARG_WITH(warehouse,
[ --with-warehouse use Warehouse System Monitor],
[USEWAREHOUSE='TRUE'],
[USEWAREHOUSE='FALSE'])
if test "$USEWAREHOUSE" != 'FALSE'; then
if test "$NMTYPE" = ''; then
RMNMPORT=" NMPORT=12321"
RMNMSERVER=" NMSERVER=$HOSTNAME"
fi
fi
AC_SUBST(RMTYPE)
AC_SUBST(RMPORT)
AC_SUBST(RMHOST)
AC_SUBST(RMSOCKETPROTOCOL)
AC_SUBST(RMWIREPROTOCOL)
AC_SUBST(RMVERSION)
AC_SUBST(RMNMPORT)
AC_SUBST(RMNMSERVER)
# END RM CONFIG --------------------------------------
# START AM CONFIG ------------------------------------
# QBank
AC_ARG_WITH(qbank,
[ --with-qbank use QBank Allocation Manager],
[USEQBANK='TRUE'],
[USEQBANK='FALSE'])
if test "$USEQBANK" != 'FALSE'; then
if test "$AMTYPE" != ''; then
AC_MSG_ERROR([Only one Allocation Manager can be specified (QBANK, $AMTYPE)])
fi
AMTYPE=QBANK
AMHOST=" HOST=$HOSTNAME"
AMPORT=" PORT=7111"
AMOTHER=" CHARGEPOLICY=DEBITALLWC JOBFAILUREACTION=NONE TIMEOUT=15"
fi
# Gold
AC_ARG_WITH(gold,
[ --with-gold use Gold Allocation Manager],
[USEGOLD='TRUE'],
[USEGOLD='FALSE'])
if test "$USEGOLD" != 'FALSE'; then
if test "$AMTYPE" != ''; then
AC_MSG_ERROR([Only one Allocation Manager can be specified (GOLD, $AMTYPE)])
fi
AMTYPE=SSS
AMHOST=" HOST=$HOSTNAME"
AMPORT=" PORT=7112"
AMSOCKETPROTOCOL=" SOCKETPROTOCOL=HTTP"
AMWIREPROTOCOL=" WIREPROTOCOL=XML"
AMOTHER=" CHARGEPOLICY=DEBITALLWC JOBFAILUREACTION=NONE TIMEOUT=15"
fi
# Other SSS Allocation Manager
AC_ARG_WITH(sss-am,
[ --with-sss-am[[=PORT]] use SSS Allocation Manager (default port [[8865]])],
[SSSAMPORT=$withval],
[SSSAMPORT='FALSE'])
if test "$SSSAMPORT" != 'FALSE'; then
if test "$SSSAMPORT" = 'yes'; then
SSSAMPORT='8865';
fi
if test "$AMTYPE" != ''; then
AC_MSG_ERROR([Only one Allocation Manager can be specified (SSS-AM, $AMTYPE)])
fi
AMTYPE=SSS
AMHOST=" HOST=$HOSTNAME"
AMPORT=" PORT=$SSSAMPORT"
AMOTHER=" CHARGEPOLICY=DEBITALLWC JOBFAILUREACTION=NONE TIMEOUT=15"
fi
if test "$AMTYPE" = ''; then
AMTYPE=NONE
fi
AC_SUBST(AMTYPE)
AC_SUBST(AMHOST)
AC_SUBST(AMPORT)
AC_SUBST(AMSOCKETPROTOCOL)
AC_SUBST(AMWIREPROTOCOL)
AC_SUBST(AMOTHER)
# END AM CONFIG ---------------------------------
# MX
AC_ARG_WITH(mx,
[ --with-mx use MX],
[USEMX='TRUE'],
[USEMX='FALSE'])
if test "$USEMX" != 'FALSE'; then
AC_SUBST_FILE(mx_definitions)
mx_definitions=include/Makefile.inc.mx
fi
# PCRE
AC_ARG_WITH(pcre,
[ --with-pcre[[=DIR]] use PCRE (pcre dir (location of PCRE include and lib directories) [[/path/to/pcre]]],
[PCREDIR=$withval],
[PCREDIR='FALSE'])
if test "$PCREDIR" != 'FALSE'; then
if test "$PCREDIR" = 'yes'; then
PCREDIR='/path/to/pcre';
fi
AC_SUBST(PCREDIR)
AC_SUBST_FILE(pcre_definitions)
pcre_definitions=include/Makefile.inc.pcre
fi
# Make sure one RM was specified
if test "$RMTYPE" = ''; then
AC_MSG_ERROR([At least one Resource Manager must be specified])
fi
# Checks for libraries.
AC_CHECK_LIB([m], [sqrt])
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STAT
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_HEADER_TIME
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_SETPGRP
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([gethostbyaddr gethostbyname gethostname gettimeofday inet_ntoa memchr memset pow putenv regcmp regcomp select setlocale socket strchr strdup strerror strrchr strstr strtol strtoul])
# Configure the output files, and generate them.
AC_CONFIG_FILES([include/Makefile.inc.ll
include/Makefile.inc.sdr
include/Makefile.inc.pbs
include/Makefile.inc.sge
include/Makefile.inc.lsf
include/Makefile.inc.mx
include/Makefile.inc.pcre])
AC_CONFIG_FILES([Makefile], [chmod 700 Makefile])
AC_CONFIG_FILES([include/maui.cfg.dist.inc.rm
maui.cfg.dist
maui-private.cfg.dist])
AC_CONFIG_FILES([etc/maui.sh etc/maui.csh])
AC_CONFIG_FILES([include/moab-local.h], [chmod 600 include/moab-local.h])
AC_OUTPUT
# Do miscellaneous configure steps
touch maui.ck
touch maui-private.cfg
# Display final messages
if test -z "`echo $PATH | grep \"$prefix\" 2>/dev/null`"; then
AC_MSG_NOTICE([
Remember to add $prefix/bin to your PATH])
fi
AC_MSG_NOTICE([NOTE: link 'docs/mauidocs.html' to your local website for access to user and admin documentation
NOTE: latest downloads, patches, etc are available at 'http://supercluster.org/maui'
configure successful.])

25
contrib/Makefile Normal file
View File

@@ -0,0 +1,25 @@
# action is snap or all
PKGDIR=/usr/local/pkg
all: maui326
maui326:
ACTION=snap ; \
PKG=maui ; \
VERSION=3.2.6 ; \
PATCH=p10 ; \
BASEDIR=$$PKG-$$VERSION$$PATCH ; \
cd $$BASEDIR ; \
for i in src/[ms]* include; do \
(cd $$i;mkheader.pl ./header.tmpl ./header.cfg $(PKGDIR)/$$BASEDIR/$$i *.[ch]); \
done ; \
for i in contrib docs; do \
(cd $$i;cp -r * $(PKGDIR)/$$BASEDIR/$$i); \
(cd $(PKGDIR)/$$BASEDIR/$$i;find . -name CVS -exec rm -rf {} \; 2>/dev/null) ; \
done ; \
cd .. ; \
TMPFILE=$(PKGDIR)/tmp/$$BASEDIR.tar.gz; \
rm -f $$TMPFILE; \
(cd $(PKGDIR);tar -czf $$TMPFILE $$BASEDIR) ;\
./copyfiles maui $$VERSION $$PATCH $$TMPFILE $$ACTION

0
contrib/README Normal file
View File

View File

@@ -0,0 +1,2 @@
all: mauireswww
mauireswww: mauireswww.o

View File

@@ -0,0 +1,64 @@
Submitted as contributed work to the Maui Scheduler
Copyright (C) 2001 Niclas Andersson
National Supercomputer Centre, Sweden
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
DESCRIPTION
The program 'mauires' generates a HTML-table out of the output from
'showres -n' in the Maui Scheduler. Job reservations are always shown
on top of any possible user reservation.
Standing reservations can be recognized by name and shown in a
different color. Currently, user reservations named "devel*" is
recognized.
The output consists of a table with gif-images in various sizes
showing all the reservations made, both running and idle, giving a
good overview of the load on the system. CSS is used to prettify the
output.
The output is preferably combined with the output from 'showq' in a
perl-script creating a WWW-page showing a more complete status of the
system. The enclosed file 'ingvarstatus' is such a script. For
a live demonstration, please direct your WWW browser to
http://www.nsc.liu.se/cgi-bin/ingvarstatus
FILES
mauireswww.c
mauistatus
mauistatus.html
status.gif
transp.gif
bggrid.gif
darkgreen.gif
green.gif
red.gif
yellow.gif
gray.gif
sunday.gif
monday.gif
tuesday.gif
wednesday.gif
thursday.gif
friday.gif
saturday.gif
AUTHOR
Niclas Andersson <nican@nsc.liu.se>
National Supercomputer Centre, Sweden

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 B

BIN
contrib/UI/mauireswww/mauireswww Executable file

Binary file not shown.

View File

@@ -0,0 +1,450 @@
/* Generates a HTML-table from the output of 'showres -n'
Version: 1.3
Copyright (C) 2001 Niclas Andersson
National Supercomputer Centre, Sweden
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define INT_MAX ((int)(~0U>>1))
#define DEBUG 0
#if DEBUG
/* Create a stand alone WWW-page
Convenient during testing */
# define WWWPAGE 1
# define IMGURL ""
#else
# define WWWPAGE 0
/* The path to the images */
/* # define IMGURL "/images/" */
# define IMGURL ""
#endif
#define NROFNODES 32
/* name of common development reservation */
#define DEVELRES "devel"
/* pixels/row */
#define RESHEIGHT 12
/* pixels = SCALE(seconds) */
#define _SCALE ((double)RESHEIGHT / 3600)
#define SCALE(x) (int)(_SCALE * (x) + .5)
/* The reservation data structures */
struct node {
struct node *next;
struct res *jobres;
struct res *userres;
char name[16];
};
struct res {
struct res *next;
int start;
int end;
char state;
char type;
char id[20];
};
struct node *nodes;
int mintime = 0;
int maxtime = 0;
int jobmaxtime = 0;
/* Reservation data */
enum restype { res_none, res_bg, res_running, res_idle, res_user, res_devel,
res_time };
char *resimg[] = {
"transp.gif",
"bggrid.gif",
"darkgreen.gif",
"green.gif",
"red.gif",
"yellow.gif",
"gray.gif"
};
#define DAYIMGTIME 5*3600 /* width of day image in scheduling time */
char *dayimg[] = {
"sunday.gif",
"monday.gif",
"tuesday.gif",
"wednesday.gif",
"thursday.gif",
"friday.gif",
"saturday.gif"
};
void initnodes()
{
int n;
nodes = (struct node *)malloc(NROFNODES * sizeof(struct node));
if (!nodes) {
perror("malloc");
exit(1);
}
/* initialize fields and make a linked list of nodes */
for (n=0; n<NROFNODES; n++) {
sprintf(nodes[n].name, "i%d", n+1);
nodes[n].next = nodes+n+1;
nodes[n].jobres = NULL;
nodes[n].userres = NULL;
}
nodes[NROFNODES-1].next = NULL;
}
void printreslist(struct res *list)
{
struct res *r;
for (r=list; r; r=r->next) {
fprintf(stderr, " start=%d end=%d type=%c id=%s\n",
r->start, r->end, r->type, r->id);
}
}
void printallres()
{
struct node *n;
for (n=nodes; n; n=n->next) {
fprintf(stderr, "Node %s\n", n->name);
if (n->jobres) {
fprintf(stderr, " Job\n");
printreslist(n->jobres);
}
if (n->userres) {
fprintf(stderr, " User\n");
printreslist(n->userres);
}
}
}
void insertresinlist(struct res *new, struct res **list)
{
struct res **cur;
for (cur=list; *cur; cur=&(*cur)->next)
if (new->start < (*cur)->start) break;
new->next = *cur;
*cur = new;
}
/* The reservations is splitted into two reservation lists, job
reservations and advance user reservations for each node.
*/
void insertres(char *nodename, char *id, char type, char state,
int start, int duration)
{
int r, i;
struct node *n;
struct res **cur, *prev, *new;
/* create new reservation */
new = (struct res *)malloc(sizeof(struct res));
if (!new) {
perror("malloc");
exit(1);
}
new->next = NULL;
new->start = start;
new->end = start + duration;
new->state = state;
new->type = type;
strncpy(new->id, id, 20);
/* find node */
n = nodes;
for (n=nodes; n; n=n->next) {
if (!strcmp(n->name, nodename))
break;
}
/* nodename not found */
if (!n) return;
switch (type) {
case 'J': /* Job */
insertresinlist(new, &n->jobres);
if (new->end > jobmaxtime) jobmaxtime = new->end;
break;
case 'U': /* User */
case 'S': /* System */
insertresinlist(new, &n->userres);
break;
}
/* statistics */
if (start < mintime) mintime = start;
if (start+duration > maxtime) maxtime = start + duration;
}
/* Convert from [-][dd:]hh:mm:ss to seconds. */
int time2sec(char *time)
{
int dd, hh, mm, ss;
int res, sign, sec;
char tmp;
/* a fix for INFINITE & INFINITY
should be handled in another way */
if (strstr(time, "INFINIT")) return 1;
/* get sign */
res = sscanf(time, " -%c", &tmp);
sign = res ? -1 : 1;
res = sscanf(time, "%d:%d:%d:%d", &dd, &hh, &mm, &ss);
dd = abs(dd);
if (res == 3) {
/* shift rigth */
ss = mm; mm = hh; hh = dd; dd = 0;
}
sec = sign * (86400 * dd + 3600 * hh + 60 * mm + ss);
return sec;
}
void getshowres(FILE *fd)
{
char line[2000];
int t;
char tok[8][30];
char nodename[20], type[20], resid[20], jobstate[20];
int start, duration, task;
while (fgets(line, 2000, fd)) {
/* Ignore some lines */
if (strlen(line) <= 1) continue;
if (strstr(line, "reservations on")) continue;
if (strstr(line, "nodes reserved")) continue;
for (t=0; t<8; t++) memset(tok[t], 0, 30);
/* Use the fixed format */
sscanf(line, "%20c%11c%19c%11c%5c%12c%12c%21c",
tok[0], tok[1], tok[2], tok[3],
tok[4], tok[5], tok[6], tok[7]);
sscanf(tok[0], "%s", nodename);
/* Skip title line */
if (strstr(nodename, "NodeName")) continue;
sscanf(tok[1], "%s", type);
sscanf(tok[2], "%s", resid);
sscanf(tok[3], "%s", jobstate);
sscanf(tok[4], "%d", &task);
start = time2sec(tok[5]);
duration = time2sec(tok[6]);
insertres(nodename, resid, type[0], jobstate[0], start, duration);
}
}
/* Print one reservation. */
void printres(int start, int end, enum restype type)
{
int height, width;
char *img;
int size;
img = resimg[type];
height = RESHEIGHT;
/* Need to do two proper conversions to integer */
width = SCALE(end) - SCALE(start);
/* width=0 is ignored by Netscape */
if (width <= 0) return;
#if 1 /* one <IMG> per "reservation" */
printf("<img border=0 height=%d width=%d src=\"%s%s\">",
height, width, IMGURL, img);
#else /* binary sized <IMG>
a test to see if the browser caches the images differently */
for (size=4096; size>=1; size/=2) {
fprintf(stderr, "res size=%d width=%d\n", size, width);
if (size > width) continue;
printf("<img border=0 height=%d width=%d src=\"%s%s\">",
height, size, IMGURL, img);
width -= size;
}
#endif
#if DEBUG
fprintf(stderr, "start=%8d end=%8d type=%d\n", start, end, type);
#endif
}
void printrow(struct node *n)
{
struct res *jobres, *userres;
enum restype type;
int dur, t;
int curtime;
printf("<tr><td class=\"nodename\">%s</td><td>&nbsp;</td>"
"<td class=\"reservations\">",
n->name);
#if DEBUG
fprintf(stderr, "Node %s\n", n->name);
#endif
/* This is where we figure out what reservation to output */
/* It traverse two linked list and handles all events (start, end) that
occurs. Job reservation are always visible. User reservations "under"
job reservations are not visible. */
curtime = 0;
jobres = n->jobres;
userres = n->userres;
while (jobres || userres) {
if (jobres && jobres->start <= curtime) {
if (jobres->end > curtime) {
switch (jobres->state) {
case 'R':
type = res_running;
break;
case 'I':
type = res_idle;
break;
}
printres(curtime, jobres->end, type);
curtime = jobres->end;
}
jobres = jobres->next;
continue;
}
if (userres && userres->start <= curtime) {
if (userres->end > curtime) {
/* Use another color on development reservations */
type = (strstr(userres->id, DEVELRES)) ? res_devel : res_user;
if (jobres && jobres->start < userres->end) {
printres(curtime, jobres->start, type);
curtime = jobres->start;
/* The user_res may contine after the job_res */
continue;
}
/* limit the length of user reservations */
t = userres->end;
/* t = MIN(userres->end, jobmaxtime); */
printres(curtime, t, type);
curtime = userres->end;
}
userres = userres->next;
continue;
}
/* The node is currently free.
Figuring out when next reservation occurs */
t = INT_MAX;
if (jobres) t = MIN(t, jobres->start);
if (userres) t = MIN(t, userres->start);
printres(curtime, t, res_none);
curtime = t;
}
/* Unallocated nodes needs something between <td> and </td>.
(&nbsp; adds extra vertical space ???) */
printres(0, 3600, res_none);
printf("</td></tr>\n");
}
void printdays()
{
int curtime, tim, day, diff;
struct tm midnight;
time_t t;
int i;
struct tm *now;
curtime = 0;
diff = time(&t);
now = localtime(&t);
midnight = *now;
midnight.tm_hour = midnight.tm_min = midnight.tm_sec = 0;
tim = mktime(&midnight) - diff;
day = now->tm_wday;
#if DEBUG
fprintf(stderr, "seconds to midnight=%d day=%d\n", tim-curtime, day);
#endif
printf("<tr><td>&nbsp;</td><td>&nbsp;</td><td class=\"reservations\">");
for (;;) {
/* next day */
day = (day+1)%7;
tim += 24*3600;
/* continue 'til end of row */
if (tim+DAYIMGTIME > maxtime) break;
printres(curtime, tim, res_none);
printf("<img src=\"%s%s\">", IMGURL, dayimg[day]);
curtime = tim+DAYIMGTIME;
}
printf("</td></tr>");
}
void printlegend()
{
int end = 3600;
/* empty row */
printf("<tr><td>&nbsp;</td></tr>\n");
printf("<!-- legend -->\n"
"<tr><td>&nbsp;</td><td>&nbsp;</td>"
"<td><div class=\"legend\">");
printres(0, end, res_bg);
printf(" = 1 node-hour ");
printres(0, end, res_running);
printf(" = running job ");
printres(0, end, res_idle);
printf(" = advance job reservation ");
printres(0, end, res_user);
printf(" = static reservation ");
printres(0, end, res_devel);
printf(" = development reservation (max walltime: 1 h) ");
printf("</div></td></tr>\n");
}
void printtable()
{
struct node *n;
#if DEBUG
fprintf(stderr, "mintime=%d maxtime=%d\n", mintime, maxtime);
#endif
printf("<table class=\"nodealloc\" cellpadding=0 cellspacing=0 border=0>\n");
/* reservations */
for (n=nodes; n; n=n->next)
printrow(n);
printdays();
printlegend();
printf("</table>\n");
}
int main(int argc, char ** argv)
{
initnodes();
getshowres(stdin);
#if DEBUG
printallres();
#endif
#if WWWPAGE
printf("<html>\n"
"<head>\n"
" <title>%s</title>\n"
" <style>\n"
" td { font-family: Arial,Helvetica; font-size: 10px}\n"
" .nodename { text-align: right; }\n"
" .reservations { white-space:pre; background: url(%s%s); background-color: #ffffa0; font-size: 10px;}"
" </style>\n"
"</head>\n"
"<body>\n",
"Showres");
#endif
printtable();
#if WWWPAGE
printf("</body>\n</html>\n");
#endif
}

View File

@@ -0,0 +1,22 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>Status Description</title>
<link rel="stylesheet" href="ug.css" type="text/css">
</head>
<body>
<h1>Status Description</h1>
<hr noshade>
<img align="center" src="status.gif">
<p><span class="OBS">Note:</span>
All advance job reservations are targeted for rescheduling every
scheduling iteration (60 seconds) and whenever new jobs enter
the batch system.
<hr noshade>
<address>
<a href="mailto:nican@nsc.liu.se">Niclas Andersson</a>
</address>
</body>
</html>

View File

@@ -0,0 +1,101 @@
#!/usr/bin/perl
#
# Version: 1.3
#
# Copyright (C) 2001 Niclas Andersson
# National Supercomputer Centre, Sweden
#
# NOTE: script must be configured by setting the following variables
$MAUIPATH="/usr/local/maui/bin";
$CGIPATH="/home/www/bin";
$MACHINENAME="Ingvar";
use CGI qw/:standard/;
$refresh = 900;
$bggrid5 = "bggrid5.gif"; # URL
$style = <<EOF;
p,th,td { font-family: Arial,Helvetica; }
/* mauireswww */
.nodename { font-size: 12px; text-align: right; }
.nodealloc td { font-size: 12px}
.nodealloc th { font-style: bold; text-align: left; background: url($bggrid5); background-color: #ffffa0; }
.reservations { fontsize: 1px; white-space: pre; background: url($bggrid5); background-color: #ffffa0; }
.legend { font-size: 14px}
.note { color: #800000 }
EOF
# newline
sub nl() { return "\n"; }
$date = localtime();
print header(-expires=>'+1m',
-Refresh=>"$refresh; URL=" . url());
print start_html(-title=>'${MACHINENAME} Status',
-bgcolor=>'#ffffff',
-head=>style($style));
print
h1('${MACHINENAME} Status'), nl,
h4($date), nl, hr({-noshade});
#--------------------------------------------------------------------------
print h3("Node Reservations:");
open(NODERES, "${MAUIPATH}/showres -n | ${CGIPATH}/mauireswww |")
or die;
@restbl = <NODERES>;
close(NODERES);
print @restbl;
print p, <<EOF;
The priority of idle jobs, whether their projects have normal
or bonus priority is not yet shown.
Normal priority jobs are always scheduled before idle, not started,
bonus priority jobs.
<p><b class="note">Note:</b>
All advance job reservation is target for rescheduling
every scheduling iteration (60 seconds) and whenever new jobs
enter the batch system.
<p><a href="mauistatus.html">Description of the graph</a>
EOF
#--------------------------------------------------------------------------
print hr({-noshade}), nl, h3("Job Status:");
open(SHOWQ, "${MAUIPATH}/showq |") or die;
while (<SHOWQ>) {
if (/ACTIVE JOBS/) {
print h4("Active Jobs"), "<pre>";
next;
}
if (/IDLE JOBS/) {
print "</pre>", h4("Idle Jobs"), "<pre>";
next;
}
if (/NON-QUEUED JOBS/) {
print "</pre>", h4("Non-Queued Jobs"), "<pre>";
next;
}
if (/JOBNAME/) {
print b($_);
next;
}
print;
}
print "</PRE>";
close(SHOWQ);
#--------------------------------------------------------------------------
print hr({-noshade}), nl,
address(a({-href=>'/~nican/'}, "Niclas Andersson")),
end_html, nl;

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 B

112
contrib/appsim/BenchMark.c Normal file
View File

@@ -0,0 +1,112 @@
/* CONTRIB: OSCProximityNodeAlloc.c */
/* code to be included in LocalJobAllocResources() in Local.c */
int ContribOSCProximityNodeAlloc(
mjob_t *J, /* IN: job allocating nodes */
mreq_t *RQ, /* IN: req allocating nodes */
nodealloc_t NodeList[], /* IN: eligible nodes */
int RQIndex, /* IN: index of job req to evaluate */
int MinTPN[], /* IN: min tasks per node allowed */
int MaxTPN[], /* IN: max tasks per node allowed */
char NodeMap[], /* IN: array of node alloc states */
int AffinityLevel, /* IN: current reservation affinity level to evaluate */
int NodeIndex[], /* IN/OUT: index of next node to find in BestList */
nodealloc_t BestList[MAX_REQ_PER_FRAG][], /* IN/OUT: list of selected nodes */
int TaskCount[], /* IN/OUT: total tasks allocated to req */
int NodeCount[]) /* IN/OUT: total nodes allocated to req */
{
int NIndex;
int nindex;
int TC;
mnode_t *N;
nodealloc_t MyNodeList[MAX_MNODE];
int MyNIndex;
/* select first 'RQ->TaskCount' procs */
MyNIndex = 0;
for (nindex = 0;NodeList[nindex].nodeindex != -1;nindex++)
{
NIndex = NodeList[nindex].nodeindex;
TC = NodeList[nindex].taskcount;
if (NodeMap[NIndex] != AffinityLevel)
{
/* node unavailable */
continue;
}
if (TC < MinTPN[RQIndex])
continue;
TC = MIN(TC,MaxTPN[RQIndex]);
N = &MNode[NIndex];
/* determine node locality */
/* NOT IMPLEMENTED */
/* determine node time availability */
/* NOT IMPLEMENTED */
/* add node to private list */
MyNodeList[MyNIndex].taskcount = TC;
MyNodeList[MyNIndex].nodeindex = NIndex;
} /* END for (nindex) */
/* select best nodes */
/* NOT IMPLEMENTED */
/* populate BestList with selected nodes */
for (nindex = 0;MyNodeList[nindex].nodeindex != -1;nindex++)
{
NIndex = MyNodeList[nindex].nodeindex;
TC = MyNodeList[nindex].taskcount;
BestList[RQIndex][NodeIndex[RQIndex]].nodeindex = NIndex;
BestList[RQIndex][NodeIndex[RQIndex]].taskcount = TC;
NodeIndex[RQIndex] ++;
TaskCount[RQIndex] += TC;
NodeCount[RQIndex] ++;
/* mark node as used */
NodeMap[NIndex] = nmUnavailable;
if (TaskCount[RQIndex] >= RQ->TaskCount)
{
/* all required tasks found */
/* NOTE: HANDLED BY DIST */
if ((RQ->NodeCount == 0) ||
(NodeCount[RQIndex] >= RQ->NodeCount))
{
/* terminate BestList */
BestList[RQIndex][NodeIndex[RQIndex]].nodeindex = -1;
break;
}
}
} /* END for (nindex) */
return(SUCCESS);
} /* END ContribOSCProximityNodeAlloc() */
/* END OSCProximityNodeAlloc.c */

613
contrib/appsim/LocalStage.c Normal file
View File

@@ -0,0 +1,613 @@
/* HEADER */
/* Contains: *
* */
#define COMPUTE_NODE_STAGE_LOAD 1 /* CPU load of a compute node staging data */
/* prototypes */
int MASLocalStage(mjob_t *,int,void *,void **);
int MASLSJobUpdate(mjob_t *);
int MASLSJobDestroy(mjob_t *);
int MASLSJobShow(mjob_t *,char *);
int MASLSJobCreate(mjob_t *,char *);
int MASLSJobConfig(mjob_t *,char *);
/* structures */
typedef struct {
char *Name;
int ASState;
xres_t *INetRes;
char *IFileName;
int IFileSize; /* in KB */
int IFileStaged;
long IStageTime;
xres_t *ONetRes;
char *OFileName;
int OFileSize; /* in KB */
int OFileStaged;
long OStageTime;
} maslsdata_t;
const char *MASLSAttributeType[] = {
NONE,
"INPUT",
"OUTPUT",
"STATE",
NULL };
enum MASLSAttrEnum {
maslsaNONE = 0,
maslsaInput,
maslsaOutput,
maslsaState };
int MASLocalStage(
mjob_t *J,
int CmdIndex,
void *IData,
void **OData)
{
int rc;
if (J == NULL)
return(FAILURE);
switch(CmdIndex)
{
case mascConfig:
rc = MASLSJobConfig(J,(char *)IData);
break;
case mascCreate:
rc = MASLSJobCreate(J,(char *)IData);
break;
case mascDestroy:
rc = MASLSJobDestroy(J);
break;
case mascShow:
rc = MASLSJobShow(J,(char *)OData);
break;
case mascUpdate:
rc = MASLSJobUpdate(J);
break;
default:
rc = FAILURE;
break;
} /* END switch(CmdIndex) */
return(rc);
} /* END MASLocalStage() */
int MASLSJobCreate(
mjob_t *J,
char *ConfigString)
{
char *ptr;
char *TokPtr;
char *ptr2;
char *TokPtr2;
char *ptr3;
char ValLine[MAX_MLINE];
int aindex;
mreq_t *RQ;
maslsdata_t *D;
if (J == NULL)
return(FAILURE);
/* NOTE: by default, each job uses 100% of all dedicated resources */
/* set 'RQ->URes.Procs' */
/* set 'RQ->URes.Mem' */
/* create AS data structure */
if (J->ASData == NULL)
{
J->ASData = calloc(1,sizeof(maslsdata_t));
}
D = (maslsdata_t *)J->ASData;
if (ConfigString != NULL)
{
/* process config data */
/* FORMAT: INPUT=<INPUTDATANAME>:<INPUTDATASIZE>;OUTPUT=<OUTPUTDATANAME>:<OUTPUTDATASIZE> */
ptr = MUStrTok(ConfigString,"; \t\n",&TokPtr);
while (ptr != NULL)
{
if (MUGetPair(
ptr,
(const char **)MASLSAttributeType,
&aindex,
NULL,
TRUE,
NULL,
ValLine,
MAX_MNAME) == FAILURE)
{
/* cannot parse value pair */
ptr = MUStrTok(NULL,"; \t\n",&TokPtr);
continue;
}
switch(aindex)
{
case maslsaInput:
/* FORMAT: <FILENAME>[<@<SOURCE>]:<FILESIZE> */
if (strchr(ValLine,'@') != NULL)
{
if ((ptr2 = MUStrTok(ValLine,":@",&TokPtr2)) != NULL)
{
MUStrDup(&D->IFileName,ptr2);
if ((ptr2 = MUStrTok(NULL,":@",&TokPtr2)) != NULL)
{
MGResFind(ptr2,-1,&D->INetRes);
}
}
}
else
{
if ((ptr2 = MUStrTok(ValLine,":",&TokPtr2)) != NULL)
{
MUStrDup(&D->IFileName,ptr2);
}
}
if (D->INetRes == NULL)
{
MGResFind(NULL,-1,&D->INetRes);
}
if ((ptr2 = MUStrTok(NULL,":@",&TokPtr2)) != NULL)
{
D->IFileSize = (int)strtol(ptr2,NULL,0);
}
D->IFileStaged = 0;
break;
case maslsaOutput:
/* FORMAT: <FILENAME>[<@<SOURCE>]:<FILESIZE> */
if (strchr(ValLine,'@') != NULL)
{
if ((ptr2 = MUStrTok(ValLine,":@",&TokPtr2)) != NULL)
{
MUStrDup(&D->OFileName,ptr2);
if ((ptr2 = MUStrTok(NULL,":@",&TokPtr2)) != NULL)
{
MGResFind(ptr2,-1,&D->ONetRes);
}
}
}
else
{
if ((ptr2 = MUStrTok(ValLine,":",&TokPtr2)) != NULL)
{
MUStrDup(&D->OFileName,ptr2);
}
}
if (D->ONetRes == NULL)
{
MGResFind(NULL,-1,&D->ONetRes);
}
if ((ptr2 = MUStrTok(NULL,":@",&TokPtr2)) != NULL)
{
D->OFileSize = (int)strtol(ptr2,NULL,0);
}
D->OFileStaged = 0;
break;
default:
break;
} /* END switch(aindex) */
ptr = MUStrTok(NULL,"; \t\n",&TokPtr);
} /* END while (ptr != NULL) */
} /* END if (ConfigString != NULL) */
/* clear resource usage */
RQ = J->Req[0];
memset(&RQ->URes,0,sizeof(RQ->URes));
return(SUCCESS);
} /* END MASLSJobCreate() */
int MASLSJobShow(
mjob_t *J,
char *Buffer)
{
maslsdata_t *D;
if ((J == NULL) || (Buffer == NULL))
{
return(FAILURE);
}
Buffer[0] = '\0';
D = (maslsdata_t *)J->ASData;
/* display staging file name, size, and status */
if (D->IFileName[0] != '\0')
{
sprintf(Buffer,"%sINPUT: File: %s:%d over %s\n",
Buffer,
D->IFileName,
D->IFileSize,
(D->INetRes != NULL) ? D->INetRes->Name : "DEFAULT");
}
if (D->OFileName[0] != '\0')
{
sprintf(Buffer,"%sOUTPUT: File: %s:%d over %s\n",
Buffer,
D->OFileName,
D->OFileSize,
(D->ONetRes != NULL) ? D->ONetRes->Name : "DEFAULT");
}
return(SUCCESS);
} /* END MASLSJobShow() */
int MASLSJobDestroy(
mjob_t *J)
{
maslsdata_t *D;
J->ASFunc = NULL;
/* clear AS Data */
if (J->ASData != NULL)
{
D = (maslsdata_t *)J->ASData;
MUFree(&D->IFileName);
MUFree(&D->OFileName);
MUFree((char **)J->ASData);
}
return(SUCCESS);
} /* END MASLSJobDestroy() */
int MASLSJobConfig(
mjob_t *J,
char *ConfigString)
{
char *ptr;
char *TokPtr;
int aindex;
char ValLine[MAX_MLINE];
char tmpLine[MAX_MLINE];
int index;
maslsdata_t *D;
if ((J == NULL) || (ConfigString == NULL))
{
return(FAILURE);
}
D = (maslsdata_t *)J->ASData;
if (D == NULL)
return(FAILURE);
/* process config data */
/* FORMAT: INPUT=<INPUTDATANAME>:<INPUTDATASIZE>;OUTPUT=<OUTPUTDATANAME>:<OUTPUTDATASIZE>;STATE=<STATE>; */
ptr = MUStrTok(ConfigString,"; \t\n",&TokPtr);
while (ptr != NULL)
{
if (MUGetPair(
ptr,
(const char **)MASLSAttributeType,
&aindex,
NULL,
TRUE,
NULL,
ValLine,
MAX_MNAME) == FAILURE)
{
/* cannot parse value pair */
ptr = MUStrTok(NULL,"; \t\n",&TokPtr);
continue;
}
switch(aindex)
{
case maslsaState:
index = MUGetIndex(ValLine,MJobState,0,0);
switch(index)
{
case mjsStarting:
case mjsRunning:
if ((D->ASState != mjsStarting) && (D->ASState != mjsRunning))
{
if ((D->IFileSize > 0) && (D->INetRes->Func != NULL))
{
/* initiate stagein transaction */
sprintf(tmpLine,"FILE+=%s:%d",
D->IFileName,
D->IFileSize);
(*D->INetRes->Func)(
&D->INetRes->Data,
mascConfig,
tmpLine,
(void **)&D->IStageTime);
}
D->ASState = index;
}
break;
default:
/* NO-OP */
break;
} /* END switch(index) */
break;
default:
/* NO-OP */
break;
} /* END switch(aindex) */
ptr = MUStrTok(NULL,"; \t\n",&TokPtr);
} /* END while (ptr != NULL) */
return(SUCCESS);
} /* END MASLSJobConfig() */
int MASLSJobUpdate(
mjob_t *J)
{
long Now;
mreq_t *RQ;
maslsdata_t *D;
double CR;
char tmpLine[MAX_MLINE];
RQ = J->Req[0];
/* default app sim jobs utilize 100% of dedicated resources */
if (J == NULL)
return(FAILURE);
D = (maslsdata_t *)J->ASData;
if (D == NULL)
return(FAILURE);
switch (J->State)
{
case mjsRunning:
case mjsStarting:
/* job is active */
if ((D->IFileName == NULL) || (D->IStageTime > 0))
{
/* no file to stage or file staging is complete */
if ((D->IFileName == NULL) && (D->IStageTime == 0))
{
D->IStageTime = J->StartTime;
}
if (MSched.Time - D->IStageTime < MSched.RMPollInterval)
{
/* job utilizes increased compute resources once data is staged */
if ((D->IStageTime > 0) && (D->INetRes != NULL))
{
/* staging completed this iteration */
CR = (double)(MSched.Time - D->IStageTime) * 100.0 / MSched.Interval;
}
else
{
CR = 1.0;
}
RQ->URes.Procs = (int)(RQ->DRes.Procs * 100 * CR);
RQ->URes.Mem = (int)(RQ->DRes.Mem * CR);
RQ->URes.Swap = (int)(RQ->DRes.Swap * CR);
RQ->URes.Disk = (int)(RQ->DRes.Disk * CR);
RQ->LURes.Procs = RQ->DRes.Procs * 100;
RQ->LURes.Mem = RQ->DRes.Mem;
RQ->LURes.Swap = RQ->DRes.Swap;
RQ->LURes.Disk = RQ->DRes.Disk;
if (D->INetRes != NULL)
{
/* transfer complete */
if (D->INetRes->Func != NULL)
{
/* remove transaction */
sprintf(tmpLine,"FILE-=%s",
D->IFileName);
(*D->INetRes->Func)(
&D->INetRes->Data,
mascConfig,
tmpLine,
(void **)NULL);
D->INetRes = NULL;
}
}
D->ASState = J->State;
}
}
else
{
/* input file is staging */
/* compute nodes are partially loaded when staging data */
RQ->URes.Procs = RQ->DRes.Procs * COMPUTE_NODE_STAGE_LOAD;
}
break;
case mjsIdle:
/* job is idle */
/* job data is static */
if (J->State != D->ASState)
{
memset(&RQ->URes,0,sizeof(RQ->URes));
D->ASState = J->State;
}
break;
case mjsCompleted:
case mjsRemoved:
/* job is completed */
/* job is freed once output data is staged */
if (J->State != D->ASState)
{
memset(&RQ->URes,0,sizeof(RQ->URes));
D->ASState = J->State;
}
break;
default:
/* NO-OP */
break;
} /* END switch(J->State) */
return(SUCCESS);
} /* END MASLSJobUpdate() */
/* END LocalStage.c */

720
contrib/appsim/Net1.c Normal file
View File

@@ -0,0 +1,720 @@
/* HEADER */
/* Contains: *
* */
/* this file contains routines to allow emulation of a network infrastructure resource *
* Each network possesses a bandwidth, latency issues ae not considered *
* Each network attempts to equally service all requests simultaneously *
* All requests require a minimum of one scheduling cycle? */
/* MASNet structures */
enum {
masnt1NONE = 0,
masnt1Create,
masnt1Suspend,
masnt1Resume,
masnt1Destroy };
typedef struct {
int State; /* 0: transfer is suspended/completed 1: transfer is active */
char *FileName;
int FileSize; /* in KB */
int DataStaged; /* in KB */
long StartTime; /* non-zero when transfer is started */
long *CompletionTime; /* non-zero when transfer is completed */
} masnet1trans_t;
typedef struct {
char *Name;
int State;
int Bandwidth; /* in MB/s */
masnet1trans_t *ActiveList[MAX_MJOB];
int Duration; /* in seconds */
int MBTransferred;
int TransfersCompleted;
double AvgTransferBW;
int AvgTransferDelay;
} masnet1_t;
const char *MASNet1AttributeType[] = {
NONE,
"BANDWIDTH",
"FILE",
"NAME",
"STATE",
NULL };
enum MASNet1AttrEnum {
masnet1aNONE = 0,
masnet1aBandwidth,
masnet1aFile,
masnet1aName,
masnet1aState };
/* prototypes */
int MASNet1(
masnet1_t **N,
int CmdIndex,
void *IData,
void **OData);
int MASNet1Config(
masnet1_t *N,
char *ConfigString,
void **OData);
int MASNet1Destroy(
masnet1_t **N);
int MASNet1Create(
masnet1_t **N,
char *ConfigString);
int MASNet1Update(
masnet1_t *N);
int MASNet1Query(
masnet1_t *N,
char *AttrName,
void **AttrVal)
{
if ((N == NULL) || (AttrName == NULL) || (AttrVal == NULL))
{
return(FAILURE);
}
/* NYI */
return(FAILURE);
} /* END MASNet1Query() */
int MASNet1Show(
masnet1_t *N,
char *Buffer)
{
int tindex;
masnet1trans_t *T;
char tmpString[MAX_MNAME];
/* display state, configuration, statistics, and activity */
if ((N == NULL) || (Buffer == NULL))
{
return(FAILURE);
}
Buffer[0] = '\0';
sprintf(Buffer,"%sResource %s Type: %s\n\n",
Buffer,
N->Name,
"Network");
sprintf(Buffer,"%sState: %s\n\n",
Buffer,
(N->State == 1) ? "Active" : "Down");
sprintf(Buffer,"%sBandwidth: %d MB/s\n",
Buffer,
N->Bandwidth);
sprintf(Buffer,"%sUpTime: %s Data Transferred: %d MB Transfers Completed: %d\n",
Buffer,
MULToTString(N->Duration),
N->MBTransferred,
N->TransfersCompleted);
sprintf(Buffer,"%sAvg Effective BW/Job: %6.2lf Avg Delay/Job: %6.2lf\n",
Buffer,
(N->TransfersCompleted > 0) ? N->AvgTransferBW / N->TransfersCompleted : 0.0,
(N->TransfersCompleted > 0) ? (double)N->AvgTransferDelay / N->TransfersCompleted : 0.0);
strcat(Buffer,"\n");
for (tindex = 0;tindex < MAX_MNODE;tindex++)
{
/* display transaction information */
T = N->ActiveList[tindex];
if (T == NULL)
break;
if (T == (masnet1trans_t *)1)
continue;
if ((T->CompletionTime != NULL) && (*T->CompletionTime > 0))
{
strcpy(tmpString,MULToTString(*T->CompletionTime - MSched.Time));
}
else
{
strcpy(tmpString,"N/A");
}
sprintf(Buffer,"%s Transaction[%d] %s %d of %d KB %s -> %s\n",
Buffer,
tindex,
T->FileName,
T->DataStaged,
T->FileSize,
MULToTString((T->StartTime > 0) ? T->StartTime - MSched.Time : 0),
tmpString);
} /* END for tindex) */
strcat(Buffer,"\n");
return(SUCCESS);
} /* MASNet1Show() */
int MASNet1TransCreate(
masnet1_t *N,
char *FileName,
int FileSize, /* in MB */
long *StageTimePtr)
{
int tindex;
masnet1trans_t **T;
if (N == NULL)
return(FAILURE);
for (tindex = 0;tindex < MAX_MNODE;tindex++)
{
T = &N->ActiveList[tindex];
if (*T == (masnet1trans_t *)NULL)
break;
if (*T == (masnet1trans_t *)1)
break;
} /* END for (tindex) */
if (tindex == MAX_MNODE)
{
/* transaction buffer is full */
return(FAILURE);
}
(*T) = (masnet1trans_t *)calloc(1,sizeof(masnet1trans_t));
MUStrDup(&(*T)->FileName,FileName);
(*T)->FileSize = FileSize << 10;
(*T)->CompletionTime = (long *)StageTimePtr;
/* enable transfer */
(*T)->State = TRUE;
if (StageTimePtr != NULL)
*(long *)StageTimePtr = 0;
return(SUCCESS);
} /* END MASNet1TransCreate() */
int MASNet1TransDestroy(
masnet1trans_t **T)
{
if (T == NULL)
return(FAILURE);
MUFree(&(*T)->FileName);
MUFree((char **)T);
*T = (masnet1trans_t *)1;
return(SUCCESS);
} /* END MASNet1TransDestroy() */
int MASNet1(
masnet1_t **N,
int CmdIndex,
void *IData,
void **OData)
{
int rc;
if (N == NULL)
return(FAILURE);
switch(CmdIndex)
{
case mascConfig:
/* add job to transfer list */
rc = MASNet1Config(*N,(char *)IData,OData);
break;
case mascCreate:
rc = MASNet1Create(N,(char *)IData);
break;
case mascDestroy:
rc = MASNet1Destroy(N);
break;
case mascQuery:
rc = MASNet1Query(*N,(char *)IData,OData);
break;
case mascShow:
rc = MASNet1Show(*N,(char *)OData);
break;
case mascUpdate:
rc = MASNet1Update(*N);
break;
default:
rc = FAILURE;
break;
} /* END switch(CmdIndex) */
return(rc);
} /* END MASNet1() */
int MASNet1Config(
masnet1_t *N,
char *ConfigString,
void **OData)
{
int aindex;
char *ptr;
char *TokPtr;
char *TokPtr2;
char *FName;
char *tmpP;
int Size;
char ValLine[MAX_MNAME];
int CmpMode;
int tindex;
masnet1trans_t **T;
if ((N == NULL) || (ConfigString == NULL))
{
return(FAILURE);
}
/* process config data */
/* FORMAT: [BANDWIDTH[+=|-=]<VAL>][;FILE=<NAME>:<SIZE>]... */
ptr = MUStrTok(ConfigString,"; \t\n",&TokPtr);
while (ptr != NULL)
{
if (MUGetPair(
ptr,
(const char **)MASNet1AttributeType,
&aindex,
NULL,
TRUE,
&CmpMode,
ValLine,
MAX_MNAME) == FAILURE)
{
/* cannot parse value pair */
ptr = MUStrTok(NULL,"; \t\n",&TokPtr);
continue;
}
switch(aindex)
{
case masnet1aFile:
/* FORMAT: <FILENAME>:<FILESIZE> */
FName = MUStrTok(ValLine,":",&TokPtr2);
if ((tmpP = MUStrTok(NULL,":",&TokPtr2)) != NULL)
{
Size = (int)strtol(tmpP,NULL,0);
}
else
{
Size = -1;
}
if (CmpMode == -1)
{
/* locate and remove transaction */
for (tindex = 0;tindex < MAX_MNODE;tindex++)
{
T = &N->ActiveList[tindex];
if (*T == (masnet1trans_t *)NULL)
break;
if (*T == (masnet1trans_t *)1)
continue;
if (!strcmp((*T)->FileName,FName))
{
MASNet1TransDestroy(T);
break;
}
} /* END for (tindex) */
}
else
{
/* create new transaction */
MASNet1TransCreate(
N,
FName,
Size,
(long *)OData);
}
break;
default:
break;
} /* END switch (aindex) */
ptr = MUStrTok(NULL,"; \t\n",&TokPtr);
} /* END while (ptr != NULL) */
return(FAILURE);
} /* MASNet1Config() */
int MASNet1Create(
masnet1_t **N,
char *ConfigString)
{
char *ptr;
char *TokPtr;
char ValLine[MAX_MLINE];
int aindex;
mreq_t *RQ;
if (N == NULL)
return(FAILURE);
/* create AS data structure */
if (*N == NULL)
{
*N = (masnet1_t *)calloc(1,sizeof(masnet1_t));
}
if (ConfigString != NULL)
{
/* process config data */
/* FORMAT: BANDWIDTH=<BANDWIDTH>;NAME=<NAME>;STATE=<ACTIVE>... */
ptr = MUStrTok(ConfigString,"; \t\n",&TokPtr);
while (ptr != NULL)
{
if (MUGetPair(
ptr,
(const char **)MASNet1AttributeType,
&aindex,
NULL,
TRUE,
NULL,
ValLine,
MAX_MNAME) == FAILURE)
{
/* cannot parse value pair */
ptr = MUStrTok(NULL,"; \t\n",&TokPtr);
continue;
}
switch(aindex)
{
case masnet1aBandwidth:
/* FORMAT: <BANDWIDTH> */
(*N)->Bandwidth = (int)strtol(ValLine,NULL,0);
break;
case masnet1aName:
MUStrDup(&(*N)->Name,ValLine);
break;
case masnet1aState:
/* enable network by default */
(*N)->State = 1;
break;
default:
break;
} /* END switch(aindex) */
ptr = MUStrTok(NULL,"; \t\n",&TokPtr);
} /* END while (ptr != NULL) */
} /* END if (ConfigString != NULL) */
/* clear network state */
/* NYI */
return(SUCCESS);
} /* END MASNet1Create() */
int MASNet1Destroy(
masnet1_t **N)
{
if (N == NULL)
return(SUCCESS);
/* clear AS Data */
if (*N != NULL)
{
MUFree(&(*N)->Name);
/* NOTE: must destroy all transactions */
/* NYI */
MUFree((char **)N);
}
return(SUCCESS);
} /* END MASNet1Destroy() */
int MASNet1Update(
masnet1_t *N)
{
long Now;
int tindex;
int MinTransfer;
int ActiveTransferCount;
int TKBytes;
long Duration;
long StartTime;
maslsdata_t *D;
masnet1trans_t *T;
/* schedule transfers to interval (Now - MSched.Interval) -> Now */
/* loop through all transfers *
* determine minimum outstanding transfer *
* determine total data transfer requested *
* determine total data transfer possible *
* transfer MIN(possible,requested) *
* update completed transfers *
* continue until all transfers complete or *
* all network bandwidth consumed */
if (N == NULL)
return(FAILURE);
/* all files/bandwidth in MB, all operations in KB */
Duration = (long)MSched.Interval / 100;
TKBytes = (Duration * N->Bandwidth) << 10;
Now = MSched.Time - Duration;
while (TKBytes > 0)
{
MinTransfer = MAX_INT;
ActiveTransferCount = 0;
for (tindex = 0;tindex < MAX_MJOB;tindex++)
{
T = N->ActiveList[tindex];
if (T == NULL)
break;
if (T == (masnet1trans_t *)1)
continue;
if (T->State == 0)
continue;
ActiveTransferCount++;
if ((T->FileSize - T->DataStaged) < MinTransfer)
{
MinTransfer = T->FileSize - T->DataStaged;
}
} /* END for (tindex) */
if (ActiveTransferCount == 0)
{
/* no active transfers required */
return(SUCCESS);
}
MinTransfer = MIN(MinTransfer,TKBytes / ActiveTransferCount);
StartTime = Now;
Now += (MinTransfer >> 10) / N->Bandwidth;
/* transfer <MinTransfer> KB for all active transfers */
for (tindex = 0;tindex < MAX_MJOB;tindex++)
{
T = N->ActiveList[tindex];
if (T == NULL)
break;
if (T == (masnet1trans_t *)1)
continue;
if (T->State == 0)
continue;
if (T->DataStaged == 0)
T->StartTime = StartTime;
T->DataStaged += MinTransfer;
TKBytes -= MinTransfer;
if (T->DataStaged == T->FileSize)
{
/* transfer is complete */
*T->CompletionTime = Now;
N->TransfersCompleted++;
N->AvgTransferBW += ((double)T->FileSize / (Now - T->StartTime));
N->AvgTransferDelay += (Now - T->StartTime);
T->State = 0;
}
} /* END for (tindex) */
} /* END while (TKBytes > 0) */
N->Duration += Duration;
N->MBTransferred += ((Duration * N->Bandwidth) - TKBytes) >> 10;
return(SUCCESS);
} /* END MASNet1Update() */
/* END Net1.c */

194
contrib/appsim/SCHSMSim.c Normal file
View File

@@ -0,0 +1,194 @@
/* CONTRIB: SCHSMSim.c */
/* code to be included in LocalInitialize() in Local.c */
/* contains both HSM simulator and job app sim modules */
#define HSM_MAXTRANS 128
#define HSM_TOTALSIZE 20000000
#define HSM_CACHESIZE 1000000
#define HSM_TAPEBANDWIDTH 40000
#define HSM_NETBANDWIDTH 100000
#define HSM_NODEBANDWIDTH 20000
#define HSM_TAPECOUNT 4
struct {
mjob_t *J;
long StartTime;
int DataTotal;
int DataRemaining;
int State;
int Priority;
} hsmtrans_t;
struct {
int TotalSize; /* size in KB */
int CacheSize; /* size in KB */
int TapeBandwidth; /* BW in KB/sec */
int NetBandwidth; /* BW in KB/sec */
int NodeBandwidth; /* BW in KB/sec */
int TapeCount; /* number of tape drives */
hsmtrans_t T[HSM_MAXTRANS];
int ActiveTapeCount;
int ActiveTransCount;
} HSM;
typedef struct {
int DataState;
char *InputDataName;
int InputDataSize;
char *OutputDataName;
int OutputDataSize;
} hsmdata_t;
/* allow up to <TAPECOUNT> tape drive to operate simultaneously */
/* only initiate stage IN/OUT if adequate cache space exists */
/* tape bandwidth is dedicated */
/* network bandwidth is evenly shared by all active transactions */
/* allow each job to perform only one stage in/out operation at any given time */
/* data only staged when complete file is available */
/* (ie, tape to cache, then cache to compute node) */
/* <MAXTRANS> stage requests can be queued up */
int ContribMASHSM(
mjob_t *J,
int CmdIndex,
void *IData,
void **OData)
{
int rc;
if (J == NULL)
return(FAILURE);
switch(CmdIndex)
{
case mascInitialize:
rc = MASHSMInitialize(J,(char *)IData);
break;
case mascUpdate:
rc = MASHSMUpdate(J,IData);
break;
case mascFinalize:
rc = MASHSMFinalize(J);
break;
default:
rc = FAILURE;
break;
} /* END switch(CmdIndex) */
return(rc);
} /* END ContribMASHSM() */
int ContribSCHSMSimInitialize()
{
memset(&HSM,0,sizeof(HSM));
HSM.TotalSize = HSM_TOTALSIZE;
HSM.CacheSize = HSM_CACHESIZE;
HSM.TapeBandwidth = HSM_TAPEBANDWIDTH;
HSM.NetBandwidth = HSM_NETBANDWIDTH;
return(SUCCESS);
} /* END ContribSCHSMSimInitialize() */
int ContribSCHSMSimInitiateStageOut(
mjob_t *J,
hsmdata_t)
{
int tindex;
int AvailT;
AvailT = -1;
if (HSM.ActiveTrans >= HSM_MAXTRANS)
{
return(FAILURE);
}
for (tindex = 0;tindex < MAX_HSMTRANS;tindex++)
{
/* verify job has no other existing transactions */
if (HSM.T[tindex].J == J)
{
/* job already has active transaction */
return(FAILURE);
}
if ((HSM.T[tindex].J == NULL) && (AvailT == -1))
AvailT == tindex;
} /* END for (tindex) */
HSM.T[tindex].J = J;
HSM.T[tindex].StartTime = MSched.Time;
HSM.T[tindex].DataTotal = X;
long StartTime;
int DataTotal;
int DataRemaining;
int State;
int Priority;
return(SUCCESS);
} /* END ContribSCHSMSimStageOut() */
int ContribSCHSMUpdate()
{
/* determine number of active transactions */
/* determine per transaction network bandwidth */
/* stage data out from cache */
/* stage to tape */
/* stage to compute nodes */
/* stage in data to cache */
/* adjust job data state */
return(SUCCESS);
} /* END ContribSCHSMUpdate() */
/* END SCHSMSim.c */

View File

@@ -0,0 +1,72 @@
/* CONTRIB: AussieCheckReq.c */
/* code to be included in LocalCheckRequirements() in Local.c */
/* This code enofrces the policy 'only one job per user per node' *
* on SMP shared nodes *
*/
/* uses global BQS and Job */
int ContribAussieCheckReq(
job_t *J,
node_t *N,
long StartTime)
{
int rindex;
long Overlap;
res_t *R;
DBG(4,fCONFIG) DPrint("ContribAussieCheckReq(%s,%s)\n",
J->Name,
N->Name);
for (rindex = 0;rindex < MAX_RESERVATION;rindex++)
{
R = N->R[rindex];
if (R == (res_t *)MAX_RES_DEPTH)
continue;
if (R == NULL)
break;
Overlap =
MIN(R->EndTime,StartTime + J->SpecWCLimit[0]) -
MAX(R->StartTime,StartTime);
if (Overlap <= 0)
{
/* reservations do not overlap */
continue;
}
if (R->J == NULL)
{
/* reservation is not a job reservation */
continue;
}
if (((job_t *)R->J)->Cred.U != J->Cred.U)
{
/* users do not match */
continue;
}
/* overlapping job reservation for same user found */
return(FAILURE);
} /* END for (rindex) */
return(SUCCESS);
} /* END ContribAussieCheckReq() */
/* END AussieCheckReq.c */

35
contrib/copyfiles Executable file
View File

@@ -0,0 +1,35 @@
#!/bin/sh
# usage copyfiles PKG VERSION PATCH ACTION
export SERVER=kahu
export DDIR=/var/www/html/cri/downloads
export NOW=`/bin/date +%s`
export PKG=$1
export DIST=$2
export VERSION=$DIST$3
export SRC=$4
export ACTION=$5
export DIR=$DDIR/$PKG
export EDIR=$DDIR/e$PKG
export SNAP=$DIR/temp/$PKG-$VERSION-snap.$NOW.tar.gz
export ESNAP=$EDIR/temp/$PKG-$VERSION-snap.$NOW.tar.gz
export DIST=$DIR/$PKG-$VERSION.tar.gz
export EDIST=$EDIR/$PKG-$VERSION.tar.gz
cp $SRC /usr/local/dev/dist
case "$ACTION" in
all)
scp $SRC $SERVER:$SNAP
scp $SRC $SERVER:$DIST
;;
snap)
scp $SRC $SERVER:$SNAP
;;
*)
;;
esac

36
contrib/ecopyfiles Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/sh
# usage copyfiles PKG VERSION PATCH ACTION
export SERVER=kahu
export DDIR=/var/www/html/cri/downloads
export NOW=`/bin/date +%s`
export PKG=$1
export DIST=$2
export VERSION=$DIST$3
export SRC=$4
export ACTION=$5
export DIR=$DDIR/$PKG
export EDIR=$DDIR/e$PKG
export SNAP=$DIR/temp/$PKG-$VERSION-snap.$NOW.tar.gz
export ESNAP=$EDIR/temp/$PKG-$VERSION-snap.$NOW.tar.gz
export DIST=$DIR/$PKG-$VERSION.tar.gz
export EDIST=$EDIR/$PKG-$VERSION.tar.gz
cp $SRC /usr/local/dev/dist
case "$ACTION" in
all)
scp $SRC $SERVER:$ESNAP
scp $SRC $SERVER:$EDIST
;;
snap)
scp $SRC $SERVER:$ESNAP
;;
*)
;;
esac

View File

@@ -0,0 +1,52 @@
/* CONTRIB: ASCBackgroundJobPolicy.c */
/* code to be included in LocalCheckFairnessPolicy() in Local.c */
#define BACKGROUNDJOBQOS 0
/* uses global Job */
int ContribASCBackgroundJobPolicy(
job_t *SpecJ,
long StartTime,
char *Message)
{
int jindex;
job_t *J;
int BackgroundQOS;
if (SpecJ == NULL)
return(FAILURE);
BackgroundQOS = BACKGROUNDJOBQOS;
if (SpecJ->QOS != BackgroundQOS)
return(SUCCESS);
/* locate idle jobs with non-background QOS */
for (jindex = Job[0].Next;jindex != 0;jindex = Job[jindex].Next)
{
J = &Job[jindex];
if (J->State != jIdle)
continue;
if (J->QOS != BackgroundQOS)
{
/* idle non-background QOS job located */
/* background job should not be allowed to run */
return(FAILURE);
}
} /* END for (jindex) */
/* no idle non-background job located */
return(SUCCESS);
} /* END ContribASCBackgroundJobPolicy() */
/* END ASCBackgroundJobPolicy.c */

View File

@@ -0,0 +1,281 @@
/* CONTRIB: JobLength.c */
/* code to be included in LocalCheckFairnessPolicy() in Local.c */
# define MAX_LOCAL_JOB_POLICIES 12
/* uses global BQS and Job */
int ContribJobLengthFairnessPolicy(
job_t *J,
long StartTime,
char *Message)
{
int jindex;
int index;
char *buf;
char *ptr;
char FileName[MAX_NAME];
int count;
int SC;
char TimeString[MAX_LINE];
char ParameterName[MAX_NAME];
static struct {
long MinLength;
long MaxLength;
int MaxCount;
int Count;
} JobLengthPolicy[MAX_LOCAL_JOB_POLICIES];
static int LocalPoliciesLoaded = bFALSE;
static int MaxSmallJobCount;
static int MaxSmallJobProcs;
static int MaxSmallJobNodes;
static int SmallJobCount;
if (LocalPoliciesLoaded == bFALSE)
{
/* initialize policies */
memset(JobLengthPolicy,0,sizeof(JobLengthPolicy));
MaxSmallJobCount = 0;
MaxSmallJobProcs = 0;
MaxSmallJobNodes = 0;
LocalPoliciesLoaded = bTRUE;
/* load local config policy configuration */
if (!strstr(BQS.ConfigFile,BQS.HomeDir))
{
if (BQS.HomeDir[strlen(BQS.HomeDir) - 1] == '/')
sprintf(FileName,"%s%s",
BQS.HomeDir,
BQS.ConfigFile);
else
sprintf(FileName,"%s/%s",
BQS.HomeDir,
BQS.ConfigFile);
}
else
{
strcpy(FileName,BQS.ConfigFile);
}
if ((buf = LoadFile(FileName,1,FILEREAD,&count,&SC)) == NULL)
{
DBG(2,fCONFIG) DPrint("WARNING: cannot open configuration file '%s' (using internal defaults)\n",
FileName);
return(FAILURE);
}
AdjustConfigBuffer(buf);
ptr = buf;
ConfigGetIntValue(buf,&ptr,"MAXSMALLJOBCOUNT",NULL,NULL,&MaxSmallJobCount,NULL);
ConfigGetIntValue(buf,&ptr,"MAXSMALLJOBPROCS",NULL,NULL,&MaxSmallJobProcs,NULL);
for (index = 0;index < MAX_LOCAL_JOB_POLICIES;index++)
{
sprintf(ParameterName,"MAXJOB%dCOUNT",
index + 1);
if (ConfigGetIntValue(
buf,
&ptr,
ParameterName,
NULL,
NULL,
&JobLengthPolicy[index].MaxCount,
NULL) == FAILURE)
{
continue;
}
sprintf(ParameterName,"JOB%dMINLENGTH",
index + 1);
if (ConfigGetStringValue(
buf,
&ptr,
ParameterName,
NULL,
NULL,
TimeString,
NULL) == FAILURE)
{
continue;
}
JobLengthPolicy[index].MinLength = TimeS2I(TimeString);
sprintf(ParameterName,"JOB%dMAXLENGTH",
index + 1);
if (ConfigGetStringValue(
buf,
&ptr,
ParameterName,
NULL,
NULL,
TimeString,
NULL) == FAILURE)
{
continue;
}
JobLengthPolicy[index].MaxLength = TimeS2I(TimeString);
DBG(4,fSCHED) DPrint("INFO: local policy joblength[%d] specified: MaxCount %d (%ld -> %ld)\n",
index + 1,
JobLengthPolicy[index].MaxCount,
JobLengthPolicy[index].MinLength,
JobLengthPolicy[index].MaxLength);
} /* END for (index) */
} /* END if (LocalPoliciesLoaded == bFALSE) */
if (J == NULL)
{
/* initialize local policy counts */
SmallJobCount = 0;
for (index = 0;index < MAX_LOCAL_JOB_POLICIES;index++)
{
JobLengthPolicy[index].Count = 0;
}
/* incorporate active job information */
for (jindex = Job[0].Next;jindex != 0;jindex = Job[jindex].Next)
{
if ((Job[jindex].State != jStarting) &&
(Job[jindex].State != jRunning))
continue;
if ((Job[jindex].TasksRequested * Job[jindex].Req[0]->DRes.Procs) <= MaxSmallJobProcs)
{
SmallJobCount++;
}
for (index = 0;index < MAX_LOCAL_JOB_POLICIES;index++)
{
if (JobLengthPolicy[index].MaxCount <= 0)
continue;
if (JobLengthPolicy[index].MinLength <= 0)
continue;
if (JobLengthPolicy[index].MaxLength <= 0)
continue;
if (Job[jindex].SpecWCLimit[0] < JobLengthPolicy[index].MinLength)
continue;
if (Job[jindex].SpecWCLimit[0] > JobLengthPolicy[index].MaxLength)
continue;
JobLengthPolicy[index].Count++;
} /* END for (index) */
} /* END for (jindex) */
DBG(8,fSCHED) DPrint("INFO: local policies initialized\n");
for (index = 0;index < MAX_LOCAL_JOB_POLICIES;index++)
{
DBG(4,fSCHED) DPrint("INFO: local policy joblength[%d] initialized: %d of %d jobs%s (%ld -> %ld)\n",
index + 1,
JobLengthPolicy[index].Count,
JobLengthPolicy[index].MaxCount,
(JobLengthPolicy[index].Count >= JobLengthPolicy[index].MaxCount) ? "*" : "",
JobLengthPolicy[index].MinLength,
JobLengthPolicy[index].MaxLength);
}
return(SUCCESS);
} /* END if (J == NULL) */
TRAPJOB(J,"LocalCheckFairnessPolicies");
if ((MaxSmallJobCount > 0) && (MaxSmallJobProcs > 0))
{
/* count active small jobs */
if (SmallJobCount >= MaxSmallJobCount)
{
DBG(3,fSCHED) DPrint("INFO: local policy 'MaxSmallJob' would be violated, rejecting job %s\n",
J->Name);
if (Message != NULL)
{
}
return(FAILURE);
}
}
else
{
DBG(8,fSCHED) DPrint("INFO: local policy 'MaxSmallJob' disabled (MaxCount: %d MaxProcs: %d/MaxNodes: %d)\n",
MaxSmallJobCount,
MaxSmallJobProcs,
MaxSmallJobNodes);
}
for (index = 0;index < MAX_LOCAL_JOB_POLICIES;index++)
{
if (JobLengthPolicy[index].MaxCount <= 0)
continue;
if (JobLengthPolicy[index].MinLength <= 0)
continue;
if (JobLengthPolicy[index].MaxLength <= 0)
continue;
if (J->SpecWCLimit[0] < JobLengthPolicy[index].MinLength)
continue;
if (J->SpecWCLimit[0] > JobLengthPolicy[index].MaxLength)
continue;
if (JobLengthPolicy[index].Count < JobLengthPolicy[index].MaxCount)
{
JobLengthPolicy[index].Count++;
break;
}
else
{
DBG(4,fSCHED) DPrint("INFO: job %s would violate local policy 'JobLength' (%ld <= %ld <= %ld) MaxCount: %d)\n",
J->Name,
JobLengthPolicy[index].MinLength,
J->SpecWCLimit[0],
JobLengthPolicy[index].MaxLength,
JobLengthPolicy[index].MaxCount);
if (Message != NULL)
{
}
return(FAILURE);
}
} /* END for (index) */
/* all local policies passed */
return(SUCCESS);
} /* END ContribJobLengthFairnessPolicy() */
/* END JobLength.c */

View File

@@ -0,0 +1,77 @@
/* CONTRIB: AussieJobInit.c */
/* code to be included in LocalJobInit() in Local.c */
/* uses global BQS and Job */
enum { ajwcNONE = 0, ajwcConstant, ajwcLinear, ajwcQuadratic };
#define DEFAULTWCPOLICY ajwcConstant
int ContribAussieJobInit(
job_t *J)
{
int WCPolicy;
int ProcCount;
DBG(4,fCONFIG) DPrint("ContribAussieJobInit(%s)\n",
J->Name);
if ((J->SpecWCLimit[0] > 0) || (J->CPULimit <= 0))
{
/* wallclock time specified for job
or
no cpulimit specified for job */
return(SUCCESS);
}
if ((J->Req[0]->TaskCount > 0) && (J->Req[0]->DRes.Procs > 0))
{
ProcCount = J->Req[0]->TaskCount * J->Req[0]->DRes.Procs;
}
else
{
/* should not happen */
ProcCount = 1;
}
WCPolicy = DEFAULTWCPOLICY;
switch(WCPolicy)
{
case ajwcLinear:
J->SpecWCLimit[0] = J->CPULimit / ProcCount;
break;
case ajwcQuadratic:
J->SpecWCLimit[0] = (long)((double)J->CPULimit / pow((double)ProcCount,0.5));
break;
case ajwcConstant:
default:
J->SpecWCLimit[0] = J->CPULimit;
break;
} /* END switch(WCPolicy) */
J->SpecWCLimit[1] = J->SpecWCLimit[0];
DBG(4,fCONFIG) DPrint("INFO: job %s wallclock limit set to %s (%ld)\n",
J->Name,
StringTime(J->SpecWCLimit[1]),
J->CPULimit);
return(SUCCESS);
} /* END ContribAussieJobInit() */
/* END AussieJobInit.c */

176
contrib/jobinit/randjob.c Normal file
View File

@@ -0,0 +1,176 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define __MDPROC72
struct {
char *Name;
int JobCount;
double PFrac;
int Duration;
} JobDesc[] = {
{ "A", 75, 0.03125, 267 }, /* A */
{ "B", 9, 0.06250, 322 }, /* B */
{ "C", 3, 0.50000, 534 }, /* C */
{ "D", 3, 0.25000, 616 }, /* D */
{ "E", 3, 0.50000, 315 }, /* E */
{ "F", 9, 0.06250, 1846 }, /* F */
{ "G", 6, 0.12500, 1334 }, /* G */
{ "H", 6, 0.15820, 1067 }, /* H */
{ "I", 24, 0.03125, 1432 }, /* I */
{ "J", 24, 0.06250, 725 }, /* J */
{ "K", 15, 0.09570, 487 }, /* K */
{ "L", 36, 0.12500, 366 }, /* L */
{ "M", 15, 0.25000, 187 }, /* M */
/* { "A", 2, 1.00000, 100 }, */
{ 0, 0, 0 }};
/* NOTE: submit 'Z' jobs at +00:24:00 and +02:00:00 */
int main(
int argc,
char **argv)
{
int jindex;
int index;
int dindex;
int JobCount;
int JobList[1000];
int SubmitTime;
int SysSize;
time_t StartTime;
time_t Now;
SysSize = atoi(argv[1]);
/* populate list of potential jobs */
jindex = 0;
for (dindex = 0;JobDesc[dindex].JobCount > 0;dindex++)
{
for (index = 0;index < JobDesc[dindex].JobCount;index++)
{
JobList[jindex++] = dindex;
}
} /* END for (dindex) */
JobCount = jindex;
jindex = 0;
#if !defined(__LIVE)
printf("# workload trace for %d processor ESP test\n",
SysSize);
#endif /* !__LIVE */
time(&StartTime);
SubmitTime = 1;
while (jindex < JobCount)
{
index = (int)((double)JobCount * rand() / (RAND_MAX + 1.0));
if (JobList[index] == -1)
continue;
#if !defined(__LIVE)
/* NOTE: staggered job submission no longer required */
/*
if (jindex > (JobCount * 2 / 3))
SubmitTime = 20 * 60;
else if (jindex > (JobCount / 3))
SubmitTime = 10 * 60;
else
SubmitTime = 1;
*/
printf("job%s%03d 1 %d userA groupB %d Completed [batch:1] %d %d %d %d [NONE] [NONE] [NONE] >= 0 >= 0 [NONE] 1 1 0 0 0 accountC [NONE] [NONE] 0 0.0 DEFAULT 1 0 0 0 0 0 X 0 [NONE] [NONE] [NONE] [NONE] [NONE]\n",
JobDesc[JobList[index]].Name,
jindex,
(int)(JobDesc[JobList[index]].PFrac * SysSize),
JobDesc[JobList[index]].Duration,
SubmitTime,
SubmitTime,
SubmitTime,
SubmitTime + JobDesc[JobList[index]].Duration);
#else
time(&Now);
if (((jindex >= (int)(JobCount * 2 / 3)) && ((Now - StartTime) < 1200)) ||
((jindex >= (int)(JobCount * 1 / 3)) && ((Now - StartTime) < 600)))
{
sleep(1);
continue;
}
/* NOTE: add submission queue info */
sprintf(SubmitCommand,"/usr/local/bin/qsub -l nodes=%d,walltime=%d %c",
JobDesc[JobList[index]].ProcCount,
JobDesc[JobList[index]].Duration,
'A' + JobList[index] - 1);
system(SubmitCommand);
#endif /* !defined(__LIVE) */
JobList[index] = -1;
jindex++;
} /* END while (jindex) */
#if !defined(__LIVE)
/* submit Z jobs */
printf("jobZ%03d 1 %d userA groupB %d Completed [super:1] %d %d %d %d [NONE] [NONE] [NONE] >= 0 >= 0 [NONE] 1 1 0 0 0 accountC [NONE] [NONE] 0 0.0 DEFAULT 1 0 0 0 0 0 X 0 [NONE] [NONE] [NONE] [NONE] [NONE]\n",
jindex,
SysSize,
100,
SubmitTime + 2400,
SubmitTime + 2400,
SubmitTime + 2400,
SubmitTime + 2400 + 100);
jindex++;
printf("jobZ%03d 1 %d userA groupB %d Completed [super:1] %d %d %d %d [NONE] [NONE] [NONE] >= 0 >= 0 [NONE] 1 1 0 0 0 accountC [NONE] [NONE] 0 0.0 DEFAULT 1 0 0 0 0 0 X 0 [NONE] [NONE] [NONE] [NONE] [NONE]\n",
jindex,
SysSize,
100,
SubmitTime + 7200,
SubmitTime + 7200,
SubmitTime + 7200,
SubmitTime + 7200 + 100);
#else
sleep(2400);
/* submit Z0 at 00:40:00 */
/* NYI */
sleep(4800);
/* submit Z1 at 02:00:00 */
/* NYI */
#endif
exit(0);
} /* END main() */

View File

@@ -0,0 +1,112 @@
/* CONTRIB: OSCProximityNodeAlloc.c */
/* code to be included in MLocalJobAllocResources() in MLocal.c */
int ContribOSCProximityNodeAlloc(
mjob_t *J, /* IN: job allocating nodes */
mreq_t *RQ, /* IN: req allocating nodes */
nodealloc_t NodeList[], /* IN: eligible nodes */
int RQIndex, /* IN: index of job req to evaluate */
int MinTPN[], /* IN: min tasks per node allowed */
int MaxTPN[], /* IN: max tasks per node allowed */
char NodeMap[], /* IN: array of node alloc states */
int AffinityLevel, /* IN: current reservation affinity level to evaluate */
int NodeIndex[], /* IN/OUT: index of next node to find in BestList */
nodealloc_t BestList[MAX_REQ_PER_FRAG][], /* IN/OUT: list of selected nodes */
int TaskCount[], /* IN/OUT: total tasks allocated to req */
int NodeCount[]) /* IN/OUT: total nodes allocated to req */
{
int NIndex;
int nindex;
int TC;
mnode_t *N;
nodealloc_t MyNodeList[MAX_MNODE];
int MyNIndex;
/* select first 'RQ->TaskCount' procs */
MyNIndex = 0;
for (nindex = 0;NodeList[nindex].nodeindex != -1;nindex++)
{
NIndex = NodeList[nindex].nodeindex;
TC = NodeList[nindex].taskcount;
if (NodeMap[NIndex] != AffinityLevel)
{
/* node unavailable */
continue;
}
if (TC < MinTPN[RQIndex])
continue;
TC = MIN(TC,MaxTPN[RQIndex]);
N = &MNode[NIndex];
/* determine node locality */
/* NOT IMPLEMENTED */
/* determine node time availability */
/* NOT IMPLEMENTED */
/* add node to private list */
MyNodeList[MyNIndex].taskcount = TC;
MyNodeList[MyNIndex].nodeindex = NIndex;
} /* END for (nindex) */
/* select best nodes */
/* NOT IMPLEMENTED */
/* populate BestList with selected nodes */
for (nindex = 0;MyNodeList[nindex].nodeindex != -1;nindex++)
{
NIndex = MyNodeList[nindex].nodeindex;
TC = MyNodeList[nindex].taskcount;
BestList[RQIndex][NodeIndex[RQIndex]].nodeindex = NIndex;
BestList[RQIndex][NodeIndex[RQIndex]].taskcount = TC;
NodeIndex[RQIndex] ++;
TaskCount[RQIndex] += TC;
NodeCount[RQIndex] ++;
/* mark node as used */
NodeMap[NIndex] = nmUnavailable;
if (TaskCount[RQIndex] >= RQ->TaskCount)
{
/* all required tasks found */
/* NOTE: HANDLED BY DIST */
if ((RQ->NodeCount == 0) ||
(NodeCount[RQIndex] >= RQ->NodeCount))
{
/* terminate BestList */
BestList[RQIndex][NodeIndex[RQIndex]].nodeindex = -1;
break;
}
}
} /* END for (nindex) */
return(SUCCESS);
} /* END ContribOSCProximityNodeAlloc() */
/* END OSCProximityNodeAlloc.c */

View File

@@ -0,0 +1,94 @@
/* CONTRIB: PNNLGetNodePriority.c.c */
/* code to be included in MLocalGetNodePriority() in MLocal.c */
typedef struct {
char *Name;
int Weight;
} CPUType_t;
int ContribPNNLGetNodePriority(
mjob_t *J,
mnode_t *N)
{
int CPUSpeedWeight = 1000;
int CPUCountWeight = 2000;
int MemoryWeight = 20;
int SwapWeight = 10;
int CPUSpeed;
int CPUTypeWeight;
int index;
int NodePriority;
int FIndex;
const CPUType_t CPUType[] = {
{ "ii", 10, },
{ "iii", 100, },
{ NULL, 0 }};
/* UofU Node Priority */
/* Priority = CPUTYPEWEIGHT[CPUTYPE] +
CPUCOUNTWEIGHT * CPUCOUNT +
MEMORYWEIGHT * MEMORY +
SWAPWEIGHT * SWAP
*/
/* obtain cpu type via node feature 'p<CPUTYPE>' */
/* obtain cpu speed via node feature 's<CPUSPEED>' */
DBG(8,fSCHED) DPrint("LocalGetNodePriority(%s,%s)\n",
J->Name,
N->Name);
/* prioritize nodes for allocation */
/* highest priority node is allocated first */
/* get feature information */
CPUSpeed = 0;
CPUTypeWeight = 0;
for (FIndex = 0;FIndex < 32;FIndex++)
{
/* FIXME: FeatureMap usage */
if ((N->FeatureMap[0] & (1 << FIndex)) == 0)
continue;
if ((MAList[eFeature][FIndex][0] == 's') &&
(isdigit(MAList[eFeature][FIndex][1])))
{
CPUSpeed = strtol(&MAList[eFeature][FIndex][2],NULL,0);
}
else if (MAList[eFeature][FIndex][0] == 'p')
{
for (index = 0;CPUType[index].Name != NULL;index++)
{
if (!strcmp(&MAList[eFeature][FIndex][1],CPUType[index].Name))
{
CPUTypeWeight = CPUType[index].Weight;
break;
}
}
}
}
NodePriority = CPUTypeWeight +
CPUSpeedWeight * CPUSpeed +
CPUCountWeight * N->CRes.Procs +
MemoryWeight * N->CRes.Mem +
SwapWeight * N->CRes.Swap;
return(NodePriority);
} /* END ContribPNNLGetNodePriority() */
/* END */

View File

@@ -0,0 +1,91 @@
/* PNNLMachinePriority.c */
typedef struct {
char *Name;
int Weight;
} CPUType_t;
int ContribPNNLGetMachinePriority(
job_t *J,
NodeSt *N)
{
int CPUSpeedWeight = 1000;
int CPUCountWeight = 2000;
int MemoryWeight = 20;
int SwapWeight = 10;
int CPUSpeed;
int CPUTypeWeight;
int index;
int NodePriority;
int FIndex;
const CPUType_t CPUType[] = {
"ii", 10,
"iii", 100,
NULL, 0};
/* UofU Node Priority */
/* Priority = CPUTYPEWEIGHT[CPUTYPE] +
CPUCOUNTWEIGHT * CPUCOUNT +
MEMORYWEIGHT * MEMORY +
SWAPWEIGHT * SWAP
*/
/* obtain cpu type via node feature 'p<CPUTYPE>' */
/* obtain cpu speed via node feature 's<CPUSPEED>' */
DBG(8,fSCHED) DPrint("LocalGetNodePriority(%s,%s)\n",
J->Name,
N->Name);
/* prioritize nodes for allocation */
/* highest priority node is allocated first */
/* get feature information */
CPUSpeed = 0;
CPUTypeWeight = 0;
for (FIndex = 0;FIndex < 32;FIndex++)
{
/* FIXME: FeatureMap usage */
if ((N->FeatureMap[0] & (1 << FIndex)) == 0)
continue;
if ((AttrList[eFeature][FIndex][0] == 's') &&
(isdigit(AttrList[eFeature][FIndex][1])))
{
CPUSpeed = strtol(&AttrList[eFeature][FIndex][2],NULL,0);
}
else if (AttrList[eFeature][FIndex][0] == 'p')
{
for (index = 0;CPUType[index].Name != NULL;index++)
{
if (!strcmp(&AttrList[eFeature][FIndex][1],CPUType[index].Name))
{
CPUTypeWeight = CPUType[index].Weight;
break;
}
}
}
}
NodePriority = CPUTypeWeight +
CPUSpeedWeight * CPUSpeed +
CPUCountWeight * N->CRes.Procs +
MemoryWeight * N->CRes.Mem +
SwapWeight * N->CRes.Swap;
return(NodePriority);
} /* END ContribPNNLGetMachinePriority() */
/* END */

8
docs/README Normal file
View File

@@ -0,0 +1,8 @@
DOCUMENTAION
Maui documentation can be accessed by linking 'mauidocs.html'
to your local website. Up to date documentation can be found at
http://supercluster.org/documentation.
Send questions to help@supercluster.org

38
docs/mauidocs.html Normal file
View File

@@ -0,0 +1,38 @@
<html>
<head>
<TITLE>Maui Scheduler Documentation</TITLE>
<META NAME="title" CONTENT="Maui Scheduler Documentation">
<META NAME="description" CONTENT="Maui Scheduler Documentation">
<META NAME="keywords" CONTENT="Maui Scheduler,grid,scheduling,metascheduling,cluster,documentation">
<META NAME="subject" CONTENT="Maui Scheduler Documentation">
<META NAME="robots" CONTENT="All">
</head>
<body>
<h1>Maui Scheduler Documentation</h1>
&nbsp;&nbsp;&nbsp; Documentation regarding the use, administration, and
tuning of the Maui scheduler is available in the following forms:
<h4><a href="http://supercluster.org/maui">Official Maui Scheduler Homepage</a></h4>
&nbsp;&nbsp;&nbsp; - provides information regarding latest developments,
documentation, downloads, and related projects.
<h4><a href="http://supercluster.org/mauidocs/mauiadmin.shtml">Maui Scheduler Administrators Guide</a></h4>
&nbsp;&nbsp;&nbsp; - provides detailed information for building, installing,
configuring, and administering Maui.&nbsp; This manual also covers general
batch system and scheduling philosophy, optimization, trouble shooting,
and setup and management of advanced scheduling features.
<h4><a href="http://supercluster.org/mauidocs/mauiusers.shtml">Maui Scheduler Users Guide</a></h4>
&nbsp;&nbsp;&nbsp; - provides information on Maui from an end-user's perspective
including tools for analyzing system usage and resource availability, methods
to take advantage of advanced scheduling services, and ways to get the
best service for one's own jobs.
<h4><a href="http://supercluster.org/mauidocs/mauistart.shtml">Maui Quick Start Guide</a></h4>
&nbsp;&nbsp;&nbsp; - brief documenation covering initial steps requires
for build, configuration, and testing of the Maui Scheduler.
<h4><a href="http://supercluster.org/mauidocs/schedfaq.shtml">Maui Scheduler FAQ</a></h4>
&nbsp;&nbsp;&nbsp; - covers frequently asked questions regarding Maui usage
<h4><a href="http://supercluster.org/pipermail/mauiusers">Maui Users List Archives</a></h4>
&nbsp;&nbsp;&nbsp; - archives containing hundreds of common configuration and usage questions
<p>Post a question to the <a href="mailto:mauiusers@supercluster.org">Maui Users</a> mailing list
<br>Post a question to <a href="mailto:help@supercluster.org">help@supercluster.org</a>
</body>
</html>

8
etc/maui.csh.in Normal file
View File

@@ -0,0 +1,8 @@
# Setup MAUI PATH
if ( "$PATH" !~ */maui/sbin* ) then
setenv PATH "${PATH}:@prefix@/sbin"
endif
if ( "$PATH" !~ */maui/bin* ) then
setenv PATH "${PATH}:@prefix@/bin"
endif

36
etc/maui.d Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/sh
#
# maui This script will start and stop the MAUI Scheduler
#
# chkconfig: 345 85 85
# description: maui
#
ulimit -n 32768
# Source the library functions
. /etc/rc.d/init.d/functions
MAUI_PREFIX=/opt/maui
# let see how we were called
case "$1" in
start)
echo -n "Starting MAUI Scheduler: "
daemon $MAUI_PREFIX/sbin/maui
echo
;;
stop)
echo -n "Shutting down MAUI Scheduler: "
killproc maui
echo
;;
status)
status maui
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: maui {start|stop|restart|status}"
exit 1
esac

8
etc/maui.sh.in Normal file
View File

@@ -0,0 +1,8 @@
# setup maui path
if [ ! `echo $PATH | /bin/grep "maui/sbin"` ]; then
export PATH=$PATH:@prefix@/sbin
fi
if [ ! `echo $PATH | /bin/grep "maui/bin"` ]; then
export PATH=$PATH:@prefix@/bin
fi

View File

@@ -0,0 +1,6 @@
# LoadLeveller Definitions
export LLDEF = @LLDEF@
export LLPATH = @LLDIR@
export LLLIB = -lllapi
export LLIP = -I$(LLPATH)/include -I/u/loadl/include
export LLLP = -L$(LLPATH)/lib -L/u/loadl/lib

View File

@@ -0,0 +1,5 @@
# LSF Definitions
export LSFDEF = @LSFDEFS@
export LSFIP = -I@LSFDIR@/include -I@LSFDIR@/include/lsf
export LSFLP = -L@LSFDIR@/lib
export LSFLIB = @LSFLIBS@

View File

@@ -0,0 +1,6 @@
# MX Definitions
export MXDEF =-D__MX
export MXLP =-L@prefix@/lib
export MXIP =-I@prefix@/include
export MXLIB =-lg2 -lsu -lpthread

View File

@@ -0,0 +1,5 @@
# PBS Definitions
export PBSDEF = -D__MPBS
export PBSIP = -I@PBSTARGETDIR@/include
export PBSLP = -L@PBSTARGETDIR@/lib
export PBSLIB = @PBSLIBS@

View File

@@ -0,0 +1,6 @@
# PCRE Definitions
export REGEXLIB = "-lpcreposix -lpcre"
export REGEXIP = "-I@PCREDIR@/include"
export REGEXLP = "-L@PCREDIR@/lib"
export REGEXDEF = "-DPCRE"

View File

@@ -0,0 +1,4 @@
# SDR Definitions
export SDRDEF = -D__MSDR
export SDRLIB = -lSDR

View File

@@ -0,0 +1,8 @@
# SGE Definitions
export SGEDEF = -D__MSGE -D__SGE_NO_USERMAPPING__
export SGETOP = @SGEBUILDDIR@
export SGEIP = -I$(SGETOP) -I$(SGETOP)/common -I$(SGETOP)/libs/comm -I$(SGETOP)/libs/cull \
-I$(SGETOP)/libs/gdi -I$(SGETOP)/daemons/commd -I$(SGETOP)/libs/rmon -I$(SGETOP)/libs/uti \
-I$(SGETOP)/libs/sched -I$(SGETOP)/daemons/common
export SGELP = -L$(SGETOP)/@SGEOSDIR@
export SGELIB = -lsched -lgdi -lcull -lcom -luti -lrmon $(SGETOP)/@SGEOSDIR@/sig_handlers.o

164
include/header.cfg Normal file
View File

@@ -0,0 +1,164 @@
VERSION 3.2.6p12
PACKAGE moab
AUTHOR Cluster Resources, Inc
FILETYPE Module
COPYRIGHT Copyright (C) 1999-2005 Cluster Resources, Inc
DISCLAIMER
-----------------------------------------------------------------------------
Moab Scheduling System - End User Open Source License
This software is based on the Moab Scheduling System which was created by
Cluster Resources, Inc.
Copyright (C) 1999-2005 Cluster Resources, Inc., all rights reserved.
Moab Scheduling System is a trademark of Cluster Resources, Inc.
This SOFTWARE is bound by an 'End User Open Source' LICENSE from Cluster
Resources Inc. The conditions of the 'End User Open Source' LICENSE include,
but are not limited to the conditions described below.
THE SOFTWARE IS PROVIDED AS IS, AND CLUSTER RESOURCES, INC. (CRI) AND ALL
CONTRIBUTING PARTIES DISCLAIM ALL WARRANTIES RELATING TO THE SOFTWARE,
WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. NEITHER
CRI NOR ANYONE INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THE
SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT, CONSEQUENTIAL, OR INCIDENTAL
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE EVEN IF CRI
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT
SHALL CRI'S LIABILITY FOR ANY DAMAGES EXCEED THE CONSIDERATION PAID FOR THE
LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM OF CLAIM. THE PERSON OR
ENTITY USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE
OF THE SOFTWARE.
By installing or using this SOFTWARE you are accepting a non-exclusive 'End
User Open Source' LICENSE from Cluster Resources Inc. and are bound to abide
by the following conditions:
1. Inclusion of Notice and Disclaimer
All copies of the SOFTWARE, whether or not for redistribution and whether
or not in source code or in binary form must include a conspicuous and
appropriate publication of the above copyright notice and disclaimer.
2. Usage
Source and/or binary forms of this SOFTWARE may be used by any 'End User'
organization pursuant to the conditions of this and other associated LICENSES
at no charge and for an unlimited period of time. An 'End User' organization
is defined as an organization that is using this SOFTWARE on their own
systems and is not commercially redistributing, modifying, supporting, or
providing other services specific to this SOFTWARE to other organizations
for profit.
3. Modifications
SOFTWARE may be freely modified by the 'End User' as necessary to meet the
needs of the 'End User' LICENSEE'S system. 'End User' may solicit the
services of Cluster Resources Inc. or 'Authorized Distribution and Services
Partners' of Cluster Resources Inc. that have received express prior written
authorization to redistribute, modify or provide services for SOFTWARE.
Available services include but are not limited to technical support,
training, consultation or optimization services. 'End User' may not
solicit or receive this SOFTWARE or services associated to the use,
customization, training, development, or support on this SOFTWARE from any
organization that is not an 'Authorized Distribution and Services Partner'
of Cluster Resources Inc. Any organization that desires to become an
'Authorized Distribution and Services Partner' of Cluster Resources, Inc.
may contact us at support@clusterresources.com. 'End User' organizations
that desire services from Cluster Resources Inc., or an 'Authorized
Distribution and Services Partner' may contact us using the same email
listed above.
4. Distribution
'End User' organizations that are academic and government agencies may
redistribute this SOFTWARE subject to the condition that the distribution
contains conspicuous publication of the acknowledgement statement found
within the LICENSE agreement distributed with this SOFTWARE.
Organizations that are not academic and government agencies including
commercial and other for-profit organizations may not redistribute this code
or derivations of this code in any form whatsoever, including parts of
SOFTWARE incorporated into other software programs without express written
permission from Cluster Resources, Inc.
Redistribution of the SOFTWARE in any form whatsoever, including parts of
the code that are incorporated into other software programs, must include a
conspicuous and appropriate publication of the following acknowledgement:
'This product was developed by Cluster Resources, Inc. Moab Scheduling
System is a trademark of Cluster Resources, Inc.'
Any redistribution or modification of the SOFTWARE must, when installed,
display the above language, the copyright notice, and the warranty
disclaimer.
Each time the SOFTWARE (or any work based on the SOFTWARE) is
redistributed, the recipient must automatically receive this LICENSE,
copyright notice, and the warranty disclaimer as described in this license
agreement, which govern the ability to copy, distribute or modify the
SOFTWARE subject to these terms and conditions, and have the choice of
accepting or declining the LICENSE.
As the LICENSEE, you shall automatically provide the recipient with a
copy of this LICENSE. Further restrictions are not to be imposed on
recipients of the SOFTWARE by the LICENSEE beyond those expressly described
herein.
5. Use of Modifications
LICENSEES with a redistribution agreement that wish to distribute their
modifications (including government and academic institutions) must first
send a copy of the modifications along with a brief explanation of why the
modification was made and the resulting performance or functionality of the
modifications to Cluster Resources, Inc. at support@clusterresources.com.
Failure to send a copy of distributed modifications renders the LICENSE
invalid, as well as any LICENSES granted to third parties subsequent to the
incorporation of the modifications into SOFTWARE. Any such modification of
the SOFTWARE must, when installed, display the LICENSE, the copyright
notice, and the warranty disclaimer as described in the LICENSE agreement/s
distributed with this SOFTWARE. Those without a LICENSE to redistribute may
send modifications to Cluster Resources for evaluation and possible
incorporation into SOFTWARE.
Copyright owners of modifications to SOFTWARE hereby grant Cluster
Resources, Inc. a non-exclusive, royalty-free, worldwide, irrevocable right
and LICENSE to install, use, distribute, sublicense, and prepare derivative
works of said modifications. Only organizations receiving an express prior
written exclusion to this condition are exempted from providing these
non-exclusive rights to Cluster Resources, Inc.
6. Communications about and Endorsement of SOFTWARE and Products/Software
Derived from the SOFTWARE
The name 'Moab Scheduling System', 'Moab Scheduler', or any of its
variants must not otherwise be used to endorse or to promote products
derived from the SOFTWARE without prior written permission from CRI.
Products derived from or incorporating the SOFTWARE in whole or in part
shall not contain as part of the product's name any form of the terms
'Cluster Resources, Inc.', 'CRI', 'Moab', 'Moab Scheduling System',
'Moab Scheduler', or 'Supercluster Development Group' unless prior written
permission has been received from Cluster Resources, Inc.
All advertising materials for products that use or incorporate features of
the SOFTWARE must display the following acknowledgement: 'This product
includes software developed by Cluster Resources, Inc. for use in the Moab
Scheduling System.'
7. Acceptance of this LICENSE
It is not required that you accept this LICENSE; however, if you do not
accept the terms of this LICENSE, you are prohibited by law from installing,
using, modifying or distributing the SOFTWARE or any of its derivative
works. Therefore, by installing, using, modifying or distributing the
SOFTWARE (or any of its derivative works), you have agreed to this LICENSE
and have accepted all its terms and conditions.
If any portion of this LICENSE is held invalid or unenforceable under any
particular circumstance, the balance of the LICENSE will continue to apply.
------------------------------------------------------------------------------

107
include/header.tmpl Normal file
View File

@@ -0,0 +1,107 @@
Package: $PACKAGE
$FILETYPE: $MODULE
Version: $VERSION
Copyright:
$COPYRIGHT
All Rights Reserved
-----------------------------------------------------------------------------
Moab Workload Manager - End User License
This product was created by Cluster Resources, Inc. and is protected by
copyright and patent law.
Copyright (C) 1999-2005 Cluster Resources, Inc., all rights reserved.
Moab Workload Manager, Moab Cluster Scheduler and Moab Scheduler
are trademarks of Cluster Resources, Inc.
This SOFTWARE is bound by an 'End User Subscription License' (LICENSE) from
Cluster Resources Inc. The conditions of the 'End User Subscription
License' (LICENSE) include, but are not limited to, the conditions described
below.
THE SOFTWARE IS PROVIDED AS IS, AND CLUSTER RESOURCES, INC. (CRI) AND ALL
CONTRIBUTING PARTIES DISCLAIM ALL WARRANTIES RELATING TO THE SOFTWARE,
WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. NEITHER
CRI NOR ANYONE INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THE
SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT, CONSEQUENTIAL, OR INCIDENTAL
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE EVEN IF CRI
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT
SHALL CRI'S LIABILITY FOR ANY DAMAGES EXCEED THE CONSIDERATION PAID FOR THE
LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM OF CLAIM. THE PERSON OR
ENTITY USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE
OF THE SOFTWARE.
By installing or using this SOFTWARE you are accepting a non-exclusive 'End
User Subscription License' (LICENSE) from Cluster Resources Inc. and are
bound to abide by the following conditions:
1. Inclusion of Notice and Disclaimer
All copies of the SOFTWARE, whether or not for redistribution and whether
or not in source code or in binary form must include a conspicuous and
appropriate publication of the above copyright notice and disclaimer.
2. Usage
Binary forms of this SOFTWARE may be used by any 'End User' organization
pursuant to the conditions of this and other associated LICENSES for the
duration of the subscription license granted. An 'End User' organization is
defined as an organization that is using this SOFTWARE on their own systems
and is not commercially redistributing, modifying, supporting, or providing
other services specific to this SOFTWARE to other organizations for profit.
3. Modifications
'End User' may solicit the services of Cluster Resources Inc. of Cluster
Resources Inc. to modify or provide services for this SOFTWARE. Available
services include but are not limited to technical support, training,
consultation or optimization services. Any unauthorized partner that desires
to become an 'Authorized Distribution and Services Partner' of Cluster
Resources, Inc. may contact us at support.com. 'End User'
organizations that desire services from Cluster Resources Inc., or an
'Authorized Distribution and Services Partner' may contact us using the same
email listed above.
4. Distribution
No redistribution of this product is permitted without express prior
written permission.
5. Communications about and Endorsement of SOFTWARE and Products/Software
Derived from the SOFTWARE
The name 'Moab Scheduling System', 'Moab Cluster Scheduler', 'Moab Scheduler',
'Moab Workload Manager' or any of its variants must not otherwise be used to
endorse or to promote products derived from the SOFTWARE without prior written
permission from CRI.
Products derived from or incorporating the SOFTWARE in whole or in part
shall not contain as part of the product's name any form of the terms 'Cluster
Resources, Inc.', 'CRI', 'Moab', 'Moab Scheduling System', 'Moab Cluster
Scheduler', 'Moab Scheduler', 'Moab Workload Manager', or 'Supercluster
Development Group' unless prior written permission has been received from
Cluster Resources, Inc.
All advertising materials for products that use or incorporate features of
the SOFTWARE must display the following acknowledgement: 'This product
includes software developed by Cluster Resources, Inc. for use in the Moab
Scheduling System.'
6. Acceptance of this LICENSE
It is not required that you accept this LICENSE; however, if you do not
accept the terms of this LICENSE, you are prohibited by law from installing,
using, modifying or distributing the SOFTWARE or any of its derivative works.
Therefore, by installing, using, modifying or distributing the SOFTWARE (or
any of its derivative works), you have agreed to this LICENSE and have
accepted all its terms and conditions.
If any portion of this LICENSE is held invalid or unenforceable under any
particular circumstance, the balance of the LICENSE will continue to apply.
------------------------------------------------------------------------------

View File

@@ -0,0 +1,2 @@
RMCFG[@MACHINE@] NMPORT=12321 NMSERVER=@HOSTNAME@

View File

@@ -0,0 +1 @@
RMCFG[@MACHINE@] TYPE=@RMTYPE@

65
include/mclient-proto.h Normal file
View File

@@ -0,0 +1,65 @@
/* HEADER */
#ifndef __MCLIENT_PROTO_H__
#define __MCLIENT_PROTO_H__
int main(int,char **);
int Initialize(int,char **,int *);
int OMCShowUsage(int);
int MCSendRequest(msocket_t *);
int MCShowCStats(char *,int,int);
int MCClusterShow(char *);
int MCQueueShow(mxml_t *);
int MCShowReservation(char *);
int MCShowReservedNodes(char *);
int MCShowJobReservation(char *);
int MCSchedCtl(char *);
int MCDiagnose(char *);
int MCShowIdle(char *);
int MCShowRun(char *);
int MCShowJobHold(char *);
int MCShowStats(char *,int);
int MCShowSchedulerStatistics(char *);
int MCResetStats(char *);
int MCResCreate(char *);
int MCReleaseReservation(char *);
int MCSetJobHold(char *);
int MCReleaseJobHold(char *);
int MCSetJobSystemPrio(char *);
int MCSetJobUserPrio(char *);
int MCStopScheduling(char *);
int MCResumeScheduling(char *);
int MCSetJobDeadline(char *);
int MCReleaseJobDeadline(char *);
int MCShowJobDeadline(char *);
int MCShowEStart(char *);
int MCSetJobQOS(char *);
int MCShowGrid(char *);
int MCShowBackfillWindow(char *);
int MCShowConfig(char *);
int MCShowUserStats(char *,int);
int MCShowGroupStats(char *,int);
int MCShowAccountStats(char *,int);
int MCRunJob(char *);
int MCCancelJob(char *);
int MCShowNodeStats(char *);
int MCChangeParameter(char *);
int MCMigrateJob(char *);
int MCBShowState(char *);
int MCShowEstimatedStartTime(char *);
int MCShowQueue(char *);
int MCShowQ(char *,int);
int LoadConfig(char *,char *);
int PSDedicatedComp(cstats *,cstats *);
int MCUPSDedicatedComp(mgcred_t *,mgcred_t *);
int MCGPSDedicatedComp(mgcred_t *,mgcred_t *);
int MCAPSDedicatedComp(mgcred_t *,mgcred_t *);
int MCQPSDedicatedComp(mqos_t *,mqos_t *);
int MCCPSDedicatedComp(mclass_t *,mclass_t *);
#endif /* __MCLIENT_PROTO_H__ */

8
include/mclient.h Normal file
View File

@@ -0,0 +1,8 @@
/* HEADER */
#ifndef __MCLIENT_H__
#define __MCLIENT_H__
#include "moab.h"
#endif /* __MCLIENT_H__ */

95
include/mcom-proto.h Normal file
View File

@@ -0,0 +1,95 @@
/* HEADER */
/* socket util object */
int MSUInitialize(msocket_t *,char *,int,long,long);
int MSUIPCInitialize(void);
int MSUListen(msocket_t *);
int MSUConnect(msocket_t *,mbool_t,char *);
int MSUDisconnect(msocket_t *);
int MSUClose(msocket_t *);
int MSUFree(msocket_t *);
int MSUAcceptClient(msocket_t *,msocket_t *,char *,int);
int MSUSendData(msocket_t *,long,mbool_t,mbool_t);
int MSUSendPacket(int,char *,long,long,enum MStatusCodeEnum *);
int MSURecvData(msocket_t *,long,mbool_t,enum MStatusCodeEnum *,char *);
int MSURecvPacket(int,char **,long,char *,long,enum MStatusCodeEnum *);
int MSUSelectWrite(int,unsigned long);
int MSUSelectRead(int,unsigned long);
int MSUCreate(msocket_t **);
int MSUAdjustSBuffer(msocket_t *,int,mbool_t);
int MSUSetAttr(msocket_t *,enum MSocketAttrEnum,void *);
int MSUDup(msocket_t **,msocket_t *);
int MUISCreateFrame(msocket_t *,mbool_t,mbool_t);
/* sec object */
int MSecGetChecksum(char *,int,char *,char *,enum MChecksumAlgoEnum,char *);
int MSecGetChecksum2(char *,int,char *,int,char *,char *,enum MChecksumAlgoEnum,char *);
int MSecTestChecksum(char *);
int MSecBufTo64BitEncoding(char *,int,char *);
int MSecCompBufTo64BitEncoding(char *,int,char *);
int MSecComp64BitToBufDecoding(char *,int,char *,int *);
int MSecBufToHexEncoding(char *,int,char *);
int MSecCompressionGetMatch(unsigned char *,unsigned int,unsigned int,int *,unsigned int *,int *);
int MSecCompress(unsigned char *,unsigned int,unsigned char *,char *);
int MSecDecompress(unsigned char *,unsigned int,unsigned char *,unsigned int,unsigned char **,char *);
int MSecEncryption(char *,char *,int);
/* XML object */
int MXMLCreateE(mxml_t **,char *);
int MXMLDestroyE(mxml_t **);
int MXMLExtractE(mxml_t *,mxml_t *,mxml_t **);
int MXMLMergeE(mxml_t *,mxml_t *,char);
int MXMLSetAttr(mxml_t *,char *,void *,enum MDataFormatEnum);
int MXMLAppendAttr(mxml_t *,char *,char *,char);
int MXMLSetVal(mxml_t *,void *,enum MDataFormatEnum);
int MXMLAddE(mxml_t *,mxml_t *);
int MXMLSetChild(mxml_t *,char *,mxml_t **);
int MXMLToString(mxml_t *,char *,int,char **,mbool_t);
int MXMLGetAttr(mxml_t *,char *,int *,char *,int);
int MXMLGetAttrF(mxml_t *,char *,int *,void *,enum MDataFormatEnum,int);
int MXMLGetChild(mxml_t *,char *,int *,mxml_t **);
int MXMLGetChildCI(mxml_t *,char *,int *,mxml_t **);
int MXMLFromString(mxml_t **,char *,char **,char *);
int MXMLDupE(mxml_t *,mxml_t **);
mbool_t MXMLStringIsValid(char *);
/* sss interface object */
int MS3LoadModule(mrmfunc_t *);
int MS3DoCommand(mpsi_t *,char *,char **,mxml_t **,int *,char *);
int MS3Setup(int);
int MS3InitializeLocalQueue(mrm_t *,char *);
int MS3AddLocalJob(mrm_t *,char *);
int MS3RemoveLocalJob(mrm_t *,char *);
/* sss convenience functions */
int MS3AddSet(mxml_t *,char *,char *,mxml_t **);
int MS3AddWhere(mxml_t *,char *,char *,mxml_t **);
int MS3GetSet(mxml_t *,mxml_t **,int *,char *,int,char *,int);
int MS3GetWhere(mxml_t *,mxml_t **,int *,char *,int,char *,int);
int MS3SetObject(mxml_t *,char *,char *);
int MS3GetObject(mxml_t *,char *);
int MS3AddGet(mxml_t *,char *,mxml_t **);
int MS3GetGet(mxml_t *,mxml_t **,int *,char *,int);
int MS3SetStatus(mxml_t *,char *,enum MSFC,char *);
int MS3CheckStatus(mxml_t *,enum MSFC *,char *);
/* sss object functions */
int MS3JobToXML(mjob_t *,mxml_t **,enum MJobAttrEnum *,enum MReqAttrEnum *,char *);
/* END mcom-proto.h */

250
include/mcom.h Normal file
View File

@@ -0,0 +1,250 @@
/* HEADER */
#ifndef __MCOM_H
#define __MCOM_H
/* core defines */
#ifndef NULL
# define NULL (void *)0
#endif /* NULL */
#ifndef MIN
# define MIN(x,y) (((x) < (y)) ? (x) : (y))
#endif /* MIN */
#ifndef MAX
# define MAX(x,y) (((x) > (y)) ? (x) : (y))
#endif /* MAX */
#ifndef TRUE
# define TRUE 1
#endif /* TRUE */
#ifndef FALSE
# define FALSE 0
#endif /* FALSE */
#ifndef NONE
# define NONE "[NONE]"
#endif /* NONE */
#ifndef ALL
# define ALL "[ALL]"
#endif /* ALL */
#ifndef DEFAULT
# define DEFAULT "[DEFAULT]"
#endif /* DEFAULT */
#ifndef SUCCESS
# define SUCCESS 1
#endif /* SUCCESS */
#ifndef FAILURE
# define FAILURE 0
#endif /* FAILURE */
#ifndef MMAX_NAME
#define MMAX_NAME 64
#endif /* MMAX_NAME */
#ifndef MMAX_LINE
#define MMAX_LINE 1024
#endif /* MMAX_LINE */
#ifndef MMAX_BUFFER
#define MMAX_BUFFER 65536
#endif /* MMAX_BUFFER */
#ifndef MCONST_CKEY
#define MCONST_CKEY "hello"
#endif /* MCONST_CKEY */
#ifndef mbool_t
# define mbool_t unsigned char
#endif /* mbool_t */
#define CRYPTHEAD "KGV"
/* enumerations */
/* sync w/MDFormat */
enum MDataFormatEnum {
mdfNONE = 0,
mdfString,
mdfInt,
mdfLong,
mdfDouble,
mdfStringArray,
mdfIntArray,
mdfLongArray,
mdfDoubleArray,
mdfOther,
mdfLAST };
enum MSocketProtocolEnum {
mspNONE = 0,
mspSingleUseTCP,
mspHalfSocket,
mspHTTPClient,
mspHTTP,
mspS3Challenge };
enum MWireProtocolEnum {
mwpNONE = 0,
mwpAVP,
mwpXML,
mwpHTML,
mwpS32 };
/* sync w/MS3Action[] */
enum MS3ActionEnum {
msssaNONE,
msssaCancel,
msssaCreate,
msssaDestroy,
msssaInitialize,
msssaList,
msssaModify,
msssaNotify,
msssaQuery,
msssaStart,
msssaLAST };
/* sync w/MCSAlgoType[] */
enum MChecksumAlgoEnum {
mcsaNONE = 0,
mcsaDES,
mcsaHMAC,
mcsaHMAC64,
mcsaMD5,
mcsaPasswd,
mcsaRemote };
/* sync w/MS3CName[] */
enum MPeerServiceEnum {
mpstNONE = 0,
mpstNM, /* system monitor */
mpstQM, /* queue manager */
mpstSC, /* scheduler */
mpstMS, /* meta scheduler */
mpstPM, /* process manager */
mpstAM, /* allocation manager */
mpstEM, /* event manager */
mpstSD, /* service directory */
mpstWWW }; /* web */
/* sync w/MS3VName[] */
enum MS3VEnum {
msssV0_2 = 0,
msssV3_0,
msssV4_0 };
/* const defines */
#define MMAX_SBUFFER 65536
#ifndef MMSG_BUFFER
#define MMSG_BUFFER (MMAX_SBUFFER << 5)
#endif /* MMSG_BUFFER */
#define MCONST_S3XPATH 3
#define MCONST_S3URI "SSSRMAP3"
#define MMAX_S3ATTR 256
#define MMAX_S3VERS 4
#define MMAX_S3JACTION 64
/* default defines */
#define MDEF_CSALGO mcsaDES
#define MMAX_SOCKETWAIT 5000000
#define MMAX_XMLATTR 64
#define MDEF_XMLICCOUNT 16
/* structures */
typedef struct mxml_s {
char *Name;
char *Val;
int ACount;
int ASize;
int CCount;
int CSize;
char **AName;
char **AVal;
struct mxml_s **C;
} mxml_t;
/* failure codes */
/* sync w/MFC[] */
enum MSFC {
msfENone = 0, /* success */
msfGWarning = 100, /* general warning */
msfEGWireProtocol = 200, /* general wireprotocol/network failure */
msfEBind = 218, /* cannot bind socket */
msfEGConnect = 220, /* general connection failure */
msfCannotConnect = 222, /* cannot connect */
msfCannotSend = 224, /* cannot send data */
msfCannotRecv = 226, /* cannot receive data */
msfConnRejected = 230, /* connection rejected */
msfETimedOut = 232, /* connection timed out */
msfEFraming = 240, /* general framing failure */
msfEEOF = 246, /* unexpected end of file */
msfEGMessage = 300, /* general message format error */
msfENoObject = 311, /* no object specified in request */
msfEGSecurity = 400, /* general security failure */
msfESecClientSig = 422, /* security - signature creation failed at client */
msfESecServerAuth = 424, /* security - server auth failure */
msfESecClientAuth = 442, /* security - client auth failure */
msfEGEvent = 500, /* general event failure */
msfEGServer = 700, /* general server error */
msfEGServerBus = 720, /* general server business logic failure */
msfEGClient = 800, /* general client error */
msfECInternal = 820, /* client internal error */
msfECResUnavail = 830, /* client resource unavailable */
msfECPolicy = 840, /* client policy failure */
msfEGMisc = 900, /* general miscellaneous error */
msfUnknownError = 999 }; /* unknown failure */
/* sync w/MSockAttr[] */
enum MSocketAttrEnum {
msockaNONE = 0,
msockaLocalHost,
msockaLocalPort,
msockaRemoteHost,
msockaRemotePort,
msockaLAST };
#ifdef __M32COMPAT
#define mlog_t dlog_t
#endif /* __M32COMPAT */
#endif /* __MCOM_H */
/* END mcom.h */

36
include/mcompat-proto.h Normal file
View File

@@ -0,0 +1,36 @@
/* HEADER */
#ifndef __M_PROTO_H__
#define __M_PROTO_H__
#include "moab-proto.h"
int MSDRGetSystemConfig(void);
int __OMCLoadArgs(char,char *,enum MSvcEnum);
int __OMCProcessArgs(int,char **,enum MSvcEnum *);
int OMCShowUsage(enum MSvcEnum);
int UIResCreate(char *,char *,int,char *,long *);
int UIResDestroy(char *,char *,int,char *,long *);
int UIResList(char *,int,char *,int,int,char *,long *);
int UIResShow(char *,char *,int,char *,long *);
int DiagnoseFairShare(char *,long *,int);
int DiagnoseQOS(char *,long *,char *);
int DiagnoseClass(char *,long *,char *);
int ResDiagnose(char *,long *,int,char *,int);
int SetJobHold(char *,char *,int,char *,long *);
int ReleaseJobHold(char *,char *,int,char *,long *);
int ShowJobHold(char *,char *,int,char *,long *);
int UIStatClear(char *,char *,int,char *,long *);
int SetJobSystemPrio(char *,char *,int,char *,long *);
int SetJobUserPrio(char *, char *,int,char *,long *);
int UIJobGetStart(char *,char *,int,char *,long *);
int UIResShowAvail(msocket_t *,int,char *);
int UIShowConfig(char *,char *,int,char *,long *);
int UIJobStart(char *,char *,int,char *,long *);
int UINodeStatShow(int,char *,long *);
int UIChangeParameter(char *,char *,int,char *,long *);
int MigrateJob(char *,char *,int,char *,long *);
int UIShowEstStartTime(char *,char *,int,char *,long *);
#endif /* __M_PROTO_H__ */

305
include/mg2.h Normal file
View File

@@ -0,0 +1,305 @@
/* HEADER */
/* NOTE: requires library 'msu' and include file 'msu.h' */
#if !defined(__G2_H)
#define __G2_H
#define MG2_VERSION "4.2.0p0"
#if defined(__MTEST)
#define SUEMLog fprintf
#endif /* __MTEST */
/* sync w/MG2MCList[] */
enum MG2MCListEnum {
mg2mclNONE = 0,
mg2mclHostList,
mg2mclState,
mg2mclSJID };
enum G2MetaCmdEnum {
g2mcNONE = 0,
g2mcInitialize,
g2mcCommit,
g2mcList,
g2mcRsvCreate,
g2mcRemove,
g2mcQuery,
g2mcSubmit,
g2mcModify,
g2mcResetStats,
g2mcRegister };
/* Callback types (sync w/MG2CBType,MG2DEF_CBMASK) */
enum MG2CallBackEnum {
mg2cbNONE = 0,
mg2cbRsvCreate,
mg2cbRsvStart,
mg2cbRsvEnd,
mg2cbRsvDestroy,
mg2cbJobCreate,
mg2cbJobStart,
mg2cbJobEnd,
mg2cbJobDestroy };
#if !defined(__G2INTERNAL_H)
#include "msu.h"
enum { g2ptNONE = 0, g2ptMoab, g2ptSilver };
enum { g2isNONE = 0, g2isFile };
#define __MINTERFACE /* FIXME */
#ifdef __MINTERFACE
#if !defined(__MX)
#define __MX
#endif /* __MX */
#include "moab.h"
#include "moab-proto.h"
typedef struct
{
char *Name;
mpar_t *MPar;
mnode_t **MNode;
msched_t *Sched;
mfsc_t *FS;
mjob_t **Job;
mres_t **Res;
mlog_t *dlog;
mrange_t *MRange;
mrm_t *MRM;
mam_t *AM;
mattrlist_t *AttrList;
long *CREndTime;
char *CurrentHostName;
mulong *PresentTime;
int (*G2RsvFind)();
int (*G2ResSetAttr)();
int (*G2AcctFind)();
int (*G2JobFind)();
int (*G2JobAddCreds)();
int (*G2JobGetResourceAvailability)();
int (*G2ReservationCancel)();
int (*G2RMJobCancel)();
int (*G2WikiJobLoad)();
int (*G2JobAllocateNodes)();
int (*G2JobDistributeTasks)();
int (*G2JobNameAdjust)();
int (*G2ReservationCreate)();
int (*G2SimJobSubmit)();
int (*G2RMJobSubmit)();
} m_base_t;
#else /* __MINTERFACE */
typdef struct
{
char *Name;
} m_base_t;
#endif /* __MINTERFACE */
enum G2OEnum {
g2oNONE,
g2oAccount,
g2oClass,
g2oGroup,
g2oJob,
g2oNode,
g2oQOS,
g2oReq,
g2oRes,
g2oSystem,
g2oUser };
/* suballocation policies */
enum {
G2sapNONE = 0,
G2sapFirstFit,
G2sapBestFit,
G2sapWorstFit,
G2sapBestCRFit,
G2sapWorstCRFit,
G2sapBalanceAFit,
G2sapBalanceCFit,
G2sapBalanceARFit,
G2sapBalanceARRFit,
G2sapBalanceARSFit };
typedef struct
{
int Type;
int ChargeType;
unsigned long Flags;
double HourOfDayChargeFactor[24];
double DayOfWeekChargeFactor[7];
double QOSChargeFactor[100];
double NodeTypeChargeFactor[100];
} g2am_t;
typedef struct {
su_t *su;
m_base_t *m;
int SubAllocPolicy;
int RMShowErrMsg;
int RMMaxNMThreadCount;
g2am_t *AM;
sufilebuf_t *GlobalCfgFBuf;
sufilebuf_t *PrivateCfgFBuf;
int MetaUseAccountMasq;
char MetaAccountMasqBaseName[MAX_SUNAME];
int MetaAccountMasqCount;
} G2_t;
typedef struct {
char *UserName;
char *GroupName;
char *AccountName;
} g2cred_t;
typedef struct {
char *Arch;
char *Features;
int NodeMem;
char NodeMemCmp;
int NodeProcs;
char NodeProcsCmp;
char *OS;
} g2rspec_t;
typedef struct {
int Disk;
int Mem;
char *Network;
int Procs;
int Swap;
} g2rreq_t;
typedef struct {
int Count;
int TPN;
int TPNCmp;
g2rspec_t ResSpec;
g2rreq_t ResReq;
} g2task_t;
typedef struct {
char *Name;
char *Class;
g2cred_t Cred;
char *QOSRequested;
long WallTime;
int TaskCount;
g2task_t *Task[16];
suattr_t **JobAttr;
char *SystemID;
char *SubmitScript;
} g2job_t;
typedef struct {
char *Name;
} g2qos_t;
typedef struct
{
char *Name;
} g2rm_t;
typedef struct
{
char *Name;
} g2ocfg_t;
typedef struct
{
char *Name;
} g2res_t;
typedef struct
{
char *Name;
} g2tcon_t;
#define MAX_G2ACL 32
#define MAX_G2RANGE_PER_RESOURCE 32
#define MAX_G2XMLATTR 64
#define DEFAULT_G2XMLICCOUNT 16
typedef struct g2xml_s {
char *Name;
char *Val;
int ACount;
int ASize;
int CCount;
int CSize;
char **AName;
char **AVal;
struct g2xml_s **C;
} g2xml_t;
/* silver structure attributes */
/* sync w/enum SResAttr (mg2-internal.h) */
enum SResAttrEnum {
sraNONE = 0,
sraArchList,
sraAttr,
sraBandwidth,
sraCfgNodeCount,
sraCfgProcCount,
sraClassList,
sraDataDir,
sraDataServer,
sraDirectJobStageEnabled,
sraFeature,
sraFlags,
sraFullName,
sraKey,
sraLocalTime,
sraNetList,
sraOSList,
sraRsvOverlap,
sraRM,
sraSource,
sraTimeout };
/* G2 parameter keywords */
#define G2_SUBALLOC_KEYWORD "G2SUBALLOCPOLICY"
#endif /* !__G2INTERNAL_H */
#endif /* !__G2_H */
/* END G2.h */

9
include/moab-local.h.in Normal file
View File

@@ -0,0 +1,9 @@
/* moab-local.h */
#define MBUILD_DATE "@BUILDDATE@"
#define MBUILD_DIR "@BUILDDIR@"
#define MBUILD_HOST "@HOSTNAME@"
#define MBUILD_SKEY "@SEED@"
#define MBUILD_HOMEDIR "@SPOOLDIR@"

998
include/moab-proto.h Normal file
View File

@@ -0,0 +1,998 @@
/*
*/
#ifdef __MINSURE
int _Insure_mem_info(void *pmem);
int _Insure_ptr_info(void **pptr);
long _Insure_list_allocated_memory(int mode);
#endif /* __MINSURE */
#include "moab.h"
#include "mcom-proto.h"
/* CP object */
int MCPCreate(char *);
int MCPStoreCluster(mckpt_t *,mnode_t **);
int MCPLoadSched(mckpt_t *,char *,msched_t *);
int MCPStoreResList(mckpt_t *,mres_t **);
int MCPIsSupported(mckpt_t *,char *);
int MCPLoadSched(mckpt_t *,char *,msched_t *);
int MCPStoreSRList(mckpt_t *,sres_t *);
int MCPLoadSys(mckpt_t *,char *,msched_t *);
int MCPLoadSysStats(char *);
int MCPLoadStats(char *);
int MCPWriteGridStats(FILE *);
int MCPLoadSR(char *);
int MCPStoreUserList(mckpt_t *,mgcred_t **);
int MCPStoreGroupList(mckpt_t *,mgcred_t *);
int MCPStoreAcctList(mckpt_t *,mgcred_t *);
int MCPStoreObj(FILE *,int,char *,char *);
int MCPLoad(char *,int);
int MCPWriteScheduler(FILE *);
int MCPWriteJobs(FILE *,char *);
int MCPWriteStandingReservations(FILE *,char *);
int MNodeToString(mnode_t *,char *);
int MCPWriteSystemStats(FILE *);
int MCPWriteGridStats(FILE *);
int MCPRestore(int,char *,void *);
/* user object */
int MUserLoadCP(mgcred_t *,char *);
int MUserToXML(mgcred_t *,mxml_t **,int *);
char *MUserShow(mgcred_t *,char *,long *,long);
int MUserInitialize(mgcred_t *,char *);
int MUserFind(char *,mgcred_t **);
int MUserAdd(char *,mgcred_t **);
int MUserCreate(char *,mgcred_t **);
int MUserToString(mgcred_t *,char *);
int MUserDestroy(mgcred_t **);
int MUserFreeTable(void);
/* group object */
char *MGroupShow(mgcred_t *,char *,long *,long);
int MGroupLoadCP(mgcred_t *,char *);
int MGroupToXML(mgcred_t *,mxml_t **,int *);
int MGroupInitialize(mgcred_t *,char *);
int MGroupFind(char *,mgcred_t **);
int MGroupAdd(char *,mgcred_t **);
int MGroupToString(mgcred_t *,char *);
int MGroupProcessConfig(mgcred_t *,char *);
/* acct object */
char *MAcctShow(mgcred_t *,char *,long *,long);
int MAcctLoadCP(mgcred_t *,char *);
int MAcctToXML(mgcred_t *,mxml_t **,int *);
int MAcctInitialize(mgcred_t *,char *);
int MAcctFind(char *,mgcred_t **);
int MAcctAdd(char *,mgcred_t **);
int MAcctToString(mgcred_t *,char *);
/* cred object */
int MCredAToString(void *,int,int,char *,int);
int MCredSetAttr(void *,int,int,void **,int,int);
int MOFromXML(void *,int,mxml_t *);
int MOFromString(void *,int,char *);
int MOToXML(void *,int,mxml_t **);
int MOGetComponent(void *,int,void **,int);
int MCOToXML(void *,int,mxml_t **,int *,int *,int);
void *MOGetNextObject(void **,int,int,void *,char **);
int MCredConfigShow(void *,int,int,int,char *);
int MCredConfigLShow(void *,int,int,int,char *);
char *MOGetName(void *,int,char **);
int MCredInitialize(int,void *,char *);
int MCredAdd(int,char *,void **);
int MCredLoadConfig(int,char *,char *);
int MCredAdjustConfig(int,void *);
int MOLoadPvtConfig(void **,int,char *,mpsi_t *,char *);
int MCredSetDefaults(void);
int MOGetObject(int,char *,void **,int);
int MCredProcessConfig(void *,int,char *,mcredl_t *,mfs_t *);
char *MCredShowAttrs(mpu_t *,mpu_t *,mpu_t *,mpu_t *,mpu_t *,mfs_t *,long,long);
int MCredIsMatch(mcred_t *,void *,int);
/* res object */
int MResAllocate(mres_t *,mnalloc_t *);
int MResDeallocateResources(mres_t *);
int MResShowHostList(mres_t *);
int MResGetRID(mres_t *,char *,char *);
int MResLoadCP(mres_t *,char *);
int MResAdjust(mres_t *,long,int);
int MResFromXML(mres_t *,mxml_t *);
int MResSetAttr(mres_t *,enum MResAttrEnum,void *,int,int);
int MResToXML(mres_t *,mxml_t *,int *);
int MResToJob(mres_t *,mjob_t *);
int MResTrap(mres_t *);
int MResPreempt( mres_t *);
int MResCreate(int,macl_t *,char *,unsigned long,mnalloc_t *,long,long,int,int,char *,mres_t **,char *,mcres_t *);
int MResAdjustTime(long);
int MResDestroy(mres_t **);
int MResChargeAllocation(mres_t *,int);
int MResShow(mres_t *);
int MResInitialize(mres_t **,char *);
int MResFind(char *,mres_t **);
int MResUpdateStats(void);
int MResCheckStatus(mres_t *);
int MResJCreate(mjob_t *,mnodelist_t,long,int,mres_t **);
int MResFreeTable(void);
int MResCheckJAccess(mres_t *,mjob_t *,long,int *,char *);
int MResCheckRAccess(mres_t *,mres_t *,long,int *,char *);
int MResAddNode(mres_t *,mnode_t *,int,int);
int MResCheckJobMatch(mjob_t *,mres_t *);
int MResAdjustGResUsage(mres_t *,int);
int MResGetPE(mcres_t *,mpar_t *,double *);
int MResAllocateRE(char *,int,int,mnalloc_t *,int *,long,long,char *,int,mreq_t *);
int MREInsert(mre_t *,long,long,int,mcres_t *,int);
int MRERelease(mre_t *,int,int);
int MRECheck(mnode_t *,char *,int);
int MResShowState(mres_t *,int,char *,int,int);
int MResDiagnoseState(mres_t *,int,char *,int,int);
int MResDiagGrid(char *,int,int);
int MResAdjustDRes(char *,int);
int MResToString(mres_t *,int *,char *,int,int *);
int MNResToXML(mnode_t *,int,mxml_t *,int *);
int MNResToString(mnode_t *,mres_t *,mxml_t **,char *,int);
/* AM object */
int MAMInitialize(mam_t *);
int MAMClose(mam_t *);
int MAMProcessOConfig(mam_t *,int,int,double,char *,char **);
int MAMSetAttr(mam_t *,int,void **,int,int);
int MAMAllocJDebit(mam_t *,mjob_t *,enum MHoldReasonEnum *,char *);
int MAMAllocRDebit(mam_t *,mrsv_t *,enum MHoldReasonEnum *,char *);
int MAMQBDoCommand(mam_t *,int,char *,void **,int *,char *);
int MAMAllocJReserve(mam_t *,mjob_t *,mbool_t,enum MHoldReasonEnum *,char *);
int MAMAllocResCancel(char *,char *,char *,char *,enum MHoldReasonEnum *);
int MAMAccountGetDefault(char *,char *,enum MHoldReasonEnum *);
int MAMLoadConfig(char *,char *);
int MAMAdd(char *,mam_t **);
int MAMShow(mam_t *,char *,int,int);
int MAMConfigShow(mam_t *,int,char *);
int MAMFind(char *,mam_t **);
int MAMDestroy(mam_t **);
int MAMCreate(char *,mam_t **);
int MAMProcessConfig(mam_t *,char *);
int MAMCheckConfig(mam_t *);
int MAMSetDefaults(mam_t *);
int MAMActivate(mam_t *);
int MAMGetChargeRateInfo(char *);
int MAMSyncAlloc(mam_t *,mrm_t *);
int MAMAllocRReserve(mam_t *,char *,long,char *,int,int,long,char *,char *,enum MHoldReasonEnum *);
int MAMIAccountVerify(char *,char *);
int MAMShutdown(mam_t *);
/* par object */
int MParSetDefaults(mpar_t *);
int MParInitialize(mpar_t *,char *);
int MParAdd(char *,mpar_t **);
int MParFind(char *,mpar_t **);
int MParProcessOConfig(mpar_t *,int,int,double,char *,char **);
int MParGetTC(mpar_t *,mcres_t *,mcres_t *,mcres_t *,mcres_t *,long);
int MParAdd(char *,mpar_t **);
int MParAddNode(mpar_t *,mnode_t *);
int MParShow(char *,char *,long *,long);
int MParUpdate(mpar_t *);
int MParConfigShow(mpar_t *,int,int,char *);
int MParListBMFromString(char *,int *,int);
char *MParBMToString(int *);
/* node object */
int MNodeShow(mnode_t *);
int MNodeConfigShow(mnode_t *,int,int,char *);
int MNodeGetPriority(mnode_t *,int,int,double *,long);
int MNodeProcessPrioF(mnode_t *,char *);
int MNodeGetTC(mnode_t *,mcres_t *,mcres_t *,mcres_t *,mcres_t *,long);
int MNodeInitialize(mnode_t *,char *);
int MNodeAdjustState(mnode_t *,enum MNodeStateEnum *);
int MNodeAdjustAvailResources(mnode_t *,double,short,short);
int MNodeSetAttr(mnode_t *,enum MNodeAttrEnum,void **,int,int);
int MNodeSetState(mnode_t *,int,int);
int MNodeEval(mnode_t *);
int MNodeLoadConfig(mnode_t *,char *);
int MNodeProcessConfig(mnode_t *,char *);
int MNodeBuildRE(mnode_t *,mres_t *,int);
int MNodeFind(char *,mnode_t **);
int MNodeAdd(char *,mnode_t **);
int MNodeCreate(mnode_t **);
int MNodeRemove(mnode_t *);
int MNodeDestroy(mnode_t **);
int MNodeCopy(mnode_t *,mnode_t *);
int MNodeTrap(mnode_t *);
int MNodeSetClass(mnode_t *,mclass_t *,char *,int);
char *MNodeAdjustName(char *,int);
int MNodeUpdateResExpression(mnode_t *);
int MClusterUpdateNodeState(void);
int MFrameAdd(char *,int *,mframe_t **);
int MFrameFind(char *,mframe_t **);
int MFrameAddNode(mframe_t *,mnode_t *,int);
int MFrameShow(char *,mpar_t *,char *,int,int);
int MNodeGetLocation(mnode_t *);
int MNodeLocationFromName(mnode_t *,int *,int *);
int MNodeCheckPolicies(mjob_t *,mnode_t *,long,int *);
int MNodeCheckStatus(mnode_t *);
int MNodeResetJobSlots(mnode_t *);
int MNodeGetPreemptList(mjob_t *,mnalloc_t *,mnalloc_t *,mjob_t **,long,int,int,int *,int *);
int MNodeSelectIdleTasks(mjob_t *,mreq_t *,mnalloc_t *,mnodelist_t,int *,int *,char *,int R[MAX_MREQ_PER_JOB][MAX_MREJREASON]);
int MNodeSelectPreemptTasks(mjob_t *,mnalloc_t *,mnodelist_t,int *,int *,char *,int R[MAX_MREQ_PER_JOB][MAX_MREJREASON],long);
int MClusterClearUsage(void);
int MNodeFreeTable(void);
int MNodeProcessFeature(mnode_t *,char *);
int MNodeCheckAllocation(mnode_t *);
int MNodeLoadCP(mnode_t *N,char *Buf);
int MNodeShowState(mnode_t *,int,char *,int,int);
int MNodeDiagnoseState(mnode_t *,int,char *,int,int);
int MNodeShowReservations(mnode_t *,int,char *,int,int);
int MNodeShowRes(mnode_t *,char *,mpar_t *,int,int,char *,int);
int MNodeDiagnoseReservations(mnode_t *,int,char *,int,int);
/* req object */
int MReqDestroy(mreq_t **);
int MReqSetAttr(mjob_t *,mreq_t *,enum MReqAttrEnum,void **,int,int);
int MReqCreate(mjob_t *,mreq_t *,mreq_t **,mbool_t);
int MReqGetFNL(mjob_t *,mreq_t *,mpar_t *,nodelist_t,nodelist_t,int *,int *,long,unsigned long);
int MReqRResFromString(mjob_t *,mreq_t *,char *,int,int);
int MReqGetPref(mreq_t *,mnode_t *,char *);
int MReqAllocateLocalRes(mjob_t *,mreq_t *);
int MReqAToString(mjob_t *,mreq_t *,enum MReqAttrEnum,char *,int);
/* job object */
int MJobFind(char *,mjob_t **,int);
int MJobCreate(char *,mbool_t,mjob_t **);
int MJobMove(mjob_t *,mjob_t *);
int MJobShow(mjob_t *,int,char *);
int MJobReserve(mjob_t *,int);
int MReqCheckResourceMatch(mjob_t *,mreq_t *,mnode_t *,int *);
int MJobUpdateFlags(mjob_t *);
int MJobUpdateResourceCache(mjob_t *,int);
int MJobClearResourceCache(mjob_t *);
int MJobPReserve(mjob_t *,int,int *,mbool_t *);
int MJobProximateMNL(mjob_t *,mnodelist_t,mnodelist_t,long,int);
int MJobCheckPolicies(mjob_t *,int,int,mpar_t *,int *,char *,long);
int MJobSetAttr(mjob_t *,enum MJobAttrEnum,void **,int,int);
int MJobEval(mjob_t *);
int MJobFromXML(mjob_t *,mxml_t *);
int MJobInitialize(mjob_t *);
int MJobToXML(mjob_t *,mxml_t *,int *);
int MJobAttrToString(mjob_t *,int,char *,int);
int MJobSetQOS(mjob_t *,mqos_t *,int);
int MJobSetState(mjob_t *,enum MJobStateEnum);
int MJobPreempt(mjob_t *,mjob_t **,enum MPreemptPolicyEnum,char *,int *);
int MJobResume(mjob_t *,char *,int *);
int MJobGetPAL(mjob_t *,int *,int *,mpar_t **);
int MJobRemove(mjob_t *);
int MJobGetAccount(mjob_t *,mgcred_t **);
int MJobSetCreds(mjob_t *,char *,char *,char *);
int MJobAllocMNL(mjob_t *,mnodelist_t,char *,mnodelist_t,int,long);
int MJobNLDistribute(mjob_t *,mnodelist_t,mnodelist_t);
int MJobSelectMNL(mjob_t *,mpar_t *,nodelist_t,mnodelist_t,char *,int);
int MJobDistributeTasks(mjob_t *,mrm_t *,mnalloc_t *,short *);
int MJobTrap(mjob_t *);
char *MJobGetName(mjob_t *,char *,mrm_t *,char *,int,enum MJobNameEnum);
int MJobGetStartPriority(mjob_t *,int,double *,int,char *);
int MJobGetRunPriority(mjob_t *,int,double *,char *);
int MJobGetBackfillPriority(mjob_t *,unsigned long,int,double *,char *);
int MJobGetPartitionAccess(mjob_t *);
int MJobGetAMNodeList(mjob_t *,mnodelist_t,mnodelist_t,char NM[MAX_MNODE],int *,int *,long);
int MJobProcessCompleted(mjob_t *);
int MJobProcessRemoved(mjob_t *);
int MJobAllocatePriority(mjob_t *,mreq_t *,mnalloc_t *,int,int *,int *,char *,int,int *,mnalloc_t *A[MAX_MREQ_PER_JOB],int *,int *,long);
int MJobAllocateFastest(mjob_t *,mreq_t *,mnalloc_t *,int,int *,int *,char *,int,int *,mnalloc_t *A[MAX_MREQ_PER_JOB],int *,int *);
int MJobAllocateBalanced(mjob_t *,mreq_t *,mnalloc_t *,int,int *,int *,char *,int,int *,mnalloc_t *A[MAX_MREQ_PER_JOB],int *,int *);
int MJobAllocateContiguous(mjob_t *,mreq_t *,mnalloc_t *,int,int *,int *,char *,int,int *,mnalloc_t *A[MAX_MREQ_PER_JOB],int *,int *);
int MJobCheckNStartTime(mjob_t *,mreq_t *,mnode_t *,long,int *,double,int *,char *,long *);
int MJobGetNRange(mjob_t *,mreq_t *,mnode_t *,long,int *,long *,char *,int *,char *);
int MJobGetSNRange(mjob_t *,mreq_t *,mnode_t *,mrange_t *,int,char *,int *,mrange_t *,mcres_t *,char *);
int MJobCTimeComp(int *,int *);
int MJobStartPrioComp(int *,int *);
int MRangeApplyLocalDistributionConstraints(mrange_t *,mjob_t *,mnode_t *);
int MRangeApplyGlobalDistributionConstraints(mrange_t *,mjob_t *,int *);
int MRangeGetIntersection(mjob_t *,mrange_t *,mrange_t *);
int MRLMerge(mrange_t *,mrange_t *,int,long *);
int MRLAND(mrange_t *,mrange_t *,mrange_t *);
int MRLANDTest(void);
int MRLLimitTC(mrange_t *,mrange_t *,mrange_t *,int);
int MRLSubtract(mrange_t *,mrange_t *);
int MRLSFromA(long,mrange_t *,mrange_t *);
int MJobSendFB(mjob_t *);
int MJobStart(mjob_t *);
int MJobCheckpoint(mjob_t *);
int MJobSetHold(mjob_t *,int,long,enum MHoldReasonEnum,char *);
int MJobMkTemp(mjob_t *,mreq_t *,macl_t *,macl_t *,mnalloc_t *,mnalloc_t *);
int MJobCheckLimits(mjob_t *,int,mpar_t *,int,char *);
int MJobCheckDataReq(mjob_t *);
int MJobDestroy(mjob_t **);
int MJobSelectPJobList(mjob_t *,int,int,mjob_t **,mnalloc_t *,mjob_t **,int *,int *,nodelist_t **);
int MJobCheckDependency(mjob_t *,enum MJobDependEnum *,char *);
int MJobSetDependency(mjob_t *,enum MJobDependEnum,char *);
int MJobSelectResourceSet(mjob_t *,int,int,char **,mnalloc_t *,int);
int MJobCheckNRes(mjob_t *,mnode_t *,mreq_t *,long,int *,double,int *,char *,long *,int);
int MJobGetEStartTime(mjob_t *,mpar_t **,int *,int *,mnodelist_t,long *);
int MJobAddToNL(mjob_t *,nodelist_t);
int MJobRemoveFromNL(mjob_t *,nodelist_t);
int MJobFreeTable(void);
int MJobProcessExtensionString(mjob_t *,char *);
int MJobBuildCL(mjob_t *);
int MJobAddHash(char *,int,int *);
int MJobRemoveHash(char *);
int MJobCheckQueuePolicies(mjob_t *,int,mpar_t *,mpar_t *,int *);
int MJobCheckPolicyEvents(mjob_t *,long,int *,char *);
double MJobGetWCAccuracy(mjob_t *,double *);
int MJobGetPE(mjob_t *,mpar_t *,double *);
int MJobWriteStats(mjob_t *J);
int MJobGetNL(mjob_t *,mnalloc_t *);
int MJobDistributeTaskGeometry(mjob_t *,mreq_t *,mnalloc_t *,int *);
int MJobCPCreate(mjob_t *,mjckpt_t **);
int MJobCPDestroy(mjob_t *,mjckpt_t **);
int MJobGetRange(mjob_t *,mreq_t *,mpar_t *,long,mrange_t *,mnodelist_t,int *,char *,int,mrange_t *);
int MJobGetProcCount(mjob_t *);
int MJobGetINL(mjob_t *,mnalloc_t *,mnalloc_t *,int,int *,int *);
int MJobTestRMExtension(char *);
int MJobTestName(char *);
int MJobTestDist(void);
int MJobAddAccess(mjob_t *,char *);
int MJobSelectFRL(mjob_t *,mrange_t *,int,int *);
int MJobToTString(mjob_t *,int,char *,int);
int MJobCheckClassJLimits(mjob_t *,mclass_t *,int,char *,int);
int MJobLoadCP(mjob_t *,char *);
int MJobStoreCP(mjob_t *,char *);
int MJobAToString(mjob_t *,enum MJobAttrEnum,char *,int);
int MJobValidate(mjob_t *,char *,int);
int MJobDetermineCreds(mjob_t *);
int MJobGetLocalTL(mjob_t *,short *,int);
/* queue object */
int MQueueInitialize(mjob_t **,char *);
int MQueueScheduleIJobs(int *,mpar_t *);
int MQueuePrioritizeJobs(mjob_t **,int *);
int MQueueGetBestRQTime(int *,long *);
int MQueueScheduleRJobs(int *);
int MQueueScheduleSJobs(int *);
int MQueueDiagnose(mjob_t **,int *,int,mpar_t *,char *);
int MQueueCheckStatus(void);
int MQueueGetRequeueValue(int *,long,long,double *);
int MQueueSelectAllJobs(mjob_t **,int,mpar_t *,int *,int,int,int,char *);
int MQueueSelectJobs(int *,int *,int,int,int,unsigned long,int,int *,mbool_t);
int MQueueAddAJob(mjob_t *);
int MQueueRemoveAJob(mjob_t *,int);
int MQueueBackFill(int *,int,mpar_t *);
int MOQueueInitialize(int *);
int MOQueueDestroy(int *,int);
/* stat object */
int MStatInitialize(mprofcfg_t *);
int MStatSetDefaults(void);
int MStatOpenFile(long);
int MStatShutdown(void);
int MStatToString(must_t *,char *,int *);
int MStatToXML(must_t *,mxml_t **,int *);
int MStatFromString(char *,must_t *);
int MStatFromXML(must_t *,mxml_t *);
int MStatSetAttr(must_t *,int ,void **,int,int);
int MStatAToString(must_t *,int,char *,int);
char *MStatsToString(must_t *,char *);
int MStatClearUsage(int,int,int);
int MStatProfInitialize(mprofcfg_t *);
int MStatUpdateActiveJobUsage(mjob_t *);
int MStatInitializeActiveSysUsage(void);
int MStatUpdateCompletedJobUsage(mjob_t *,int,int);
int MStatUpdateRejectedJobUsage(mjob_t *,int);
int MStatUpdateSubmitJobUsage(mjob_t *);
double MStatCalcCommunicationCost(mjob_t *);
double MStatGetCom(mnode_t *,mnode_t *);
int MStatAddEJob(mjob_t *);
int MStatRemoveEJob(mjob_t *);
int MStatBuildRClass(int,mrclass_t *);
int MStatUpdateBFUsage(mjob_t *);
int MStatBuildGrid(int,char *,int);
char *MStatGetGrid(int,must_t *,must_t *,must_t *,must_t *,int);
/* sys object */
char *MSysToString(msched_t *,char *,int);
int MSysToXML(msched_t *,mxml_t **,int *, int *,int);
int MSysAToString(msched_t *,int,char *,int);
int MSysSetAttr(msched_t *,int,void **,int,int);
int MSysMemCheck(void);
int MSysDoTest(void);
int MSysCheck(void);
int MSysRegEvent(char *,int,long,int);
int MSysRegExtEvent(char *,int,long,int);
int MSysLaunchAction(char **,int);
int MSysLoadConfig(char *,char *,int);
int MSysUpdateTime(msched_t *);
int MSysDSRegister(char *,char *,char *,int,char *,char *);
int MSysDSUnregister(char *,char *,char *,int,char *,char *);
int MSysDSQuery(char *,char *,char *,int *,char *,char *);
int MSysEMSubmit(mpsi_t *,char *,char *,char *);
int MSysEMRegister(mpsi_t *,char *,char *,char *,char *);
int MSysSynchronize(void);
int MSysInitialize(void);
void MSysShutdown(int);
int MSysDestroyObjects(void);
int MSysDiagnose(char *,int,long);
int MSysStartServer(int);
/* limit object */
int MLimitToXML(mcredl_t *,mxml_t **,int *);
int MLimitAToString(mcredl_t *,int,char *,int);
int MLimitToString(mcredl_t *,char *);
int MLimitFromXML(mcredl_t *,mxml_t *);
int MLimitSetAttr(mcredl_t *,int ,void **,int,int);
int MLimitEnforceAll(mpar_t *);
/* fs object */
int MFSToXML(mfs_t *,mxml_t **,int *);
int MFSAToString(mfs_t *,int,char *,int);
int MFSTargetFromString(mfs_t *,char *);
int MFSSetAttr(mfs_t *,int,void **, int,int);
int MFSFromXML(mfs_t *,mxml_t *);
int MFSProcessOConfig(mfsc_t *,int,int,double,char *,char **);
int MFSLoadConfig(void);
int MFSCheckCap(mfs_t *,mjob_t *,mpar_t *,int *);
int MFSSetDefaults(mfs_t *,int);
int MFSLoadDataFile(char *,int);
int MFSUpdateData(mfsc_t *,int,int);
int MFSInitialize(mfsc_t *);
double MFSCalcFactor(mfsc_t *,double *);
char *MFSTargetToString(double,int);
int MFSShutdown(mfsc_t *);
int MFSShow(char *,int,int);
/* cfg object */
int MCfgGetIndex(int,int *);
int MCfgTranslateBackLevel(int *);
int MCfgAdjustBuffer(char **,mbool_t);
int MCfgProcessLine(int,char *,char *,char *);
int MCfgEnforceConstraints(void);
int MCfgGetVal(char **,const char *,char *,int *,char *,int,char **);
int MCfgGetIVal(char *,char **,const char *,char *,int *,int *,char **);
int MCfgGetDVal(char *,char **,const char *,char *,int *,double *,char **);
int MCfgGetSVal(char *,char **,const char *,char *,int *,char *,int,int,char **);
int MCfgGetSList(char *,char **,const char *,char *,int *,int,char *,char **);
int MCfgProcessBuffer(char *);
int MCfgSetVal(int,int,double,char *,char **,mpar_t *,char *);
/* qos object */
char *MQOSFlagsToString(mqos_t *,char *,int);
int MQOSFlagsFromString(mqos_t *,char *);
int MQOSSetAttr(mqos_t *,int,void **,int,int);
int MQOSAToString(mqos_t *,int,char *,int);
int MQOSProcessOConfig(mqos_t *,int,int,double,char *,char **);
int MQOSConfigLShow(mqos_t *,int,int,char *);
int MQOSInitialize(mqos_t *,char *);
int MQOSAdd(char *,mqos_t **);
int MQOSFind(char *,mqos_t **);
int MQOSGetAccess(mjob_t *,mqos_t *,int *,mqos_t **);
int MQOSLoadConfig(char *);
int MQOSProcessConfig(mqos_t *,char *);
int MQOSListBMFromString(char *,int *,int);
char *MQOSBMToString(int *);
int MQOSShow(char *,char *,long *,long);
int MQOSDestroy(mqos_t **);
int MQOSFreeTable(void);
int MQOSConfigShow(mqos_t *,int,int,char *,int);
/* class object */
int MClassSetAttr(mclass_t *,int,void **,int,int);
int MClassAToString(mclass_t *,int,char *,int,int);
int MClassProcessConfig(mclass_t *,char *);
int MClassConfigLShow(mclass_t *,int,int,char *);
int MClassInitialize(mclass_t *,char *);
int MClassAdd(char *,mclass_t **);
int MClassFind(char *,mclass_t **);
int MClassConfigShow(mclass_t *,int,char *);
int MClassGetPrio(mjob_t *,long *);
int MClassShow(mclass_t *,char *,long *,int);
/* sres object */
int MSRInitialize(sres_t *,char *);
int MSRFind(char *,sres_t **);
int MSRAdd(char *,sres_t **);
int MSRCreate(char *,sres_t *);
int MSRUpdate(sres_t *);
int MSRDestroy(sres_t **);
int MSRRefresh(void);
int MSRSetAttr(sres_t *,int,void **,int,int);
int MSRAToString(sres_t *,int,char *,int);
int MSRProcessOConfig(sres_t *,int,int,double,char *,char **);
int MSRSelectNodeList(mjob_t *,sres_t *,nodelist_t,int *,long,nodelist_t,unsigned long);
int MSRShow(sres_t *,char *,int,int);
int MSRConfigShow(sres_t *,int,int,char *);
int MSRSetRes(sres_t *,int,int);
int MSRGetAttributes(sres_t *,int,long *,unsigned long *);
int MSRCheckReservation(sres_t *,mres_t *);
int MSRGetCurrentValues(sres_t *,sres_t *,sres_t *);
int MSRBuildHostList(sres_t *);
int MSRLoadConfig(char *);
int MSRCheckConfig(sres_t *);
int MSRProcessConfig(sres_t *,char *);
int MSRToXML(sres_t *,mxml_t *,int *);
int MSRDiag(sres_t *,char *,int,int);
int MSRFromString(sres_t *,char *);
int MSRFromXML(sres_t *,mxml_t *);
/* sched object */
int MSchedProcessOConfig(msched_t *,int,int,double,char *,char **,char *);
int MSchedToString(msched_t *,char *);
int MSchedStatToString(msched_t *,int,char *,int);
int MSchedFromString(msched_t *,char *);
int MSchedSetDefaults(msched_t *);
int MSchedSetAttr(msched_t *,int,void **,int,int);
int MSchedOConfigShow(char *,int,int);
int MPolicyGetEStartTime(mjob_t *,mpar_t *,int,long *);
int MPolicyAdjustUsage(int *,mjob_t *,mres_t *,int,mpu_t *,int,int,int *);
int MPolicyCheckLimit(int,int,int,int,mpu_t *,mpu_t *,mpu_t *,int *);
int MSchedProcessJobs(char *,int *,int *);
int MSchedUpdateStats(void);
int MSchedTest(void);
int MSchedDiag(msched_t *,char *,int,int);
int MSchedProcessConfig(msched_t *,char *);
int MSchedLoadConfig(char *);
int MSchedConfigShow(msched_t *,int,char *,int);
int MSchedAToString(msched_t *,int,char *,int);
/* sim object */
int MSimInitialize(void);
int MSimShow(msim_t *,char *,int);
int MSimProcessEvents(int *);
int MSimSummarize(void);
int MSimProcessOConfig(msim_t *,int,int,double,char *,char **);
int MSimSetDefaults(void);
int MSimRMGetInfo(void);
int MSimMaintainWorkload(void);
int MSimGetWorkload(void);
int MSimInitializeWorkload(void);
int MSimJobSubmit(long,mjob_t **,void *,int);
int MSimJobStart(mjob_t *);
int MSimJobResume(mjob_t *);
int MSimJobModify(mjob_t *,char *,char *,char *,int *);
int MSimJobRequeue(mjob_t *);
int MSimJobSuspend(mjob_t *);
int MSimJobCheckpoint(mjob_t *);
int MSimJobTerminate(mjob_t *,int);
int MSimJobCancel(mjob_t *);
int MSimGetResources(char *,char *,char *);
int MSimLoadWorkloadCache(char *,char *,int *);
int MSimJobCreateName(char *,mrm_t *);
/* RM object */
int MRMInitialize(void);
int MRMClusterQuery(int *,int *);
int MRMWorkloadQuery(int *,int *);
int MRMJobStart(mjob_t *,char *Msg,int *);
int MRMJobCancel(mjob_t *,char *,int *);
int MRMCreate(char *,mrm_t *);
int MRMSetDefaults(mrm_t *);
int MRMOConfigShow(mrm_t *,int,int,char *);
int MRMShow(mrm_t *,char *,int,int);
int MRMFind(char *,mrm_t **);
int MRMDestroy(mrm_t **);
int MRMFinalizeCycle(void);
int MRMProcessConfig(mrm_t *,char *);
int MRMCheckConfig(mrm_t *);
int MRMJobGetProximateMNL(mjob_t *,mrm_t *,mnodelist_t,mnodelist_t,long,int,char *,int *);
int MRMCheckEvents(void);
int MRMJobSubmit(char *,mrm_t *,mjob_t **,char *,char *,int *);
int MRMJobSuspend(mjob_t *,char *,int *);
int MRMJobResume(mjob_t *,char *,int *);
int MRMJobCheckpoint(mjob_t *,int,char *,int *);
int MRMJobMigrate(mjob_t *,mnalloc_t *,int *);
int MRMJobModify(mjob_t *,char *,char *,char *,int *);
int MRMJobPreLoad(mjob_t *,char *,int);
int MRMReqPreLoad(mreq_t *);
int MRMJobPostLoad(mjob_t *,short *,mrm_t *);
int MRMJobPostUpdate(mjob_t *,short *,enum MJobStateEnum,mrm_t *);
int MRMJobStage(mjob_t *);
int MRMJobPreUpdate(mjob_t *);
int MRMJobRequeue(mjob_t *,mjob_t **,int *);
int MRMSetFailure(mrm_t *,int,char *);
int MRMLoadModules(void);
int MPBSLoadModule(mrmfunc_t *);
int MSGELoadModule(mrmfunc_t *);
int MLLLoadModule(mrmfunc_t *);
int MWikiLoadModule(mrmfunc_t *);
int MSSSLoadModule(mrmfunc_t *);
int MLSFLoadModule(mrmfunc_t *);
int MRMProcessOConfig(mrm_t *,int,int,double,char *,char **);
int MRMLoadConfig(char *);
int MRMGetInfo(void);
int MRMAdd(char *,mrm_t **);
int MRMConfigShow(mrm_t *,int,char *,int);
int MRMSetAttr(mrm_t *,int,void **,int,int);
int MRMAToString(mrm_t *,int,char *,int);
int MRMNodePreLoad(mnode_t *,int,mrm_t *);
int MRMNodePostLoad(mnode_t *);
int MRMNodePostUpdate(mnode_t *,int);
int MRMNodePreUpdate(mnode_t *,int,mrm_t *);
/* RMS interface object */
int MRMSInitialize(void);
int MRMSJobAllocateResources(mjob_t *,mreq_t *,mnalloc_t *,int,int *,int *,char *,int,int *,mnalloc_t *A[MAX_MREQ_PER_JOB],int *,int *);
int MRMSSelectAdjacentNodes(int,int,mnalloc_t *,mnalloc_t A[][MAX_MNODE]);
int MRMSQueryJob(mjob_t *,short *,int *);
int MRMSJobControl(mjob_t *,char *,char *,int *);
int MRMSJobSubmit(char *, mrm_t *, mjob_t **, int *);
/* BF object */
int MBFPreempt(mjob_t **,int,nodelist_t,unsigned long,int,int,mpar_t *);
int MBFFirstFit(mjob_t **,int,nodelist_t,unsigned long,int,int,mpar_t *);
int MBFBestFit(mjob_t **,int,nodelist_t,unsigned long,int,int,mpar_t *);
int MBFGreedy(mjob_t **,int,nodelist_t,unsigned long,int,int,mpar_t *);
int MBFGetWindow(int *,int *,nodelist_t,long *,long,mpar_t *,char *,char *,char *,int,int,unsigned long,mcres_t *,char *,char *,char *,char *);
/* wiki interface object */
int MWikiJobLoad(char *,char *,mjob_t *,short *,mrm_t *);
int MWikiDoCommand(char *,int,long,int,char *,char **,long *,int *);
int MWikiTestNode(char *);
int MWikiTestJob(char *);
/* util object */
int MUThread(int (*)(),long,int *,int,int *,...);
int MUStrCat(char *,char *,int);
int MUStrDup(char **,char *);
int MUMemCCmp(char *Data,char,int);
int MUFree(char **);
int MUCmpFromString(char *,int *);
int MUParseComp(char *,char *,int *,char *);
int MUGetPair(char *,const char **,int *,char *,int,int *,char *,int);
int MUBoolFromString(char *,int);
int MUGetIndex(char *,const char **,int,int);
int MUSScanF(char *,char *,...);
int MUStrCpy(char *,char *,int);
int MUStrToLower(char *);
int MUStrToUpper(char *,char *,int);
char *MUStrChr(char *,char);
int MUGetTime(mulong *,enum MTimeModeEnum,msched_t *);
char *MUPrintBuffer(char *,int);
int MUSleep(long);
int MUNumListGetCount(long,mnuml_t *,mnuml_t *,int,int *);
int MCResAdd(mcres_t *,mcres_t *,mcres_t *,int,int);
int MCResRemove(mcres_t *,mcres_t *,mcres_t *,int,int);
int MUCResIsNeg(mcres_t *);
int MUBuildPList(mcfg_t *,char **);
int MUCResGetMin(mcres_t *,mcres_t *,mcres_t *);
int MUCResGetMax(mcres_t *,mcres_t *,mcres_t *);
int MUNumListFromString(mnuml_t *,char *,int);
char *MUCAListToString(mnuml_t *,mnuml_t *,char *);
char *MUListAttrs(int,int);
int MUShowCopy(void);
int MFULock(char *,char *);
int MUSetEnv(char *,char *);
int MUGetMS(struct timeval *,long *);
long MUTimeFromString(char *);
int MUStringToE(char *,long *);
int MUReadPipe(char *,char *,int);
int MUClearChild(int *);
int MUCompare(int,int,int);
char *MULToTString(long);
char *MUStrTok(char *,char *,char **);
char *MUStrTokE(char *,char *,char **);
int MUGetOpt(int *,char **,char *,char **,int *);
long MURSpecToL(char *,enum MValModEnum,enum MValModEnum);
char *MULToRSpec(long,int,char *);
int MUCResFromString(mcres_t *,char *);
char *MUCResToString(mcres_t *,long,int,char *);
int MUStringUnpack(char *,char *,int);
int MUStringPack(char *,char *,int);
int MUStrNCmpL(char *,char *,int);
char *MUStrStrL(char *,char *);
int MUGetTokens(char **,short *,char *,char **);
int MUGetHash2(char *);
int MUDStatInitialize(dstat_t *,int);
int MUDStatIsEnabled(dstat_t *);
int MUDStatAdd(dstat_t *,char *);
int MUNLGetMinAVal(mnalloc_t *,int,mnode_t **,void **);
int MUNLGetMaxAVal(mnalloc_t *,int,mnode_t **,void **);
int MUSNInit(char **,int *,char *,int);
int MUSNPrintF(char **,int *,char *,...);
int MUStrNCat(char **,int *,char *);
int MUSNCat(char **,int *,char *);
char *MUMAList(int,int *,int);
int MUMAGetBM(int,char *,int);
int MUMAGetIndex(int,char *,int);
int MUMAMAttrFromLine(int,char *,int,int *,int);
int MUMAFromList(int,char **,int);
int MUMAFromString(int,char *,int);
char *MUMAToString(int,char,int *,int);
int MUNLCopy(mnalloc_t *,mnodelist_t,int,int);
int MUREToList(char *,int,int,short *,int *,char *);
char *MUUIDToName(int);
char *MUGIDToName(int);
int MUGIDFromUID(int);
int MUUIDFromName(char *);
int MUGIDFromName(char *);
int MUGNameFromUName(char *,char *);
char *MUBListAttrs(int,int);
char *MUSNCTime(long *Time);
int MSubmitTimeComp(mjob_t *,mjob_t *);
char *MUFindEnv(char *,int *);
int MUUnsetEnv(char *);
int MUPurgeEscape(char *);
int MUGetPeriodStart(long,long,int,int,long *);
char *MUBMToString(unsigned long,const char **,char,char *,char *);
int MUBMFromString(char *,const char **,unsigned long *);
int MUBMOR(int *,int *,int);
int MUBMAND(int *,int *,int);
int MUBMIsClear(int *,int);
int MUTMToHostList(short *,char **,mrm_t *);
unsigned long MUGetHash(char *);
int MUGetMAttr(int,char *,int,int *,int);
char *MUShowIArray(const char *,int,int);
char *MUShowLArray(const char *,int,long);
char *MUShowSArray(const char *,int,char *);
char *MUShowFArray(const char *,int,double);
int MUShowSSArray(const char *,char *,char *,char *);
char *MUBStringTime(long);
char *MUStrStr(char *,char *,int,mbool_t,mbool_t);
int MUStrNCmpCI(char *,char *,int);
char *MUNumListToString(mnuml_t *,mnuml_t *,char *,char *,int);
char *MULToDString(mulong *);
char *MAttrFind(char *,int,int *,int,char **);
int MAttrSubset(int *,int *,int,int);
int MAVPToXML(const char *,const char *,mamolist_t *,mamolist_t *,mamolist_t *,char *,char *);
int MXMLToAVP(const char *,mamolist_t *,char *);
int MOSSyslog(int,char *,...);
int MOSGetPID(void);
int MOSSetGID(int);
int MOSSetUID(int);
int MOSGetUID(void);
int MOSGetEUID(void);
int MOSGetHostName(char *,char *,unsigned long *);
int MOSSyslogInit(msched_t *);
int MUSystemF(char *,int,int *);
int MUCheckAuthFile(msched_t *,char *,int *,int);
char *MUCResRatioToString(mcres_t *,mcres_t *,mcres_t *,int);
int MMovePtr(char **,char **);
int MSDataCreate(msdata_t **);
int MSDataDestroy(msdata_t **);
int MDataGetEAvailTime(msdata_t *,long *);
/* NOTE: G2 prototype header not included */
int G2XMLCreateE(mxml_t **,char *);
int G2XMLDestroyE(mxml_t **);
int G2XMLSetAttr(mxml_t *,char *,void *,int);
int G2XMLSetVal(mxml_t *,void *,int);
int G2XMLAddE(mxml_t *,mxml_t *);
int G2XMLToString(mxml_t *,char *,int,char **,int);
int G2XMLGetAttr(mxml_t *,char *,int *,char *);
int G2XMLGetChild(mxml_t *,char *,int *,mxml_t **);
int G2XMLFromString(mxml_t **,char *,char **);
int MUIXMLSetStatus(mxml_t *,int,char *,int);
char *MUURLCreate(char *,char *,char *,int,char *,int);
int MUURLParse(char *,char *,char *,char *,int,int *,mbool_t);
int MUHProcessRequest(msocket_t *,char *);
int MUHInitialize(void);
/* log object */
int MLogInitialize(char *,int,int);
int MLogOpen(int);
int MLogRoll(char *,int,int,int);
char *MLogGetTime(void);
void MLogLevelAdjust(int);
int MLogShutdown(void);
#ifndef __MTEST
int DPrint(char *Format, ...);
#endif /* __MTEST */
/* acl management object */
int MACLLoadConfig(macl_t *ACL,char **ACLList,int,int);
int MACLSet(macl_t *,int,void *,int,int,long,int);
int MACLClear(macl_t *ACL,int);
int MACLLoadConfigLine(macl_t *ACL,char *);
int MACLGet(macl_t *,int,void **,int *);
int MACLCheckAccess(macl_t *,macl_t *,char *,int *);
char *MACLListShow(macl_t *,int,int,char *);
char *MACLShow(macl_t,int,int);
/* file util object */
char *MFULoad(char *,int,int,int *,int *);
int MFUGetInfo(char *,long *,long *,int *);
int MFUCacheInitialize(mulong *);
int MFUIndexInitialize(char *, int,int *);
int MFUGetRecord(char *,char *,char **,int *,int *);
int MFUPutRecord(char *,char *,char *,int *);
int MFURemoveRecord(char *,char *,int *);
int MFUGetModifyTime(char *,long *);
int MFUCacheInvalidate(char *);
int MFUGetCurrentIndex(char *,int *,int);
int MFUGetAttributes(char *,int *,long *,long *,int *,int *,int *);
int MFURename(char *,char *);
/* trace object */
int MTraceLoadWorkload(char *,int *,mjob_t *,int,int *);
int MTraceLoadResource(char *,int *,mnode_t *,int *);
int MTraceLoadComputeNode(char *,mnode_t *,int);
int MTraceLoadNetwork(char *,mnode_t *, int);
int MTraceLoadHSM(char *,mnode_t *,int);
int MTraceGetWorkloadVersion(char *,int *);
int MTraceGetResourceVersion(char *,int *);
int MTraceBuildResource(mnode_t *,int,char *,int);
/* ui util object */
int MUISMsgClear(msocket_t *);
int MUISMsgAdd(msocket_t *,char *);
/* client object */
int MClientLoadConfig(void);
int MClientProcessConfig(char *);
int MCDoCommand(char *,int,int,char *,char *);
int MCSendRequest(msocket_t *);
/* local interface */
int MLocalInitialize(void);
int MLocalNodeFilter(mjob_t *,mnode_t *,long);
int MLocalGetNodePriority(mjob_t *,mnode_t *);
int MLocalJobAllocateResources(mjob_t *,mreq_t *,mnalloc_t *,mulong,int,int *,int *,char *,int,int *,mnalloc_t *B[MAX_MREQ_PER_JOB],int *,int *);
int MLocalJobCheckNRes(mjob_t *,mnode_t *,long);
int MLocalJobDistributeTasks(mjob_t *,mrm_t *,mnalloc_t *,short *);
int MLocalNodeInit(mnode_t *);
int MLocalJobInit(mjob_t *);
int MLocalCheckFairnessPolicy(mjob_t *,long,char *);
int MLocalCheckRequirements(mjob_t *,mnode_t *,long);
int MLocalQueueScheduleIJobs(int *,mpar_t *);
/* other */
int MetaCtlInitialize(char *,char *,char *);
int MetaCtlCommit(char *,char *,char *);
int MetaCtlList(char *,char *,char *);
int MetaCtlQuery(char *,char *,char *);
int MetaCtlRegister(char *,char *,char *);
int MetaCtlRemove(char *,char *,char *);
int MetaCtlSet(char *, char *,char *);
int MetaCtlSubmit(char *,char *,char *);
int MetaStoreCompletedJobInfo(mjob_t *);
int MUNLFromTL(mnalloc_t *,short *,int *);
/* app sim interface */
char *MASGetName(void *);
int MASGetDriver(void **,char *,int);
int MGResFind(char *,int,xres_t **);
/* general object */
int MPrioConfigShow(int,int,char *);
/* X prototypes */
int XGetClientInfo(void *,msocket_t *,char *);
int XPBSInitialize(void *,mrm_t *);
int XPBSNMGetData(void *,mnode_t *, mrm_t *);
int XInitialize(mx_t *,char *,int *,char **,char *);
int XLoadClientKeys(void *);
int XUIHandler(void *,msocket_t *,char *,int);
int XUIJobCtl(void);
int XUIMetaCtl(void);
int XUIResCtl(void);
int XShowConfig(void *,char *);
int XRMInitialize(void *,mrm_t *);
int XRMResetState(void *,mrm_t *);
int XRMVerifyData(void *,mrm_t *,char *);
int XRMJobResume(void);
int XRMJobSuspend(void);
int XUpdateState(void);
int XMetaStoreCompletedJobInfo(void);
int XAllocMachinePrio(void);
int XAllocLoadBased(void);
int XJobProcessWikiAttr(void *,mjob_t *,char *);
int XJobDestroy(void *,mjob_t **,int);
int XJobGetStartPriority(void *,mjob_t *, double *);
int XLL2JobLoad(void *,mjob_t *,void *);
int XLL2JobUpdate(void *,mjob_t *,void *);
int XLL2NodeLoad(void *,mnode_t *,void *);
int XLL2NodeUpdate(void *,mnode_t *,void *);
int XQueueScheduleJobs(void *,int *,int);
/* END moab-proto.h */

114
include/moab-s_apps.h Normal file
View File

@@ -0,0 +1,114 @@
/*
*/
/* apps/s_apps.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include <sys/types.h>
#if (defined(VMS) || defined(__VMS)) && !defined(FD_SET)
/* VAX C does not defined fd_set and friends, but it's actually quite simple */
/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */
#define MAX_NOFILE 32
#define NBBY 8 /* number of bits in a byte */
#ifndef FD_SETSIZE
#define FD_SETSIZE MAX_NOFILE
#endif /* FD_SETSIZE */
/* How many things we'll allow select to use. 0 if unlimited */
#define MAXSELFD MAX_NOFILE
typedef int fd_mask; /* int here! VMS prototypes int, not long */
#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask (power of 2!)*/
#define NFDSHIFT 5 /* Shift based on above */
typedef fd_mask fd_set;
#define FD_SET(n, p) (*(p) |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p) (*(p) &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p) (*(p) & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
#endif
#define PORT 4433
#define PORT_STR "4433"
#define PROTOCOL "tcp"
int do_server(int port, int *ret, int (*cb) (), char *context);
#ifdef HEADER_X509_H
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
#else
int MS_CALLBACK verify_callback(int ok, char *ctx);
#endif
#ifdef HEADER_SSL_H
int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file);
#else
int set_cert_stuff(char *ctx, char *cert_file, char *key_file);
#endif
int init_client(int *sock, char *server, int port);
int should_retry(int i);
int extract_port(char *str, short *port_ptr);
int extract_host_port(char *str,char **host_ptr,unsigned char *ip,short *p);
long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp,
int argi, long argl, long ret);
#ifdef HEADER_SSL_H
void MS_CALLBACK apps_ssl_info_callback(SSL *s, int where, int ret);
#else
void MS_CALLBACK apps_ssl_info_callback(char *s, int where, int ret);
#endif

346
include/moab-wiki.h Normal file
View File

@@ -0,0 +1,346 @@
/*
*/
#ifndef __MWIKI_H__
#define __MWIKI_H__
#include "msched-common.h"
#define WIKI_MAX_JOB 512
#define WIKI_MAX_NODE 128
#define WIKI_MAX_FRAG_PER_JOB 8
#define WIKI_MAX_NODE_PER_JOB 256
#define DEFAULT_CONFIGFILE "/etc/rm.cfg"
#define DEFAULT_WMTCPPORT 30002
#define DEFAULT_WMUDPPORT 30003
#define DEFAULT_JMTCPPORT 30004
#define DEFAULT_JMUDPPORT 30005
#define DEFAULT_NMTCPPORT 30006
#define DEFAULT_TMTCPPORT 30007
#define DEFAULT_WMTIMEOUT 10000000
#define DEFAULT_JMTIMEOUT 10000000
#define DEFAULT_NMTIMEOUT 10000000
#define DEFAULT_TMTIMEOUT 10000000
#define DEFAULT_JOBMANCOMMAND "/usr/local/bin/jobman"
#define DEFAULT_NODEMANCOMMAND "/usr/local/bin/nodeman"
#define DEFAULT_TASKMANCOMMAND "/usr/local/bin/taskman"
#define DEFAULT_RSHCOMMAND "rsh"
#define DEFAULT_LOCALFILESYSTEM "/tmp"
#define MAX_HIER_CHILD 32
#define MAX_CHILD_PER_LEVEL 128
#define MAX_WIKINODEATTR 22
#define MAX_WIKIJOBATTR 38
enum {
sigAlive = 0
};
enum {
cmdWMNone = 0,
cmdWMSubmitJob,
cmdWMGetJobs,
cmdWMGetNodes,
cmdWMUpdateJob,
cmdWMStartJob,
cmdWMCancelJob,
cmdWMSuspendJob,
cmdWMResumeJob,
cmdWMCheckPointJob,
cmdWMMigrateJob,
cmdWMPurgeJob,
cmdWMStartTask,
cmdWMKillTask,
cmdWMSuspendTask,
cmdWMResumeTask,
cmdWMGetTaskStatus,
cmdWMGetNodeStatus,
cmdWMGetJobStatus,
cmdWMUpdateTaskStatus,
cmdWMUpdateNodeStatus,
cmdWMUpdateJobStatus,
cmdWMAllocateNode,
cmdWMStartNodeman,
cmdWMSpawnTaskman,
cmdWMSpawnJobman,
cmdWMReconfig,
cmdWMShutdown,
cmdWMDiagnose,
cmdWMReparent
};
enum {
woNone = 0,
woNodeStatus,
woJobStatus
};
enum {
wnaNone = 0,
wnaUpdateTime,
wnaState,
wnaOS,
wnaArch,
wnaCacheSize,
wnaL2CacheSize,
wnaConfMemory,
wnaAvailMemory,
wnaConfSwap,
wnaAvailSwap,
wnaConfLocalDisk,
wnaAvailLocalDisk,
wnaConfProcCount,
wnaAvailProcCount,
wnaConfNetworkList,
wnaAvailNetworkList,
wnaCPULoad,
wnaMaxTasks
};
enum {
weNone = 0,
weNoReport,
weNoParent
};
enum {
wsNone = 0,
wsJob,
wsNode
};
typedef struct {
char Name[MAX_MNAME];
long MTime;
char State[MAX_MNAME];
char OS[MAX_MNAME];
char Arch[MAX_MNAME];
int CacheSize;
int L2CacheSize;
int ConfMemory;
int AvailMemory;
int ConfSwap;
int AvailSwap;
int ConfLocalDisk;
int AvailLocalDisk;
int ConfProcCount;
int AvailProcCount;
char ConfNetworkList[MAX_MLINE];
char AvailNetworkList[MAX_MLINE];
double CPULoad;
int MaxTasks;
} wiki_node_t;
typedef struct {
char Arch[MAX_MNAME];
char OS[MAX_MNAME];
char Network[MAX_MNAME];
char Features[MAX_MNAME];
int ProcCount;
int ProcCountCmp;
int Memory;
int MemCmp;
int Disk;
int DiskCmp;
int Swap;
int SwapCmp;
char IWD[MAX_PATH_LEN];
char Args[MAX_MNAME];
char Env[MAX_MNAME];
char Input[MAX_PATH_LEN];
char Output[MAX_PATH_LEN];
char Error[MAX_PATH_LEN];
char Exec[MAX_PATH_LEN];
char Shell[MAX_PATH_LEN];
time_t QueueTime;
time_t StartTime;
time_t CompletionTime;
int Status;
char JobMonServer[MAX_MNAME];
int JobMonPort;
char HostName[MAX_MNODE_PER_FRAG + 1][MAX_MNAME];
char HostStatus[MAX_MNODE_PER_FRAG + 1];
short TaskList[MAX_MTASK_PER_FRAG + 1];
int TaskCount;
char Buf[5 * MAX_MNAME];
} wiki_frag_t;
typedef struct {
char Name[MAX_MNAME];
long MTime;
int Status;
long StateMTime;
int Version;
int WCLimit;
int UID;
int GID;
char Account[MAX_MNAME];
char PartitionList[MAX_MNAME];
wiki_frag_t Frag[WIKI_MAX_FRAG_PER_JOB];
int FragCount;
char NodeList[MAX_MNODE_PER_JOB + 1][MAX_MNAME];
short TaskMap[MAX_MTASK_PER_JOB + 1];
char JobmanHost[MAX_MNAME];
int JobmanPort;
} wiki_job_t;
typedef struct {
char Name[MAX_MNAME];
char Exec[MAX_PATH_LEN];
char Shell[MAX_PATH_LEN];
char Args[MAX_MNAME];
char Input[MAX_PATH_LEN];
char Output[MAX_PATH_LEN];
char Error[MAX_PATH_LEN];
char IWD[MAX_PATH_LEN];
char Env[MAX_MLINE];
int UID;
int GID;
int TID;
int PID;
int SID;
} wiki_task_t;
typedef struct {
char HostName[MAX_MNAME];
int MsgType;
int Port;
} wiki_jobstatus_t;
typedef struct {
char Buf[MAX_MLINE];
} wiki_stat_t;
enum MWNodeAttrEnum {
mwnaNONE = 0,
mwnaUpdateTime,
mwnaState,
mwnaOS,
mwnaArch,
mwnaCMemory,
mwnaAMemory,
mwnaCSwap,
mwnaASwap,
mwnaCDisk,
mwnaADisk,
mwnaCProc,
mwnaAProc,
mwnaCNet,
mwnaANet,
mwnaCRes,
mwnaARes,
mwnaCPULoad,
mwnaCClass,
mwnaAClass,
mwnaFeature,
mwnaPartition,
mwnaEvent,
mwnaCurrentTask,
mwnaMaxTask,
mwnaSpeed,
mwnaName
};
enum MWJobAttrEnum {
mwjaNONE = 0,
mwjaUpdateTime,
mwjaState,
mwjaWCLimit,
mwjaTasks,
mwjaNodes,
mwjaGeometry,
mwjaQueueTime,
mwjaStartDate,
mwjaStartTime,
mwjaCompletionTime,
mwjaUName,
mwjaGName,
mwjaAccount,
mwjaRFeatures,
mwjaRNetwork,
mwjaDNetwork,
mwjaRClass,
mwjaROpsys,
mwjaRArch,
mwjaRMem,
mwjaRMemCmp,
mwjaDMem,
mwjaRDisk,
mwjaRDiskCmp,
mwjaDDisk,
mwjaRSwap,
mwjaRSwapCmp,
mwjaDSwap,
mwjaPartitionList,
mwjaExec,
mwjaArgs,
mwjaIWD,
mwjaComment,
mwjaRejectionCount,
mwjaRejectionMessage,
mwjaRejectionCode,
mwjaEvent,
mwjaTaskList,
mwjaTaskPerNode,
mwjaQOS,
mwjaEndDate,
mwjaDProcs,
mwjaHostList,
mwjaSuspendTime,
mwjaResAccess,
mwjaName,
mwjaEnv,
mwjaInput,
mwjaOutput,
mwjaError,
mwjaFlags,
mwjaSubmitString,
mwjaSubmitType
};
#endif /* __MWIKI_H__ */

2078
include/moab.h Normal file

File diff suppressed because it is too large Load Diff

33
include/mprof-proto.h Normal file
View File

@@ -0,0 +1,33 @@
/*
*/
#ifndef __MPROF_PROTO_H__
#define __MPROF_PROTO_H__
int main(int,char **);
int MPInitialize(void);
int OpenPlotFile(char *);
int MPReadArgs(int,char **);
int PJobCountDistribution(void);
int PBFCountDistribution(void);
int PQueueDistribution(void);
int PAccuracyDistribution(int);
int PNSRequestDistribution(void);
int PNSRunDistribution(void);
int PQueueTimeDistribution(void);
int PJobLengthAccuracy(void);
int PXFactor(void);
int PMaxXFactor(void);
int PJobEfficiency(void);
int PQOSSuccessRate(void);
int ProfileMemoryUsage(void);
int ProfileUser(void);
int ProfileGroup(void);
int ProfileAccount(void);
int UPSComp(mgcred_t **,mgcred_t **);
int GPSComp(mgcred_t *,mgcred_t *);
int APSComp(mgcred_t *, mgcred_t *);
int MPLoadTrace(char *);
int GetComp(char *);
#endif /* __MPROF_PROTO_H__ */

View File

@@ -0,0 +1,59 @@
/*
*/
#ifndef __M_COMMON_PROTO_H__
#define __M_COMMON_PROTO_H__
int DStatInitialize( dstat_t *D, int DSize);
int DStatIsEnabled( dstat_t *D);
int DStatAdd( dstat_t *D, char *Data);
char *BStringTime(long iTime); /* IN: epoch time */
char *snctime(long *Time);
char *PrintBuffer(char *,int);
int SystemF(char *,int,int *);
unsigned short DoCRC(unsigned short,unsigned char);
int PSDES(unsigned int *,unsigned int *);
int OSGetHostName(
char *HostName,
char *FullHostName,
unsigned long *Address);
int GetTokens(
char *Line[],
short TokList[],
char TypeList[],
char *ValList[]);
char *GetShortName(char *);
int OSGetPID(void);
int OSSetGID(int);
int OSSetUID(int);
char *ShowIArray(const char *,int,int);
char *ShowLArray(const char *,int,long);
char *ShowSArray(const char *,int,char *);
char *ShowFArray(const char *,int,double);
int ShowSSArray(
const char *Param, /* I */
char *IndexName, /* I */
char *ValLine, /* I */
char *Buffer); /* I/O */
int UHProcessRequest(msocket_t *,char *);
#endif /* __M_COMMON_PROTO_H__ */

770
include/msched-common.h Normal file
View File

@@ -0,0 +1,770 @@
/*
*/
#ifndef __M_COMMON_H__
#define __M_COMMON_H__
#ifdef __MTHREADS
# include <pthread.h>
#endif /* __MTHREADS */
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <locale.h>
#include <signal.h>
#include <time.h>
#include <stdarg.h>
#include <ctype.h>
#include <unistd.h>
#include <strings.h>
#include <grp.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <syslog.h>
#include <pwd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#define NONE "[NONE]"
#define ALL "[ALL]"
#define NOBODY "[NOBODY]"
#ifndef DEFAULT
# define DEFAULT "[DEFAULT]"
#endif /* DEFAULT */
#define MAX_PATH_LEN 256
#define MAX_SBUFFER 262144
#define MAX_MPATH_LEN 256
#define MMAX_PATH_LEN 256
#define MAX_MLINE 1024
#define MMAX_LINE 1024
#define MAX_MBUFFER 65536
#define MMAX_BUFFER 65536
#define MAX_MSBUFFER 262144
#define MAX_MENVVAR 64
#define MAX_USHORT 65532
#define MAX_MARG 32
#define MMAX_ARG 32
#define MAX_TOKEN 64
#define MAX_MTIME 2140000000
#define MAX_MEFFINF 50000000 /* ~ 1.5 years */
#ifndef MAX_MNODE
# define MAX_MNODE 5120
#endif /* MAX_MNODE */
#define MMAX_NODE 5120
#define MAX_MNODE_PER_JOB 1024
#define MAX_MNODE_PER_FRAG 1024
#ifndef MAX_MTASK
# define MAX_MTASK 4096
#endif /* MAX_MTASK */
#define MAX_MTASK_PER_FRAG MAX_MTASK
#define MAX_MTASK_PER_JOB MAX_MTASK
#define MMAX_TASK_PER_JOB MAX_MTASK
#ifndef MAX_LONG
# define MAX_LONG 0x7fffffff
#endif /* MAX_LONG */
#ifndef MAX_INT
# define MAX_INT 0x7fffffff
#endif /* MAX_INT */
#ifndef MAX_CHAR
# define MAX_CHAR 0xff
#endif /* MAX_CHAR */
#define MAX_MCLIENT 10
#define MMAX_CLIENT 10
#define DAY_LEN 86400
#define WEEK_LEN 604800
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif /* FALSE */
#ifndef MBNOTSET
#define MBNOTSET 2
#endif /* MBNOTSET */
#ifndef SUCCESS
#define SUCCESS 1
#endif
#ifndef FAILURE
#define FAILURE 0
#endif
#define TCP 1
#define UDP 2
enum MSockFTypeEnum {
msftNONE = 0,
msftTCP,
msftUDP };
#define MLog DPrint
/* value types */
enum {
cNONE = 0,
cSString,
cSNum,
cSStr,
cMNum,
cMStr,
cSFloat,
cSIntArray,
cSFloatArray,
cMStrArray };
typedef struct {
mulong StartTime;
mulong EndTime;
int TaskCount;
int NodeCount;
char Affinity;
} mrange_t;
#define DSTAT_STEPSIZE 64
typedef struct {
char *Data;
int DSize;
int Count;
int Size;
} dstat_t;
typedef struct {
char FileName[MAX_PATH_LEN];
time_t ProgTimeStamp;
time_t FileTimeStamp;
char *Buffer;
int BufSize;
} mfcache_t;
typedef struct {
char FileName[MAX_PATH_LEN];
int Index;
} mfindex_t;
typedef struct {
int Offset;
char Key[MAX_MNAME];
} rindex_t;
#define MAX_MACL 32
/* node accessibility */
enum {
nmUnavailable = 0,
nmRequired,
nmPositiveAffinity,
nmNeutralAffinity,
nmNegativeAffinity,
nmPreemptible,
nmNone /* no affinity (ie, no reservation) */
};
enum MACLEnum {
maclNONE = 0,
maclDeny,
maclXOR,
maclRequired };
typedef struct {
char Name[MAX_MNAME];
long Value;
long Flags;
char Type;
char Cmp;
char Affinity;
} macl_t;
#define MAX_FILECACHE 32
#define MAX_FBUFFER 16000000
/* period types */
enum MPeriodEnum { mpNONE = 0, mpDay, mpWeek, mpInfinity };
enum { jtNONE = 0, jtWiki, jtTrace, jtXML };
/* trace flags */
enum MTraceFlagEnum {
tfNONE,
tfFixCorruption };
/* client keyword values */
enum MClientKeywordEnum {
mckNONE = 0,
mckStatusCode,
mckArgs,
mckAuth,
mckCommand,
mckData,
mckClient,
mckTimeStamp,
mckCheckSum };
#define MAX_MRESOURCETYPE 6
enum MResourceTypeEnum {
mrNONE = 0,
mrNode,
mrProc,
mrMem,
mrSwap,
mrDisk };
/* object access types */
#define MAX_MATTRTYPE 20
#define MMAX_ATTRTYPE 20
enum MAttrEnum {
maNONE = 0,
maJob,
maNode,
maRes,
maUser,
maGroup,
maAcct,
maPartition,
maScheduler,
maSystem,
maClass,
maQOS,
maJFeature,
maDuration,
maTask,
maProc,
maFrame,
maQueue,
maCluster };
typedef struct {
FILE *logfp;
int Threshold;
unsigned long FacilityList;
} mlog_t;
#ifndef DBG
enum { dbLOGFILE, dbNOTIFY, dbSYSLOG };
#define DBG(X,F) if ((mlog.Threshold >= X) && ((mlog.FacilityList) & F))
#define MDB(X,F) if ((mlog.Threshold >= X) && ((mlog.FacilityList) & F))
#ifdef __MTEST
#define DPrint printf
#endif /* __MTEST */
#define MDEBUG(X) if (mlog.Threshold >= X)
/* log facility values */
#define fCORE (1 << 0)
#define fSCHED (1 << 1)
#define fSOCK (1 << 2)
#define fUI (1 << 3)
#define fLL (1 << 4)
#define fSDR (1 << 5)
#define fCONFIG (1 << 6)
#define fSTAT (1 << 7)
#define fSIM (1 << 8)
#define fSTRUCT (1 << 9)
#define fFS (1 << 10)
#define fCKPT (1 << 11)
#define fAM (1 << 12)
#define fRM (1 << 13)
#define fPBS (1 << 14)
#define fWIKI (1 << 15)
#define fSGE (1 << 16)
#define fS3 (1 << 17)
#define fLSF (1 << 18)
#define fNAT (1 << 19)
#define fALL 0xffffffff
#endif /* DBG */
#ifndef MIN
# define MIN(x,y) (((x) < (y)) ? (x) : (y))
#endif
#ifndef MAX
# define MAX(x,y) (((x) > (y)) ? (x) : (y))
#endif
#define RSPMARKER "RSP="
/* comparision types */
enum MCompEnum {
mcmpNONE = 0,
mcmpLT,
mcmpLE,
mcmpEQ,
mcmpGE,
mcmpGT,
mcmpNE,
mcmpEQ2,
mcmpNE2,
mcmpSSUB,
mcmpSNE,
mcmpSEQ
};
enum {
rmaNONE = 0,
rmaCheckSum,
rmaPKI,
rmaSecurePort
};
typedef struct
{
int count;
} mnuml_t;
typedef struct {
int Nodes;
int Memory;
unsigned long Workload;
unsigned long InitialWorkload;
} mrclass_t;
#define MAX_MCLASS 16
#define MMAX_CLASS 16
#define MAX_MGRES 4
typedef struct {
int Procs;
int Mem; /* (in MB) */
int Swap; /* (in MB) */
int Disk; /* (in MB) */
mnuml_t PSlot[MAX_MCLASS];
mnuml_t GRes[MAX_MGRES];
} mcres_t;
/* AM Interface */
typedef struct
{
const char *Attr;
char Value[MAX_MLINE];
char *Cmp;
} mamolist_t;
#define MAX_MAMO 12
enum MAMOTypes {
mamoNONE = 0,
mamoAccount,
mamoClass,
mamoDuration,
mamoJobID,
mamoJobType,
mamoMachine,
mamoNodeType,
mamoProcCount,
mamoProcRate,
mamoQOS,
mamoUser
};
enum {
pParamNONE = 0,
mcoBFChunkDuration,
mcoBFChunkSize,
mcoComputeHosts,
pSchedConfigFile,
pSchedMode,
pSchedStepCount,
pMServerHomeDir,
pServerName,
pSchedLogDir,
pSchedLogFile,
pLogLevel,
pLogFacility,
pRMPollInterval,
pDisplayFlags,
pMaxSleepIteration,
pSchedToolsDir,
pSchedLockFile,
pMachineConfigFile,
pCheckPointFile,
pCheckPointInterval,
pCheckPointExpirationTime,
pClientCfg,
pAdminEInterval,
pAdminEAction,
pLogFileMaxSize,
pLogFileRollDepth,
pServerHost,
pServerPort,
pAMType,
pAMProtocol,
pAMChargePolicy,
pAMHost,
pAMPort,
pAMFlushInterval,
pAMFallbackAccount,
pAMAppendMachineName,
pAMDeferOnJobFailure,
pAMTimeout,
pDefaultDomain,
pDefaultQMHost,
pDefaultClassList,
pRMPort,
pRMHost,
pRMNMPort,
pRMName,
pRMType,
pRMAuthType,
pRMTimeout,
pRMConfigFile,
pRMLocalDiskFS,
mcoRMEPort,
pNAPolicy,
pResourceCollectionPolicy,
pRemoteStartCommand,
pResourceCommand,
pResourcePort,
pResourceSampleInterval,
pResourceReportWait,
pResourceDataFile,
pResourceLockFile,
mcoAdminUsers,
mcoAdmin1Users,
mcoAdmin2Users,
mcoAdmin3Users,
mcoAdmin4Users,
mcoAdminHosts,
mcoJobFBAction,
mcoMailAction,
mcoDeferTime,
pDeferCount,
pDeferStartCount,
pJobPurgeTime,
pNodePurgeTime,
pAPIFailureThreshhold,
pNodeSyncDeadline,
pJobSyncDeadline,
pJobMaxOverrun,
pSimWCScalingPercent, /* sim params */
pSimInitialQueueDepth,
pSimWCAccuracy,
pSimWCAccuracyChange,
pSimJobSubmissionPolicy,
pSimNCPolicy,
pUseMachineSpeed,
pUseSystemQueueTime,
pNodeAvailPolicy,
mcoResourceLimitPolicy,
mcoAdminMinSTime,
pJobPrioAccrualPolicy,
pBFPriorityPolicy,
pUseLocalMachinePriority,
pSimNodeCount,
pSimScaleJobRunTime,
pSimCheckpointInterval,
pWorkloadTraceFile,
pResourceTraceFile,
pStopIteration,
pExitIteration,
pSimAutoShutdown,
pSimFlags,
pSimIgnoreJobFlags,
pSimDefaultJobFlags,
pSimStartTime,
pNodeMaxLoad,
pNodeLoadPolicy,
pNodeSetPolicy,
pNodeSetAttribute,
pNodeSetDelay,
pNodeSetList,
pNodeSetTolerance,
pNodeSetPriorityType,
pNodeUntrackedProcFactor,
pNodeDownStateDelayTime,
mcoAllocLocalityPolicy,
mcoUseJobRegEx,
mcoEnableMultiNodeJobs,
mcoEnableMultiReqJobs,
pCommunicationType,
pIntraFrameCost,
pInterFrameCost,
pComRate,
pRandomizeJobSize,
pBFPolicy, /* policy params */
pBFDepth,
pBFType,
pBFProcFactor,
pBFMaxSchedules,
pSRName,
pSRPeriod,
pSRDays,
pSRStartTime,
pSREndTime,
pSRWStartTime,
pSRWEndTime,
pSRDepth,
pSRResources,
pSRTPN,
pSRTaskCount,
pSRMaxTime,
pSRIdleTime,
pSRMinLoad,
pSRTimeLogic,
pSRUserList,
pSRGroupList,
pSRAccountList,
pSRQOSList,
pSRClassList,
pSRPartition,
pSRHostList,
pSRChargeAccount,
pSRAccess,
pSRPriority,
pSRFlags,
pSRFeatures,
pSRMinTasks,
pSRMaxTasks,
pMaxJobPerUserCount,
pHMaxJobPerUserCount,
pMaxJobPerUserPolicy,
pMaxProcPerUserCount,
pHMaxProcPerUserCount,
pMaxProcPerUserPolicy,
pMaxNodePerUserCount,
pHMaxNodePerUserCount,
pMaxNodePerUserPolicy,
pMaxPSPerUserCount,
pHMaxPSPerUserCount,
pMaxPSPerUserPolicy,
pMaxJobQueuedPerUserCount,
pHMaxJobQueuedPerUserCount,
pMaxJobQueuedPerUserPolicy,
pMaxPEPerUserCount,
pHMaxPEPerUserCount,
pMaxPEPerUserPolicy,
pMaxJobPerGroupCount,
pHMaxJobPerGroupCount,
pMaxJobPerGroupPolicy,
pMaxNodePerGroupCount,
pHMaxNodePerGroupCount,
pMaxNodePerGroupPolicy,
pMaxPSPerGroupCount,
pHMaxPSPerGroupCount,
pMaxPSPerGroupPolicy,
pMaxJobQueuedPerGroupCount,
pHMaxJobQueuedPerGroupCount,
pMaxJobQueuedPerGroupPolicy,
pMaxJobPerAccountPolicy,
pMaxJobPerAccountCount,
pHMaxJobPerAccountCount,
pMaxNodePerAccountPolicy,
pMaxNodePerAccountCount,
pHMaxNodePerAccountCount,
pMaxPSPerAccountPolicy,
pMaxPSPerAccountCount,
pHMaxPSPerAccountCount,
pMaxJobQueuedPerAccountPolicy,
pMaxJobQueuedPerAccountCount,
pHMaxJobQueuedPerAccountCount,
pMaxMetaTasks,
pSystemMaxJobProc,
pSystemMaxJobTime,
pSystemMaxJobPS,
pMaxJobStartTime,
pNodeAllocationPolicy,
pTaskDistributionPolicy,
pBFMetric,
pJobSizePolicy,
pJobNodeMatch,
mcoJobAttrPrioF,
pResPolicy,
pResRetryTime,
pResThresholdValue,
pResThresholdType,
pReservationDepth,
pServWeight, /* NOTE: parameters must sync with prio comp/subcomp enum */
pTargWeight,
pCredWeight,
pAttrWeight,
pFSWeight,
pResWeight,
pUsageWeight,
pSQTWeight,
pSXFWeight,
pSSPVWeight,
pSBPWeight,
pTQTWeight,
pTXFWeight,
pCUWeight,
pCGWeight,
pCAWeight,
pCQWeight,
pCCWeight,
pFUWeight,
pFGWeight,
pFAWeight,
pFQWeight,
pFCWeight,
pAJobAttrWeight,
pAJobStateWeight,
pRNodeWeight,
pRProcWeight,
pRMemWeight,
pRSwapWeight,
pRDiskWeight,
pRPSWeight,
pRPEWeight,
pRWallTimeWeight,
pRUProcWeight,
pRUJobWeight,
pUConsWeight,
pURemWeight,
pUPerCWeight,
pXFMinWCLimit,
pServCap, /* NOTE: parameters must sync with prio comp/subcomp enum */
pTargCap,
pCredCap,
pAttrCap,
pFSCap,
pResCap,
pUsageCap,
pSQTCap,
pSXFCap,
pSSPVCap,
pSBPCap,
pTQTCap,
pTXFCap,
pCUCap,
pCGCap,
pCACap,
pCQCap,
pCCCap,
pFUCap,
pFGCap,
pFACap,
pFQCap,
pFCCap,
pAJobAttrCap,
pAJobStateCap,
pRNodeCap,
pRProcCap,
pRMemCap,
pRSwapCap,
pRDiskCap,
pRPSCap,
pRPECap,
pRWallTimeCap,
pUConsCap,
pURemCap,
pUPerCCap,
pQOSName,
pQOSXFWeight,
pQOSTargetXF,
pQOSQTWeight,
pQOSTargetQT,
pQOSPriority,
pQOSFlags,
pResQOSList,
pFSPolicy,
pFSConfigFile,
pFSInterval,
pFSDepth,
pFSDecay,
pFSEnforcement,
pStatDir, /* Stat params */
pPlotMinTime,
pPlotMaxTime,
pPlotTimeScale,
pPlotMinNode,
pPlotMaxNode,
pPlotNodeScale,
pMonitoredJob,
pMonitoredNode,
pMonitoredRes,
pMonitoredFunction,
pResDepth,
pNodePollFrequency,
pProcSpeedFeatureHeader,
pNodeTypeFeatureHeader,
pPartitionFeatureHeader,
pClientTimeout,
pMCSocketProtocol,
pDefaultAccountName,
pNodeCPUOverCommitFactor,
pNodeMemOverCommitFactor,
pMaxJobPerIteration,
pMinDispatchTime,
mcoUseSyslog,
pResCtlPolicy,
pPreemptPolicy,
pJobAggregationTime,
pUseCPUTime,
pParIgnQList,
mcoRejectNegPrioJobs,
mcoEnableNegJobPriority,
mcoWCViolAction,
mcoResLimitPolicy,
mcoDirectoryServer,
mcoEventServer,
mcoTimePolicy,
pOLDFSUWeight, /* params for backwards compatibility */
pOLDFSGWeight,
pOLDFSAWeight,
pOLDFSQWeight,
pOLDFSCWeight,
pOLDServWeight,
pOLDQTWeight,
pOLDXFWeight,
pOLDUFSWeight,
pOLDGFSWeight,
pOLDAFSWeight,
pOLDDirectSpecWeight,
pOLDBankServer,
pOLDRMServer
};
#endif /* __M_COMMON_H__ */

120
include/msched-llapi.h Normal file
View File

@@ -0,0 +1,120 @@
/*
*/
#ifndef __LLAPI
#define __LLAPI
#define LL_JOB_VERSION 0
#define LL_PROC_VERSION 0
#define LL_CONTROL_VERSION 22
enum { LL_CM, QUERY_ALL, JOBS, MACHINES };
enum DataFilter { ALL_DATA, STATUS_LINE, Q_LINE };
enum Usage { SHARED, NOT_SHARED };
enum HoldType { NO_HOLD, HOLDTYPE_USER, HOLDTYPE_SYSTEM, HOLDTYPE_USERSYS };
enum {
STATE_IDLE,STATE_PENDING,STATE_STARTING,STATE_REMOVED,STATE_REJECT_PENDING,STATE_COMPLETE_PENDING,STATE_VACATE_PENDING,STATE_REMOVE_PENDING,STATE_RUNNING,STATE_HOLD,STATE_DEFERRED,STATE_REJECTED,STATE_UNEXPANDED,STATE_NOTQUEUED,STATE_COMPLETED,STATE_VACATED,STATE_NOTRUN,STATE_SUBMISSION_ERR,STATE_TERMINATED,STATE_CANCELED,STATE_PREEMPTED,STATE_PREEMPT_PENDING,STATE_RESUME_PENDING };
enum {
LL_MachineVirtualMemory,LL_MachineRealMemory,LL_MachineCPUs,LL_MachineDisk,LL_MachineMaxTasks,LL_MachinePoolList,LL_MachinePoolListSize,LL_MachineOperatingSystem,LL_MachineArchitecture,LL_MachineLoadAverage,LL_MachineSpeed,LL_MachineAdapterList,LL_MachineFeatureList,LL_MachineConfiguredClassList,LL_MachineAvailableClassList,LL_JobSubmitHost,LL_StepHoldType,LL_StepHostList,LL_StepState,LL_StepDispatchTime,LL_StepTaskInstanceCount,LL_StepCompletionDate,LL_StepCompletionCode,LL_StepMessages,LL_MachineName,LL_MachineStartdState,LL_StepGetFirstMachine,LL_StepGetNextMachine,LL_JobCredential,LL_CredentialUserName,LL_CredentialGroupName,LL_StepAccountNumber,LL_StepGetFirstNode,LL_NodeMinInstances,LL_NodeInitiatorCount,LL_StepGetNextNode,LL_NodeGetFirstTask,LL_NodeRequirements,LL_StepComment,LL_JobStepType,LL_JobSubmitTime,LL_StepStartCount,LL_StepStartDate,LL_StepExecSize,LL_StepImageSize,LL_StepIwd,LL_TaskExecutable,LL_StepWallClockLimitHard,LL_StepJobClass,LL_StepNodeUsage,LL_JobGetFirstStep,LL_StepID,LL_JobGetNextStep,LL_TaskIsMaster,LL_TaskGetFirstTaskInstance,LL_TaskInstanceMachineName,LL_TaskGetNextTaskInstance,LL_NodeGetNextTask };
enum { API_OK = 0,API_INVALID_INPUT,API_CANT_MALLOC,API_CANT_CONNECT,API_CONFIG_ERR,API_CANT_TRANSMIT,API_CANT_AUTH,API_CANT_FIND_PROC,API_WRNG_PROC_VERSION,API_WRNG_PROC_STATE,API_MACH_NOT_AVAIL,API_CANT_FIND_RUNCLASS,API_REQ_NOT_MET,API_WRNG_MACH_NO,API_LL_SCH_ON,API_MACH_DUP };
enum LL_control_op {
LL_CONTROL_RECYCLE, LL_CONTROL_RECONFIG, LL_CONTROL_START,
LL_CONTROL_STOP, LL_CONTROL_DRAIN, LL_CONTROL_DRAIN_STARTD,
LL_CONTROL_DRAIN_SCHEDD, LL_CONTROL_PURGE_SCHEDD, LL_CONTROL_FLUSH,
LL_CONTROL_SUSPEND, LL_CONTROL_RESUME, LL_CONTROL_RESUME_STARTD,
LL_CONTROL_RESUME_SCHEDD, LL_CONTROL_FAVOR_JOB, LL_CONTROL_UNFAVOR_JOB,
LL_CONTROL_FAVOR_USER, LL_CONTROL_UNFAVOR_USER,
LL_CONTROL_HOLD_USER, LL_CONTROL_HOLD_SYSTEM, LL_CONTROL_HOLD_RELEASE,
LL_CONTROL_PRIO_ABS, LL_CONTROL_PRIO_ADJ };
/* structures */
typedef void LL_element;
typedef void * LL_node;
typedef struct {
int cluster;
int proc;
char *from_host; /* name of the schedd host */
} LL_STEP_ID;
typedef struct {
LL_STEP_ID id; /* step id */
int q_date; /* UNIX time step was submitted */
int status; /* Running, unexpanded, completed,.. */
/* The following are valid after scheduling has occured */
int num_processors; /* actual number of assigned processors */
char **processor_list;/* list of processors on which to run step */
/* The following are inputs needed to actually start an executable */
char *cmd; /* a.out file */
char *args; /* command line args */
char *env; /* environment */
char *in; /* file for stdin */
char *out; /* file for stdout */
char *err; /* file for stderr */
char *iwd; /* Initial working directory */
char *notify_user; /* target to be used when sending mail */
char *shell; /* shell to be used */
char *tracker; /* user's step tracking exit */
char *tracker_arg; /* argument to tracking exit */
int notification; /* Notification options */
int image_size; /* Size of the virtual image in K */
int exec_size; /* size of the executable */
} LL_job_step;
typedef struct LL_job {
int version_num; /* LL_JOB_VERSION */
char *job_name; /* job name */
char *owner; /* login of person submitting job */
char *groupname; /* group name of owner's login group */
uid_t uid; /* unix userid of submitter */
gid_t gid; /* unix group id of submitter */
char *submit_host; /* Host of job submission */
int steps; /* number of steps in job */
LL_job_step **step_list; /* ptr to array of ptrs to job steps */
} LL_job;
typedef struct {
int version_num;
LL_STEP_ID StepId;
char *msg;
} LL_terminate_job_info;
typedef struct {
int version_num;
LL_STEP_ID StepId;
char **nodeList;
} LL_start_job_info;
/* API prototypes */
LL_element *ll_get_objs(LL_element *,int,void *,int *,int *);
LL_element *ll_next_obj(LL_element *);
int ll_free_objs(LL_element *);
int llfree_job_info(LL_job *,int);
LL_element *ll_query(int);
int ll_set_request(LL_element *,int,void *,int);
int ll_deallocate(LL_element *);
int ll_get_data(LL_element *,int,void *);
int ll_start_job(LL_start_job_info *);
int ll_terminate_job(LL_terminate_job_info *);
int ll_control(void);
int llsubmit(char *,void *,void *,LL_job *,int);
#endif /* __LLAPI */
/* END msched-llapi.h */

137
include/msched-pbsapi.h Normal file
View File

@@ -0,0 +1,137 @@
/*
*/
#ifndef __PBSAPI
#define __PBSAPI
/* structures */
struct attrl {
struct attrl *next;
char *name;
char *resource;
char *value;
int op; /* not used */
};
struct batch_status {
struct batch_status *next;
char *name;
struct attrl *attribs;
char *text;
};
/* prototypes */
struct batch_status *pbs_statnode();
struct batch_status *pbs_statjob();
struct batch_status *pbs_statque(int, char*, attrl*, char*);
int pbs_statfree(batch_status*);
int pbs_runjob(int, char*, char*, char*);
int pbs_alterjob(int, char*, attrl*, char*);
int pbs_deljob(int, char*, char*);
int pbs_stagein(int,char*,char*,char*);
int pbs_rerunjob(int, char*, char*);
char *pbs_geterrmsg(int);
int openrm(char *,int);
int closerm(int);
int pbs_connect();
int pbs_disconnect();
int addreq(int,char*);
char *getreq(int);
/* defines */
#ifndef ND_free
#define ND_free "free"
#define ND_offline "offline"
#define ND_down "down"
#define ND_reserve "reserve"
#define ND_job_exclusive "job-exclusive"
#define ND_job_sharing "job-sharing"
#define ND_busy "busy"
#define ND_state_unknown "state-unknown"
#define ND_timeshared "time-shared"
#define ND_cluster "cluster"
#endif /* ND_free */
#ifndef ATTR_NODE_state
#define ATTR_NODE_state "state"
#define ATTR_NODE_np "np"
#define ATTR_NODE_properties "properties"
#define ATTR_NODE_ntype "ntype"
#define ATTR_NODE_jobs "jobs"
#define ATTR_a "Execution_Time"
#define ATTR_c "Checkpoint"
#define ATTR_e "Error_Path"
#define ATTR_g "group_list"
#define ATTR_h "Hold_Types"
#define ATTR_j "Join_Path"
#define ATTR_k "Keep_Files"
#define ATTR_l "Resource_List"
#define ATTR_m "Mail_Points"
#define ATTR_o "Output_Path"
#define ATTR_p "Priority"
#define ATTR_q "destination"
#define ATTR_r "Rerunable"
#define ATTR_u "User_List"
#define ATTR_v "Variable_List"
#define ATTR_A "Account_Name"
#define ATTR_M "Mail_Users"
#define ATTR_N "Job_Name"
#define ATTR_S "Shell_Path_List"
#define ATTR_depend "depend"
#define ATTR_inter "interactive"
#define ATTR_stagein "stagein"
#define ATTR_stageout "stageout"
#define ATTR_ctime "ctime"
#define ATTR_exechost "exec_host"
#define ATTR_mtime "mtime"
#define ATTR_qtime "qtime"
#define ATTR_session "session_id"
#define ATTR_euser "euser"
#define ATTR_egroup "egroup"
#define ATTR_hashname "hashname"
#define ATTR_hopcount "hop_count"
#define ATTR_security "security"
#define ATTR_sched_hint "sched_hint"
#define ATTR_substate "substate"
#define ATTR_name "Job_Name"
#define ATTR_owner "Job_Owner"
#define ATTR_used "resources_used"
#define ATTR_state "job_state"
#define ATTR_queue "queue"
#define ATTR_server "server"
#define ATTR_maxrun "max_running"
#define ATTR_total "total_jobs"
#define ATTR_comment "comment"
#define ATTR_cookie "cookie"
#define ATTR_qrank "queue_rank"
#define ATTR_altid "alt_id"
#define ATTR_etime "etime"
#define ATTR_aclhten "acl_host_enable"
#define ATTR_aclhost "acl_hosts"
#endif /* ATTR_NODE_state */
enum batch_op { SET, UNSET, INCR, DECR,
EQ, NE, GE, GT, LE, LT, DFLT
};
#endif /* __PBSAPI */
/* END maui-pbsapi.h */

84
include/msched-proto.h Normal file
View File

@@ -0,0 +1,84 @@
/*
*/
#ifndef __M_PROTO_H__
#define __M_PROTO_H__
#include "moab-proto.h"
int main(int,char **);
int SDRGetSystemConfig(void);
int ServerProcessRequests(void);
int ServerLoadSignalConfig(void);
int ServerShowCopy(void);
int ServerUpdate(void);
int ServerProcessArgs(int,char **,int);
int StringToComp(char *,int *);
int ServerInitializeLog(int,char **);
int ServerGetAuth(char *,long *);
int MServerConfigShow(char *,int,int);
int ServerDemonize(void);
int ServerAuthenticate(void);
int ServerSetCreds(int,int);
int CrashMode(int);
void ServerRestart(int);
int ReloadConfig(int);
int ServerShowUsage(char *);
int UIProcessClients(msocket_t *,long);
int UIFormatShowAllJobs(char *,char *,int);
int UIFormatHShowAllJobs(char *,char *);
int MUISProcessRequest(msocket_t *,char *);
int UIProcessCommand(msocket_t *);
int UIClusterShow(char *,char *,int,char *,long *);
int UIResCreate(char *,char *,int,char *,long *);
int UIResDiagnose(char *,long *,int,char *,int);
int UIResDestroy(char *,char *,int,char *,long *);
int UIResList(char *,int,char *,int,int,char *,long *);
int UIResShow(char *,char *,int,char *,long *);
int MUISchedCtl(char *,char *,int,char *,long *);
int UIDiagnose(char *,char *,int,char *,long *);
int DiagnoseFairShare(char *,long *,int);
int UIDiagnosePriority(char *,long *,mpar_t *);
int UIQueueDiagnose(char *,long *,int,int);
int DiagnoseQOS(char *,long *,char *);
int DiagnoseClass(char *,long *,char *);
int MUIJobDiagnose(char *,long *,int,char *,int);
int UINodeDiagnose(char *,long *,int,char *,int);
int MParDiagnose(char *,long *,char *);
int UIUserDiagnose(char *,long *,char *,int);
int UIGroupDiagnose(char *,long *,char *,int);
int UIAcctDiagnose(char *,long *,char *,int);
int ResDiagnose(char *,long *,int,char *,int);
int UIQueueShowBJobs(char *,long *,mpar_t *,char *);
int UIQueueShowEJobs(char *,long *,mpar_t *,char *);
int UIQueueShowAJobs(char *,long *,mpar_t *,int, char *);
int UIQueueShowAllJobs(char *,long *,mpar_t *, char *);
int SetJobHold(char *,char *,int,char *,long *);
int ReleaseJobHold(char *,char *,int,char *,long *);
int ShowJobHold(char *,char *,int,char *,long *);
int UIStatClear(char *,char *,int,char *,long *);
int UIStatShow(char *,char *,int,char *,long *);
int SetJobSystemPrio(char *,char *,int,char *,long *);
int SetJobUserPrio(char *, char *,int,char *,long *);
int UIJobGetStart(char *,char *,int,char *,long *);
int UIShowGrid(char *,char *,int,char *,long *);
int ShowBackfillWindow(char *,char *,int,char *,long *);
int UIShowConfig(char *,char *,int,char *,long *);
int UIShowCStats(char *,int,char *,long *);
int UIJobShow(char *,char *,int,char *,long *);
int UIParShowStats(char *,char *,long *);
int UINodeShow(char *,char *,int,char *,long *);
int UIJobStart(char *,char *,int,char *,long *);
int MUIJobPreempt(mjob_t *,char *,char *,int,char *);
int MUIJobResume(mjob_t *,char *,char *,char *);
int UIJobCancel(char *,char *,int,char *,long *);
int UINodeStatShow(int,char *,long *);
int UIChangeParameter(char *,char *,int,char *,long *);
int MigrateJob(char *,char *,int,char *,long *);
int UIShowEstStartTime(char *,char *,int,char *,long *);
int UIQueueShow(char *,char *,int,char *,long *);
int ConfigShow(char *,int,int);
int UHProcessRequest(msocket_t *,char *);
#endif /* __M_PROTO_H__ */

2349
include/msched.h Normal file

File diff suppressed because it is too large Load Diff

460
include/msu.h Normal file
View File

@@ -0,0 +1,460 @@
/*
*/
#if !defined(__SU_H)
#define __SU_H
#define MSU_VERSION "4.0.2p0"
#ifdef __MTEST
#define SUEMLog fprintf
#endif /* __MTEST */
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <locale.h>
#include <signal.h>
#include <time.h>
#include <stdarg.h>
#include <ctype.h>
#include <unistd.h>
#include <strings.h>
#include <grp.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <syslog.h>
#include <pwd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
enum {
sumkNONE = 0,
sumkStatusCode,
sumkArgs,
sumkAuth,
sumkCommand,
sumkData,
sumkClient,
sumkTimeStamp,
sumkCheckSum };
#define MAX_SUNAME 64
#define MAX_SUPATH 256
#define MAX_SULINE 1024
#define MAX_SUBUFFER 65536
#define MAX_SURANGE 256
#define MAX_SUTIME 2140000000
#ifndef NULL
# define NULL (void *)0
#endif /* NULL */
#ifndef MIN
# define MIN(x,y) (((x) < (y)) ? (x) : (y))
#endif /* MIN */
#ifndef MAX
# define MAX(x,y) (((x) > (y)) ? (x) : (y))
#endif /* MAX */
#ifndef TRUE
# define TRUE 1
#endif /* TRUE */
#ifndef FALSE
# define FALSE 0
#endif /* FALSE */
#ifndef NONE
# define NONE "[NONE]"
#endif /* NONE */
#ifndef ALL
# define ALL "[ALL]"
#endif /* ALL */
#ifndef DEFAULT
# define DEFAULT "[DEFAULT]"
#endif /* DEFAULT */
#ifndef SUCCESS
# define SUCCESS 1
#endif /* SUCCESS */
#ifndef FAILURE
# define FAILURE 0
#endif /* FAILURE */
#ifndef suscNOERROR
enum { suscNOERROR = 0, suscNOMEMORY, suscNOENT };
#endif /* suscNOERROR */
#ifndef DBG
# define DBG(S,X,F) if ((S != NULL) && (S->EMT != NULL) && (*S->EMT >= X) && (*S->EMF & F))
#endif /* DBG */
#ifndef sfNONE
enum sulogfacility {
sfNONE = 0,
sfEM = (1 << 0),
sfMeta = (1 << 1),
sfQueue = (1 << 2),
sfJob = (1 << 3),
sfResource = (1 << 4),
sfObj = (1 << 5),
sfFile = (1 << 6),
sfConfig = (1 << 7),
sfUtil = (1 << 8),
sfSocket = (1 << 9),
sfUI = (1 << 10),
sfOS = (1 << 11),
sfSec = (1 << 12),
sfMI = (1 << 13),
sfSC = (1 << 14),
sfRange = (1 << 15),
sfStat = (1 << 16),
sfCP = (1 << 17),
sfPolicy = (1 << 18),
sfXML = (1 << 19),
sfRM = (1 << 20),
sfAM = (1 << 21),
sfStruct = (1 << 22) };
#define sfALL (sfEM | sfMeta | sfQueue | sfJob | sfResource | sfObj | sfFile | \
sfConfig | sfUtil | sfSocket | sfUI | sfOS | sfSec | sfMI | sfSC | \
sfRange | sfStat | sfCP | sfPolicy | sfXML | sfRM | sfAM)
#endif /* sfNONE */
enum SUEMPEnum {
suempNONE = 0,
suempState,
suempThreshold,
suempFacilityList,
suempLogFileMaxSize,
suempLogFileRollDepth,
suempLogDir,
suempLogFileName };
enum SUCompList {
sucmpNONE = 0,
sucmpLT,
sucmpLE,
sucmpEQ,
sucmpGT,
sucmpGE,
sucmpNE,
sucmpEQ2,
sucmpNE2,
sucmpSSUB,
sucmpSNE,
sucmpSEQ };
/* sync w/SUIFlagType */
enum SUDFEnum {
sudfNONE = 0,
sudfXML,
sudfFT,
sudfVerbose };
#ifndef SUDEFRCLIST
#define SUDEFRCLIST
enum SURCListEnum {
surclNONE = 0,
surclYear,
surclDecade,
surclCentury,
surclMillenium };
#endif /* SUDEFRCLIST */
/* sync with SObjList[] in SConst.c */
enum SUObjectList {
suoNONE = 0,
suoLocalJob,
suoLocalRsv,
suoUser, /* grid user */
suoJob, /* grid job */
suoQueue, /* grid queue */
suoRsv, /* grid rsv */
suoRes, /* grid resource/cluster */
suoSystem }; /* grid scheduler/server */
enum SUKeyList {
sukNONE = 0,
sukName,
sukUser,
sukRsvID };
#define MAX_SULIST 32
#define MAX_SUWORD 32
#define MAX_SUATTR 64
#define MAX_SUCONSTRAINT 4
/* sync w/MSUDataMode */
enum SUDataModeEnum {
sudmNONE = 0,
sudmHuman,
sudmXML,
sudmFlatText };
enum SUOAttrMode {
suoattrNONE = 0,
suoattrAdd,
suoattrCheck,
suoattrAppend,
suoattrReplace };
typedef char suattrtype_t[MAX_SULIST][MAX_SUATTR][MAX_SUNAME];
typedef struct {
int Size;
int Count;
char **List;
} suet_t;
enum SUAttrEnum {
suaNONE = 0,
suaCKey };
/* NOTE: sync w/mlog_t */
typedef struct
{
unsigned long State; /* External */
int Threshold; /* External */
unsigned long FacilityList; /* External */
FILE *logfp;
unsigned long LogFileMaxSize; /* External */
int LogFileRollDepth;
char *LogDir; /* External */
char *LogFileName; /* External */
char *LogPathName;
char *FileMode;
int ControlMode;
char Buffer[MAX_SUBUFFER];
} suem_t;
typedef struct
{
int Type;
char *Value;
} suacl_t;
typedef struct
{
char *Name;
char *Value;
int CIndex;
} suattr_t;
/* value of type DType is set to DVal if condition of type CType is set to CVal */
typedef struct
{
char *DVal; /* data value */
char *CVal; /* conditional value */
int DType; /* data type */
int CType; /* conditional type */
char Source;
} sucval_t;
typedef struct
{
char *PathName; /* (alloc) */
long ModifyTime;
long RefreshTime;
unsigned long BufferSize;
char *Buffer; /* (alloc) */
char *Ptr; /* read ptr */
} sufilebuf_t;
/* CP class */
#define SUMAX_CPINDEX 2048
#define SUCP_OVERHEAD 64
#define SUDEF_CPFILENAME ".server.ck"
#define SUDEF_CPBUFFERSTEPSIZE 4096
#define SUDEF_CPPAD 32
#define SUDEF_CPMAXINTERVAL 300
typedef struct
{
long UpdateTime; /* time of last update */
long MaxInterval; /* max time between checkpoints */
char *PathName;
char *Buffer;
int BufSize;
struct {
char State; /* I=ignore A=active 0=end marker */
char *OType;
char *OName;
int Size; /* total size of record */
int Offset;
long ETime;
} Index[SUMAX_CPINDEX];
} sucp_t;
typedef struct
{
char *CommandName;
char *HomeDir;
char *HostName;
unsigned long HostAddress;
char *UserName;
char *SpoolDir;
int UID;
int PID;
char **ArgV;
int ProgType;
int TimeMode;
int TimeRatio;
int TimeServerPort;
char *TimeServerHost;
long RealTime; /* actual 'real world' time */
struct timeval SimTime; /* accurate time within simulation */
long ETime;
} suenv_t;
typedef struct
{
char *Name;
unsigned long EncryptionMode;
union
{
char CSKey[MAX_SUNAME];
} EncryptionData;
} suclcred_t;
enum { suspNONE = 0, suspLocalHost, suspRemoteHost, suspLocalPort, suspRemotePort };
typedef struct
{
unsigned long SocketType;
unsigned long TimeOut;
long LastActivity;
int sd;
int RemotePort;
int LocalPort;
char *RemoteHost;
char *LocalHost;
char *ClientName;
unsigned long Flags;
unsigned long State;
unsigned long Version;
unsigned long AuthenticationMode;
void *AuthenticationData;
int WireProtocol;
suclcred_t *Cred;
} susocket_t;
typedef struct
{
char buffer[MAX_SUBUFFER];
int length;
int state;
size_t msgSize;
} sucomm_parser_t;
/* socket states */
enum { sussNONE = 0, sussClosed, sussOpen, sussBusy };
#define MAX_SUCLCRED 256
enum {
sustNONE = 0,
sustTCP = (1 << 0),
sustUDP = (1 << 1) };
#define SUDEF_RSVOVERLAP 300
#ifndef __SUINTERNAL_H
typedef void sumb_t;
typedef struct
{
/* order must NOT change */
int *EMT; /* must be first in array (HACK) */
unsigned long *EMF;
suem_t *EM;
sucp_t *CP;
suenv_t *Env;
suclcred_t *Cred[MAX_SUCLCRED];
char *Name;
long State;
long PresentTime;
/* END order must NOT change */
} su_t;
enum SUDataTypeEnum {
sudtNONE = 0,
sudtString,
sudtInt,
sudtLong,
sudtDouble,
sudtStringArray,
sudtIntArray,
sudtLongArray,
sudtDoubleArray,
sudtOther };
#endif /* __SUINTERNAL_H */
#endif /* !defined(__SU_H) */
/* END msu.h */

0
maui-private.cfg.dist.in Normal file
View File

74
maui.cfg.dist.in Normal file
View File

@@ -0,0 +1,74 @@
# maui.cfg @PACKAGE_VERSION@
SERVERHOST @HOSTNAME@
# primary admin must be first in list
ADMIN1 @USER@
# Resource Manager Definition
RMCFG[@MACHINE@] TYPE=@RMTYPE@@RMHOST@@RMPORT@@RMVERSION@@RMWIREPROTOCOL@@RMSOCKETPROTOCOL@@RMNMHOST@@RMNMPORT@
# Allocation Manager Definition
AMCFG[bank] TYPE=@AMTYPE@@AMHOST@@AMPORT@@AMSOCKETPROTOCOL@@AMWIREPROTOCOL@@AMOTHER@
# full parameter docs at http://supercluster.org/mauidocs/a.fparameters.html
# use the 'schedctl -l' command to display current configuration
RMPOLLINTERVAL 00:00:30
SERVERPORT 42559
SERVERMODE NORMAL
# Admin: http://supercluster.org/mauidocs/a.esecurity.html
LOGFILE maui.log
LOGFILEMAXSIZE 10000000
LOGLEVEL 3
# Job Priority: http://supercluster.org/mauidocs/5.1jobprioritization.html
QUEUETIMEWEIGHT 1
# FairShare: http://supercluster.org/mauidocs/6.3fairshare.html
#FSPOLICY PSDEDICATED
#FSDEPTH 7
#FSINTERVAL 86400
#FSDECAY 0.80
# Throttling Policies: http://supercluster.org/mauidocs/6.2throttlingpolicies.html
# NONE SPECIFIED
# Backfill: http://supercluster.org/mauidocs/8.2backfill.html
BACKFILLPOLICY FIRSTFIT
RESERVATIONPOLICY CURRENTHIGHEST
# Node Allocation: http://supercluster.org/mauidocs/5.2nodeallocation.html
NODEALLOCATIONPOLICY MINRESOURCE
# QOS: http://supercluster.org/mauidocs/7.3qos.html
# QOSCFG[hi] PRIORITY=100 XFTARGET=100 FLAGS=PREEMPTOR:IGNMAXJOB
# QOSCFG[low] PRIORITY=-1000 FLAGS=PREEMPTEE
# Standing Reservations: http://supercluster.org/mauidocs/7.1.3standingreservations.html
# SRSTARTTIME[test] 8:00:00
# SRENDTIME[test] 17:00:00
# SRDAYS[test] MON TUE WED THU FRI
# SRTASKCOUNT[test] 20
# SRMAXTIME[test] 0:30:00
# Creds: http://supercluster.org/mauidocs/6.1fairnessoverview.html
# USERCFG[DEFAULT] FSTARGET=25.0
# USERCFG[john] PRIORITY=100 FSTARGET=10.0-
# GROUPCFG[staff] PRIORITY=1000 QLIST=hi:low QDEF=hi
# CLASSCFG[batch] FLAGS=PREEMPTEE
# CLASSCFG[interactive] FLAGS=PREEMPTOR

255
src/mcom/MComm.c Normal file
View File

@@ -0,0 +1,255 @@
/* HEADER */
#include "moab.h"
#include "moab-proto.h"
extern const char *SUMKType[];
extern mlog_t mlog;
void MSUCommParserInit(
sucomm_parser_t *parser) /* I (modified) */
{
if (parser == NULL)
{
return;
}
parser->length = 0;
parser->state = 0;
parser->msgSize = 0;
return;
} /* END MSUCommParserInit() */
int MSUCommParse(
su_t *su,
sucomm_parser_t *Parser, /* I */
void *data,
size_t size,
mbool_t *IsDone) /* O (modified) */
{
*IsDone = FALSE;
if (Parser == NULL)
{
return(FAILURE);
}
if (Parser->length + size >= MMAX_BUFFER) /* buffer overflow */
{
return(FAILURE);
}
memcpy(Parser->buffer + Parser->length, data, size);
Parser->length += size;
/* perform mcomm specific parsing */
switch (Parser->state)
{
case 0: /* initial */
if (Parser->length < 9)
{
return(SUCCESS);
}
Parser->buffer[8] = '\0';
Parser->msgSize = strtoul(Parser->buffer, NULL, 10);
if ((Parser->msgSize == 0) || (Parser->msgSize >= MMAX_BUFFER))
{
return(FAILURE);
}
memmove(Parser->buffer,Parser->buffer + 9,Parser->length - 9);
Parser->length -= 9;
Parser->state = 1;
/* fall through */
case 1: /* length known */
if (Parser->length >= (int)Parser->msgSize)
{
*IsDone = TRUE;
Parser->buffer[Parser->length] = '\0';
}
return(SUCCESS);
} /* END switch (Parser->state) */
return(FAILURE);
} /* END MSUCommParse() */
int MSUCommWrapMessage(
su_t *su,
const char *cmd,
const char *args,
suclcred_t *Cred,
char *buffer,
size_t size)
{
char msg[MMAX_BUFFER];
char cksum[MMAX_LINE];
time_t Now;
char backup;
time(&Now);
snprintf(msg,MMAX_BUFFER,"%s%ld ID=%s %s%s%s %s%s %s%s %s%s",
SUMKType[sumkTimeStamp],
(long)Now,
su->Env->UserName,
SUMKType[sumkData],
SUMKType[sumkCommand],
cmd,
SUMKType[sumkAuth],
(su->Env->UserName != NULL) ? su->Env->UserName : NONE,
SUMKType[sumkClient],
(su->Name != NULL) ? su->Name : NONE,
SUMKType[sumkArgs],
(args != NULL) ? args : "");
MSecGetChecksum(
msg,
strlen(msg),
cksum,
NULL,
mcsaDES,
Cred->EncryptionData.CSKey);
snprintf(buffer + 9,size - 9,"%s%s %s",
SUMKType[sumkCheckSum],
cksum,
msg);
backup = buffer[9];
sprintf(buffer, "%08ld\n", (long)strlen(buffer+9));
buffer[9] = backup;
return(strlen(buffer));
} /* END MSUCommWrapMessage() */
int MSUCommMessageIsValid(
su_t *su,
char *msg, /* I */
suclcred_t *Cred)
{
char *cksum = strstr(msg,SUMKType[sumkCheckSum]);
char *ts = strstr(msg,SUMKType[sumkTimeStamp]);
char *data = strstr(msg,SUMKType[sumkData]);
char *cksumEnd;
char *tsEnd;
char CKSum[MMAX_LINE];
time_t TSVal;
time_t Now;
if (cksum == NULL)
{
MDB(1,fSOCK) MLog("ALERT: cannot locate checksum '%s'\n",
msg);
return(FAILURE);
}
if (ts == NULL)
{
MDB(1,fSOCK) MLog("ALERT: cannot locate timestamp '%s'\n",
msg);
return(FAILURE);
}
if (data == NULL)
{
MDB(1,fSOCK) MLog("ALERT: cannot locate data '%s'\n",
msg);
return(FAILURE);
}
cksum += strlen(SUMKType[sumkCheckSum]);
cksumEnd = strchr(cksum,' ');
if (cksumEnd)
*cksumEnd = 0;
MSecGetChecksum(
ts,
strlen(ts),
CKSum,
NULL,
mcsaDES,
Cred->EncryptionData.CSKey);
if (strcmp(cksum,CKSum) != 0)
{
MDB(1,fSOCK) MLog("ALERT: checksum does not match (%s:%s)\n",
cksum,
CKSum);
if (cksumEnd)
*cksumEnd = ' ';
return(FAILURE);
}
if (cksumEnd)
*cksumEnd = ' ';
ts += strlen(SUMKType[sumkTimeStamp]);
tsEnd = strchr(ts, ' ');
if (tsEnd)
*tsEnd = 0;
TSVal = strtoul(ts, NULL, 10);
if (tsEnd)
*tsEnd = ' ';
time(&Now);
if (((Now - TSVal) > 3600) || ((Now - TSVal) < -3600))
{
MDB(1,fSOCK) MLog("ALERT: timestamp does not match (%ld:%ld)\n",
(unsigned long)Now,
(unsigned long)TSVal);
return(FAILURE);
}
return(SUCCESS);
} /* END MSUCommMessageIsValid() */
/* END MComm.c */

109
src/mcom/MConst.c Normal file
View File

@@ -0,0 +1,109 @@
/* HEADER */
#include "moab.h"
/* repository for char arrays */
const char *MFrameProtocol[] = {
NONE,
"COUNT",
"SSS-0.1",
NULL };
const char *MSockProtocol[] = {
NONE,
"SUTCP",
"SSS-HALF",
"HTTPCLIENT",
"HTTP",
"SSS-CHALLENGE",
NULL };
/* sync w/enum MSockAttrEnum */
const char *MSockAttr[] = {
NONE,
"LocalHost",
"LocalPort",
"RemoteHost",
"RemotePort",
NULL };
/* sync w/XXX */
const char *MS3SockProtocol[] = {
NONE,
NULL,
"sssbase",
NULL,
NULL,
"ssschallenge",
NULL };
/* sync w/enum MDataFormatEnum */
const char *MDFormat[] = {
NONE,
"string",
"int",
"long",
"double",
"stringarray",
"intarray",
"longarray",
"doublearray",
"other",
NULL };
/* sync w/enum MS3ActionEnum */
const char *MS3Action[] = {
NONE,
"Cancel",
"Create",
"Destroy",
"Initialize",
"List",
"Modify",
"Notify",
"Query",
"Start",
NULL };
const char *MWireProtocol[] = {
NONE,
"AVP",
"XML",
"HTML",
"SSS2",
NULL };
/* sync w/enum MChecksumAlgoEnum */
const char *MCSAlgoType[] = {
NONE,
"DES",
"HMAC",
"HMAC64",
"MD5",
"PASSWD",
"REMOTE",
NULL };
/* sync w/enum MS3VEnum */
const char *MS3VName[] = {
"SSSRM0.2",
"SSS3.0",
"SSS4.0",
NULL };
/* END MConst.c */

1405
src/mcom/MGrid.c Normal file

File diff suppressed because it is too large Load Diff

7256
src/mcom/MS3I.c Normal file

File diff suppressed because it is too large Load Diff

4141
src/mcom/MSU.c Normal file

File diff suppressed because it is too large Load Diff

2012
src/mcom/MSec.c Normal file

File diff suppressed because it is too large Load Diff

889
src/mcom/MTComm.c Normal file
View File

@@ -0,0 +1,889 @@
/* HEADER */
#ifdef __MGRIDENABLE
#ifndef __MTHREADS
#define __MTHREADS
#endif /* __MTHREADS */
#ifdef __MTHREADS
#include "msu.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <errno.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#include <pthread.h>
#include <fcntl.h>
#include "communication.h"
pthread_mutex_t comm_mutex = PTHREAD_MUTEX_INITIALIZER;
/* prototypes */
void communication_free(communication_t *);
void *comm_client_loop(comm_thread_t *);
void *comm_server_loop(comm_thread_t *);
/* END prototypes */
comm_thread_t* comm_thread_new(
int max_connections) /* I */
{
comm_thread_t* thread;
if ((thread = (comm_thread_t *)malloc(sizeof(comm_thread_t))) == NULL)
{
return(NULL);
}
thread->open_handler = NULL;
thread->read_handler = NULL;
thread->close_handler = NULL;
thread->error_handler = NULL;
thread->connection = (communication_t **)malloc(max_connections * sizeof(void*));
thread->connections = 0;
thread->max_connections = max_connections;
thread->port = -1;
thread->wakeup_fdr = -1;
thread->wakeup_fdw = -1;
return(thread);
} /* END comm_thread_new() */
void comm_thread_free(
comm_thread_t *thread)
{
int i;
if (thread == NULL)
{
return;
}
for (i = 0;i < thread->connections;i++)
{
communication_free(thread->connection[i]);
}
if (thread->connection)
free(thread->connection);
if (thread->wakeup_fdr > 0)
close(thread->wakeup_fdr);
if (thread->wakeup_fdw > 0)
close(thread->wakeup_fdw);
free(thread);
return;
} /* END comm_thread_free() */
int comm_thread_add_connection(comm_thread_t* thread, communication_t* comm) {
if (thread->connections >= thread->max_connections) {
thread->error_handler("too many open connections");
return -1;
}
thread->connection[thread->connections++] = comm;
return 0;
}
void* comm_thread_start(
int port,
int max_connections,
comm_open_handler_f open_handler,
comm_close_handler_f close_handler,
comm_read_handler_f read_handler,
comm_error_handler_f error_handler,
void *FPtr)
{
pthread_t t;
int fd[2];
comm_thread_t* thread = comm_thread_new(max_connections);
if (pipe(fd) < 0)
{
error_handler("unable to create a pipe (%s)", strerror(errno));
comm_thread_free(thread);
return(NULL);
}
thread->wakeup_fdr = fd[0];
thread->wakeup_fdw = fd[1];
thread->port = port;
thread->open_handler = open_handler;
thread->read_handler = read_handler;
thread->close_handler = close_handler;
thread->error_handler = error_handler;
if (pthread_create(&t,NULL,(void* (*)(void*))FPtr,thread))
{
error_handler("unable to create a new thread");
comm_thread_free(thread);
return(NULL);
}
return(thread);
} /* END comm_thread_start() */
comm_thread_t* comm_client_thread_start(
int max_connections,
comm_open_handler_f open_handler,
comm_close_handler_f close_handler,
comm_read_handler_f read_handler,
comm_error_handler_f error_handler)
{
/* void *comm_client_loop(comm_thread_t *); */
/* ARG void *(*loop)(comm_thread_t*)) */
/* DOUG (void *(*)(comm_thread_t *))comm_client_loop)); */
return((comm_thread_t *)comm_thread_start(
-1,
max_connections,
open_handler,
close_handler,
read_handler,
error_handler,
(void *)comm_client_loop));
}
comm_thread_t *comm_server_thread_start(
int port,
int max_connections,
comm_open_handler_f open_handler,
comm_close_handler_f close_handler,
comm_read_handler_f read_handler,
comm_error_handler_f error_handler)
{
return((comm_thread_t *)comm_thread_start(
port,
max_connections,
open_handler,
close_handler,
read_handler,
error_handler,
(void *)comm_server_loop));
}
void comm_thread_stop(
comm_thread_t *thread)
{
int action = 0;
if (write(thread->wakeup_fdw,&action,sizeof(int)) != sizeof(int))
thread->error_handler(strerror(errno));
comm_thread_free(thread);
return;
} /* END comm_thread_stop() */
communication_t *communication_new(
comm_thread_t *thread)
{
communication_t *comm;
if ((comm = (communication_t *)malloc(sizeof(communication_t))) == NULL)
{
return(NULL);
}
comm->thread = thread;
comm->host = NULL;
comm->port = -1;
comm->user = NULL;
comm->fd = -1;
comm->speed = 0;
comm->uptime = time(NULL);
comm->bytes = 0;
return(comm);
} /* END communication_new() */
void communication_free(
communication_t *comm) /* I (freed) */
{
if (comm == NULL)
{
return;
}
if (comm->host != NULL)
free(comm->host);
if (comm->fd > 0)
{
close(comm->fd);
comm->fd = -1;
}
free(comm);
return;
} /* END communication_free() */
communication_t *comm_client_new(
comm_thread_t *thread,
char *host,
int port,
void *user)
{
communication_t *comm = communication_new(thread); /* alloc */
comm->host = host ? strdup(host) : NULL;
comm->port = port;
comm->user = user;
if (comm_thread_add_connection(thread,comm) < 0)
{
communication_free(comm);
return(NULL);
}
return(comm);
}
void comm_client_free(
communication_t *comm) /* I (free) */
{
communication_free(comm);
return;
} /* END comm_client_free() */
int comm_client_open(
communication_t *comm) /* I (modified) */
{
struct sockaddr_in addr;
struct hostent *hent;
int fd;
int flags;
int result;
if (comm->fd > 0)
{
/* SUCCESS - socket already open */
return(SUCCESS);
}
if (comm->host == NULL)
{
/* FAILURE */
return(FAILURE);
}
hent = gethostbyname(comm->host);
if (hent == NULL)
{
comm->thread->error_handler(
"unknown host name %s (%s)",
comm->host,
hstrerror(h_errno));
return(FAILURE);
}
memset(&addr,0,sizeof(addr));
addr.sin_family = AF_INET;
memcpy(&addr.sin_addr.s_addr,hent->h_addr_list[0],sizeof(addr.sin_addr.s_addr));
addr.sin_port = htons(comm->port);
fd = socket(AF_INET, SOCK_STREAM, 0);
if (fd < 0)
{
comm->thread->error_handler(strerror(errno));
return(FAILURE);
}
if ((flags = fcntl(fd,F_GETFL,0)) < 0)
{
comm->thread->error_handler(strerror(errno));
return(FAILURE);
}
if (fcntl(fd,F_SETFL,flags | O_NONBLOCK) < -1)
{
comm->thread->error_handler(strerror(errno));
return(FAILURE);
}
result = connect(fd,(struct sockaddr*)&addr,sizeof(addr));
if ((result < 0) && (errno != EINPROGRESS))
{
comm->thread->error_handler("unable to connect to %s:%d (%s)",
comm->host,
comm->port,
strerror(errno));
close(fd);
return(FAILURE);
}
comm->fd = fd;
/* send socket descriptor to parent thread */
if (write(comm->thread->wakeup_fdw,&fd,sizeof(int)) != sizeof(int))
comm->thread->error_handler(strerror(errno));
return(SUCCESS);
} /* END comm_client_open() */
void comm_close(
communication_t *comm) /* I (modified) */
{
int fd = -1;
if (comm == NULL)
{
return;
}
pthread_mutex_lock(&comm_mutex);
if (comm->fd > 0)
{
fd = comm->fd;
comm->fd = -1;
}
pthread_mutex_unlock(&comm_mutex);
if (fd < 0)
{
return;
}
fd = -fd;
if (write(comm->thread->wakeup_fdw,&fd,sizeof(int)) != sizeof(int))
comm->thread->error_handler(strerror(errno));
return;
} /* END comm_close() */
/* TODO what if comm_close is called while sending? */
int comm_send(
communication_t *comm,
const void *data,
size_t size)
{
size_t sent = 0;
fd_set wset;
struct timeval timeout = {3, 0};
int result;
if (comm->fd < 0)
{
return(-1);
}
FD_ZERO(&wset);
FD_SET(comm->fd,&wset);
while (sent < size)
{
int n;
result = select(comm->fd + 1, NULL, &wset, NULL, &timeout);
if (result == 0)
{
/* timed out */
comm->thread->error_handler("sending timed out");
return(-1);
}
if (result < 0)
{
comm->thread->error_handler(strerror(errno));
return(-1);
}
FD_SET(comm->fd,&wset);
if ((n = write(comm->fd,&((char *)data)[sent],size - sent)) < 0)
{
comm->thread->error_handler("unable to send data (%s)",
strerror(errno));
return(-1);
}
sent += n;
} /* END while (sent < size) */
/* SUCCESS */
return(0);
} /* END comm_send() */
void* comm_client_loop(
comm_thread_t *thread)
{
char buffer[BUFSIZ];
fd_set allrset;
fd_set allwset;
fd_set wset;
fd_set rset;
int i;
int wakeup_fd = thread->wakeup_fdr;
int maxfd = wakeup_fd;
FD_ZERO(&allrset);
FD_ZERO(&allwset);
FD_SET(wakeup_fd, &allrset);
for (;;)
{
int close_fd = -1;
rset = allrset;
wset = allwset;
if (select(maxfd + 1,&rset,&wset,NULL,NULL) < 0)
{
thread->error_handler("select failed: %s",
strerror(errno));
return(NULL);
}
if (FD_ISSET(wakeup_fd,&rset))
{
int action = 0;
if (read(wakeup_fd,&action,sizeof(int)) != sizeof(int))
{
thread->error_handler("pipe read failed: %s",
strerror(errno));
return(NULL);
}
if (action == 0)
{
/* stop */
thread->error_handler("communication thread stopped");
return(NULL);
}
if (action > 0)
{
/* open */
FD_SET(action,&allrset);
FD_SET(action,&allwset);
if (action > maxfd)
maxfd = action;
}
else
{
/* close */
action = -action;
FD_CLR(action,&allrset);
FD_CLR(action,&allwset);
close_fd = action;
}
} /* END if (FD_ISSET(wakeup_fd,&rset)) */
for (i = 0;i < thread->connections;i++)
{
communication_t *comm = thread->connection[i];
int fd;
fd = comm->fd;
if (fd < 0)
continue;
if (FD_ISSET(fd,&wset))
{
int error;
int errsiz = sizeof(int);
FD_CLR(fd,&allwset);
if (getsockopt(fd,SOL_SOCKET,SO_ERROR,&error,(socklen_t *)&errsiz) < 0)
{
thread->error_handler(strerror(errno));
comm_close(comm);
continue;
}
if (error != 0)
{
thread->error_handler(strerror(error));
comm_close(comm);
continue;
}
thread->open_handler(comm);
}
if (FD_ISSET(fd,&rset))
{
int n = read(fd,buffer,BUFSIZ);
if (n < 0)
{
thread->error_handler(strerror(errno));
}
else if (n == 0)
{
thread->close_handler(comm);
FD_CLR(fd, &allrset);
comm_close(comm);
}
else if (thread->read_handler(comm,buffer,n))
{
FD_CLR(fd,&allrset);
comm_close(comm);
}
}
} /* END for (i) */
if ((close_fd > 0) && (close(close_fd) < 0))
thread->error_handler(strerror(errno));
} /* END for (;;) */
return(NULL);
} /* END comm_client_loop() */
/* Listen for incoming connections on @port. */
void *comm_server_loop(
comm_thread_t *thread)
{
int sd;
struct sockaddr_in sa;
char buffer[BUFSIZ];
struct sockaddr_in ca;
int cl = sizeof(ca);
fd_set rset, allset;
int wakeup_fd = thread->wakeup_fdr;
int maxfd;
int i;
if (thread == NULL)
{
/* FAILURE */
return;
}
/* NOTE: previously initialized w/
struct sockaddr_in sa = {AF_INET,htons(thread->port),{INADDR_ANY},""}; */
sa.sin_family = AF_INET;
sa.sin_port = htons(thread->port);
sa.sin_addr.s_addr = htonl(INADDR_ANY);
sa.sin_zero[0] = '\0';
sd = socket(AF_INET,SOCK_STREAM,0);
if (sd < 0)
{
thread->error_handler(strerror(errno));
return(NULL);
}
if (bind(sd,(struct sockaddr*)&sa,sizeof(sa)) < 0)
{
thread->error_handler("unable to bind to port %d (%s)",
thread->port,
strerror(errno));
return(NULL);
}
if (listen(sd,16) < 0)
{
thread->error_handler(strerror(errno));
return(NULL);
}
FD_ZERO(&allset);
FD_SET(sd,&allset);
FD_SET(wakeup_fd,&allset);
maxfd = (sd > wakeup_fd) ? sd : wakeup_fd;
for (;;)
{
rset = allset;
if (select(maxfd + 1,&rset,NULL,NULL,NULL) < 0)
{
thread->error_handler(strerror(errno));
return(NULL);
}
if (FD_ISSET(wakeup_fd,&rset))
{
int action = 0;
if (read(wakeup_fd,&action,sizeof(int)) != sizeof(int))
{
thread->error_handler(strerror(errno));
return(NULL);
}
if (action == 0) /* stop */
{
return(NULL);
}
else if (action > 0) /* open */
{
FD_SET(action,&allset);
}
else /* close */
{
FD_CLR(action,&allset);
}
} /* END if (FD_ISSET(wakeup_fd,&rset)) */
if (FD_ISSET(sd,&rset))
{
int cd;
communication_t *comm;
cd = accept(sd,(struct sockaddr*)&ca,(socklen_t *)&cl);
if (cd < 0)
{
thread->error_handler(strerror(errno));
continue;
}
if (cl != sizeof(ca))
{
close(cd);
thread->error_handler("unknown sockaddr type");
continue;
}
comm = communication_new(thread);
comm->fd = cd;
if (comm_thread_add_connection(thread,comm) < 0)
{
communication_free(comm);
continue;
}
if (thread->open_handler(comm))
{
thread->connections--;
communication_free(comm);
continue;
}
FD_SET(cd,&allset);
if (cd > maxfd)
maxfd = cd;
continue;
} /* END if (FD_ISSET(sd,&rset)) */
for (i = 0;i < thread->connections;i++)
{
communication_t* comm = thread->connection[i];
if (comm->fd > 0 && FD_ISSET(comm->fd,&rset))
{
int n;
n = read(comm->fd,buffer,BUFSIZ);
if (n < 0)
{
thread->error_handler(strerror(errno));
}
else if (n == 0)
{
thread->close_handler(comm);
FD_CLR(comm->fd,&allset);
comm_close(comm);
}
else if (thread->read_handler(comm,buffer,n))
{
FD_CLR(comm->fd,&allset);
comm_close(comm);
}
}
}
} /* END for (i) */
close(sd);
return(0);
} /* END comm_server_loop() */
#endif /* __MTHREADS */
#endif /* __MGRIDENABLE */
/* END MTComm.c */

1965
src/mcom/MXML.c Normal file

File diff suppressed because it is too large Load Diff

49
src/mcom/Makefile Normal file
View File

@@ -0,0 +1,49 @@
# Makefile for libmcom
# Copyright 1999 - 2005 Cluster Resources, Inc, All Rights Reserved
TOP =../..
BIN =$(TOP)/bin/
INC =$(TOP)/include/
SRC =$(TOP)/src/moab
LIB =$(TOP)/lib/
SCHEDIP=-I$(INC) -I$(MSCHED_HOME)/include
SHELL =/bin/sh
LP =-L$(LIB) $(SCHEDLP) $(MXLP) $(REGEXLP)
IP =$(SCHEDIP) $(REGEXIP) $(MXIP)
INCS =$(INC)moab.h $(INC)moab-proto.h
DEFS =-D$(OPSYS) $(OSDEF) $(MXDEF) $(REGEXDEF) $(SECDEF)
LIBMCOM =libmcom.a
LOBJECTS =MSU.o MSec.o MS3I.o MXML.o MConst.o MTComm.o MComm.o
LD =$(CC)
CP =cp
RM =rm -f
SOURCE =
CFLAGS = $(OSCCFLAGS)
all: $(LIBMCOM)
install: all
mkdir -p $(INST_DIR)/bin $(INST_DIR)/sbin $(INST_DIR)/include $(INST_DIR)/lib
$(CP) $(LIB)$(LIBMCOM) $(INST_DIR)/lib
uninstall:
$(RM) $(LIB)$(LIBMCOM)
.c.o: $(INCS)
$(CC) $(IP) $(DEFS) $(CFLAGS) $(SOURCE) -c $<
$(LIBMCOM): $(LOBJECTS)
ar rcs $(LIB)$(LIBMCOM) $(LOBJECTS)
clean:
$(RM) *.o $(LIB)$(LIBMCOM)
remove:
$(RM) $(INST_DIR)/lib/$(LIBMCOM)

53
src/mcom/Makefile.in Normal file
View File

@@ -0,0 +1,53 @@
# Makefile for GridSuite: MCom 4.2.2
# Copyright 1999 - 2005 Cluster Resources, Inc, All Rights Reserved
prefix=$(ROOT)@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
sysconfdir=@sysconfdir@
localstatedir=@localstatedir@
libdir=@libdir@
includedir=@includedir@
mandir=@mandir@
CC=@CC@
CFLAGS=@CFLAGS@
SEED=@seed@
moab_defs=@moab_defs@ -D__MGRIDENABLE
moab_ip=@moab_ip@
moab_lp=@moab_lp@
moab_libs=@moab_libs@
LD=$(CC)
CP=cp
RM=rm -f
AR=ar rcs
TOP =../..
BIN =$(TOP)/bin
INC =$(TOP)/include
LIB =$(TOP)/lib
LP =-L$(LIB) $(moab_lp)
IP =-I$(INC) $(moab_ip)
DEFS =$(moab_defs)
LIBS = $(moab_libs)
LIBMCOM =$(LIB)/libmcom.a
OBJS =MSU.o MSec.o MXML.o MSSSI.o MConst.o MComm.o MTComm.o
DEPS =$(INC)/moab.h $(INC)/moab-proto.h $(INC)/mcom.h $(INC)/mg2.h
all: $(LIBMCOM)
.c.o: $(DEPS)
$(CC) $(CFLAGS) $(IP) $(DEFS) -c $<
$(LIBMCOM): $(OBJS)
$(AR) $(LIBMCOM) $(OBJS)
clean:
$(RM) *.o $(LIBMCOM)

164
src/mcom/header.cfg Normal file
View File

@@ -0,0 +1,164 @@
VERSION 3.2.6p14
PACKAGE moab
AUTHOR Cluster Resources, Inc
FILETYPE Module
COPYRIGHT Copyright (C) 1999-2005 Cluster Resources, Inc
DISCLAIMER
-----------------------------------------------------------------------------
Moab Scheduling System - End User Open Source License
This software is based on the Moab Scheduling System which was created by
Cluster Resources, Inc.
Copyright (C) 1999-2005 Cluster Resources, Inc., all rights reserved.
Moab Scheduling System is a trademark of Cluster Resources, Inc.
This SOFTWARE is bound by an 'End User Open Source' LICENSE from Cluster
Resources Inc. The conditions of the 'End User Open Source' LICENSE include,
but are not limited to the conditions described below.
THE SOFTWARE IS PROVIDED AS IS, AND CLUSTER RESOURCES, INC. (CRI) AND ALL
CONTRIBUTING PARTIES DISCLAIM ALL WARRANTIES RELATING TO THE SOFTWARE,
WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. NEITHER
CRI NOR ANYONE INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THE
SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT, CONSEQUENTIAL, OR INCIDENTAL
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE EVEN IF CRI
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT
SHALL CRI'S LIABILITY FOR ANY DAMAGES EXCEED THE CONSIDERATION PAID FOR THE
LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM OF CLAIM. THE PERSON OR
ENTITY USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE
OF THE SOFTWARE.
By installing or using this SOFTWARE you are accepting a non-exclusive 'End
User Open Source' LICENSE from Cluster Resources Inc. and are bound to abide
by the following conditions:
1. Inclusion of Notice and Disclaimer
All copies of the SOFTWARE, whether or not for redistribution and whether
or not in source code or in binary form must include a conspicuous and
appropriate publication of the above copyright notice and disclaimer.
2. Usage
Source and/or binary forms of this SOFTWARE may be used by any 'End User'
organization pursuant to the conditions of this and other associated LICENSES
at no charge and for an unlimited period of time. An 'End User' organization
is defined as an organization that is using this SOFTWARE on their own
systems and is not commercially redistributing, modifying, supporting, or
providing other services specific to this SOFTWARE to other organizations
for profit.
3. Modifications
SOFTWARE may be freely modified by the 'End User' as necessary to meet the
needs of the 'End User' LICENSEE'S system. 'End User' may solicit the
services of Cluster Resources Inc. or 'Authorized Distribution and Services
Partners' of Cluster Resources Inc. that have received express prior written
authorization to redistribute, modify or provide services for SOFTWARE.
Available services include but are not limited to technical support,
training, consultation or optimization services. 'End User' may not
solicit or receive this SOFTWARE or services associated to the use,
customization, training, development, or support on this SOFTWARE from any
organization that is not an 'Authorized Distribution and Services Partner'
of Cluster Resources Inc. Any organization that desires to become an
'Authorized Distribution and Services Partner' of Cluster Resources, Inc.
may contact us at support@clusterresources.com. 'End User' organizations
that desire services from Cluster Resources Inc., or an 'Authorized
Distribution and Services Partner' may contact us using the same email
listed above.
4. Distribution
'End User' organizations that are academic and government agencies may
redistribute this SOFTWARE subject to the condition that the distribution
contains conspicuous publication of the acknowledgement statement found
within the LICENSE agreement distributed with this SOFTWARE.
Organizations that are not academic and government agencies including
commercial and other for-profit organizations may not redistribute this code
or derivations of this code in any form whatsoever, including parts of
SOFTWARE incorporated into other software programs without express written
permission from Cluster Resources, Inc.
Redistribution of the SOFTWARE in any form whatsoever, including parts of
the code that are incorporated into other software programs, must include a
conspicuous and appropriate publication of the following acknowledgement:
'This product was developed by Cluster Resources, Inc. Moab Scheduling
System is a trademark of Cluster Resources, Inc.'
Any redistribution or modification of the SOFTWARE must, when installed,
display the above language, the copyright notice, and the warranty
disclaimer.
Each time the SOFTWARE (or any work based on the SOFTWARE) is
redistributed, the recipient must automatically receive this LICENSE,
copyright notice, and the warranty disclaimer as described in this license
agreement, which govern the ability to copy, distribute or modify the
SOFTWARE subject to these terms and conditions, and have the choice of
accepting or declining the LICENSE.
As the LICENSEE, you shall automatically provide the recipient with a
copy of this LICENSE. Further restrictions are not to be imposed on
recipients of the SOFTWARE by the LICENSEE beyond those expressly described
herein.
5. Use of Modifications
LICENSEES with a redistribution agreement that wish to distribute their
modifications (including government and academic institutions) must first
send a copy of the modifications along with a brief explanation of why the
modification was made and the resulting performance or functionality of the
modifications to Cluster Resources, Inc. at support@clusterresources.com.
Failure to send a copy of distributed modifications renders the LICENSE
invalid, as well as any LICENSES granted to third parties subsequent to the
incorporation of the modifications into SOFTWARE. Any such modification of
the SOFTWARE must, when installed, display the LICENSE, the copyright
notice, and the warranty disclaimer as described in the LICENSE agreement/s
distributed with this SOFTWARE. Those without a LICENSE to redistribute may
send modifications to Cluster Resources for evaluation and possible
incorporation into SOFTWARE.
Copyright owners of modifications to SOFTWARE hereby grant Cluster
Resources, Inc. a non-exclusive, royalty-free, worldwide, irrevocable right
and LICENSE to install, use, distribute, sublicense, and prepare derivative
works of said modifications. Only organizations receiving an express prior
written exclusion to this condition are exempted from providing these
non-exclusive rights to Cluster Resources, Inc.
6. Communications about and Endorsement of SOFTWARE and Products/Software
Derived from the SOFTWARE
The name 'Moab Scheduling System', 'Moab Scheduler', or any of its
variants must not otherwise be used to endorse or to promote products
derived from the SOFTWARE without prior written permission from CRI.
Products derived from or incorporating the SOFTWARE in whole or in part
shall not contain as part of the product's name any form of the terms
'Cluster Resources, Inc.', 'CRI', 'Moab', 'Moab Scheduling System',
'Moab Scheduler', or 'Supercluster Development Group' unless prior written
permission has been received from Cluster Resources, Inc.
All advertising materials for products that use or incorporate features of
the SOFTWARE must display the following acknowledgement: 'This product
includes software developed by Cluster Resources, Inc. for use in the Moab
Scheduling System.'
7. Acceptance of this LICENSE
It is not required that you accept this LICENSE; however, if you do not
accept the terms of this LICENSE, you are prohibited by law from installing,
using, modifying or distributing the SOFTWARE or any of its derivative
works. Therefore, by installing, using, modifying or distributing the
SOFTWARE (or any of its derivative works), you have agreed to this LICENSE
and have accepted all its terms and conditions.
If any portion of this LICENSE is held invalid or unenforceable under any
particular circumstance, the balance of the LICENSE will continue to apply.
------------------------------------------------------------------------------

107
src/mcom/header.tmpl Normal file
View File

@@ -0,0 +1,107 @@
Package: $PACKAGE
$FILETYPE: $MODULE
Version: $VERSION
Copyright:
$COPYRIGHT
All Rights Reserved
-----------------------------------------------------------------------------
Moab Workload Manager - End User License
This product was created by Cluster Resources, Inc. and is protected by
copyright and patent law.
Copyright (C) 1999-2005 Cluster Resources, Inc., all rights reserved.
Moab Workload Manager, Moab Cluster Scheduler and Moab Scheduler
are trademarks of Cluster Resources, Inc.
This SOFTWARE is bound by an 'End User Subscription License' (LICENSE) from
Cluster Resources Inc. The conditions of the 'End User Subscription
License' (LICENSE) include, but are not limited to, the conditions described
below.
THE SOFTWARE IS PROVIDED AS IS, AND CLUSTER RESOURCES, INC. (CRI) AND ALL
CONTRIBUTING PARTIES DISCLAIM ALL WARRANTIES RELATING TO THE SOFTWARE,
WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. NEITHER
CRI NOR ANYONE INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THE
SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT, CONSEQUENTIAL, OR INCIDENTAL
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE EVEN IF CRI
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT
SHALL CRI'S LIABILITY FOR ANY DAMAGES EXCEED THE CONSIDERATION PAID FOR THE
LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM OF CLAIM. THE PERSON OR
ENTITY USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE
OF THE SOFTWARE.
By installing or using this SOFTWARE you are accepting a non-exclusive 'End
User Subscription License' (LICENSE) from Cluster Resources Inc. and are
bound to abide by the following conditions:
1. Inclusion of Notice and Disclaimer
All copies of the SOFTWARE, whether or not for redistribution and whether
or not in source code or in binary form must include a conspicuous and
appropriate publication of the above copyright notice and disclaimer.
2. Usage
Binary forms of this SOFTWARE may be used by any 'End User' organization
pursuant to the conditions of this and other associated LICENSES for the
duration of the subscription license granted. An 'End User' organization is
defined as an organization that is using this SOFTWARE on their own systems
and is not commercially redistributing, modifying, supporting, or providing
other services specific to this SOFTWARE to other organizations for profit.
3. Modifications
'End User' may solicit the services of Cluster Resources Inc. of Cluster
Resources Inc. to modify or provide services for this SOFTWARE. Available
services include but are not limited to technical support, training,
consultation or optimization services. Any unauthorized partner that desires
to become an 'Authorized Distribution and Services Partner' of Cluster
Resources, Inc. may contact us at support.com. 'End User'
organizations that desire services from Cluster Resources Inc., or an
'Authorized Distribution and Services Partner' may contact us using the same
email listed above.
4. Distribution
No redistribution of this product is permitted without express prior
written permission.
5. Communications about and Endorsement of SOFTWARE and Products/Software
Derived from the SOFTWARE
The name 'Moab Scheduling System', 'Moab Cluster Scheduler', 'Moab Scheduler',
'Moab Workload Manager' or any of its variants must not otherwise be used to
endorse or to promote products derived from the SOFTWARE without prior written
permission from CRI.
Products derived from or incorporating the SOFTWARE in whole or in part
shall not contain as part of the product's name any form of the terms 'Cluster
Resources, Inc.', 'CRI', 'Moab', 'Moab Scheduling System', 'Moab Cluster
Scheduler', 'Moab Scheduler', 'Moab Workload Manager', or 'Supercluster
Development Group' unless prior written permission has been received from
Cluster Resources, Inc.
All advertising materials for products that use or incorporate features of
the SOFTWARE must display the following acknowledgement: 'This product
includes software developed by Cluster Resources, Inc. for use in the Moab
Scheduling System.'
6. Acceptance of this LICENSE
It is not required that you accept this LICENSE; however, if you do not
accept the terms of this LICENSE, you are prohibited by law from installing,
using, modifying or distributing the SOFTWARE or any of its derivative works.
Therefore, by installing, using, modifying or distributing the SOFTWARE (or
any of its derivative works), you have agreed to this LICENSE and have
accepted all its terms and conditions.
If any portion of this LICENSE is held invalid or unenforceable under any
particular circumstance, the balance of the LICENSE will continue to apply.
------------------------------------------------------------------------------

912
src/moab/MACL.c Normal file
View File

@@ -0,0 +1,912 @@
/* HEADER */
#include "moab.h"
#include "msched-proto.h"
extern mlog_t mlog;
extern const char *MHRObj[];
extern const char *MComp[];
extern const char *MAttrO[];
char *MACLListShow(
macl_t *ACL,
int OType,
int Mode,
char *Buffer) /* O: (required) */
{
int aindex;
int oindex;
char *ptr;
char tmpLine[MAX_MLINE];
int ACLFound = FALSE;
/* OType != -1 Format: <A>[:<B>]... */
/* or <OBJECT>=<A> <OBJECT>=<B>... */
if (Buffer == NULL)
{
return(NULL);
}
Buffer[0] = '\0';
for (oindex = 0;oindex < MAX_MATTRTYPE;oindex++)
{
if ((OType != -1) && (OType != oindex))
continue;
tmpLine[0] = '\0';
for (aindex = 0;ACL[aindex].Type != maNONE;aindex++)
{
if (ACL[aindex].Type != oindex)
continue;
ACLFound = TRUE;
ptr = MACLShow(ACL[aindex],Mode,FALSE);
if (tmpLine[0] != '\0')
{
if (OType == -1)
strcat(tmpLine,":");
else
strcat(tmpLine,":");
}
strcat(tmpLine,ptr);
}
if (tmpLine[0] != '\0')
{
if ((OType == -1) || (Mode & (1 << mfmVerbose)))
{
strcat(Buffer,MAttrO[oindex]);
if ((tmpLine[0] != '=') &&
(tmpLine[0] != '<') &&
(tmpLine[0] != '>'))
{
strcat(Buffer,"=");
}
strcat(Buffer,tmpLine);
}
else
{
if (!strncmp(tmpLine,"==",2))
strcat(Buffer,&tmpLine[2]);
else
strcat(Buffer,tmpLine);
}
if (Mode & (1 << mfmAVP))
strcat(Buffer,";");
else
strcat(Buffer," ");
}
} /* END for (aindex) */
if (ACLFound == FALSE)
{
if (Mode & (1 << mfmAVP))
strcat(Buffer,NONE);
return(Buffer);
}
return(Buffer);
} /* END MACLListShow() */
char *MACLShow(
macl_t ACL,
int Mode,
int ShowObject)
{
int cindex;
static char Line[MAX_MLINE];
char ACLString[MAX_MNAME << 1];
char ModString[MAX_MNAME];
Line[0] = '\0';
if (ShowObject == TRUE)
strcpy(ACLString,MHRObj[(int)ACL.Type]);
else
ACLString[0] = '\0';
if (Mode & (1 << mfmVerbose))
{
cindex = 0;
switch((int)ACL.Affinity)
{
case nmPositiveAffinity:
/* default */
ModString[cindex++] = '+';
break;
case nmNeutralAffinity:
ModString[cindex++] = '=';
break;
case nmNegativeAffinity:
ModString[cindex++] = '-';
break;
case nmUnavailable:
case nmRequired:
case nmNone:
default:
ModString[cindex++] = '?';
break;
} /* END switch((int)ACL.Affinity) */
if (ACL.Flags & (1 << maclRequired))
ModString[cindex++] = '*';
if (ACL.Flags & (1 << maclDeny))
ModString[cindex++] = '!';
if (ACL.Flags & (1 << maclXOR))
ModString[cindex++] = '^';
ModString[cindex] = '\0';
}
else
{
ModString[0] = '\0';
}
cindex = ACL.Cmp;
if (Mode & (1 << mfmHuman))
{
if (cindex == mcmpSEQ)
cindex = mcmpEQ;
else if (cindex == mcmpSNE)
cindex = mcmpNE;
}
switch(ACL.Cmp)
{
case mcmpSEQ:
case mcmpSSUB:
case mcmpSNE:
default:
sprintf(ACLString,"%s%s%s%s",
ACLString,
MComp[cindex],
ACL.Name,
ModString);
break;
case mcmpLT:
case mcmpLE:
case mcmpEQ:
case mcmpNE:
case mcmpGE:
case mcmpGT:
if ((ACL.Type == maDuration) && (Mode & (1 << mfmHuman)))
{
/* human readable */
sprintf(ACLString,"%s%s%s%s",
ACLString,
MComp[cindex],
MULToTString(ACL.Value),
ModString);
}
else
{
sprintf(ACLString,"%s%s%ld%s",
ACLString,
MComp[cindex],
ACL.Value,
ModString);
}
break;
} /* END switch(ACL.Cmp) */
if (Mode & (1 << mfmHuman))
{
if (Line[0] != '\0')
strcat(Line," ");
}
else if (Mode & (1 << mfmAVP))
{
if (Line[0] != '\0')
strcat(Line,":");
}
strcat(Line,ACLString);
if ((Mode & (1 << mfmAVP)) && (Line[0] == '\0'))
strcpy(Line,NONE);
return(Line);
} /* END MACLShow() */
int MACLLoadConfigLine(
macl_t *ACL,
char *ACLLine)
{
char *ptr;
char *TokPtr;
char *ACLVal[2];
int oindex;
ACLVal[1] = NULL;
/* FORMAT: <OBJTYPE><CMP><VAL><MODIFIER>{<WS>|;|,}... */
ptr = MUStrTok(ACLLine," \t\n;,",&TokPtr);
while (ptr != NULL)
{
if ((oindex = MUGetIndex(ptr,MAttrO,TRUE,0)) != 0)
{
ACLVal[0] = ptr + strlen(MAttrO[oindex]);
MACLLoadConfig(ACL,ACLVal,1,oindex);
}
ptr = MUStrTok(NULL," \t\n;,",&TokPtr);
} /* END while (ptr != NULL) */
return(SUCCESS);
} /* END MACLLoadConfigLine() */
int MACLLoadConfig(
macl_t *ACL, /* O */
char **ACLList, /* I */
int ACLCount, /* I */
int ObjType) /* I */
{
int index;
int len;
int aindex;
int ACLStart;
int AIndex;
char *ptr;
char *ptr2;
char *tail;
char *TokPtr;
const char *FName = "MACLLoadConfig";
DBG(7,fCONFIG) DPrint("%s(ACL,%s,%d,%s)\n",
FName,
(ACLList != NULL) ? ACLList[0] : "NULL",
ACLCount,
MAttrO[ObjType]);
/* FORMAT: [<CMP>]{[<MODIFIER>]<OBJECTVAL>[<AFFINITY>]}[{:,}{[<MODIFIER>]<OBJECTVAL>[<AFFINITY>]}]... */
if ((ACL == NULL) || (ACLList == NULL))
{
return(FAILURE);
}
for (ACLStart = 0;ACLStart < MAX_MACL;ACLStart++)
{
if ((ACL[ACLStart].Name[0] == '\0') && (ACL[ACLStart].Value == 0))
break;
} /* END for (ACLStart = 0;...) */
if (ACLStart == MAX_MACL)
{
return(FAILURE);
}
AIndex = 0;
for (aindex = 0;aindex < ACLCount;aindex++)
{
if (ObjType != maDuration)
ptr = MUStrTok(ACLList[aindex],":|,",&TokPtr);
else
ptr = MUStrTok(ACLList[aindex],"|,",&TokPtr);
while (ptr != NULL)
{
if ((ACLStart + aindex) >= MAX_MACL)
break;
ACL[ACLStart + AIndex].Type = (char)ObjType;
/* extract affinity */
ACL[ACLStart + AIndex].Affinity = nmPositiveAffinity;
for (tail = ptr + strlen(ptr) - 1;strchr("-+=%^!*",*tail);tail++)
{
switch(*tail)
{
case '-':
tail[0] = '\0';
ACL[ACLStart + AIndex].Affinity = nmNegativeAffinity;
break;
case '=':
tail[0] = '\0';
ACL[ACLStart + AIndex].Affinity = nmNeutralAffinity;
break;
case '+':
tail[0] = '\0';
ACL[ACLStart + AIndex].Affinity = nmPositiveAffinity;
break;
case '!':
*tail = '\0';
ACL[ACLStart + AIndex].Flags |= (1 << maclDeny);
break;
case '^':
*tail = '\0';
ACL[ACLStart + AIndex].Flags |= (1 << maclXOR);
break;
case '*':
*tail = '\0';
ACL[ACLStart + AIndex].Flags |= (1 << maclRequired);
break;
default:
/* NO-OP */
break;
} /* END switch(*tail) */
} /* END for (tail) */
/* extract modifier */
/* FORMAT: [<CMD>][!^*][<CMP>]<ACLVAL> */
if ((ptr[0] == '=') && (strchr("<>!=%",ptr[1])))
ptr++;
ptr2 = ptr;
if ((index = MUCmpFromString(ptr2,&len)) != 0)
{
ACL[ACLStart + AIndex].Cmp = index;
ptr2 += len;
}
else
{
switch(ObjType)
{
case maDuration:
case maTask:
case maProc:
ACL[ACLStart + AIndex].Cmp = mcmpLE;
break;
default:
ACL[ACLStart + AIndex].Cmp = mcmpSEQ;
break;
} /* END switch(ObjType) */
}
if (ptr2[0] == '!')
{
ACL[ACLStart + AIndex].Flags |= (1 << maclDeny);
ptr2++;
}
if (ptr2[0] == '^')
{
ACL[ACLStart + AIndex].Flags |= (1 << maclXOR);
ptr2++;
}
if (ptr2[0] == '*')
{
ACL[ACLStart + AIndex].Flags |= (1 << maclRequired);
ptr2++;
}
switch(ObjType)
{
case maDuration:
case maTask:
case maProc:
/* do nothing */
break;
default:
if (ACL[ACLStart + AIndex].Cmp == mcmpEQ)
ACL[ACLStart + AIndex].Cmp = mcmpSEQ;
else if (ACL[ACLStart + AIndex].Cmp == mcmpNE)
ACL[ACLStart + AIndex].Cmp = mcmpSNE;
break;
} /* END switch(ObjType) */
switch(ACL[ACLStart + AIndex].Cmp)
{
case mcmpSEQ:
case mcmpSNE:
case mcmpSSUB:
MUStrCpy(ACL[ACLStart + AIndex].Name,ptr2,sizeof(ACL[0].Name));
break;
default:
MUStrCpy(ACL[ACLStart + AIndex].Name,ptr2,sizeof(ACL[0].Name));
if (ObjType == maDuration)
ACL[ACLStart + AIndex].Value = MUTimeFromString(ptr2);
else
ACL[ACLStart + AIndex].Value = strtol(ptr2,NULL,0);
break;
} /* END switch(ObjType) */
DBG(7,fCONFIG) DPrint("INFO: ACL[%d] loaded with %s %s (Affinity: %d)\n",
ACLStart + AIndex,
MAttrO[ObjType],
ptr2,
ACL[ACLStart + AIndex].Affinity);
AIndex++;
if (ObjType != maDuration)
ptr = MUStrTok(NULL,":|,",&TokPtr);
else
ptr = MUStrTok(NULL,"|,",&TokPtr);
} /* END while (ptr != NULL) */
} /* END for (aindex) */
return(SUCCESS);
} /* END MACLLoadConfig() */
/* access granted if: */
/* R1 CL matches R2 ACL (R2 grants access to R1) */
/* R2 CL matches R1 ACL (R1 grants X ) */
/* R1 CL matches R2 RCL */
/* R2 CL matches R1 RCL */
int MACLCheckAccess(
macl_t *ACL, /* I: access control list */
macl_t *CL, /* I: cred list */
char *Affinity,
int *IsInclusive)
{
int aindex;
int cindex;
int oindex;
int Inclusive[MAX_MATTRTYPE];
int tmpIsInclusive = FALSE;
mbool_t NonReqNeeded = FALSE;
mbool_t NonReqFound = FALSE;
if (IsInclusive == NULL)
{
return(FAILURE);
}
memset(Inclusive,FALSE,sizeof(Inclusive));
/* check 'deny' ACLs */
for (aindex = 0;ACL[aindex].Name[0] != '\0';aindex++)
{
if (ACL[aindex].Flags & (1 << maclDeny))
Inclusive[(int)ACL[aindex].Type] = TRUE;
if ((!(ACL[aindex].Flags & (1 << maclDeny))) &&
(!(ACL[aindex].Flags & (1 << maclRequired))) &&
(!(ACL[aindex].Flags & (1 << maclXOR))))
{
NonReqNeeded = TRUE;
}
} /* END for (raindex) */
/* check other ACLs */
for (aindex = 0;ACL[aindex].Type != maNONE;aindex++)
{
char ACLMatch = FALSE;
for (cindex = 0;CL[cindex].Type != maNONE;cindex++)
{
char ValMatch = TRUE;
if (CL[cindex].Type != ACL[aindex].Type)
continue;
switch(ACL[aindex].Cmp)
{
case mcmpEQ:
if (CL[cindex].Value != ACL[aindex].Value)
ValMatch = FALSE;
break;
case mcmpGT:
if (CL[cindex].Value <= ACL[aindex].Value)
ValMatch = FALSE;
break;
case mcmpGE:
if (CL[cindex].Value < ACL[aindex].Value)
ValMatch = FALSE;
break;
case mcmpLT:
if (CL[cindex].Value >= ACL[aindex].Value)
ValMatch = FALSE;
case mcmpLE:
if (CL[cindex].Value > ACL[aindex].Value)
ValMatch = FALSE;
break;
case mcmpNE:
if (CL[cindex].Value == ACL[aindex].Value)
ValMatch = FALSE;
break;
case mcmpSEQ:
default:
if ((CL[cindex].Name[0] != ACL[aindex].Name[0]) &&
(CL[cindex].Name[0] != '['))
{
ValMatch = FALSE;
}
else if ((strcmp(CL[cindex].Name,ACL[aindex].Name)) &&
(strcmp(CL[cindex].Name,ALL)))
{
ValMatch = FALSE;
}
break;
} /* END switch(ACL[aindex].Type) */
if (ValMatch != TRUE)
{
if (CL[cindex].Flags & (1 << maclRequired))
{
/* required credential request not matched */
*IsInclusive = FALSE;
return(FAILURE);
}
continue;
}
/* match found */
if (ACL[aindex].Flags & (1 << maclDeny))
{
/* deny match found, reservation is exclusive */
*IsInclusive = FALSE;
return(FAILURE);
}
else if (ACL[aindex].Flags & (1 << maclXOR))
{
Inclusive[(int)ACL[aindex].Type] = FALSE;
continue;
}
else if (ACL[aindex].Flags & (1 << maclRequired))
{
/* NO-OP */
}
else
{
NonReqFound = TRUE;
}
if (Affinity != NULL)
*Affinity = ACL[aindex].Affinity;
ACLMatch = TRUE;
tmpIsInclusive = TRUE;
} /* END for (cindex) */
if ((ACL[aindex].Flags & (1 << maclRequired)) &&
(ACLMatch != TRUE))
{
/* cannot locate 'required' ACL match */
*IsInclusive = FALSE;
return(FAILURE);
}
} /* END for (aindex) */
if ((NonReqNeeded == TRUE) && (NonReqFound == FALSE))
{
/* cannot locate 'required' ACL match */
*IsInclusive = FALSE;
return(FAILURE);
} /* END ((NonReqNeeded == TRUE) && (NonReqFound == FALSE)) */
if (tmpIsInclusive == FALSE)
{
for (oindex = 1;oindex < MAX_MATTRTYPE;oindex++)
{
if (Inclusive[oindex] == TRUE)
{
tmpIsInclusive = TRUE;
break;
}
} /* END for (oindex) */
}
*IsInclusive = tmpIsInclusive;
return(SUCCESS);
} /* END MACLCheckAccess() */
int MACLSet(
macl_t *ACL, /* I */
int Type,
void *Val,
int Cmp,
int Affinity,
long Flags,
int Mode) /* I: 0 -> unique type */
{
int aindex;
for (aindex = 0;aindex < MAX_MACL;aindex++)
{
if (ACL[aindex].Type != maNONE)
{
if ((Mode != 0) || (ACL[aindex].Type != Type))
continue;
}
if (ACL[aindex].Type == maNONE)
ACL[aindex + 1].Type = maNONE;
/* free slot located */
switch(Cmp)
{
case mcmpSEQ:
case mcmpSSUB:
case mcmpSNE:
strncpy(ACL[aindex].Name,(char *)Val,MAX_MNAME);
break;
default:
ACL[aindex].Value = (long)(*(long *)Val);
break;
} /* END switch(Cmp) */
ACL[aindex].Cmp = Cmp;
ACL[aindex].Affinity = Affinity;
ACL[aindex].Type = Type;
ACL[aindex].Flags = Flags;
return(SUCCESS);
} /* END for (aindex) */
return(FAILURE);
} /* END MACLSet() */
int MACLGet(
macl_t *ACL,
int OType,
void **Value,
int *Start)
{
int aindex;
int sindex;
if (Start != NULL)
sindex = *Start;
else
sindex = 0;
for (aindex = sindex;ACL[aindex].Type != maNONE;aindex++)
{
if (ACL[aindex].Type != OType)
continue;
if (Value != NULL)
{
switch(ACL[aindex].Cmp)
{
case mcmpSEQ:
case mcmpSNE:
case mcmpSSUB:
*Value = (void *)ACL[aindex].Name;
break;
default:
*Value = (void *)&ACL[aindex].Value;
break;
} /* END switch(ACL[aindex].Cmp) */
} /* END if (Value != NULL) */
return(SUCCESS);
} /* END for (aindex) */
/* matching ACL not located */
return(FAILURE);
} /* END MACLGet() */
int MACLClear(
macl_t *ACL,
int OType)
{
int aindex;
int tindex;
/* locate tail */
for (tindex = 0;tindex < MAX_MACL;tindex++)
{
if (ACL[tindex].Type == maNONE)
break;
}
if (tindex == MAX_MACL)
{
return(FAILURE);
}
/* remove all instances of object type ACL's in list */
for (aindex = 0;aindex < tindex;aindex++)
{
if (ACL[aindex].Type != OType)
continue;
/* remove type */
memcpy(&ACL[aindex],&ACL[tindex - 1],sizeof(macl_t));
aindex--;
tindex--;
ACL[tindex].Type = maNONE;
} /* END for (aindex) */
return(SUCCESS);
} /* END MACLClear() */
/* END MACL.c */

4093
src/moab/MAM.c Normal file

File diff suppressed because it is too large Load Diff

424
src/moab/MAcct.c Normal file
View File

@@ -0,0 +1,424 @@
/* HEADER */
/* Contains: *
* int MAcctInitialize(A,AName) *
* int MAcctFind(A,AccountName) *
* */
#include "moab.h"
#include "msched-proto.h"
extern mlog_t mlog;
extern msched_t MSched;
extern mgcred_t MAcct[];
extern mckpt_t MCP;
extern const char *MCredAttr[];
extern const char *MXO[];
extern const char *MJobFlags[];
int MAcctLoadCP(
mgcred_t *AS,
char *Buf)
{
char tmpHeader[MAX_MNAME];
char AName[MAX_MNAME];
char *ptr;
mgcred_t *A;
long CkTime;
mxml_t *E = NULL;
const char *FName = "MAcctLoadCP";
DBG(4,fCKPT) DPrint("%s(AS,%s)\n",
FName,
(Buf != NULL) ? Buf : "NULL");
if (Buf == NULL)
return(FAILURE);
/* FORMAT: <HEADER> <GID> <CKTIME> <GSTRING> */
/* load CP header */
sscanf(Buf,"%s %s %ld",
tmpHeader,
AName,
&CkTime);
if (((long)MSched.Time - CkTime) > MCP.CPExpirationTime)
return(SUCCESS);
if (AS == NULL)
{
if (MAcctAdd(AName,&A) != SUCCESS)
{
DBG(5,fCKPT) DPrint("ALERT: cannot load CP account '%s'\n",
AName);
return(FAILURE);
}
}
else
{
A = AS;
}
if ((ptr = strchr(Buf,'<')) == NULL)
{
return(FAILURE);
}
MXMLCreateE(&E,(char *)MXO[mxoAcct]);
MXMLFromString(&E,ptr,NULL,NULL);
MOFromXML((void *)A,mxoAcct,E);
MXMLDestroyE(&E);
return(SUCCESS);
} /* END MAcctLoadCP() */
int MAcctAdd(
char *AName, /* I */
mgcred_t **A) /* O (optional) */
{
int aindex;
int Key;
mgcred_t *Atmp;
const char *FName = "MAcctAdd";
DBG(5,fSTRUCT) DPrint("%s(%s,A)\n",
FName,
(AName != NULL) ? AName : "NULL");
if (A != NULL)
*A = NULL;
if ((AName == NULL) || (AName[0] == '\0'))
{
return(FAILURE);
}
Key = (int)(MUGetHash(AName) % MAX_MACCT);
for (aindex = Key;aindex < MAX_MACCT + MAX_MHBUF;aindex++)
{
Atmp = &MAcct[aindex];
/* if account already in table */
if (!strcmp(Atmp->Name,AName))
{
if (A != NULL)
*A = Atmp;
return(SUCCESS);
}
/* if empty slot found */
if (Atmp->Name[0] == '\0')
{
/* setup new record */
if (A != NULL)
*A = Atmp;
if (!strcmp(AName,NONE))
Atmp->Key = 0;
else
Atmp->Key = Key;
MUStrCpy(Atmp->Name,AName,sizeof(Atmp->Name));
Atmp->Index = aindex;
if (strcmp(AName,ALL) && strcmp(AName,NONE))
{
/* update account record */
if (MSched.Mode != msmSim)
MCPRestore(mcpAcct,Atmp->Name,(void *)Atmp);
DBG(5,fSTRUCT) DPrint("INFO: account %s added\n",
AName);
}
else
{
/* do nothing */
}
return(SUCCESS);
}
} /* END for (aindex) */
/* end of table reached */
DBG(1,fSTRUCT) DPrint("ALERT: account table overflow (cannot add account %s)\n",
AName);
return(FAILURE);
} /* END MAcctAdd() */
int MAcctFind(
char *AccountName,
mgcred_t **A)
{
/* If found, return success with A pointing to Account. */
/* If not found, return failure with A pointing to */
/* first free Account if available, A set to NULL otherwise */
int aindex;
int Key;
char AName[MAX_MNAME];
DBG(5,fSTRUCT) DPrint("MAcctFind(%s,A)\n",
(AccountName == NULL) ? "NULL" : AccountName);
if (A != NULL)
*A = NULL;
if ((AccountName == NULL) || (AccountName[0] == '\0'))
strcpy(AName,NONE);
else
MUStrCpy(AName,AccountName,sizeof(AName));
Key = (int)(MUGetHash(AName) % MAX_MACCT);
for (aindex = Key;aindex < MAX_MACCT + MAX_MHBUF;aindex++)
{
if (MAcct[aindex].Name[0] == '\0')
{
if (A != NULL)
*A = &MAcct[aindex];
break;
}
if (strcmp(MAcct[aindex].Name,AName) != 0)
continue;
/* Account found */
if (A != NULL)
*A = &MAcct[aindex];
return(SUCCESS);
} /* END for (aindex) */
return(FAILURE);
} /* END MAcctFind() */
int MAcctInitialize(
mgcred_t *A,
char *AName)
{
if ((A == NULL) ||
(AName == NULL) ||
(AName[0] == '\0'))
{
return(FAILURE);
}
memset(A,0,sizeof(mgcred_t));
MUStrCpy(A->Name,AName,sizeof(A->Name));
return(SUCCESS);
} /* END MAcctInitialize() */
int MAcctToXML(
mgcred_t *A,
mxml_t **EP,
int *SAList)
{
int DAList[] = {
mcaID,
-1 };
int aindex;
int *AList;
char tmpString[MAX_MLINE];
if ((A == NULL) || (EP == NULL))
return(FAILURE);
if (SAList != NULL)
AList = SAList;
else
AList = DAList;
MXMLCreateE(EP,(char *)MXO[mxoAcct]);
for (aindex = 0;AList[aindex] != -1;aindex++)
{
if ((MCredAToString((void *)A,mxoAcct,AList[aindex],tmpString,0) == FAILURE) ||
(tmpString[0] == '\0'))
{
continue;
}
MXMLSetAttr(*EP,(char *)MCredAttr[AList[aindex]],tmpString,mdfString);
} /* END for (aindex) */
return(SUCCESS);
} /* END MAcctToXML() */
int MAcctToString(
mgcred_t *A,
char *Buf)
{
const int CPCList[] = {
mxoStats,
-1 };
mxml_t *E = NULL;
if ((A == NULL) || (Buf == NULL))
return(FAILURE);
Buf[0] = '\0';
MCOToXML((void *)A,mxoAcct,&E,NULL,(int *)CPCList,0);
MXMLToString(E,Buf,MAX_MBUFFER,NULL,TRUE);
MXMLDestroyE(&E);
return(SUCCESS);
} /* END MAcctToString() */
char *MAcctShow(
mgcred_t *A, /* I */
char *Buf, /* O */
long *BufSize,
long Mode)
{
static char Line[MAX_MLINE];
char FlagLine[MAX_MLINE];
char QALLine[MAX_MLINE];
char QALChar;
char ALLine[MAX_MLINE];
char *ptr;
const char *FName = "MAcctShow";
DBG(3,fUI) DPrint("%s(%s,Buf,BufSize,%ld)\n",
FName,
(A != NULL) ? A->Name : "NULL",
Mode);
ptr = (Buf != NULL) ? Buf : Line;
if (A == NULL)
{
/* build header */
/* NAME PRI FLAG QDEF QLST * PLST TRG LIMITS */
sprintf(ptr,"%-12s %8s %12s %12s %12s%s %20s %6s %7s\n\n",
"Name",
"Priority",
"Flags",
"QDef",
"QOSList",
"*",
"PartitionList",
"Target",
"Limits");
}
else
{
/* build job info line */
MUBMToString(A->F.JobFlags,MJobFlags,':',FlagLine,NONE);
MUStrCpy(QALLine,MQOSBMToString(A->F.QAL),sizeof(QALLine));
if (A->F.QALType == qalAND)
QALChar = '&';
else if (A->F.QALType == qalONLY)
QALChar = '^';
else
QALChar = ' ';
MUStrCpy(ALLine,
MCredShowAttrs(&A->L.AP,A->L.IP,NULL,NULL,NULL,&A->F,0,(1 << mcsLimits)),sizeof(ALLine));
/* NAME PRIO FLAG QDEF QLST * PLST FSTARG LIMITS */
sprintf(ptr,"%-12s %8ld %12s %12s %12s%c %20s %6.2lf %7s\n",
A->Name,
A->F.Priority,
FlagLine,
((mqos_t *)A->F.QDef) != NULL ?
((mqos_t *)A->F.QDef)->Name :
NONE,
(QALLine[0] != '\0') ? QALLine : NONE,
QALChar,
(A->F.PAL[0] == 0) ?
NONE :
MUListAttrs(ePartition,A->F.PAL[0]),
A->F.FSTarget,
(ALLine[0] != '\0') ? ALLine : NONE);
} /* END else (A == NULL) */
return(ptr);
} /* END MAcctShow() */
/* END MAcct.c */

Some files were not shown because too many files have changed in this diff Show More