1GETNTYPE(2)                   LAM NETWORK LIBRARY                  GETNTYPE(2)
2
3
4

NAME

6       getnodeid, getnodetype, getorigin, getncomp, getnotb, getnall, getntype
7       - Get information on LAM nodes.
8

SYNOPSIS

10       #include <net.h>
11
12       int getnodeid ();
13       int getnodetype ();
14       int getorigin ();
15
16       int getnall ();
17       int getncomp ();
18       int getnjones ();
19       int getnotb ();
20       int getntype (int nodetype, int typemask);
21

FORTRAN SYNOPSIS

23       integer function IGNDID ()
24       integer function IGNDTP ()
25       integer function IGORGN ()
26
27       integer function IGNALL ()
28       integer function IGNCMP ()
29       integer function IGNJON ()
30       integer function IGNOTB ()
31       integer function IGNTP (nodetype, typemask)
32
33       integer nodetype, typemask
34

DESCRIPTION

36       These functions return node information obtained from the  local  route
37       daemon,  a modular component of the LAM daemon, regarding the currently
38       running LAM network.  A node is defined by its identifier, an arbitrary
39       32 bit value, and its type, a combination of flags describing the capa‐
40       bilities of the node.  These flags (see  CONSTANTS(5)  and/or  <net.h>)
41       are:
42
43       NT_ITB      node running LAM natively
44
45       NT_CAST     node multicast, a group of nodes
46
47       NT_WASTE    node not part of main computing group
48
49       NT_DISK     node has a disk
50
51       NT_TUBE     node has a video display unit
52
53       NT_JONES    node is a neighbour of the local node
54
55       NT_BOOT     node is booted by the local node
56
57       getnodeid()  returns  the local node identifier.  getnodetype() returns
58       the local node type.  getorigin() returns the origin  node  identifier,
59       from which LAM was booted.
60
61       getncomp()  returns  the number of nodes marked for the "main" computa‐
62       tion.  A typical application will use most (maybe all) of the nodes  in
63       a parallel machine to compute portions of decomposed data.  Programmers
64       frequently need to know the number of  these  "compute"  nodes.   Other
65       nodes  may be present in the multicomputer to handle peripherals or se‐
66       quential portions of an application.
67
68       getnotb() returns the total number of OTB nodes.  getnall() returns the
69       total  number of nodes in the system.  getnjones() returns the caller's
70       number of neighbour (directly connected) nodes.
71
72       getntype() is a general function that is used to determine  the  number
73       of  nodes  whose  node  types  have certain bits set to certain values.
74       This is a flexible tool which allows the user to obtain  very  specific
75       information about the capabilities of nodes in the system.
76
77   Type Inquiries
78       You may need more detailed information on the number and types of nodes
79       in the system than provided by the convenience functions.  You may, for
80       example, want to know the number of computing nodes with attached video
81       displays.  The getntype() function is used for this purpose.
82
83       Node types are interpreted as bit fields, and each node type has a dif‐
84       ferent  bit set.  A bitmask having all bits set, NT_ALL, is also avail‐
85       able.  Note that NT_ALL does not include  NT_JONES  nor  NT_BOOT  since
86       these node characteristics are not inherent to the nodes, but depend on
87       the node from which the query is made.  The node types are thus:
88
89       Nodetype     Value     Bitmask
90
91       NT_ITB       1         ...00000001
92       NT_CAST      2         ...00000010
93       NT_WASTE     4         ...00000100
94       NT_DISK      8         ...00001000
95       NT_TUBE      16        ...00010000
96       NT_ALL       31        ...00011111
97       NT_JONES     32        ...00100000
98       NT_BOOT      64        ...01000000
99
100       The typemask argument to getntype() is used to specify which  bits  are
101       of  interest.   These are set to 1, all others are set to 0.  The node‐
102       type argument is used to specify what values these  bits  should  take.
103       getntype()  then  compares the relevant bits (as specified by typemask)
104       in the node type of each node in the system, to see if  they  have  the
105       appropriate value (as specified by nodetype).
106
107       To  learn the number of nodes that have video capabilities, the bits of
108       interest are NT_WASTE and NT_TUBE, thus typemask is 20.  NT_WASTE  must
109       be  0  and NT_TUBE must be 1, which combined gives nodetype as 16.  The
110       complete call to getntype() is:
111
112       nnodes = getntype(NT_TUBE, NT_TUBE | NT_WASTE);
113
114       To learn the number of compute nodes that have an attached  video  dis‐
115       play,  but  no  other capabilities, all bits must be considered and all
116       bits except NT_TUBE must be clear (0).  The complete function call is:
117
118       nnodes = getntype(NT_TUBE, NT_ALL);
119

C RETURN VALUE

121       getnodeid() and getorigin() both return  node  identifiers.   NOTNODEID
122       (defined in <net.h>) is returned if an error occurred.  Likewise, getn‐
123       odetype() returns a valid node type or NOTNODETYPE in the case  of  er‐
124       ror.   The  return  values upon successful completion for the remaining
125       functions are described above; they return -1 if an error  occurs.   In
126       all  cases of error, the global error variable errno is set to indicate
127       the error.
128

FORTRAN RETURN VALUE

130       IGNDID() and IGORGN() both return  node  identifiers.   NOTNODEID  (see
131       CONSTANTS(5)) is returned if an error occurred.  Likewise, IGNDTP() re‐
132       turns a valid node type or NOTNODETYPE in the case of error.   The  re‐
133       turn  values upon successful completion for the remaining functions are
134       described above; they return -1 if an error occurs.
135

SEE ALSO

137       getroute(2), CONSTANTS(5)
138
139
140
141LAM 7.1.2                         March, 2006                      GETNTYPE(2)
Impressum