build_pdata.sh 6.07 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
incardon's avatar
incardon committed
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
incardon's avatar
incardon committed
21 22 23

# pull from all the projects
cd openfpm_data
incardon's avatar
incardon committed
24
git checkout develop
incardon's avatar
incardon committed
25
mkdir src/config
incardon's avatar
incardon committed
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
incardon's avatar
incardon committed
34
mkdir src/config
incardon's avatar
incardon committed
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
incardon's avatar
incardon committed
43
mkdir src/config
incardon's avatar
incardon committed
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
incardon's avatar
incardon committed
52
mkdir src/config
incardon's avatar
incardon committed
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
incardon's avatar
incardon committed
68
 make
incardon's avatar
incardon committed
69

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

## produce the module path

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

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

incardon's avatar
incardon committed
109
 ## Run on the cluster
110
 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.59.0;  mpirun -np 2 ./src/pdata"
incardon's avatar
incardon committed
111
 if [ $? -ne 0 ]; then exit 1 ; fi
112
 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.59.0;  mpirun -np 3 ./src/pdata"
incardon's avatar
incardon committed
113
 if [ $? -ne 0 ]; then exit 1 ; fi
114
 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.59.0;  mpirun -np 4 ./src/pdata"
incardon's avatar
incardon committed
115
 if [ $? -ne 0 ]; then exit 1 ; fi
116
 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.59.0;  mpirun -np 5 ./src/pdata"
incardon's avatar
incardon committed
117
 if [ $? -ne 0 ]; then exit 1 ; fi
118
 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.59.0;  mpirun -np 6 ./src/pdata"
incardon's avatar
incardon committed
119
 if [ $? -ne 0 ]; then exit 1 ; fi
120
 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.59.0;  mpirun -np 7 ./src/pdata"
incardon's avatar
incardon committed
121
 if [ $? -ne 0 ]; then exit 1 ; fi
122
 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.59.0;  mpirun -np 8 ./src/pdata"
incardon's avatar
incardon committed
123
 if [ $? -ne 0 ]; then exit 1 ; fi
124
 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.59.0;  mpirun -np 9 ./src/pdata"
incardon's avatar
incardon committed
125
 if [ $? -ne 0 ]; then exit 1 ; fi
126
 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.59.0;  mpirun -np 10 ./src/pdata"
incardon's avatar
incardon committed
127
 if [ $? -ne 0 ]; then exit 1 ; fi
128
 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.59.0;  mpirun -np 11 ./src/pdata"
incardon's avatar
incardon committed
129
 if [ $? -ne 0 ]; then exit 1 ; fi
130
 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.59.0;  mpirun -np 12 ./src/pdata"
incardon's avatar
incardon committed
131
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
132 133 134 135 136 137 138
 # 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
139 140 141 142
elif [ "$2" == "taurus" ]
then
 echo "Compiling on taurus"

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

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

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

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

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