TEAM(1)

NAME
team - parallel "pipe", allows asynchronous io

SYNOPSIS
team [-r] [-v] [-i volsize [b|k|m]] [-o volsize [b|k|m]] [blocksize [ [b|k|m] [processes]]

DESCRIPTION
Team just copies its standard input to its standard output. It does so however forking a team of independent processes (default is 4), arranged in a ring, with reads overlapped with writes.

Each process will wait for the end of the read phase of previous process, will then read blocksize bytes (or 512 byte blocks if suffixed with b or kilobytes if suffixed with k, or megabytes if suffixed with m; the default is 20k) from its standard input, activate the next process read phase, wait for the previous process write phase end, then write to its standard output, and activate the next process write phase.

If the input or output volume ends or an IO error is detected, team will ask wehtether the user wants to continue (but only if the concerned volume is a block or character device and the program's standard error channel is a tty device). Possible answers are

c   This means that the user wishes to continue, but the file pointer shall be reset to the beginning of the volume, as a new volume has been started anew. This is the the answer to give on end of volume when writing to multiple floppies, etc...

y   The user simply wishes to continue, without any change.

n   The user wishes to stop; the program will be terminated or aborted.

There are just three options, as follows:

-i  The value that follows the option is the assumed volume size of the input, and it is expressed in the same units as the buffer size.

-o  The value that follows the option is the assumed volume size of the output, and it is expressed in the same units as the buffer size.

-v  If specified as each buffer is read or written the total number of kilobytes read or written that far is printed.

-r  If specified the number of kilobytes processed and the number of seconds taken is not printed at the end of the run.

Team consumes system time to synchronize and task switch among its processes; also, in order to avoid slowing it, it is best run on a quiescent system.

This program is most useful for output to a device, especially where a streaming tape is involved. It may be used to advantage with disc to disc and disc to tape copies.

EXAMPLES
find dir -print | cpio -oBc | team 20k 8 >/dev/rmt0
team 20k 4 </dev/rmt0 | cpio -iBcdmu
pax -w -b 4k * | team -o 1200k 15k 2 >/dev/rdsk/f0t

ADVICE
You are advised to experiment with different combinations of block size and number of processes; each program used with team works best with certain parameters, and performance depends even more strongly on the output device, so experiment with parameters also for this (it seems that the blocking factor of the process that feeds team ought to be inferior to that given to it, and possibly inferior to the limit on the size of a pipe for your version of the system). Team ought to be adaptive, and adjust dynamically both parameters, in order to reach a state where there is no pause between each stage of the ring. This is too difficult to achieve under UNIX.

Notice also that this program will read and write blocks all of the same size as prescribed, except the last, even when reading from pipes; if a read from its input supplies less bytes than the prescribed block size, this program will read again until its buffer is filled to norm or the input finishes.

A final note: it is usually advantageous to give to team a block size that is a multiple of the block size produced by the program before it in a pipeline. Notice that in many cases, such as the tape archival programs, the output will not be directly recognizable to the tape archiver in input, but will have to be reblocked back to the blocksize expected by the tape archiver either by way of dd or reapplication of team, that is much faster of course.

BUGS
Team will emit a number of messages comprehensible only to the author in case of errors. Plase note them and report them to the author.

This is not strictly a bug in this program, but rather a limitation; some device drivers will have problems when you change volume when this program asks you whether to continue operation. They require that the device be closed and opened again whenever a volume is changed. Unfortunately this cannot be done, given the structure of team; with such device drivers you effectively cannot use team to write multiple volumes.

Some device drivers, on physical end of file or volume while writing do not do the decent thing, and write a legible truncated block and return its length; some drivers, e.g. some tape drivers, handle physical eof on write quite badly. With these drivers you had better use the -o option to set a logical EOF if you want to use multiple volumes. As an hint, give the volume size as about five percent less than the nominal. Whatever value you use for output, take not of it, as you will have to use exactly the same value for input!

SEE ALSO
volcopy(8)
cpio(1)
tar(1)
dump(8)

AUTHOR
Piercarlo Grandi, Milano.