1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
.TH GETNTYPE 2 "November, 2001" "LAM 6.5.6" "LAM NETWORK LIBRARY"
.hy 0
.SH NAME
getnodeid, getnodetype, getorigin, getncomp, getnotb,
getnall, getntype \- Get information on LAM nodes.
.SH SYNOPSIS
.hy 1
.nf
#include <net.h>
int getnodeid ();
int getnodetype ();
int getorigin ();
int getnall ();
int getncomp ();
int getnjones ();
int getnotb ();
int getntype (int nodetype, int typemask);
.fi
.SH FORTRAN SYNOPSIS
.nf
integer function IGNDID ()
integer function IGNDTP ()
integer function IGORGN ()
integer function IGNALL ()
integer function IGNCMP ()
integer function IGNJON ()
integer function IGNOTB ()
integer function IGNTP (nodetype, typemask)
integer nodetype, typemask
.fi
.SH DESCRIPTION
These functions return node information obtained from the local route
daemon, a modular component of the LAM daemon, regarding the currently
running LAM network.
A node is defined by its identifier, an arbitrary 32 bit value,
and its type, a combination of flags describing the capabilities of
the node.
These flags (see CONSTANTS(5) and/or <net.h>) are:
.TP 12
NT_ITB
node running LAM natively
.TP
NT_CAST
node multicast, a group of nodes
.TP
NT_WASTE
node not part of main computing group
.TP
NT_DISK
node has a disk
.TP
NT_TUBE
node has a video display unit
.TP
NT_JONES
node is a neighbour of the local node
.TP
NT_BOOT
node is booted by the local node
.PP
.I getnodeid()
returns the local node identifier.
.I getnodetype()
returns the local node type.
.I getorigin()
returns the origin node identifier, from which LAM was booted.
.PP
.I getncomp()
returns the number of nodes marked for the "main" computation.
A typical application will use most (maybe all) of the nodes in
a parallel machine to compute portions of decomposed data.
Programmers frequently need to know the number of these "compute" nodes.
Other nodes may be present in the multicomputer to handle peripherals
or sequential portions of an application.
.PP
.I getnotb()
returns the total number of OTB nodes.
.I getnall()
returns the total number of nodes in the system.
.I getnjones()
returns the caller's number of neighbour (directly connected) nodes.
.PP
.I getntype()
is a general function that is used to determine the number of nodes
whose node types have certain bits set to certain values.
This is a flexible tool which allows the user to obtain very specific
information about the capabilities of nodes in the system.
.SS Type Inquiries
You may need more detailed information on the number and types of nodes
in the system than provided by the convenience functions.
You may, for example, want to know the number of computing nodes with
attached video displays.
The
.I getntype()
function is used for this purpose.
.PP
Node types are interpreted as bit fields, and each node type
has a different bit set.
A bitmask having all bits set, NT_ALL, is also available.
Note that NT_ALL does not include NT_JONES nor NT_BOOT since these
node characteristics are not inherent to the nodes, but depend on the
node from which the query is made.
The node types are thus:
.PP
.nf
.ta 1.3i 2.3i
Nodetype Value Bitmask
NT_ITB 1 ...00000001
NT_CAST 2 ...00000010
NT_WASTE 4 ...00000100
NT_DISK 8 ...00001000
NT_TUBE 16 ...00010000
NT_ALL 31 ...00011111
NT_JONES 32 ...00100000
NT_BOOT 64 ...01000000
.fi
.PP
The
.I typemask
argument to
.I getntype()
is used to specify which bits are of interest.
These are set to 1, all others are set to 0.
The
.I nodetype
argument is used to specify what values these bits should take.
.I getntype()
then compares the relevant bits (as specified by
.IR typemask )
in the node type of each node in the system, to
see if they have the appropriate value (as specified by
.IR nodetype ).
.PP
To learn the number of nodes that have video capabilities,
the bits of interest are NT_WASTE and NT_TUBE, thus
.I typemask
is 20.
NT_WASTE must be 0 and NT_TUBE must be 1, which combined gives
.I nodetype
as 16.
The complete call to
.I getntype()
is:
.PP
nnodes = getntype(NT_TUBE, NT_TUBE | NT_WASTE);
.PP
To learn the number of compute nodes that have an attached video
display, but no other capabilities, all bits must be considered and
all bits except NT_TUBE must be clear (0).
The complete function call is:
.PP
nnodes = getntype(NT_TUBE, NT_ALL);
.SH C RETURN VALUE
.I getnodeid()
and
.I getorigin()
both return node identifiers.
NOTNODEID (defined in <net.h>) is returned if an error occurred.
Likewise,
.I getnodetype()
returns a valid node type or NOTNODETYPE in the case of error.
The return values upon successful completion for the remaining
functions are described above; they return -1 if an error occurs.
In all cases of error, the global error variable
.I errno
is set to indicate the error.
.SH FORTRAN RETURN VALUE
.I IGNDID()
and
.I IGORGN()
both return node identifiers.
NOTNODEID (see CONSTANTS(5)) is returned if an error occurred.
Likewise,
.I IGNDTP()
returns a valid node type or NOTNODETYPE in the case of error.
The return values upon successful completion for the remaining
functions are described above; they return -1 if an error occurs.
.SH SEE ALSO
getroute(2), CONSTANTS(5)
|