cc_staff
239
edits
(Marked this version for translation) |
(update instructions to use openmpi/1.10.7) |
||
Line 92: | Line 92: | ||
<!--T:20--> | <!--T:20--> | ||
module spider r | module spider r | ||
<!--T:21--> | <!--T:21--> | ||
In this case we choose the latest (as of November, 2017): | In this case we choose the latest (as of November, 2017), and also load the required OpenMPI module: | ||
<!--T:22--> | <!--T:22--> | ||
module load r/3.4.0 | module load r/3.4.0 | ||
module load openmpi/1.10.7 | |||
Line 111: | Line 112: | ||
<!--T:26--> | <!--T:26--> | ||
mkdir -p ~/local/R_libs/ | mkdir -p ~/local/R_libs/ | ||
export R_LIBS=~/local/R_libs/ | export R_LIBS=~/local/R_libs/ | ||
Line 123: | Line 124: | ||
<!--T:29--> | <!--T:29--> | ||
This | This uses OpenMPI version 1.10.7 which is needed to spawn processes correctly (the default MPI module 2.1.1 has a problem with that at present. | ||
====Running==== <!--T:30--> | ====Running==== <!--T:30--> | ||
Line 131: | Line 132: | ||
<!--T:32--> | <!--T:32--> | ||
#Tell all slaves to return a message identifying themselves. | #Tell all slaves to return a message identifying themselves. | ||
library("Rmpi") | library("Rmpi") | ||
sprintf("TEST mpi.universe.size() = %i", mpi.universe.size()) | sprintf("TEST mpi.universe.size() = %i", mpi.universe.size()) | ||
Line 150: | Line 151: | ||
<!--T:34--> | <!--T:34--> | ||
#!/bin/bash | #!/bin/bash | ||
#SBATCH --account=def-ppomorsk # replace this with your own account | #SBATCH --account=def-ppomorsk # replace this with your own account | ||
#SBATCH --ntasks=5 # number of MPI processes | #SBATCH --ntasks=5 # number of MPI processes | ||
Line 156: | Line 157: | ||
#SBATCH --time=0-00:15 # time (DD-HH:MM) | #SBATCH --time=0-00:15 # time (DD-HH:MM) | ||
module load r/3.4.0 | module load r/3.4.0 | ||
module load openmpi/1.10.7 | |||
export R_LIBS=~/local/R_libs/ | export R_LIBS=~/local/R_libs/ | ||
mpirun -np 1 R CMD BATCH test.R test.txt | mpirun -np 1 R CMD BATCH test.R test.txt | ||
Line 163: | Line 165: | ||
<!--T:36--> | <!--T:36--> | ||
sbatch job.sh | sbatch job.sh | ||
<!--T:37--> | <!--T:37--> |