Last active
August 29, 2015 14:09
-
-
Save sachsmc/541c0f50101a5940e97e to your computer and use it in GitHub Desktop.
Parallel Jobs on Biowulf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make_swarmfile <- function(id_vector, scriptfile = "run.R", options = "--vanilla", outfile = "Rjobs"){ | |
runlist <- paste0("Rscript ", options, " ", scriptfile, " ", id_vector, " > run-", id_vector, ".Rout") | |
cat(runlist, file = outfile, sep = "\n") | |
} | |
make_swarmfile(1:1000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rscript --vanilla run.R 1 > run-1.Rout | |
Rscript --vanilla run.R 2 > run-2.Rout | |
Rscript --vanilla run.R 3 > run-3.Rout | |
Rscript --vanilla run.R 4 > run-4.Rout | |
Rscript --vanilla run.R 5 > run-5.Rout | |
Rscript --vanilla run.R 6 > run-6.Rout | |
Rscript --vanilla run.R 7 > run-7.Rout | |
Rscript --vanilla run.R 8 > run-8.Rout | |
Rscript --vanilla run.R 9 > run-9.Rout | |
Rscript --vanilla run.R 10 > run-10.Rout | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
args <- commandArgs() | |
mean <- as.numeric(args[length(args)]) | |
sample = rnorm(4444, mean) | |
saveRDS(sample, file = paste0("sample_", mean, ".RDS")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swarm -f Rjobs --module R |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran into problems on a simulation and perused the user guide (http://biowulf.nih.gov/user_guide.html), and found:
and found this.
So I changed
to
And it ...... WORKED!!!!!!!!!!!!
And when that didn't work, I
and it worked. I didn't think
-g 4
could go bigger than 4.