PVM.pack {rpvm}R Documentation

Packing data

Description

Pack data into current active send buffer.

Usage

.PVM.pkdouble (data = 0.0, stride = 1)
.PVM.pkint (data = 0, stride = 1)
.PVM.pkstr (data = "")

.PVM.pkintvec (data)
.PVM.pkdblvec (data)
.PVM.pkstrvec (data)

.PVM.pkintmat (data)
.PVM.pkdblmat (data)
.PVM.pkstrmat (data)

.PVM.pkfactor (data)

Arguments

data data to be packed.
stride the stride to be used when packing the items. For example, if stride = 2 with .PVM.pkdouble then every other element in the vector data will be packed.

Details

The first three functions are low-level correspondents of the PVM packing routines for packing double, integer arrays and a single character string. In particular, the number of item packed is not passed and has to be specified when unpacking the data.

The other functions also pack the dimension information therefore there is no need to specify length and the correct dimension will be automatically recovered when corresponding unpack functions are used.

Value

.PVM.pkstrvec returns the maximum length of the strings packed. Others return 0 if succeeded or -1 if failed.

Note

The PVM C library supports a variety of data types. Since R doesn't have that many types, most are irrelevant.

To passing data between R process, there is in general no need to distinguish between integer and double (except for efficiency consideration). .PVM.dblvec and .PVM.dblmat are recommended for all numerical data.

.PVM.pkstr and .PVM.upkstr are mainly for communicating with C functions.

Special values such as NAs, NaNs, Infs, etc., are not supported at this point.

Author(s)

Na (Michael) Li nali@umn.edu and A.J. Rossini rossini@u.washington.edu

References

PVM documentation

See Also

PVM.unpack

Examples

## Pack and send a matrix
a <- matrix (1:20, nrow=4)
## Not run: .PVM.pkdblmat (a)

[Package rpvm version 0.6-2 Index]