Created
September 14, 2015 09:59
-
-
Save jlehtoma/63a584cb3bb4f23e2a6a to your computer and use it in GitHub Desktop.
Run simple R/MPI example on CSC Taito
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
# Tell all slaves to return a message identifying themselves. | |
mpi.remote.exec(paste("I am",mpi.comm.rank(),"of",mpi.comm.size())) | |
mpi.remote.exec(paste(mpi.comm.get.parent())) | |
# Send execution commands to the slaves | |
x <- 5 | |
x <- mpi.remote.exec(rnorm,x) | |
length(x) | |
x | |
mpi.close.Rslaves() | |
mpi.quit() |
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
#!/bin/bash | |
#SBATCH -J rmpi_job | |
#SBATCH -o output.txt | |
#SBATCH -e errors.txt | |
#SBATCH -t hh:mm:ss | |
#SBATCH --nodes=1 | |
#SBATCH --ntasks=12 | |
#SBATCH --mem-per-cpu=200 | |
# | |
module load R.latest | |
srun -n 12 Rmpi --no-save < rmpi_script.R |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment