| PVM.gather {rpvm} | R Documentation |
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.
.PVM.gather (x, count = length (x), msgtag, group, rootginst = 0)
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. |
.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.
On the root, a vector combining all the x's.
Na (Michael) Li nali@umn.edu and A.J. Rossini rossini@u.washington.edu
PVM documentation
.PVM.joingroup, .PVM.reduce,
.PVM.scatter
gname <- "pvmtest"
## Not run:
if (myinum == 0) {
result <- .PVM.gather(as.integer (1:100),
msgtag = 11, group = gname, root = 0)
}
## End(Not run)