---
name: "pvm_catchout"
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_catchout"
---

# pvm\_catchout(3)

Catch output from child tasks.

## NAME

pvm\_catchout - Catch output from child tasks.

## SYNOPSIS

```
C	#include <stdio.h>
	int info = pvm_catchout( FILE *ff )
Fortran	call pvmfcatchout( onoff, info )
```

## PARAMETERS

- ff

  **File descriptor on which to write collected output.**\

- onoff

  **Integer parameter.  Turns output collection on or off.**\

- info

  **Integer status code returned by the routine.** **Values less than zero indicate an error.**

## DESCRIPTION

**The routine** *pvm\_catchout* causes the calling task (the parent) to catch output from tasks spawned after the call to pvm\_catchout. Characters printed on *stdout* or *stderr* in children tasks are collected by the pvmds and sent in control messages to the parent task, which tags each line and appends it to the specified file. Output from grandchildren (spawned by children) tasks is also collected, provided the children don't reset *PvmOutputTid*.

If option *PvmShowTids* (see *pvm\_setopt*) is true (nonzero), output is printed as shown below, tagged with the task id where the output originated:

```
	[txxxxx] BEGIN
	[txxxxx] (text from child task)
	[txxxxx] END
```

The output from each task includes one BEGIN line and one END line, with whatever the task prints in between. If PvmShowTids is false, raw output is printed with no additional information.

In C, the output file descriptor may be specified. Giving a null pointer turns output collection off. In Fortran, output collection can only be turned on or off, and is logged to stdout of the parent task.

If *pvm\_exit* is called while output collection is in effect, it will block until all tasks sending it output have exited, in order to print all their output. To avoid this, output collection can be turned off by calling pvm\_catchout(0) before calling pvm\_exit.

pvm\_catchout() always returns 0.

## EXAMPLES

```
C:
	#include <stdio.h>
	pvm_catchout(stdout);

Fortran:
	CALL PVMFCATCHOUT( 1, INFO )
```

## SEE ALSO

pvm\_exit(3PVM), pvm\_setopt(3PVM), pvm\_spawn(3PVM)
