next up previous

3.1 C Example     continued...

Before issuing a send command, the buffer must be packed with data to be sent. The functions to pack data into the active send buffer are pvm_pkXXXX() where the XXXX indicates the type of data being packed. The data types supported by PVM (and their XXXX function designation) are byte (byte), complex (cplx), double complex (dcplx), double (double), float (float), integer (int), long (long) and short(short). The example code packs integers and uses the function pvm_pkint().

int info = pvm_pkint(int *np, int nitem, int stride)

Each of the functions outlined above has three parameters. The first is a pointer to the first item to be packed into the message, the second is the total number of items to be packed and the third is the stride to use when packing. There is also a function to pack a NULL terminated string (str) that requires only a single parameter which points to the first position of the string.