build_pdata.sh 5.66 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 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

# pull from all the projects
cd openfpm_data
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
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
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
git pull origin master
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi
cd ..

45
git submodule update
incardon's avatar
incardon committed
46 47 48 49
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi
incardon's avatar
incardon committed
50

51
cd openfpm_data
incardon's avatar
incardon committed
52 53 54 55
git checkout develop
cd ..

if [ "$2" == "gin" ]
incardon's avatar
incardon committed
56
then
incardon's avatar
incardon committed
57
 echo "Compiling on gin\n"
incardon's avatar
incardon committed
58 59
 source ~/.bashrc
 sh ./autogen.sh
incardon's avatar
incardon committed
60
 module load gcc/4.9.2
incardon's avatar
incardon committed
61
 ./install -s
incardon's avatar
incardon committed
62
 make
incardon's avatar
incardon committed
63

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

## produce the module path

incardon's avatar
incardon committed
93
 source ~/.bashrc
incardon's avatar
incardon committed
94 95 96
 module load gcc/4.9.2
 module load openmpi/1.8.1
 module load boost/1.54.0
incardon's avatar
incardon committed
97

incardon's avatar
incardon committed
98
 sh ./autogen.sh
incardon's avatar
incardon committed
99
 ./install -s -c "--with-boost=/sw/apps/boost/1.54.0/"  CXX=mpic++
incardon's avatar
incardon committed
100
 make
incardon's avatar
incardon committed
101
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
102

incardon's avatar
incardon committed
103
 ## Run on the cluster
incardon's avatar
incardon committed
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
 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
126 127 128 129 130 131 132
 # 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
133 134 135 136
elif [ "$2" == "taurus" ]
then
 echo "Compiling on taurus"

incardon's avatar
incardon committed
137
 source /etc/profile
incardon's avatar
incardon committed
138
 echo "$PATH"
incardon's avatar
incardon committed
139
 module load boost/1.56.0-gnu4.9.1
incardon's avatar
incardon committed
140 141
 module unload gcc/4.9.1
 module load gcc/4.9.3
incardon's avatar
incardon committed
142 143
 module load openmpi/1.8.7
 module unload bullxmpi
incardon's avatar
incardon committed
144
 module load metis/5.1.0
incardon's avatar
incardon committed
145 146

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

incardon's avatar
incardon committed
151
 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
152
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
153
 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
154
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
155
 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
156
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
157
 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
158
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
159
 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
160
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
161 162 163

else
 echo "Compiling general"
incardon's avatar
incardon committed
164
 source ~/.bashrc
incardon's avatar
incardon committed
165
 sh ./autogen.sh
incardon's avatar
incardon committed
166
 ./install -s
incardon's avatar
incardon committed
167 168 169 170 171 172 173 174

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