build_vcluster.sh 3.26 KB
Newer Older
incardon's avatar
incardon committed
1 2 3 4
#! /bin/bash

# Make a directory in /tmp/OpenFPM_data

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

incardon's avatar
incardon 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
incardon's avatar
incardon committed
15
git clone git@ppmcore.mpi-cbg.de:incardon/openfpm_data.git OpenFPM_data
incardon's avatar
incardon committed
16 17 18

cd "$1/OpenFPM_vcluster"

incardon's avatar
incardon committed
19
if [ "$2" == "gin" ]
incardon's avatar
incardon committed
20
then
incardon's avatar
incardon committed
21 22 23
 echo "Compiling on gin\n"
 module load gcc/4.9.2
 module load openmpi/1.8.1
incardon's avatar
incardon committed
24
elif [ "$2" == "wetcluster" ]
incardon's avatar
incardon committed
25 26 27 28 29
then
 echo "Compiling on wetcluster"

## produce the module path

incardon's avatar
incardon committed
30
 export MODULEPATH="/sw/apps/modules/modulefiles:$MODULEPATH"
incardon's avatar
incardon committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44

 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

incardon's avatar
incardon committed
45
 bsub -o output_compile.%J -K -n 1 -J compile sh ./compile_script
incardon's avatar
incardon committed
46

47
## Run on the cluster
incardon's avatar
incardon committed
48
 bsub -o output_run2.%J -K -n 2 "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 2 ./src/vcluster"
incardon's avatar
incardon committed
49
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
50
 bsub -o output_run4.%J -K -n 4 "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 4 ./src/vcluster"
incardon's avatar
incardon committed
51
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
52
 bsub -o output_run8.%J -K -n 8 "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 8 ./src/vcluster"
incardon's avatar
incardon committed
53
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
54 55 56 57 58 59 60 61
 bsub -o output_run16.%J -K -n 16 "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 16 ./src/vcluster"
 if [ $? -ne 0 ]; then exit 1 ; fi
 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
incardon's avatar
incardon committed
62 63 64 65
elif [ "$2" == "taurus" ]
then
 echo "Compiling on taurus"

incardon's avatar
incardon committed
66
 echo "$PATH"
67
 module load gcc/4.8.2
incardon's avatar
incardon committed
68 69
 module load boost/1.55.0-gnu4.8
 module unload bullxmpi
incardon's avatar
incardon committed
70
 module load openmpi/1.8.5
71

incardon's avatar
incardon committed
72 73 74
 sh ./autogen.sh
 sh ./configure  CXX=mpic++
 make
incardon's avatar
incardon committed
75
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
76

incardon's avatar
incardon committed
77
 salloc --nodes=1 --ntasks-per-node=16 --time=04:00:00 --mem-per-cpu=1900 --partition=sandy mpirun -np 16 src/vcluster
incardon's avatar
incardon committed
78 79 80 81 82 83 84 85 86
 if [ $? -ne 0 ]; then exit 1 ; fi
 salloc --nodes=2 --ntasks-per-node=16 --time=04:00:00 --mem-per-cpu=1900 --partition=sandy mpirun -np 32 src/vcluster
 if [ $? -ne 0 ]; then exit 1 ; fi
 salloc --nodes=4 --ntasks-per-node=16 --time=04:00:00 --mem-per-cpu=1900 --partition=sandy mpirun -np 64 src/vcluster
 if [ $? -ne 0 ]; then exit 1 ; fi
 salloc --nodes=8 --ntasks-per-node=16 --time=04:00:00 --mem-per-cpu=1900 --partition=sandy mpirun -np 128 src/vcluster
 if [ $? -ne 0 ]; then exit 1 ; fi
 salloc --nodes=16 --ntasks-per-node=16 --time=04:00:00 --mem-per-cpu=1900 --partition=sandy mpirun -np 256 src/vcluster
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
87

incardon's avatar
incardon committed
88 89
else
 echo "Compiling general"
incardon's avatar
incardon committed
90
 sh ./autogen.sh
incardon's avatar
incardon committed
91
 sh ./configure  CXX=mpic++
incardon's avatar
incardon committed
92 93 94 95 96
 make

 mpirun -np 2 ./src/vcluster
 mpirun -np 4 ./src/vcluster

incardon's avatar
incardon committed
97 98 99
fi