PVM.gather {rpvm}R Documentation

Gather the data into root

Description

A specified member of the group (the root) receives mes sages from each member of the group and gathers these messages into a single array.

Usage

.PVM.gather (x, count = length (x), msgtag, group, rootginst = 0)

Arguments

x an integer or double vector of length at least count
count the number of elements to be sent to the root
msgtag an integer message tag supplied by the user.
group a character string naming the group
rootginst an integer instance number of group member who performs the gather of its array to the members of the group.

Details

.PVM.gather performs a send of messages from each member of the group to the specified root member of the group. All group members must call .PVM.gather, each sends its vector data of to the root which accumulates these messages into a single vector. The root task is identified by its instance number in the group.

x has to be a vector of storage mode integer or double. The .PVM.gather.default function just calls stop ().

.PVM.gather does not block. If a task calls .PVM.gather and then leaves the group before the root has called .PVM.gather an error may occur.

Value

On the root, a vector combining all the x's.

Author(s)

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

References

PVM documentation

See Also

.PVM.joingroup, .PVM.reduce, .PVM.scatter

Examples

gname <- "pvmtest"
## Not run: 
if (myinum == 0) {
   result <- .PVM.gather(as.integer (1:100),
                         msgtag = 11, group = gname, root = 0)
}
## End(Not run)

[Package rpvm version 0.6-2 Index]