Skip to content

Instantly share code, notes, and snippets.

@jlehtoma
Created September 14, 2015 09:59
Show Gist options
  • Save jlehtoma/63a584cb3bb4f23e2a6a to your computer and use it in GitHub Desktop.
Save jlehtoma/63a584cb3bb4f23e2a6a to your computer and use it in GitHub Desktop.
Run simple R/MPI example on CSC Taito
# 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()
#!/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