Commit 87034b99 authored by Michael Krause's avatar Michael Krause 🎉
Browse files

software: r registerDoMC example

parent 0e562b4d
......@@ -105,8 +105,23 @@ Timings:
user system elapsed
107.442 0.052 7.20
Alternatively you can use `%dopar%` and `foreach`:
If you want to unroll the vector operation of the whole cluster, have a look at
.. code-block:: r
library(doMC)
library(gmp)
cores <- Sys.getenv("PBS_NUM_PPN")
cores <- if (cores == '') 1 else as.numeric(cores)
registerDoMC(cores)
foreach(i=seq(1,16)) %dopar% {
factorize(matrix(as.bigz(2**521)-1))
}
If you want to unroll the vector operation to the whole cluster, have a look at
the `batchjobs`_ package.
.. _batchjobs: https://cran.r-project.org/web/packages/BatchJobs/index.html
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment