View source: R/RhpcSerialzie.R
| Rhpc_serialize | R Documentation |
Serialize R objects for transmission or storage, and unserialize them back.
Rhpc_serialize(obj)
Rhpc_serialize_onlysize(obj)
Rhpc_serialize_norealloc(obj)
Rhpc_unserialize(obj)
obj |
R object to serialize, or serialized object to unserialize |
These functions provide low-level serialization utilities for handling R objects:
Rhpc_serializeFully serializes an object to raw bytes, allocating necessary memory
Rhpc_serialize_onlysizeReturns only the size needed for serialization without actual serialization
Rhpc_serialize_noreallocSerializes without reallocating memory (for efficiency)
Rhpc_unserializeReconstructs an R object from its serialized form
These functions are primarily intended for internal Rhpc use but may be useful for debugging or advanced users.
For Rhpc_serialize: raw vector containing serialized data
For Rhpc_serialize_onlysize: integer giving the size in bytes
For Rhpc_serialize_norealloc: raw vector containing serialized data
For Rhpc_unserialize: original R object
## Serialization example (executable without MPI)
data_to_serialize <- list(a = 1:5, b = c("x", "y", "z"))
serialized <- Rhpc_serialize(data_to_serialize)
deserialized <- Rhpc_unserialize(serialized)
stopifnot(identical(data_to_serialize, deserialized))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.