Commit 3e0b9a58 authored by Michael Krause's avatar Michael Krause 🎉
Browse files

R: typos in core detetection

parent 96d35e1f
Pipeline #7155 passed with stages
in 37 seconds
...@@ -114,8 +114,7 @@ Example :samp:`srun -c 16 --pty /bin/bash` ...@@ -114,8 +114,7 @@ Example :samp:`srun -c 16 --pty /bin/bash`
library(parallel) library(parallel)
library(gmp) library(gmp)
cores <- Sys.getenv("SLURM_ARRAY_TASK_ID") cores <- as.integer(Sys.getenv('SLURM_CPUS_PER_TASK', unset=1))
cores <- if (cores == '') 1 else as.numeric(cores)
data <- matrix(as.bigz(2**521)-1, 16) data <- matrix(as.bigz(2**521)-1, 16)
mclapply(data, factorize, mc.cores=cores) mclapply(data, factorize, mc.cores=cores)
...@@ -138,8 +137,7 @@ Alternatively you can use `%dopar%` and `foreach`: ...@@ -138,8 +137,7 @@ Alternatively you can use `%dopar%` and `foreach`:
library(doMC) library(doMC)
library(gmp) library(gmp)
cores <- Sys.getenv("SLURM_ARRAY_TASK_ID") cores <- as.integer(Sys.getenv('SLURM_CPUS_PER_TASK', unset=1))
cores <- if (cores == '') 1 else as.numeric(cores)
registerDoMC(cores) registerDoMC(cores)
foreach(i=seq(1,16)) %dopar% { foreach(i=seq(1,16)) %dopar% {
......
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