PSEND(3PVM)

πŸ“¦ version 3.4.6, in debian bookworm, ubuntu jammy

πŸ’Œ PSEND(3PVM) β€” pvm_psend, the pack-and-send-it-all-in-one-call icon

ok so bestie. welcome to the PVM Version 3.4 manual, page PSEND(3PVM). this one is literally the shortcut of your dreams: instead of packing stuff up all fancy and then sending it, you just... do both. at once. one call. main character energy fr fr. πŸ’…


✨ NAME ✨

pvm_psend β€” pack and send data in one call.

like, that's it. that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

C    int info = pvm_psend( int tid, int msgtag, char *buf,
                           int len, int datatype )
Fortran   call pvmfpsend( tid, msgtag, buf, len, datatype,
                        info )

πŸ’– PARAMETERS πŸ’–

  • tid β€” the integer task identifier of the destination process. who's getting this message? them. πŸ‘‘
  • msgtag β€” an integer message tag that you supply, girl. it labels the message. and listen: msgtag should be >= 0. no negative tags, we don't do that here. πŸ™…
  • buf β€” a pointer to the buffer you wanna send. the goods. the content. ✨
  • len β€” the length of the buffer, and it's measured in multiples of the data type size. important!! don't just throw raw byte counts at it, okay? 😭
  • datatype β€” the type of data that buf points at (full list further down, keep reading bestie πŸ¦‹).
  • info β€” the integer status code that the routine hands back to you. your lil report card. πŸ’œ

πŸ¦‹ DESCRIPTION πŸ¦‹

ok so here's the tea. pvm_psend takes a pointer to a buffer buf, its length len, and its data type datatype, and sends that data directly to the PVM task identified by tid. msgtag is what you use to label the content of the message β€” like a little name tag at a party but for data. πŸŽ€

if pvm_psend is successful, info will be 0. if some error happens, then info will be < 0. that's the whole mood. 🫢

data sent with pvm_psend can be received by pvm_precv, pvm_recv, pvm_trecv, or pvm_nrecv.

πŸ’‘ also pvm_psend is asynchronous, bestie. computation on the sending processor resumes as soon as the buffer is safe for reuse. this is the opposite of synchronous communication, where the sending processor just stops and waits, frozen, until the matching receive is executed by the receiving processor. no waiting around for us, we're busy. πŸ’…

in C, the datatype parameter must be one of the following, depending on the type of data you're sending:

⚠️ [Version 3.3.0 β€” this parameter only determines message length, not data conversion. It only sends raw bytes] ⚠️
  • PVM_STR β€” string
  • PVM_BYTE β€” byte
  • PVM_SHORT β€” short
  • PVM_INT β€” int
  • PVM_FLOAT β€” real
  • PVM_CPLX β€” complex
  • PVM_DOUBLE β€” double
  • PVM_DCPLX β€” double complex
  • PVM_LONG β€” long integer
  • PVM_USHORT β€” unsigned short int
  • PVM_UINT β€” unsigned int
  • PVM_ULONG β€” unsigned long int

in Fortran, use the same data types that you'd specify for pack. same energy, different language. 🌈

now, the PVM model guarantees the following about message order (and this is lowkey iconic of it): if task 1 sends message A to task 2, and then task 1 sends message B to task 2, message A will arrive at task 2 before message B. moreover, if both messages arrive before task 2 does a receive, then a wildcard receive will always return message A. order is respected. periodt. ✨

and one more thing: pvm_psend does not affect the state of the current outgoing message buffer (the one created by pvm_initsend and used by pvm_send). it minds its own business. πŸ™ˆ


πŸ’€ WARNINGS πŸ’€

🚨 okay this part matters, so pay attention bestie 🚨

in some versions of PVM (CM5, I860 and PGON), messages sent using pvm_psend must be received only by pvm_precv, and likewise those sent with pvm_send must be received by pvm_recv, pvm_nrecv or pvm_trecv. pvm_psend is not compatible with pvm_recv (nor is pvm_send with pvm_precv). in addition, pvm_probe is not interoperable with pvm_psend.

why is it like this?? because nonstandard message headers are used for efficiency in the pvm_psend function. it's a tradeoff, girl. in the generic Unix version of PVM, the calls are fully interoperable. so like... depends where you're running. 😭

also!! the message tag space is shared between pvm_send and pvm_psend, so you must be careful to avoid selecting the wrong message β€” for example by using a wildcard to match the message. you've been warned. πŸ’€


🌟 EXAMPLES 🌟

C:

info = pvm_psend( tid, msgtag, array, 1000, PVM_FLOAT );

Fortran:

CALL PVMFPSEND( TID, MSGTAG, BUF, CNT, REAL4, INFO )

look at that. one line. slay. πŸ‘‘


πŸ”₯ ERRORS πŸ”₯

these error conditions can be returned by pvm_psend:

  • PvmBadParam β€” giving an invalid tid, msgtag, or datatype. you gave it something it can't work with, babe. 😭
  • PvmSysErr β€” pvmd not responding. the daemon is ghosting you. πŸ’€

🫢 SEE ALSO 🫢

  • pvm_precv(3PVM)
  • pvm_send(3PVM)

ok that's the whole page, bestie, you're officially a pvm_psend girlie now. this was PVM Version 3.4, dated 15 March, 1994 β€” yes she's vintage, yes she still ate. go forth and pack-and-send responsibly. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸŒˆβ­πŸ’œ

πŸ“¦ where this page comes from