[12567] | 1 | #!/bin/bash
|
---|
| 2 | #Step 0: download
|
---|
| 3 | #Step 1: unzip and install
|
---|
| 4 | #Step 2: After Plapack implodes
|
---|
| 5 | STEP=0
|
---|
| 6 |
|
---|
| 7 | if [ $STEP -eq 0 ]; then
|
---|
| 8 | # Adapted from petsc 3.2.
|
---|
| 9 | # Used Mercurial to get code
|
---|
| 10 | rm -rf src
|
---|
| 11 | hg clone http://petsc.cs.iit.edu/petsc/petsc-dev src
|
---|
| 12 | cd src
|
---|
| 13 | hg clone http://petsc.cs.iit.edu/petsc/BuildSystem config/BuildSystem
|
---|
| 14 | fi
|
---|
| 15 |
|
---|
| 16 | # To update (via Mercurial):
|
---|
| 17 | # cd petsc-dev
|
---|
| 18 | # hg pull -u
|
---|
| 19 | # cd config/BuildSystem
|
---|
| 20 | # hg pull -u
|
---|
| 21 |
|
---|
| 22 |
|
---|
| 23 | # configure script
|
---|
| 24 | # Note: using metis from externalpackages did not work...
|
---|
| 25 | # for now downloading new metis
|
---|
| 26 | # -then rename metis in externalpackages to metis2
|
---|
| 27 | if [ $STEP -eq 1 ]; then
|
---|
| 28 | #Some cleanup
|
---|
| 29 | rm -rf install petsc-3.2-p3 src
|
---|
| 30 | mkdir install src
|
---|
| 31 |
|
---|
| 32 | #Download from ISSM server
|
---|
| 33 | $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-3.2-p3.tar.gz' 'petsc-3.2-p3.tar.gz'
|
---|
| 34 |
|
---|
| 35 | #Untar and move petsc to install directory
|
---|
| 36 | tar -zxvf petsc-3.2-p3.tar.gz
|
---|
| 37 | mv petsc-3.2-p3/* src/
|
---|
| 38 | rm -rf petsc-3.2-p3
|
---|
| 39 |
|
---|
| 40 | #configure
|
---|
| 41 | cd src
|
---|
| 42 | ./config/configure.py \
|
---|
| 43 | --prefix="$ISSM_DIR/externalpackages/petsc/install" \
|
---|
| 44 | --with-batch=1 \
|
---|
| 45 | --PETSC_ARCH="$ISSM_ARCH" \
|
---|
| 46 | --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
|
---|
| 47 | --with-debugging=0 \
|
---|
| 48 | --with-shared-libraries=0 \
|
---|
| 49 | --with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
|
---|
| 50 | --known-mpi-shared-libraries=1 \
|
---|
| 51 | --with-mpi-lib=/nasa/sgi/mpt/1.25/lib/libmpi.so \
|
---|
| 52 | --with-mpi-include=/nasa/sgi/mpt/1.25/include \
|
---|
| 53 | --download-mumps=yes \
|
---|
| 54 | --download-plapack=yes \
|
---|
| 55 | --download-scalapack=yes \
|
---|
| 56 | --download-blacs=yes \
|
---|
| 57 | --download-blas=yes \
|
---|
| 58 | --download-f-blas-lapack=yes \
|
---|
| 59 | --download-parmetis=yes \
|
---|
| 60 | --download-metis=yes \
|
---|
| 61 | --download-spai=yes \
|
---|
| 62 | --FFLAGS=-I/usr/include \
|
---|
| 63 | --with-cc=icc \
|
---|
| 64 | --with-fc=ifort \
|
---|
| 65 | --COPTFLAGS=" -O3 -xS" \
|
---|
| 66 | --FOPTFLAGS=" -O3 -xS" \
|
---|
| 67 | --CXXOPTFLAGS=" -O3 -xS" \
|
---|
| 68 | --with-pic=1
|
---|
| 69 | echo "== Fix Plapack compilation manually (http://issm.jpl.nasa.gov/documentation/faq/petsc32/) =="
|
---|
| 70 | echo "== Then run STEP=2 =="
|
---|
| 71 | fi
|
---|
| 72 | if [ $STEP -eq 2 ]; then
|
---|
| 73 | cd src
|
---|
| 74 | ./config/configure.py \
|
---|
| 75 | --prefix="$ISSM_DIR/externalpackages/petsc/install" \
|
---|
| 76 | --with-batch=1 \
|
---|
| 77 | --PETSC_ARCH="$ISSM_ARCH" \
|
---|
| 78 | --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
|
---|
| 79 | --with-debugging=0 \
|
---|
| 80 | --with-shared-libraries=0 \
|
---|
| 81 | --with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
|
---|
| 82 | --with-mpi-lib=/nasa/sgi/mpt/1.25/lib/libmpi.so \
|
---|
| 83 | --with-mpi-include=/nasa/sgi/mpt/1.25/include \
|
---|
| 84 | --known-mpi-shared-libraries=1 \
|
---|
| 85 | --download-mumps=yes \
|
---|
| 86 | --download-scalapack=yes \
|
---|
| 87 | --download-blacs=yes \
|
---|
| 88 | --download-blas=yes \
|
---|
| 89 | --download-f-blas-lapack=yes \
|
---|
| 90 | --download-parmetis=yes \
|
---|
| 91 | --download-metis=yes \
|
---|
| 92 | --download-spai=yes \
|
---|
| 93 | --with-plapack-dir=$ISSM_DIR/externalpackages/petsc/src/$ISSM_ARCH \
|
---|
| 94 | --download-parmetis=yes \
|
---|
| 95 | --FFLAGS=-I/usr/include \
|
---|
| 96 | --with-cc=icc \
|
---|
| 97 | --with-fc=ifort \
|
---|
| 98 | --COPTFLAGS=" -O3 -xS" \
|
---|
| 99 | --FOPTFLAGS=" -O3 -xS" \
|
---|
| 100 | --CXXOPTFLAGS=" -O3 -xS" \
|
---|
| 101 | --with-pic=1
|
---|
| 102 | cat > src/script.queue << EOF
|
---|
| 103 | #PBS -S /bin/bash
|
---|
| 104 | #PBS -q debug
|
---|
| 105 | #PBS -l select=1:ncpus=1:model=har
|
---|
| 106 | #PBS -l walltime=200
|
---|
| 107 | #PBS -W group_list=s1010
|
---|
| 108 | #PBS -m e
|
---|
| 109 | . /usr/share/modules/init/bash
|
---|
| 110 | module load comp-intel/11.1.046
|
---|
| 111 | module load mpi/mpt.1.25
|
---|
| 112 | module load math/intel_mkl_64_10.0.011
|
---|
| 113 | export PATH="$PATH:."
|
---|
| 114 | export MPI_GROUP_MAX=64
|
---|
| 115 | mpiexec -np 1 ./conftest-linux-gnu-ia64-intel.py
|
---|
| 116 | EOF
|
---|
| 117 | echo "== Follow PETSc's instructions"
|
---|
| 118 | fi
|
---|