---
name: "getnodes"
section: "2"
platform: "linux"
package: "lam2-dev"
version: "6.3.2-3"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/getnodes"
---

# getnodes(2)

Get array of LAM node identifiers.

## NAME

getnodes - Get array of LAM node identifiers.

## C SYNOPSIS

```
#include <net.h>
int getnodes (int *nodes, int nnodes, int nodetype, int typemask);
int getall (int *nodes, int nnodes);
int getcomps (int *nodes, int nnodes);
int getjones (int *nodes, int nnodes);
int getotbs (int *nodes, int nnodes);
```

## FORTRAN SYNOPSIS

```
subroutine GNODES (nodes, nnodes, nodetype, typemask, ierror)
subroutine GALL (nodes, nnodes, ierror)
subroutine GCOMPS (nodes, nnodes, ierror)
subroutine GJONES (nodes, nnodes, ierror)
subroutine GOTBS (nodes, nnodes, ierror)
integer nodes(*), nnodes, nodetype, typemask, ierror
```

## DESCRIPTION

*getnodes()* fills the array, *nodes*, with no more than *nnodes* node identifiers whose types match *nodetype* at the bit positions specified by *typemask*. Given sufficient space and a sufficiently large *nnodes*, all node identifiers having a node type field that satisfies the relation imposed by the *nodetype* and *typemask* arguments will be returned.

The remaining functions are wrappers for *getnodes()* that match commonly used node types.

- *getotbs()*

  OTB nodes

- *getall()*

  all nodes

- *getcomps()*

  nodes in main computing group (see [getntype(2)](/getntype/2.md))

- *getjones()*

  neighbour nodes of the caller

The node type is a combination of flags, defined in \<net.h\>, describing the capabilities of the node. Usage of the *nodetype* and *typemask* arguments in *getnodes()* is identical to [getntype(2)](/getntype/2.md). Indeed, [getntype(2)](/getntype/2.md) is usually called before *getnodes()* to count the matching nodes and thus ascertain the space requirement for the node array. No indication of the number of returned node identifiers is given by *getnodes()*.

## SEE ALSO

[getntype(2)](/getntype/2.md)
