PSEND(3PVM)
π 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:msgtagshould 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 thatbufpoints 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β stringPVM_BYTEβ bytePVM_SHORTβ shortPVM_INTβ intPVM_FLOATβ realPVM_CPLXβ complexPVM_DOUBLEβ doublePVM_DCPLXβ double complexPVM_LONGβ long integerPVM_USHORTβ unsigned short intPVM_UINTβ unsigned intPVM_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 invalidtid,msgtag, ordatatype. you gave it something it can't work with, babe. πPvmSysErrβpvmdnot 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
- debian bookworm: pvm-dev 3.4.6-5
- ubuntu jammy: pvm-dev 3.4.6-3.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms