1RECV(3PVM) PVM Version 3.4 RECV(3PVM)
2
3
4
6 pvm_recv - Receive a message.
7
8
10 C int bufid = pvm_recv( int tid, int msgtag )
11
12 Fortran call pvmfrecv( tid, msgtag, bufid )
13
14
16 tid Integer task identifier of sending process supplied by the
17 user.
18
19 msgtag Integer message tag supplied by the user. msgtag should be >=
20 0.
21
22 bufid Integer returns the value of the new active receive buffer
23 identifier. Values less than zero indicate an error.
24
25
27 The routine pvm_recv blocks the process until a message with label msg‐
28 tag has arrived from tid. pvm_recv then places the message in a new
29 active receive buffer, which also clears the current receive buffer.
30
31 A -1 in msgtag or tid matches anything. This allows the user the fol‐
32 lowing options. If tid = -1 and msgtag is defined by the user, then
33 pvm_recv will accept a message from any process which has a matching
34 msgtag. If msgtag = -1 and tid is defined by the user, then pvm_recv
35 will accept any message that is sent from process tid. If tid = -1 and
36 msgtag = -1, then pvm_recv will accept any message from any process.
37
38 The PVM model guarantees the following about message order. If task 1
39 sends message A to task 2, then task 1 sends message B to task 2, mes‐
40 sage A will arrive at task 2 before message B. Moreover, if both mes‐
41 sages arrive before task 2 does a receive, then a wildcard receive will
42 always return message A.
43
44 If pvm_recv is successful, bufid will be the value of the new active
45 receive buffer identifier. If some error occurs then bufid will be <
46 0.
47
48 pvm_recv is blocking which means the routine waits until a message
49 matching the user specified tid and msgtag values arrives at the local
50 pvmd. If the message has already arrived then pvm_recv returns immedi‐
51 ately with the message.
52
53 Once pvm_recv returns, the data in the message can be unpacked into the
54 user's memory using the unpack routines.
55
56
58 C:
59 tid = pvm_parent();
60 msgtag = 4 ;
61 bufid = pvm_recv( tid, msgtag );
62 info = pvm_upkint( tid_array, 10, 1 );
63 info = pvm_upkint( problem_size, 1, 1 );
64 info = pvm_upkfloat( input_array, 100, 1 );
65
66 Fortran:
67 CALL PVMFRECV( -1, 4, BUFID )
68 CALL PVMFUNPACK( INTEGER4, TIDS, 25, 1, INFO )
69 CALL PVMFUNPACK( REAL8, MATRIX, 100, 100, INFO )
70
71
72
74 These error conditions can be returned by pvm_recv
75
76 PvmBadParam
77 giving an invalid tid value, or msgtag < -1.
78
79 PvmSysErr
80 pvmd not responding.
81
83 pvm_bufinfo(3PVM), pvm_getminfo(3PVM), pvm_nrecv(3PVM),
84 pvm_unpack(3PVM), pvm_probe(3PVM), pvm_send(3PVM), pvm_mcast(3PVM)
85
86
87
88 30 August, 1993 RECV(3PVM)