r - Using knitr with cluster computing -
i have r script needs run repeatedly. (for concreteness, talking 500-1000 independent computationally-intensive mcmc chains want summarize in few key plots @ end.) school has server available uses queuing system makes these computations feasible. right submit multiple jobs "short" queue since less overburdened "multicore" or "long" job queues. have been running having r script called multiple times, submitting 50 jobs of 10 chains apiece , saving results single output file appending. job submission code:
for arrayvar in `seq 1 1 50` bsub -q short -u me@school.edu r cmd batch "code.r --args arg1 = $arrayvar" done
arrayvar used setting random number seed. once jobs have completed, plotting done in separate script.
for homework assignments , previous research, have used knitr rstudio combine latex notes r code. end result single .rnw generates reproducible document containing notes, code, , results. liked approach better since sure plots/results corresponded code version saw in front of me. possible similar here there 1 file re-run reproduce findings? new using cluster , r without rstudio.
Comments
Post a Comment