Utilities for Parallel Computations
ts_eval
generates a thread safe version of eval
.
It uses boost mutexes provided by the synchronicity
package.
The generated function has arguments expr
and envir
, which are passed
to eval
.
ts_tempfile
generates a unique temporary filename
that includes the name of the host machine and/or the caller's process id,
so that it is thread safe.
hostfile
generates a temporary filename composed with
the name of the host machine and/or the current process id.
gVariable
generates a function that access a global static variable,
possibly in shared memory (only for numeric matrix-coercible data in this case).
It is used primarily in parallel computations, to preserve data accross
computations that are performed by the same process.
ts_eval(mutex = synchronicity::boost.mutex(), verbose = FALSE) ts_tempfile(pattern = "file", ..., host = TRUE, pid = TRUE) hostfile(pattern = "file", tmpdir = tempdir(), fileext = "", host = TRUE, pid = TRUE) gVariable(init, shared = FALSE)
boost.mutex
.tempfile
.