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

# rpstate(2)

Report status of LAM processes on a remote node.

## NAME

rpstate - Report status of LAM processes on a remote node.

## SYNOPSIS

\#include \<preq.h\>

int rpstate(int node, int sflags, int svalue, struct pstate \*stat\_tab, int maxsize);

## ARGUMENTS

- node

  target node where selected processes are running

- sflags

  selection method

- svalue

  selection matching value, if required, otherwise ignored

- stat\_tab

  array of remote process status structures (output)

- maxsize

  size of *stat\_tab* array

## DESCRIPTION

### Selection Methods

Processes to be reported from the target node are selected by one of several methods, chosen in the *sflags* argument. The selection method codes are defined in \<preq.h\>.

- SELECT\_PID

  Select by process ID. The *svalue* argument contains the process ID.

- SELECT\_INDEX

  Select by process table index. The *svalue* argument contains the index.

- SELECT\_APPL

  Select all application (user) processes.

- SELECT\_SYS

  Select all system processes.

- SELECT\_ALL

  Select all application and all system processes.

### Remote Process Status

The status structure array, *stat\_tab*, is filled with information on the selected processes. The structure is defined in \<preq.h\>.

```
struct pstate {
	int		ps_reply;
	int		ps_index;
	int		ps_pid;
	int		ps_rtf;
	int		ps_nodeid;
	int		ps_event;
	struct kstatus	ps_kernel;
	char		ps_name[PSMAXNAME];
	char		ps_loadpt[PSMAXNAME];
};
```

- ps\_reply

  internal use by *rpstate()*

- ps\_index

  index within target node

- ps\_pid

  identifier within target node

- ps\_rtf

  runtime flags, see [rploadgo(2)](/rploadgo/2.md)

- ps\_nodeid

  parent's node identifier

- ps\_event

  parent's event for reporting process's exit

- ps\_kernel

  kernel status, see [kstate(2)](/kstate/2.md)

- ps\_name

  argv\[0\], usually the program name, see [kenter(2)](/kenter/2.md)

- ps\_loadpt

  load module filename

## RETURN VALUE

Upon successful completion, the number of selected processes is returned. This could be more or less than *maxsize*. If an error occurred, -1 is returned and the global variable *errno* is set to indicate the error.

## SEE ALSO

[kstate(2)](/kstate/2.md), [rploadgo(2)](/rploadgo/2.md)
