1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
4
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=iso-8859-1">
6
<meta name="GENERATOR" content="Mozilla/4.76C-CCK-MCD Netscape [en] (X11; U; SunOS 5.8 sun4u) [Netscape]">
7
<meta name="AUTHOR" content="Ernst Bablick">
8
<meta name="CREATED" content="20010608;9201000">
9
<meta name="CHANGEDBY" content="Ernst Bablick">
10
<meta name="CHANGED" content="20010703;14194400">
13
@page { margin-left: 1.25in; margin-right: 1.25in; margin-top: 1in; margin-bottom: 1in }
14
P.sdfootnote { margin-left: 0.2in; text-indent: -0.2in; margin-bottom: 0in; font-size: 10pt }
15
A.sdfootnoteanc { font-size: 57% }
21
<h1 STYLE="margin-top: 0.17in; page-break-after: avoid">
22
<b><font face="Times New Roman, serif">Common Usable List Library<a NAME="sdfootnote1anc" CLASS="sdfootnoteanc" HREF="#sdfootnote1sym"></a><a NAME="sdfootnote1anc" href="#sdfootnote1sym" CLASS="sdfootnoteanc"></a><sup><a href="#sdfootnote1sym" CLASS="sdfootnoteanc" NAME="sdfootnote1anc">1</a></sup></font></b></h1>
25
Capabilities of the Common Usable List Library (CULL)</h2>
26
The CULL allows to create and maintain so called CULL lists, which are
27
the central Grid Engine data structure in which almost all Grid Engine
28
data, such as jobs, queues, hosts, etc., are stored. The CULL has the following
31
<ul>applicability for every client/server in Grid Engine.
33
<p STYLE="margin-bottom: 0in">reusability of list management code.
34
<p>no need for recompilation of client code in case of uncritical data
36
<p>interface duality - either list oriented or SQL inspired.
37
<p>fast search functions using hash tables</ul>
39
The CULL is the building block for the Grid Engine Database Interface (GDI
40
- see <a href="../gdi/gdi.html">here</a>).
43
Internal data structures</h2>
44
See below for a schematic overview of the CULL internal list data structure:
51
<p><img SRC="list_struct.jpg" NAME="Grafik1" BORDER=0 height=530 width=524 align=BOTTOM></center>
57
This is the structure for the list header. The meaning of the different
58
fields is stated in the comments of the structure definition below. The
59
position and type information for all list elements is maintained in the
60
lDescr array. The element data itself can be referenced via the first and
63
int nelem; /* number of elements in the list */
64
char *listname; /* name of the list */
65
lDescr *descr; /* pointer to the descriptor array */
66
lListElem *first; /* pointer to the first element of the list */
67
lListElem *last; /* pointer to the last element of the list */
72
The following structure defines a list element being used to store data
73
in CULL lists. The data storage occurs in arrays of lMultiType unions (see
74
below). The access to the data is performed by getting the array index
75
and the field type through the lDescr struct array. The field descr is
76
used for type checking.
78
lListElem *next; /* next lList element */
79
lListElem *prev; /* previous lList element */
80
lUlong status; /* status: element in list/ element free */
81
lDescr *descr; /* pointer to the descriptor array */
82
lMultiType *cont; /* pointer to the lMultiType array */
87
The descriptor struct contains two integer fields. One is representing
88
the name of the field and the other one the associated type. The names
89
are represented by unique numbers, which can be mapped to enum definitions
90
or #define statements (the steps to define a list are shown below.)
92
int nm; /* unique number that stands for a name */
93
int mt; /* multitype information */
94
lHash *hash; /* hashing information */
99
The lHash structure stores information about hash tables to be used for
101
<br>For each data field that shall be accessed by a hash table, the corresponding
102
descriptor (lDesc) contains a reference to an lHash object. The lHash object
103
defines the type of hash table (unique or non unique keys) and a pointer
104
to a HashTable object.
105
<pre>typedef struct {
106
int unique; /* 0 = non unique keys, 1 = unique keys */
107
HashTable table; /* pointer to HashTable from libs/uti/sge_hash.* */
112
The lMultiType union consists of various basic types. Which union member
113
has to be accessed is determined by the type field ("mt") in the lDescr
114
struct. An array of lMultiType unions contains the data.
116
lFloat fl; /* float */
117
lDouble db; /* double */
118
lUlong ul; /* unsigned long */
122
lString str; /* char* */
123
lList *glp<b>;</b> /* sublist */
124
lRef ref; /* pointer */
125
lCondition *cp<b>;</b> /* lCondition pointer */
129
Usage of the Generic List</h2>
130
In the directory source/lib/cull you can find one example which demonstrates
131
how to use CULL lists. To build it use the aimk script: "aimk example1"
134
Each CULL list definition consists of following parts:
136
<p STYLE="margin-left: 0.79in">Definition of some constants which identify
137
the attributes of a CULL element.
139
<p STYLE="margin-left: 0.79in">A Section which defines the type of the
140
attributes of a CULL element.
142
<p STYLE="margin-left: 0.79in">A List of names used when a attribute name
143
should be written in readable form.
144
<p>You can find a definition for a CULL list <a href="hostL.h">here</a>.
145
Lists used in Grid Engine are part of the GDI library. Concerning source
146
code can be found in source/libs/gdi. Each file whose filename ends with
147
an capital L before the .h suffix contains CULL list definitions.
149
Definition of Name Space</h3>
150
Suppose you intend to write a piece of Grid Engine code based on a new
151
CULL list. One thing you should do is to define the names to be used for
152
the CULL list elements and you have to make sure that none of your names
153
conflicts with already existing names. For this purpose you have to select
154
one or several of the predefined name spaces, which are defined in the
155
header boundaries.h (see <a href="boundaries.h">here</a>). By using one
156
or multiple name spaces, you can create your own list structure as shown
158
<p>The file source/libs/gdi/sge_boundaries.h contains the name space definition
161
Application Specific Header File</h3>
163
<div STYLE="margin-bottom: 0in">Each attribute within a CULL object is
164
uniquely identified by a constant value which will be used to get or modify
165
its value. For output and debug purpose it is extremely valuable to use
166
strings instead of enum values. Therefore all the list structures that
167
shall be used, should be included in an application specific header file.
168
Here an array of type lNameSpace has to be defined. This table will be
169
used to convert field names to field numbers and vice versa within the
172
<div STYLE="margin-bottom: 0in">The example1.h file can be found <a href="example1.h">here</a>.
173
The file source/libs/gdi/sge_all_listsL.h containes the array used in Grid
177
List Usage Example</h3>
179
<div STYLE="margin-bottom: 0in">In the the C file <a href="example1.c">example1.c</a>
180
the usage of the various CULL list library functions is explained. Run
181
the corresponding application without any arguments to get a list of scenarios
182
demonstrated by the example.</div>
186
Functional Overview</h3>
188
<div STYLE="margin-bottom: 0in">The most important functions of the CULL
189
are explained in the man page <a href="list_intro.txt">list_intro</a>(3).
190
In addition, more high level composite funtions exist, which combine the
191
use of several basic functions for standard tasks. Using these composite
192
functions may reduce the size of the code dramatically. There are no man
193
pages available for the composite functions currently but they are documented
194
in the sourcecode. Here their names are listed:</div>
196
<div STYLE="margin-bottom: 0in">lGetElemCaseStr(), lGetElemDescr(), lGetElemHost(),
197
lGetElemIndex(), lGetElemStr(), lGetElemStrLike(), lGetElemUlong(), lGetSubCaseStr(),
198
lGetSubHost(), lGetSubStr(), lGetSubUlong(), lAddElemUlong(), lAddElemStr(),
199
lAddSubStr(), lAddSubUlong(), lDelElemCaseStr(), lDelElemHost(), lDelElemStr(),
200
lDelElemUlong(), lDelSubCaseStr(), lDelSubStr(), lDelSubUlong()</div>
202
<div ID="sdfootnote1">
203
<center><a NAME="sdfootnote1sym" CLASS="sdfootnotesym" HREF="#sdfootnote1anc"></a><a NAME="sdfootnote1sym" href="#sdfootnote1anc" CLASS="sdfootnotesym"></a><a href="#sdfootnote1anc" CLASS="sdfootnotesym" NAME="sdfootnote1sym">1</a>Copyright
204
2001 Sun Microsystems, Inc. All rights reserved.</center>