.PVM.trecv {rpvm}R Documentation

Timeout receive

Description

Checks for nonblocking message.

Usage

.PVM.trecv (tid = -1, msgtag = -1, sec = 0, usec = 0)

Arguments

tid tid of sending process (-1 matches any tid)
msgtag integer message tag (>=0) supplied by the user (-1 matches any message tag)
sec time to wait in seconds
usec time to wait in microseconds

Details

.PVM.trecv blocks the process until a message with label msgtag has arrived from tid. .PVM.trecv then places the message in a new active receive buffer, also clearing the current receive buffer. If no matching message arrives within the specified waiting time, .PVM.trecv returns without a message.

sec and usec specify how long .PVM.trecv will wait without returning a matching message. With both set to zero, .PVM.trecv behaves the same as .PVM.nrecv, which is to probe for messages and return immediately even if none are matched. Setting sec to -1 makes .PVM.trecv behave like .PVM.trecv, that is, it will wait indefinitely.

If .PVM.trecv is successful, it will return the new active receive buffer identifier. If no message is received, it returns 0. If some error occurs then the return value will be < 0.

Value

Returns the id of the new active receive buffer. -1 indicates an error.

Author(s)

Na (Michael) Li nali@umn.edu and A.J. Rossini rossini@u.washington.edu

References

PVM documentation

See Also

.PVM.nrecv, .PVM.recv

Examples

## Not run: myparent <- .PVM.parent ()
## Not run: bufid <- .PVM.trecv (myparent, 4, 2)
## Not run: if (bufid > 0) data <- .PVM.upkintvec ()

[Package rpvm version 0.6-2 Index]