1SIBLINGS(3PVM)                  PVM Version 3.4                 SIBLINGS(3PVM)
2
3
4

NAME

6       pvm_siblings  -  return the number and associated task ids of processes
7       that were started together in a single spawn call.
8
9

SYNOPSIS

11       C    int ntids = pvm_siblings( int **tids )
12
13       Fortran   call pvmfsiblings( ntids, index, sibling )
14
15

PARAMETERS

17       ntids   Returns the number of tids that were  spawned  together.  Value
18               less than 0 indicates an error.
19
20       tids    Pointer  to  the  array  of  tids  that  contains the siblings.
21               Indexed from 0 to (ntids - 1)
22
23       index   Integer index of tid to be returned in sibling. If index is set
24               to  -1,  then  sibling  is unchanged. Otherwise, must be in the
25               range [0, ntids - 1]
26
27       sibling When index is in the range [0, ntids -1], this contains the tid
28               of the desired index.
29
30

DESCRIPTION

32       The routine pvm_siblings returns the number of tasks and a list of task
33       ids of processes that were spawned together in a single spawn call. The
34       spawning task multicasts the list of successful to the spawned tasks so
35       that each task has an identical copy of the sibling list.  pvm_siblings
36       uses  local  storage  to keep the list of tids and does not update this
37       list when sibling tasks exit the virtual machine.  The FORTRAN  version
38       allows calling programs read a particular index in the internal sibling
39       array.  If pvm_siblings is successful, ntids will  be   >  0.  If  some
40       error occurs then ntids will be < 0.
41
42       pvm_siblings  is  designed  to  simplify the logic in static spmd-style
43       programs. By giving tasks an identical list of tids and its size,  pro‐
44       grams  may  self  size  and  treat  the  sibling  as static map between
45       instances and tasks. The internal list  is  not  updated  when  sibling
46       tasks  exit  the virtual machine and should be treated as a snapshot of
47       the parallel program when it was first started.
48
49       If a task was started by pvm_spawn, then pvm_siblings will return ntids
50       = 1 and
51
52       ntids = 1 and tids will contain a single entry identical to the task id
53       returned by pvm_mytid()
54
55
56

EXAMPLES

58       C:
59            int *tids;
60            ntids = pvm_siblings(&tids);
61
62       Fortran:
63            INTEGER TIDS(0:MAXNPROC)
64            CALL PVMFSIBLINGS(NTIDS, -1, IDUM)
65            DO I = 0, NTIDS-1
66               CALL PVMFSIBLINGS(NTIDS, I, TIDS(I))
67
68

ERRORS

70       pvm_siblings can return the following error codes
71
72       PvmNoTask
73              No task at that index, or index is invalid.
74
75

SEE ALSO

77       pvm_spawn(3PVM), pvm_mytid(3PVM), pvm_parent(3PVM)
78
79
80
81
82                                 26 June, 1997                  SIBLINGS(3PVM)
Impressum