build_pdata.sh 6.12 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 12 13 14 15 16 17 18 19 20
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi

git submodule update
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi
21 22 23

# pull from all the projects
cd openfpm_data
incardon's avatar
incardon committed
24
git checkout develop
25
mkdir src/config
26 27 28 29 30 31 32 33
git pull origin develop
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi
cd ..

cd openfpm_devices
34
mkdir src/config
35 36 37 38 39 40 41 42
git pull origin master
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi
cd ..

cd openfpm_vcluster
43
mkdir src/config
44 45 46 47 48 49 50 51
git pull origin master
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi
cd ..

cd openfpm_io
52
mkdir src/config
53 54 55 56 57 58 59
git pull origin master
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi
cd ..

incardon's avatar
incardon committed
60 61

if [ "$2" == "gin" ]
incardon's avatar
incardon committed
62
then
incardon's avatar
incardon committed
63
 echo "Compiling on gin\n"
incardon's avatar
incardon committed
64 65
 source ~/.bashrc
 sh ./autogen.sh
incardon's avatar
incardon committed
66
 module load gcc/4.9.2
incardon's avatar
incardon committed
67
 ./install -s -c "--prefix=/home/jenkins/openfpm_install"
incardon's avatar
incardon committed
68
 make
incardon's avatar
incardon committed
69
 make install
incardon's avatar
incardon committed
70

incardon's avatar
incardon committed
71
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
72
 mpirun -np 2 ./src/pdata
incardon's avatar
incardon committed
73
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
74
 mpirun -np 3 ./src/pdata
incardon's avatar
incardon committed
75
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
76
 mpirun -np 4 ./src/pdata
incardon's avatar
incardon committed
77
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
78
 mpirun -np 5 ./src/pdata
incardon's avatar
incardon committed
79
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
80
 mpirun -np 6 ./src/pdata
incardon's avatar
incardon committed
81
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
82
 mpirun -np 7 ./src/pdata
incardon's avatar
incardon committed
83
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
84
 mpirun -np 8 ./src/pdata
incardon's avatar
incardon committed
85
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
86
 mpirun -np 9 ./src/pdata
incardon's avatar
incardon committed
87
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
88
 mpirun -np 10 ./src/pdata
incardon's avatar
incardon committed
89
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
90
 mpirun -np 11 ./src/pdata
incardon's avatar
incardon committed
91
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
92
 mpirun -np 12 ./src/pdata
incardon's avatar
incardon committed
93
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
94 95 96 97 98 99
elif [ "$2" == "wetcluster" ]
then
 echo "Compiling on wetcluster"

## produce the module path

incardon's avatar
incardon committed
100
 source ~/.bashrc
incardon's avatar
incardon committed
101 102
 module load gcc/4.9.2
 module load openmpi/1.8.1
103
 module load boost/1.54.0
incardon's avatar
incardon committed
104

incardon's avatar
incardon committed
105
 sh ./autogen.sh
106
 ./install -s -c "--with-boost=/sw/apps/boost/1.54.0/ CXX=mpic++"
incardon's avatar
incardon committed
107
 make
incardon's avatar
incardon committed
108
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
109

incardon's avatar
incardon committed
110
 ## Run on the cluster
111
 bsub -o output_run2.%J -K -n 2 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0;  mpirun -np 2 ./src/pdata"
incardon's avatar
incardon committed
112
 if [ $? -ne 0 ]; then exit 1 ; fi
113
 bsub -o output_run3.%J -K -n 3 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0;  mpirun -np 3 ./src/pdata"
incardon's avatar
incardon committed
114
 if [ $? -ne 0 ]; then exit 1 ; fi
115
 bsub -o output_run4.%J -K -n 4 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0;  mpirun -np 4 ./src/pdata"
incardon's avatar
incardon committed
116
 if [ $? -ne 0 ]; then exit 1 ; fi
117
 bsub -o output_run5.%J -K -n 5 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0;  mpirun -np 5 ./src/pdata"
incardon's avatar
incardon committed
118
 if [ $? -ne 0 ]; then exit 1 ; fi
119
 bsub -o output_run6.%J -K -n 6 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0;  mpirun -np 6 ./src/pdata"
incardon's avatar
incardon committed
120
 if [ $? -ne 0 ]; then exit 1 ; fi
121
 bsub -o output_run7.%J -K -n 7 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0;  mpirun -np 7 ./src/pdata"
incardon's avatar
incardon committed
122
 if [ $? -ne 0 ]; then exit 1 ; fi
123
 bsub -o output_run8.%J -K -n 8 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0;  mpirun -np 8 ./src/pdata"
incardon's avatar
incardon committed
124
 if [ $? -ne 0 ]; then exit 1 ; fi
125
 bsub -o output_run9.%J -K -n 9 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0;  mpirun -np 9 ./src/pdata"
incardon's avatar
incardon committed
126
 if [ $? -ne 0 ]; then exit 1 ; fi
127
 bsub -o output_run10.%J -K -n 10 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0;  mpirun -np 10 ./src/pdata"
incardon's avatar
incardon committed
128
 if [ $? -ne 0 ]; then exit 1 ; fi
129
 bsub -o output_run11.%J -K -n 11 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0;  mpirun -np 11 ./src/pdata"
incardon's avatar
incardon committed
130
 if [ $? -ne 0 ]; then exit 1 ; fi
131
 bsub -o output_run12.%J -K -n 12 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0;  mpirun -np 12 ./src/pdata"
incardon's avatar
incardon committed
132
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
133 134 135 136 137 138 139
 # 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
140 141 142 143
elif [ "$2" == "taurus" ]
then
 echo "Compiling on taurus"

incardon's avatar
incardon committed
144
 source /etc/profile
incardon's avatar
incardon committed
145
 echo "$PATH"
incardon's avatar
incardon committed
146
 module load boost/1.56.0-gnu4.9.1
147 148
 module unload gcc/4.9.1
 module load gcc/4.9.3
incardon's avatar
incardon committed
149 150
 module load openmpi/1.8.7
 module unload bullxmpi
151
 module load metis/5.1.0
incardon's avatar
incardon committed
152 153

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

incardon's avatar
incardon committed
158
 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
159
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
160
 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
161
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
162
 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
163
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
164
 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
165
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
166
 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
167
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
168 169 170

else
 echo "Compiling general"
incardon's avatar
incardon committed
171
 source ~/.bashrc
incardon's avatar
incardon committed
172
 sh ./autogen.sh
incardon's avatar
incardon committed
173
 ./install -s
incardon's avatar
incardon committed
174 175 176 177 178 179 180 181

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