PVM.serialize {rpvm}R Documentation

Serialize R Objects

Description

Serialize to/from the current active send/receive buffer.

Usage

.PVM.serialize (object, refhook = NULL)
.PVM.unserialize(refhook = NULL)

Arguments

object object to serialize.
refhook hook function for handling reference objects

Details

The function .PVM.serialize writes object to the current active send buffer. Sharing of reference objects is preserved within the object but not across separate calls to .PVM.serialize. unserialize reads an object from connection. connection may also be a string.

The refhook functions can be used to customize handling of non-system reference objects (all external pointers and weak references, and all environments other than name space and package environments and .GlobalEnv). The hook function for .PVM.serialize should return a character vector for references it wants to handle; otherwise it should return NULL. The hook for .PVM.unserialize will be called with character vectors supplied to .PVM.serialize and should return an appropriate object.

Value

.PVM.serialize returns NULL; .PVM.unserialize returns the unserialized object.

Author(s)

Luke Tierney luke@stat.umn.edu

Examples

## Pack and send a matrix
## Not run: 
BUFTAG<-22
tid <- .PVM.mytid()
a <- matrix (1:20, nrow=4)
.PVM.initsend()
.PVM.serialize(a)
.PVM.send(tid, BUFTAG)
## Receive the matrix
.PVM.recv(tid, BUFTAG)
.PVM.unserialize()
## End(Not run)

[Package rpvm version 0.6-2 Index]