add patch to fix hardcoded num_cores in DMCfun extension included with R 4.0.x#12583
add patch to fix hardcoded num_cores in DMCfun extension included with R 4.0.x#12583boegel merged 6 commits intoeasybuilders:developfrom
Conversation
|
I think it would be good to see testing of this on different schedulers before merging. |
| num_cores <- 2L | ||
| } else { | ||
| - num_cores <- parallel::detectCores() / 2 | ||
| + num_cores <- as.numeric(Sys.getenv("PBS_NP", parallel::detectCores() / 2)) |
There was a problem hiding this comment.
Why not extend this to
Sys.getenv("PBS_NP", Sys.getenv("SLURM_CPUS_ON_NODE", parallel::detectCores() / 2))
There was a problem hiding this comment.
Or possibly the other way around seing that Slurm is more common than PBS these days.
There was a problem hiding this comment.
I have added num_cores <- as.numeric(Sys.getenv("SLURM_NTASKS", Sys.getenv("PBS_NP", parallel::detectCores() / 2))
I think SLURM_NTASKS are closer to the meaning of PBS_NP, which is the number of processors (nodes=x:ppn=y, so PBS_NP=X*Y)
There was a problem hiding this comment.
Ah, so it is MPI aware?
There was a problem hiding this comment.
Then SLURM_CPUS_ON_NODE is probably more correct.
There was a problem hiding this comment.
Honestly, I find this hairsplitting, but be it. All in all, if the user incorrectly assumes from an only OpenMP software that it is MPI, then both versions are wrong. You can argue which one is worst, though, but it does not change the fact that both are incorrect. If it is used in a correct way, both versions are just fine.
Just telling in advance, I will not compare SLURM_CPUS_ON_NODE and SLURM_NTASKS with each other and if they differ, then program will not stop nor write a friendly message that please do not use multiple nodes, because this software is only for one node.
|
@verdurin I am open for suggestions. I can only reach slurm with pbs compatibility enabled. |
|
@hajgato Patch introduces broken code it seems, |
|
@boegelbot please test @ generoso |
|
@boegel: Request for testing this PR well received on generoso PR test command '
Test results coming soon (I hope)... Details- notification for comment with ID 832597968 processed Message to humans: this is just bookkeeping information for me, |
|
Test report by @boegelbot |
|
I've tested the patched installation of |
|
Going in, thanks @hajgato! |
fixes #12569
This only solves PBS cases so other queue systems might need different solution(s)