1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
.\" $Id: pvm_scatter.3,v 1.1 1996/09/23 22:06:09 pvmsrc Exp $
.TH SCATTER 3PVM "21 April, 1994" "" "PVM Version 3.4"
.SH NAME
pvm_scatter \- Sends to each member of a group a section of an array
from a specified member of the group.
.SH SYNOPSIS
.nf
.ft B
C int info = pvm_scatter( void *result, void *data,
.br
int count, int datatype, int msgtag,
.br
char *group, int rootginst)
.br
Fortran call pvmfscatter(result, data, count, datatype,
.br
msgtag, group, rootginst, info)
.fi
.SH PARAMETERS
.IP result 0.8i
Pointer to the starting address of an array of length
.I count
of
.I datatype
which will be
overwritten by the message from the specified root member of the group.
.br
.IP data
On the root this is a
pointer to the starting address of an array
.I datatype
of local values
which are to be distributed to the members of the group.
If n is the number of members in the group, then this array of
.I datatype
should be of length at least n*\fIcount\fR.
This argument is meaningful only on the root.
.br
.IP count
Integer specifying the number of elements of
.I datatype
to be sent to each member of the group from the root.
.br
.IP datatype
Integer specifying the type of the entries in the result and data arrays.
(See below for defined types.)
.IP msgtag
Integer message tag supplied by the user.
msgtag should be >= 0. It allows the user's program to
distinguish between different kinds of messages.
.br
.IP group
Character string group name of an existing group.
.br
.IP rootginst
Integer instance number of group member who performs
the scatter of its array to the members of the group.
.br
.IP info
Integer status code returned by the routine.
Values less than zero indicate an error.
.SH DESCRIPTION
.I pvm_scatter()
performs a scatter of data from the specified root member of the group
to each of the members of the group, including itself.
All group members must call pvm_scatter(),
each receives a portion of the
.I data
array from the root in
their local
.I result
array.
It is as if the root node sends to the ith member of the group
.I count
elements from its array
.I data
starting at offset i*\fIcount\fR from the beginning of the
.I data
array.
And, it is as if, each member of the group performs a corresponding
receive of
.I count
values of
.I datatype
into its
.I result
array.
The root task is identified by its instance number in the group.
.PP
C and Fortran defined
.I datatypes
are:
.nf
C datatypes FORTRAN datatypes
-----------------------------------
PVM_BYTE BYTE1
PVM_SHORT INTEGER2
PVM_INT INTEGER4
PVM_FLOAT REAL4
PVM_CPLX COMPLEX8
PVM_DOUBLE REAL8
PVM_DCPLX COMPLEX16
PVM_LONG
.fi
.PP
In using the scatter and gather routines, keep in mind that
C stores multidimensional arrays in row order,
typically starting with an initial index of 0; whereas,
Fortran stores arrays in column order,
typically starting with an offset of 1.
.PP
The current algorithm is very simple and robust. A future implementation
may make more efficient use of the architecture to allow greater
parallelism.
.SH EXAMPLES
.nf
C:
info = pvm_scatter(&getmyrow, &matrix, 10, PVM_INT,
msgtag, "workers", rootginst);
.sp
Fortran:
CALL PVMFSCATTER(GETMYCOLUMN, MATRIX, COUNT, INTEGER4,
& MTAG, 'workers', ROOT, INFO)
.fi
.SH ERRORS
These error conditions can be returned by
.I pvm_scatter
.IP PvmNoInst
Calling task is not in the group
.IP PvmBadParam
The datatype specified is not appropriate
.IP PvmSysErr
Pvm system error
.PP
.SH SEE ALSO
pvm_bcast(3PVM),
pvm_barrier(3PVM),
pvm_psend(3PVM)
|