build_pdata.sh 5.04 KB
Newer Older
incardon's avatar
incardon committed
1 2 3 4 5 6 7
#! /bin/bash

# Make a directory in /tmp/OpenFPM_data

echo "Directory: $1"
echo "Machine: $2"

8
mkdir src/config
incardon's avatar
incardon committed
9

10
git submodule init
11
git submodule update
incardon's avatar
incardon committed
12

13
cd openfpm_data
incardon's avatar
incardon committed
14 15 16 17
git checkout develop
cd ..

if [ "$2" == "gin" ]
incardon's avatar
incardon committed
18
then
incardon's avatar
incardon committed
19
 echo "Compiling on gin\n"
incardon's avatar
incardon committed
20 21
 source ~/.bashrc
 sh ./autogen.sh
incardon's avatar
incardon committed
22
 module load gcc/4.9.2
incardon's avatar
incardon committed
23
 ./install -s
incardon's avatar
incardon committed
24
 make
incardon's avatar
incardon committed
25

incardon's avatar
incardon committed
26
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
27
 mpirun -np 2 ./src/pdata
incardon's avatar
incardon committed
28
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
29
 mpirun -np 3 ./src/pdata
incardon's avatar
incardon committed
30
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
31
 mpirun -np 4 ./src/pdata
incardon's avatar
incardon committed
32
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
33
 mpirun -np 5 ./src/pdata
incardon's avatar
incardon committed
34
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
35
 mpirun -np 6 ./src/pdata
incardon's avatar
incardon committed
36
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
37
 mpirun -np 7 ./src/pdata
incardon's avatar
incardon committed
38
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
39
 mpirun -np 8 ./src/pdata
incardon's avatar
incardon committed
40
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
41
 mpirun -np 9 ./src/pdata
incardon's avatar
incardon committed
42
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
43
 mpirun -np 10 ./src/pdata
incardon's avatar
incardon committed
44
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
45
 mpirun -np 11 ./src/pdata
incardon's avatar
incardon committed
46
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
47
 mpirun -np 12 ./src/pdata
incardon's avatar
incardon committed
48
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
49 50 51 52 53 54
elif [ "$2" == "wetcluster" ]
then
 echo "Compiling on wetcluster"

## produce the module path

incardon's avatar
incardon committed
55
 source ~/.bashrc
incardon's avatar
incardon committed
56 57 58
 module load gcc/4.9.2
 module load openmpi/1.8.1
 module load boost/1.54.0
incardon's avatar
incardon committed
59

incardon's avatar
incardon committed
60
 sh ./autogen.sh
incardon's avatar
incardon committed
61
 ./install -s -c "--with-boost=/sw/apps/boost/1.54.0/"  CXX=mpic++
incardon's avatar
incardon committed
62
 make
incardon's avatar
incardon committed
63
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
64

incardon's avatar
incardon committed
65
 ## Run on the cluster
incardon's avatar
incardon committed
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
 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/pdata"
 if [ $? -ne 0 ]; then exit 1 ; fi
 bsub -o output_run3.%J -K -n 3 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 3 ./src/pdata"
 if [ $? -ne 0 ]; then exit 1 ; fi
 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/pdata"
 if [ $? -ne 0 ]; then exit 1 ; fi
 bsub -o output_run5.%J -K -n 5 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 5 ./src/pdata"
 if [ $? -ne 0 ]; then exit 1 ; fi
 bsub -o output_run6.%J -K -n 6 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 6 ./src/pdata"
 if [ $? -ne 0 ]; then exit 1 ; fi
 bsub -o output_run7.%J -K -n 7 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 7 ./src/pdata"
 if [ $? -ne 0 ]; then exit 1 ; fi
 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/pdata"
 if [ $? -ne 0 ]; then exit 1 ; fi
 bsub -o output_run9.%J -K -n 9 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 9 ./src/pdata"
 if [ $? -ne 0 ]; then exit 1 ; fi
 bsub -o output_run10.%J -K -n 10 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 10 ./src/pdata"
 if [ $? -ne 0 ]; then exit 1 ; fi
 bsub -o output_run11.%J -K -n 11 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2;  mpirun -np 11 ./src/pdata"
 if [ $? -ne 0 ]; then exit 1 ; fi
 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/pdata"
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
88 89 90 91 92 93 94
 # 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
95 96 97 98
elif [ "$2" == "taurus" ]
then
 echo "Compiling on taurus"

incardon's avatar
incardon committed
99
 source /etc/profile
incardon's avatar
incardon committed
100
 echo "$PATH"
incardon's avatar
incardon committed
101
 module load boost/1.56.0-gnu4.9.1
incardon's avatar
incardon committed
102 103
 module unload gcc/4.9.1
 module load gcc/4.9.3
incardon's avatar
incardon committed
104 105
 module load openmpi/1.8.7
 module unload bullxmpi
incardon's avatar
incardon committed
106
 module load metis/5.1.0
incardon's avatar
incardon committed
107 108

 sh ./autogen.sh
incardon's avatar
incardon committed
109
 ./configure --with-metis=$METIS_ROOT --with-boost=$BOOST_ROOT CXX=mpic++
incardon's avatar
incardon committed
110 111 112
 make
 if [ $? -ne 0 ]; then exit 1 ; fi

incardon's avatar
incardon committed
113
 salloc --nodes=1 --ntasks-per-node=16 --time=00:10:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 16 src/pdata"
incardon's avatar
incardon committed
114
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
115
 salloc --nodes=2 --ntasks-per-node=16 --time=00:10:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 32 src/pdata"
incardon's avatar
incardon committed
116
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
117
 salloc --nodes=4 --ntasks-per-node=16 --time=00:10:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 64 src/pdata"
incardon's avatar
incardon committed
118
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
119
 salloc --nodes=8 --ntasks-per-node=16 --time=00:10:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 128 src/pdata"
incardon's avatar
incardon committed
120
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
121
 salloc --nodes=16 --ntasks-per-node=16 --time=00:10:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 256 src/pdata"
incardon's avatar
incardon committed
122
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
123 124 125

else
 echo "Compiling general"
incardon's avatar
incardon committed
126
 source ~/.bashrc
incardon's avatar
incardon committed
127
 sh ./autogen.sh
incardon's avatar
incardon committed
128
 ./install -s
incardon's avatar
incardon committed
129 130 131 132 133 134 135 136

 mpirun -np 2 ./src/pdata
 mpirun -np 3 ./src/pdata
 mpirun -np 4 ./src/pdata
fi