1SCATTER(3PVM) PVM Version 3.4 SCATTER(3PVM)
2
3
4
6 pvm_scatter - Sends to each member of a group a section of an array
7 from a specified member of the group.
8
9
11 C int info = pvm_scatter( void *result, void *data,
12 int count, int datatype, int msgtag,
13 char *group, int rootginst)
14
15 Fortran call pvmfscatter(result, data, count, datatype,
16 msgtag, group, rootginst, info)
17
18
20 result Pointer to the starting address of an array of length count of
21 datatype which will be overwritten by the message from the
22 specified root member of the group.
23
24 data On the root this is a pointer to the starting address of an
25 array datatype of local values which are to be distributed to
26 the members of the group. If n is the number of members in the
27 group, then this array of datatype should be of length at least
28 n*count. This argument is meaningful only on the root.
29
30 count Integer specifying the number of elements of datatype to be
31 sent to each member of the group from the root.
32
33 datatype
34 Integer specifying the type of the entries in the result and
35 data arrays. (See below for defined types.)
36
37 msgtag Integer message tag supplied by the user. msgtag should be >=
38 0. It allows the user's program to distinguish between differ‐
39 ent kinds of messages.
40
41 group Character string group name of an existing group.
42
43 rootginst
44 Integer instance number of group member who performs the scat‐
45 ter of its array to the members of the group.
46
47 info Integer status code returned by the routine. Values less than
48 zero indicate an error.
49
50
51
53 pvm_scatter() performs a scatter of data from the specified root member
54 of the group to each of the members of the group, including itself.
55 All group members must call pvm_scatter(), each receives a portion of
56 the data array from the root in their local result array. It is as if
57 the root node sends to the ith member of the group count elements from
58 its array data starting at offset i*count from the beginning of the
59 data array. And, it is as if, each member of the group performs a cor‐
60 responding receive of count values of datatype into its result array.
61 The root task is identified by its instance number in the group.
62
63 C and Fortran defined datatypes are:
64 C datatypes FORTRAN datatypes
65 -----------------------------------
66 PVM_BYTE BYTE1
67 PVM_SHORT INTEGER2
68 PVM_INT INTEGER4
69 PVM_FLOAT REAL4
70 PVM_CPLX COMPLEX8
71 PVM_DOUBLE REAL8
72 PVM_DCPLX COMPLEX16
73 PVM_LONG
74
75 In using the scatter and gather routines, keep in mind that C stores
76 multidimensional arrays in row order, typically starting with an ini‐
77 tial index of 0; whereas, Fortran stores arrays in column order, typi‐
78 cally starting with an offset of 1.
79
80 The current algorithm is very simple and robust. A future implementa‐
81 tion may make more efficient use of the architecture to allow greater
82 parallelism.
83
84
86 C:
87 info = pvm_scatter(&getmyrow, &matrix, 10, PVM_INT,
88 msgtag, "workers", rootginst);
89
90 Fortran:
91 CALL PVMFSCATTER(GETMYCOLUMN, MATRIX, COUNT, INTEGER4,
92 & MTAG, 'workers', ROOT, INFO)
93
94
96 These error conditions can be returned by pvm_scatter
97
98 PvmNoInst
99 Calling task is not in the group
100
101 PvmBadParam
102 The datatype specified is not appropriate
103
104 PvmSysErr
105 Pvm system error
106
108 pvm_bcast(3PVM), pvm_barrier(3PVM), pvm_psend(3PVM)
109
110
111
112 21 April, 1994 SCATTER(3PVM)