-
Notifications
You must be signed in to change notification settings - Fork 4
/
linear-regression-SLURM-R
65 lines (50 loc) · 1.44 KB
/
linear-regression-SLURM-R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#SBATCH --error=lr.err
#SBATCH --output=r_linear_regression.out
#SBATCH --job-name=CSE587-R-soumasis
#SBATCH --mail-user=soumasis@buffalo.edu
#SBATCH --mail-type=ALL
#SBATCH --time=12:00:00
#SBATCH --cpus-per-task=1
#SBATCH --nodes=1
##SBATCH --partition=general-compute
# for 8-core nodes
#SBATCH --mem=24000
#SBATCH --tasks-per-node=8
#SBATCH --constraint=CPU-L5630|CPU-L5520
# for 12-core nodes
##SBATCH --mem=48000
##SBATCH --tasks-per-node=12
##SBATCH --constraint=CPU-E5645
# for 16-core nodes
##SBATCH --mem=128000
##SBATCH --tasks-per-node=16
##SBATCH --constraint=CPU-E5-2660
# for 32-core nodes
##SBATCH --mem=256000
##SBATCH --tasks-per-node=32
##SBATCH --constraint=CPU-6132HE|CPU-E7-4830|CPU-X7550
tic=`date +%s`
echo "Start Time = "`date`
#construct nodefile
SLURM_NODEFILE=my_slurm_nodes.$$
srun hostname | sort > $SLURM_NODEFILE
# load R module
module load R/3.1.2
# cd to directory from which job was submitted
cd $SLURM_SUBMIT_DIR
# compute number of processors
NPROCS=`cat $SLURM_NODEFILE | wc -l`
# set intel-mpi environment variables
# turn debugging up a bit
export I_MPI_DEBUG=5
export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so
# launch simple Rmpi example using srun
# NOTE: This requires .Rprofile file in the workdir
echo "Launching simple example"
srun -n $NPROCS Rscript linear-regression.R
echo "All Done!"
echo "End Time = "`date`
toc=`date +%s`
elapsedTime=`expr $toc - $tic`
echo "Elapsed Time = $elapsedTime seconds"