---
name: "pvm_getinst"
section: "3"
platform: "linux"
package: "pvm-dev"
version: "3.4.2-8"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/pvm_getinst"
---

# pvm\_getinst(3)

Returns the instance number in a group of a PVM process.

## NAME

pvm\_getinst - Returns the instance number in a group of a PVM process.

## SYNOPSIS

```
C	int inum = pvm_getinst( char *group, int tid )
Fortran	call pvmfgetinst( group, tid, inum )
```

## PARAMETERS

- group

  **Character string group name of an existing group.**\

- tid

  **Integer task identifier of a PVM process.**\

- inum

  **Integer instance number returned by the routine.** **Instance numbers start at 0 and count up.** **Values less than zero indicate an error.**

## DESCRIPTION

**The routine** *pvm\_getinst* **takes a group name** *group* **and a PVM task identifier** *tid* **and returns the unique** **instance number that corresponds to the input.** **It can be called by any task whether in the group or not.** **If pvm\_getinst is successful,** *inum* **will be \>= 0.** **If some error occurs then** *inum* **will be \< 0.**

## EXAMPLES

```
C:
	inum = pvm_getinst( "worker", pvm_mytid() );
	--------
	inum = pvm_getinst( "worker", tid[i] );

Fortran:
	CALL PVMFGETINST( 'GROUP3', TID, INUM )
```

## ERRORS

**These error conditions can be returned by** *pvm\_getinst*

- PvmSysErr

  **pvmd was not started or has crashed.**

- PvmBadParam

  **giving an invalid tid value.**

- PvmNoGroup

  **giving a non-existent group name.**

- PvmNotInGroup

  **specifying a group in which the tid is not a member.**

## SEE ALSO

**pvm\_joingroup(3PVM),** **pvm\_gettid(3PVM)**
