Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions easybuild/easyconfigs/r/R/DMCfun-2.0.0_fix-parallel-detect.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# parallal::detectCores() detects physical cores and not available cores. It is ususally problem in queue systems
# like PBS or Slurm. This patch gives solution for that problem for PBS and with Slurm with PBS compatibility switched
# on. For other queue systems, a different solutiom might needed.
# April 13th 2021 by B. Hajgato (UGent)
# Updated for 2.0.0 by Simon Branford (University of Birmingham)
diff -ru DMCfun.orig/MD5 DMCfun/MD5
--- DMCfun.orig/MD5 2021-01-10 18:50:10.000000000 +0100
+++ DMCfun/MD5 2021-04-13 09:31:31.242654188 +0200
@@ -4,7 +4,7 @@
a835c7e49694b2c835c438362b16946f *R/DMCfun.R
034299149a3219bf581d440b19d94fbb *R/RcppExports.R
7d89e703313977e0f0390c301ba41719 *R/dmcData.R
-a3141dac9d27d87db3494c293328358d *R/dmcFit.R
+afbe1e78cad3156de24ae67dd94153c0 *R/dmcFit.R
2c816b9074882e79af599451d079723d *R/dmcSim.R
9acbbd1c38bace26bed9c6a50f7c82ea *R/methods.R
169bfcbfb92b758fb0dd18e481711aa8 *R/plot.R
diff -ru DMCfun.orig/R/dmcFit.R DMCfun/R/dmcFit.R
--- DMCfun.orig/R/dmcFit.R 2020-12-03 18:53:03.000000000 +0100
+++ DMCfun/R/dmcFit.R 2021-04-13 09:28:47.506520017 +0200
@@ -159,7 +159,7 @@
if (nzchar(chk) && (chk == "true")) {
num_cores <- 2L
} else {
- num_cores <- parallel::detectCores() / 2
+ num_cores <- as.numeric(Sys.getenv("SLURM_CPUS_ON_NODE", Sys.getenv("PBS_NUM_PPN", parallel::detectCores() / 2)))
}

# Older code (pre June 2020) used doSNOW progress bar
@@ -297,7 +297,7 @@
if (nzchar(chk) && (chk == "true")) {
num_cores <- 2L
} else {
- num_cores <- parallel::detectCores() / 2
+ num_cores <- as.numeric(Sys.getenv("SLURM_CPUS_ON_NODE", Sys.getenv("PBS_NUM_PPN", parallel::detectCores() / 2)))
}
cl <- parallel::makeCluster(num_cores)
invisible(parallel::clusterExport(cl = cl, varlist=c("dmcSim", "calculateCostValue")))
Loading