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

NAME

6       pvm_precv - Receive a message directly into a buffer.
7
8

SYNOPSIS

10       C    int info = pvm_precv( int tid, int msgtag, char *buf,
11                                  int len, int datatype, int *atid,
12                                  int *atag, int *alen )
13
14       Fortran   call pvmfprecv( tid, msgtag, buf, len, datatype,
15                               atid, atag, alen, info )
16
17

PARAMETERS

19       tid     Integer task identifier of sending process (to match).
20
21       msgtag  Integer message tag (to match).  msgtag should be >= 0.
22
23       buf     Pointer to a buffer to receive into.
24
25       len     Length of buffer (in multiple of data type size).
26
27       datatype
28               Type of data to which buf points (see below).
29
30       atid    Returns actual TID of sender.
31
32       atag    Returns actual message tag.
33
34       alen    Returns actual message length.
35
36       info    Returns  PvmOk  on  success.  Values less than zero indicate an
37               error.
38
39

DESCRIPTION

41       The routine pvm_precv blocks the process until  a  message  with  label
42       msgtag has arrived from tid.  pvm_precv then places the contents of the
43       message in the supplied buffer, buf, up to a maximum length  of  len  *
44       (size of data type).
45
46       pvm_precv  can receive messages sent by pvm_psend, pvm_send, pvm_mcast,
47       or pvm_bcast.
48
49       A -1 in msgtag or tid matches anything.  This allows the user the  fol‐
50       lowing  options.   If  tid = -1 and msgtag is defined by the user, then
51       pvm_precv will accept a message from any process which has  a  matching
52       msgtag.   If msgtag = -1 and tid is defined by the user, then pvm_precv
53       will accept any message that is sent from process tid.  If tid = -1 and
54       msgtag = -1, then pvm_precv will accept any message from any process.
55
56       In  C the datatype parameter must be one of the following, depending on
57       the type of data to be unpacked: [Version 3.3.0 - This  parameter  only
58       determines  message  length,  not data conversion.  It only unpacks raw
59       bytes]
60           datatype    Data Type
61           PVM_STR     string
62           PVM_BYTE    byte
63           PVM_SHORT   short
64           PVM_INT     int
65           PVM_FLOAT   real
66           PVM_CPLX    complex
67           PVM_DOUBLE  double
68           PVM_DCPLX   double complex
69           PVM_LONG    long integer
70           PVM_USHORT  unsigned short int
71           PVM_UINT    unsigned int
72           PVM_ULONG   unsigned long int
73
74       In Fortran the same data types specified for unpack should be used.
75
76       The PVM model guarantees the following about message order.  If task  1
77       sends  message A to task 2, then task 1 sends message B to task 2, mes‐
78       sage A will arrive at task 2 before message B.  Moreover, if both  mes‐
79       sages arrive before task 2 does a receive, then a wildcard receive will
80       always return message A.
81
82       If pvm_precv is successful, info will be = 0.   If  some  error  occurs
83       then info will be < 0.
84
85       pvm_precv  is  blocking  which  means the routine waits until a message
86       matching the user specified tid and msgtag arrives at the  local  pvmd.
87       If  the  message has already arrived then pvm_precv returns immediately
88       with the message.
89
90       pvm_precv does not affect the state of the current receive message buf‐
91       fer (created by the other receive functions).
92

WARNINGS

94       In  some  versions  of  PVM  (CM5,  I860 and PGON), messages sent using
95       pvm_psend must be received only by pvm_precv, likewise those sent  with
96       pvm_send   must  be  received  by  pvm_recv,  pvm_nrecv  or  pvm_trecv.
97       pvm_psend  is  not  compatible  with  pvm_recv   (nor   pvm_send   with
98       pvm_precv).    In   addition,   pvm_probe  is  not  interoperable  with
99       pvm_psend.
100
101       This problem occurs because nonstandard message headers  are  used  for
102       efficiency  in  the pvm_psend function.  In the generic Unix version of
103       PVM, the calls are fully interoperable.
104
105       The message tag space is shared between pvm_send and pvm_psend, so  you
106       must  be  careful  to avoid selecting the wrong message (for example by
107       using a wildcard to match the message).
108

EXAMPLES

110       C:
111           info = pvm_precv( tid, msgtag, array, cnt, PVM_FLOAT,
112                             &src, &rtag, &rlen );
113
114       Fortran:
115           CALL PVMFPRECV( -1, 4, BUF, CNT, REAL4,
116          >                SRC, RTAG, RCNT, INFO )
117
118
119

ERRORS

121       These error conditions can be returned by pvm_precv
122
123       PvmBadParam
124              giving an invalid tid, msgtag, or datatype.
125
126       PvmSysErr
127              pvmd not responding.
128

SEE ALSO

130       pvm_psend(3PVM), pvm_recv(3PVM)
131
132
133
134                                15 March, 1994                     PRECV(3PVM)
Impressum