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.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
mutex |
a mutex or a mutex descriptor.
If missing, a new mutex is created via the function |
verbose |
a logical that indicates if messages should be printed when locking and unlocking the mutex. |
pattern |
a non-empty character vector giving the initial part of the name. |
... |
extra arguments passed to |
host |
logical that indicates if the host machine name should be appear in the filename. |
pid |
logical that indicates if the current process id be appear in the filename. |
tmpdir |
a non-empty character vector giving the directory name |
fileext |
a non-empty character vector giving the file extension |
init |
initial value |
shared |
a logical that indicates if the variable should be stored in shared memory or in a local environment. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.