build_vcluster.sh 1.51 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 24 25
 echo "Compiling on gin\n"
 module load gcc/4.9.2
 module load openmpi/1.8.1
fi

incardon's avatar
incardon committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
if [ "$2" == "wetcluster" ]
then
 echo "Compiling on wetcluster"

## produce the module path

export MODULEPATH="/sw/apps/modules/modulefiles:$MODULEPATH"

 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
47
 bsub -o output_compile.%J -K -n 1 -J compile sh ./compile_script
incardon's avatar
incardon committed
48

49
## Run on the cluster
incardon's avatar
incardon committed
50
 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
51
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
52
 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
53
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
54
 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
55
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
56 57 58
fi