-
Notifications
You must be signed in to change notification settings - Fork 2
Configure openMPI on a Computing Cluster
Colby Ford edited this page Aug 15, 2018
·
1 revision
- Must use openMPI 1.X on the cluster
- Cannot use InfiniBand-version of the compiled openMPI library
- Ensure that both Rmpi and doMPI are installed and load properly
#!/bin/sh
#PBS -q clustername
#PBS -N myrunname
#PBS -l nodes=16:ppn=16
#PBS -l walltime=24:00:00
module load openmpi/1.10.0 R/3.4.3
cd $PBS_O_WORKDIR
nodecnt=`wc -l $PBS_NODEFILE | awk '{print $1}'`
echo "Node File:"
cat $PBS_NODEFILE
echo ""
echo "Executing: mpirun -quiet -np 1 --hostfile $PBS_NODEFILE R --slave -f myRscript.R"
echo ""
mpirun -quiet -np 1 --hostfile $PBS_NODEFILE R --slave -f myRscript.R
echo ""
library(doMPI)
# create and register a doMPI cluster if necessary
if (!identical(getDoParName(), 'doMPI')) {
# set count to (cores_requested-1)
cl <- startMPIcluster(count=255,verbose=TRUE)
registerDoMPI(cl)
}