build_vcluster.sh 3.57 KB
Newer Older
Pietro Incardona's avatar
Pietro Incardona committed
1
2
3
4
#! /bin/bash

# Make a directory in /tmp/OpenFPM_data

Pietro Incardona's avatar
Pietro Incardona committed
5
6
7
echo "Directory: $1"
echo "Machine: $2"

Pietro Incardona's avatar
Pietro Incardona committed
8
9
10
11
12
13
14
mkdir /tmp/openfpm_vcluster
mv * .[^.]* /tmp/openfpm_vcluster
mv /tmp/openfpm_vcluster OpenFPM_vcluster

mkdir OpenFPM_vcluster/src/config

git clone git@ppmcore.mpi-cbg.de:incardon/openfpm_devices.git OpenFPM_devices
Pietro Incardona's avatar
Pietro Incardona committed
15
git clone git@ppmcore.mpi-cbg.de:incardon/openfpm_data.git OpenFPM_data
16
17
18
cd OpenFPM_data
git checkout develop
cd ..
Pietro Incardona's avatar
Pietro Incardona committed
19
20
21

cd "$1/OpenFPM_vcluster"

Pietro Incardona's avatar
Pietro Incardona committed
22
if [ "$2" == "gin" ]
Pietro Incardona's avatar
Pietro Incardona committed
23
then
Pietro Incardona's avatar
Pietro Incardona committed
24
25
26
 echo "Compiling on gin\n"
 module load gcc/4.9.2
 module load openmpi/1.8.1
Pietro Incardona's avatar
Pietro Incardona committed
27
elif [ "$2" == "wetcluster" ]
Pietro Incardona's avatar
Pietro Incardona committed
28
29
30
31
32
then
 echo "Compiling on wetcluster"

## produce the module path

Pietro Incardona's avatar
Pietro Incardona committed
33
 export MODULEPATH="/sw/apps/modules/modulefiles:$MODULEPATH"
Pietro Incardona's avatar
Pietro Incardona committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47

 script="module load gcc/4.9.2\n 
module load openmpi/1.8.1\n
module load boost/1.54.0\n
compile_options='--with-boost=/sw/apps/boost/1.54.0/'\n
\n
sh ./autogen.sh\n
sh ./configure \"\$compile_options\"  CXX=mpic++\n
make\n
if [ \"\$?\" = "0" ]; then exit 1 ; fi\n
exit(0)\n"

 echo $script | sed -r 's/\\n/\n/g' > compile_script

Pietro Incardona's avatar
Pietro Incardona committed
48
 bsub -o output_compile.%J -K -n 1 -J compile sh ./compile_script
Pietro Incardona's avatar
Pietro Incardona committed
49

50
## Run on the cluster
51
 bsub -o output_run2.%J -K -n 2 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 2 ./src/vcluster"
Pietro Incardona's avatar
Pietro Incardona committed
52
 if [ $? -ne 0 ]; then exit 1 ; fi
53
 bsub -o output_run4.%J -K -n 4 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 4 ./src/vcluster"
Pietro Incardona's avatar
Pietro Incardona committed
54
 if [ $? -ne 0 ]; then exit 1 ; fi
55
 bsub -o output_run8.%J -K -n 8 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 8 ./src/vcluster"
Pietro Incardona's avatar
Pietro Incardona committed
56
 if [ $? -ne 0 ]; then exit 1 ; fi
57
 bsub -o output_run12.%J -K -n 12 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 12 ./src/vcluster"
Pietro Incardona's avatar
Pietro Incardona committed
58
 if [ $? -ne 0 ]; then exit 1 ; fi
59
60
61
62
63
64
# bsub -o output_run32.%J -K -n 32 "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 32 ./src/vcluster"
# if [ $? -ne 0 ]; then exit 1 ; fi
# bsub -o output_run32.%J -K -n 64 "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 64 ./src/vcluster"
# if [ $? -ne 0 ]; then exit 1 ; fi
# bsub -o output_run32.%J -K -n 128 "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 128 ./src/vcluster"
# if [ $? -ne 0 ]; then exit 1 ; fi
65
66
67
68
elif [ "$2" == "taurus" ]
then
 echo "Compiling on taurus"

69
 echo "$PATH"
70
 module load gcc/4.8.2
Pietro Incardona's avatar
Pietro Incardona committed
71
 module load boost/1.55.0-gnu4.8
72
 module load openmpi/1.8.7
Pietro Incardona's avatar
Pietro Incardona committed
73
 module unload bullxmpi
74

75
 sh ./autogen.sh
76
 sh ./configure --enable-verbose CXX=mpic++
77
 make
78
 if [ $? -ne 0 ]; then exit 1 ; fi
79

80
 salloc --nodes=1 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 16 src/vcluster"
81
 if [ $? -ne 0 ]; then exit 1 ; fi
82
 salloc --nodes=2 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 32 src/vcluster"
83
 if [ $? -ne 0 ]; then exit 1 ; fi
84
 salloc --nodes=4 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 64 src/vcluster"
85
 if [ $? -ne 0 ]; then exit 1 ; fi
86
 salloc --nodes=8 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 128 src/vcluster"
87
 if [ $? -ne 0 ]; then exit 1 ; fi
88
 salloc --nodes=16 --ntasks-per-node=16 --time=00:5:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 256 src/vcluster"
89
 if [ $? -ne 0 ]; then exit 1 ; fi
90

Pietro Incardona's avatar
Pietro Incardona committed
91
92
else
 echo "Compiling general"
Pietro Incardona's avatar
Pietro Incardona committed
93
 sh ./autogen.sh
Pietro Incardona's avatar
Pietro Incardona committed
94
 sh ./configure  CXX=mpic++
Pietro Incardona's avatar
Pietro Incardona committed
95
96
97
98
 make

 mpirun -np 2 ./src/vcluster
 mpirun -np 4 ./src/vcluster
Pietro Incardona's avatar
Pietro Incardona committed
99
100
101
fi