build_pdata.sh 5.39 KB
Newer Older
incardon's avatar
incardon committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#! /bin/bash

# Make a directory in /tmp/OpenFPM_data

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

mkdir /tmp/openfpm_pdata
mv * .[^.]* /tmp/openfpm_pdata
mv /tmp/openfpm_pdata OpenFPM_pdata

mkdir OpenFPM_pdata/src/config

git clone ssh://git@ppmcoremirror.dynu.com:2222/incardon/openfpm_vcluster.git OpenFPM_vcluster
git clone ssh://git@ppmcoremirror.dynu.com:2222/incardon/openfpm_devices.git OpenFPM_devices
git clone ssh://git@ppmcoremirror.dynu.com:2222/incardon/openfpm_data.git OpenFPM_data
incardon's avatar
incardon committed
17
git clone ssh://git@ppmcoremirror.dynu.com:2222/incardon/openfpm_io.git OpenFPM_IO
incardon's avatar
incardon committed
18
cd OpenFPM_data
incardon's avatar
incardon committed
19 20 21 22 23 24
git checkout develop
cd ..

cd "$1/OpenFPM_pdata"

if [ "$2" == "gin" ]
incardon's avatar
incardon committed
25
then
incardon's avatar
incardon committed
26
 echo "Compiling on gin\n"
incardon's avatar
incardon committed
27 28
 source ~/.bashrc
 sh ./autogen.sh
incardon's avatar
incardon committed
29
 module load gcc/4.9.2
incardon's avatar
incardon committed
30
 ./install
incardon's avatar
incardon committed
31
 make
incardon's avatar
incardon committed
32

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

## produce the module path

incardon's avatar
incardon committed
62
 source ~/.bashrc
incardon's avatar
incardon committed
63 64 65
 module load gcc/4.9.2
 module load openmpi/1.8.1
 module load boost/1.54.0
incardon's avatar
incardon committed
66

incardon's avatar
incardon committed
67 68 69
 sh ./autogen.sh
 ./install --with-boost=/sw/apps/boost/1.54.0/  CXX=mpic++
 make
incardon's avatar
incardon committed
70
 if [ $? -ne 0 ]; then exit 1 ; fi
incardon's avatar
incardon committed
71

incardon's avatar
incardon committed
72
 ## Run on the cluster
incardon's avatar
incardon committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
 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
95 96 97 98 99 100 101
 # 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
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
elif [ "$2" == "taurus" ]
then
 echo "Compiling on taurus"

 echo "$PATH"
 module load gcc/4.8.2
 module load boost/1.55.0-gnu4.8
 module load openmpi/1.8.7
 module unload bullxmpi

 sh ./autogen.sh
 sh ./configure --enable-verbose CXX=mpic++
 make
 if [ $? -ne 0 ]; then exit 1 ; fi

# salloc --nodes=1 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 16 src/vcluster"
# if [ $? -ne 0 ]; then exit 1 ; fi
# salloc --nodes=2 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 32 src/vcluster"
# if [ $? -ne 0 ]; then exit 1 ; fi
# salloc --nodes=4 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 64 src/vcluster"
# if [ $? -ne 0 ]; then exit 1 ; fi
# salloc --nodes=8 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 128 src/vcluster"
# if [ $? -ne 0 ]; then exit 1 ; fi
# salloc --nodes=16 --ntasks-per-node=16 --time=00:5:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 256 src/vcluster"
# if [ $? -ne 0 ]; then exit 1 ; fi

else
 echo "Compiling general"
incardon's avatar
incardon committed
130
 source ~/.bashrc
incardon's avatar
incardon committed
131
 sh ./autogen.sh
incardon's avatar
incardon committed
132
 ./install
incardon's avatar
incardon committed
133 134 135 136 137 138 139 140

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