179 lines
7.2 KiB
Plaintext
179 lines
7.2 KiB
Plaintext
|
|
.\"############################################################################
|
||
|
|
.\" $Id: libgenders.3,v 1.27 2010-02-02 00:04:34 chu11 Exp $
|
||
|
|
.\"############################################################################
|
||
|
|
.\" Copyright (C) 2007-2019 Lawrence Livermore National Security, LLC.
|
||
|
|
.\" Copyright (C) 2001-2007 The Regents of the University of California.
|
||
|
|
.\" Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
|
||
|
|
.\" Written by Jim Garlick <garlick@llnl.gov> and Albert Chu <chu11@llnl.gov>.
|
||
|
|
.\" UCRL-CODE-2003-004.
|
||
|
|
.\"
|
||
|
|
.\" This file is part of Genders, a cluster configuration database.
|
||
|
|
.\" For details, see <http://www.llnl.gov/linux/genders/>.
|
||
|
|
.\"
|
||
|
|
.\" Genders 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.
|
||
|
|
.\"
|
||
|
|
.\" Genders is distributed in the hope that it will be useful, but WITHOUT ANY
|
||
|
|
.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||
|
|
.\" FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||
|
|
.\" details.
|
||
|
|
.\"
|
||
|
|
.\" You should have received a copy of the GNU General Public License along
|
||
|
|
.\" with Genders. If not, see <http://www.gnu.org/licenses/>.
|
||
|
|
.\"############################################################################
|
||
|
|
.TH LIBGENDERS 3 "August 2003" "LLNL" "LIBGENDERS"
|
||
|
|
.SH NAME
|
||
|
|
libgenders \- a library of functions to parse and retrieve genders data
|
||
|
|
.SH SYNOPSIS
|
||
|
|
.B #include <genders.h>
|
||
|
|
.sp
|
||
|
|
.BI "genders_t genders_handle_create(void);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_handle_destroy(genders_t handle);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_load_data(genders_t handle, const char *filename);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_errnum(genders_t handle);"
|
||
|
|
.sp
|
||
|
|
.BI "char *genders_strerror(int errnum);"
|
||
|
|
.sp
|
||
|
|
.BI "char *genders_errormsg(genders_t handle);"
|
||
|
|
.sp
|
||
|
|
.BI "void genders_perror(genders_t handle, const char *msg);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_getnumnodes(genders_t handle);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_getnumattrs(genders_t handle);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_getmaxattrs(genders_t handle);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_getmaxnodelen(genders_t handle);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_getmaxattrlen(genders_t handle);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_getmaxvallen(genders_t handle);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_nodelist_create(genders_t handle, char ***nodelist);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_nodelist_clear(genders_t handle, char **nodelist);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_nodelist_destroy(genders_t handle, char **nodelist);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_attrlist_create(genders_t handle, char ***attrlist);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_attrlist_clear(genders_t handle, char **attrlist);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_attrlist_destroy(genders_t handle, char **attrlist);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_vallist_create(genders_t handle, char ***vallist);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_vallist_clear(genders_t handle, char **vallist);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_vallist_destroy(genders_t handle, char **vallist);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_getnodename(genders_t handle, char *node, int len);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_getnodes(genders_t handle, char *nodes[], int len, const char *attr, const char *val);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_getattr(genders_t handle, char *attrs[], char *vals[], int len, const char *node);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_getattr_all(genders_t handle, char *attrs[], int len);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_testattr(genders_t handle, const char *node, const char *attr, char *val, int len);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_testattrval(genders_t handle, const char *node, const char *attr, const char *val);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_isnode(genders_t handle, const char *node);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_isattr(genders_t handle, const char *attr);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_isattrval(genders_t handle, const char *attr, const char *val);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_index_attrvals(genders_t handle, const char *attr);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_query(genders_t handle, char *nodes[], int len, const char *query);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_testquery(genders_t handle, const char *node, const char *query);"
|
||
|
|
.sp
|
||
|
|
.BI "int genders_parse(genders_t handle, const char *filename, FILE *stream);"
|
||
|
|
.br
|
||
|
|
.SH DESCRIPTION
|
||
|
|
The genders library functions are a set of functions used to parse and
|
||
|
|
retrieve data from a genders file. For API details, please see the
|
||
|
|
individual manpages for each of the functions above, or read the
|
||
|
|
comments written in /usr/include/genders.h.
|
||
|
|
.br
|
||
|
|
.SH GENDERS FILE FORMAT
|
||
|
|
Each line of the genders file has one of the following formats. See
|
||
|
|
the section HOST RANGES below for information on host range
|
||
|
|
formatting.
|
||
|
|
|
||
|
|
nodename attr[=value],attr[=value],...
|
||
|
|
nodename1,nodename2,... attr[=value],attr[=value],...
|
||
|
|
nodenames[A-B] attr[=value],attr[=value],...
|
||
|
|
|
||
|
|
The nodename(s) are the shortened hostnames of a node. This is
|
||
|
|
followed by any number of spaces or tabs, and then the comma-separated
|
||
|
|
list of attributes, each of which can optionally have a value. The
|
||
|
|
substitution string "%n" can be used in an attribute value to
|
||
|
|
represent the nodename. Nodenames can be listed on multiple lines, so
|
||
|
|
a node's attributes can be specified on multiple lines. However, no
|
||
|
|
single node may have duplicate attributes.
|
||
|
|
|
||
|
|
There must be no spaces embedded in the attribute list and there is no
|
||
|
|
provision for continuation lines. Commas and equal characters are
|
||
|
|
special and cannot appear in attribute names or their values.
|
||
|
|
Comments are prefixed with the hash chracter (#) and can appear
|
||
|
|
anywhere in the file. The active genders file is typically found at
|
||
|
|
/etc/genders or /admin/etc/genders.
|
||
|
|
|
||
|
|
Here is an example genders file from a small 16-node linux cluster:
|
||
|
|
|
||
|
|
# slc cluster genders file
|
||
|
|
slci,slcj,slc[0-15] eth2=e%n,cluster=slc,all
|
||
|
|
slci passwdhost
|
||
|
|
slci,slcj management
|
||
|
|
slc[1-15] compute
|
||
|
|
|
||
|
|
.SH "HOST RANGES"
|
||
|
|
As noted in sections above, the genders database
|
||
|
|
accepts ranges of nodenames in the general form: prefix[n-m,l-k,...],
|
||
|
|
where n < m and l < k, etc., as an alternative to explicit lists of
|
||
|
|
nodenames.
|
||
|
|
|
||
|
|
This range syntax is meant only as a convenience on clusters with a
|
||
|
|
prefixNN naming convention and specification of ranges should not be
|
||
|
|
considered necessary -- the list foo1,foo9 could be specified as such,
|
||
|
|
or by the range foo[1,9].
|
||
|
|
|
||
|
|
Some examples of range usage follow:
|
||
|
|
|
||
|
|
foo01,foo02,foo03,foo04,foo05: foo[01-05]
|
||
|
|
|
||
|
|
foo3,foo7,foo9,foo11: foo[3,7,9-11]
|
||
|
|
|
||
|
|
fooi,fooj,foo0,foo1,foo2: fooi,fooj,foo[0-2]
|
||
|
|
|
||
|
|
.SH FILES
|
||
|
|
/usr/include/genders.h
|
||
|
|
.sp
|
||
|
|
/etc/genders
|
||
|
|
.SH SEE ALSO
|
||
|
|
Libgenders(3), Genders(3), genders_handle_create(3),
|
||
|
|
genders_handle_destroy(3), genders_load_data(3), genders_errnum(3),
|
||
|
|
genders_strerror(3), genders_errormsg(3), genders_perror(3),
|
||
|
|
genders_getnumnodes(3), genders_getnumattrs(3),
|
||
|
|
genders_getmaxattrs(3), genders_getmaxnodelen(3),
|
||
|
|
genders_getmaxattrlen(3), genders_getmaxvallen(3),
|
||
|
|
genders_nodelist_create(3), genders_nodelist_clear(3),
|
||
|
|
genders_nodelist_destroy(3), genders_attrlist_create(3),
|
||
|
|
genders_attrlist_clear(3), genders_attrlist_destroy(3),
|
||
|
|
genders_vallist_create(3), genders_vallist_clear(3),
|
||
|
|
genders_vallist_destroy(3), genders_getnodename(3),
|
||
|
|
genders_getnodes(3), genders_getattr(3), genders_getattr_all(3),
|
||
|
|
genders_testattr(3), genders_testattrval(3), genders_testnode(3),
|
||
|
|
genders_index_nodes(3), genders_index_attrs(3), genders_index_attrvals(3),
|
||
|
|
genders_query(3), genders_testquery(3), genders_parse(3)
|