Skip to content

Instantly share code, notes, and snippets.

@clarkfitzg
Created October 25, 2017 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clarkfitzg/6d4e77e94ad38813f5eb9d020f20ecbf to your computer and use it in GitHub Desktop.
Save clarkfitzg/6d4e77e94ad38813f5eb9d020f20ecbf to your computer and use it in GitHub Desktop.
# Following:
# https://cran.r-project.org/web/packages/rslurm/vignettes/rslurm.html
library(rslurm)
test_func <- function(par_mu, par_sd) {
samp <- rnorm(10^6, par_mu, par_sd)
c(s_mu = mean(samp), s_sd = sd(samp))
}
pars <- data.frame(par_mu = 1:10,
par_sd = seq(0.1, 1, length.out = 10))
sjob <- slurm_apply(test_func, pars, jobname = 'test_apply',
nodes = 2, cpus_per_node = 2, submit = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment