Advanced Simulation Library(ASL)&& An adaptive and distributed-memory parallel implementatio
Posted 熊猫滚滚
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Advanced Simulation Library(ASL)&& An adaptive and distributed-memory parallel implementatio相关的知识,希望对你有一定的参考价值。
How to install asl and ibamr tools:
ASL 和 IBAMR 都是有限元分析的工具,流体力学等,ASL可以使用GPU加速计算,
主机配置,i7 6代,1060, 32G,500G,ubuntu1604。
安装ASL、配置依赖、安装、运行测试:
1.GPU DRIVER && CUDA SDK OpenCL
在Ubuntu 软件源下载GPU驱动。
NVIDIA 官网下载cuda run安装包,安装时候不要选择图形图像显示驱动的安装。
装一些依赖:
1 sudo apt-get install clinfo dkms xz-utils openssl libnuma1 libpciaccess0 bc curl libssl-dev lsb-core libicu-dev -y
1 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF 2 echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list 3 sudo apt-get install mono-complete -y
2.CMAKE
1 sudo apt-get install libncurses5-dev cmake-curses-gui -y
1 sudo apt-get install build-essential -y 2 wget http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz 3 tar xf cmake-3.11.1.tar.gz && cd cmake-3.11.1 && ./configure 4 make -j8 && sudo make install
3.OpenGL
1 sudo apt-get install build-essential libgl1-mesa-dev freeglut3-dev libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev gfortran doxygen graphviz -y
4.VTK
The Visualization Toolkit (VTK) is an open-source, freely available software system for 3D computer graphics, image processing, and visualization.
又是一个神乎其技的开源工具。
1 sudo apt-get install libvtk6.2 2 wget https://www.vtk.org/files/release/6.3/VTK-6.3.0.zip 3 unzip VTK-6.3.0.zip 4 mkdir VTK-build && cd VTK-build&&ccmake ../VTK-6.3.0
然后按“c”确认配置生成可编译文件,直到“g”选项出现,然后按“g”即可
1 make -j8 2 sudo make install
5.BOOST
首先安装一个低版本的boost,这个是给ASL用的。
1 sudo apt-get install libboost1.58-all-dev -y
6.ASL
1 unzip ASL-0.1.7.zip 2 mkdir build-asl && cd build-asl 3 cmake -D OpenCL_INCLUDE_DIR=/usr/local/cuda-9.0/include/ -G "Unix Makefiles" ../ASL-0.1.7 4 cmake -D OpenCL_LIBRARY=/usr/local/cuda-9.0/lib64/libOpenCL.so -G "Unix Makefiles" ../ASL-0.1.7 5 make -j8 6 sudo make install
运行实例:
1 cd examples/flow/locomotive 2 wget http://asl.org.il/input_data/locomotive.stl 3 ./asl-locomotive --input locomotive.stl
====================================================================================================================
安装IBAMR、配置依赖、安装、运行测试:此处已经是旧版的ibamr了下载其源码需要找到GitHub上倒数第二个版本v0.2 https://github.com/IBAMR/IBAMR/releases
1.安装BOOST
1 mkdir sfw && cd sfw && mkdir linux && cd linux && mkdir boost && cd boost 2 unzip boost_1_60_0.zip 3 mv boost_1_60_0 1.6.0 4 export BOOST_ROOT=$HOME/sfw/linux/boost/1.6.0 5 mkdir $BOOST_ROOT/include 6 ln -s $BOOST_ROOT/boost $BOOST_ROOT/include
7 sudo apt install libz-dev m4 gfortran -y
2.安装eigen
1 cd sfw && cd linux && mkdir eigen && cd eigen 2 下载 eigen 3.3.1 3 tar -jxvf 3.3.1.tar.bz2 4 cmake eigen-eigen-f562a193118d 5 make -j8 && sudo make install
3.安装HDF5
1 cd sfw/linux && mkdir hdf5 && cd hdf5 2 下载 hdf5-1.8.16.tar.bz2 3 tar xvjf ~/hdf5-1.8.16.tar.bz2 4 cd hdf5-1.8.16
./configure \\ CC=gcc \\ CXX=g++ \\ FC=gfortran \\ F77=gfortran \\ --enable-production \\ --disable-debug \\ --prefix=$HOME/sfw/linux/hdf5/1.8.16
1 make -j8 && make check && sudo make install
4.安装SILO
1 cd $HOME/sfw/linux 2 tar xvfz silo-4.10.tar.gz && cd silo-4.10
./configure \\ CC=gcc \\ CXX=g++ \\ FC=gfortran \\ F77=gfortran \\ --prefix=$HOME/sfw/linux/silo/4.10 \\ --disable-silex
1 make -j8 && sudo make install
5.安装MUPARSER
1 sudo apt-get install libmuparser-dev -y
6.安装OpenMPI
1 cd $HOME/sfw/linux 2 tar xvfj openmpi-1.10.2.tar.bz2 3 cd openmpi-1.10.2 ./configure \\ CC=gcc \\ CXX=g++ \\ FC=gfortran \\ F77=gfortran \\ --prefix=$HOME/sfw/linux/openmpi/1.10.2 \\ --disable-mpi-cxx-seek \\ --disable-heterogeneous \\ --enable-orterun-prefix-by-default 1 make -j8 && make check && sudo make install
7.安装PETSC
7.1首先编译debug 版:
1 sudo apt-get install libblas-dev liblapack-dev -y 2 cd $HOME/sfw && mkdir petsc && cd petsc 3 wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.7.2.tar.gz 4 tar xvfz petsc-3.7.2.tar.gz 5 mv petsc-3.7.2 3.7.2 && cd 3.7.2 6 export PETSC_DIR=$PWD 7 export PETSC_ARCH=linux-debug ./config/configure.py \\ --CC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicc \\ --CXX=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicxx \\ --FC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpif90 \\ --LDFLAGS="-L$HOME/sfw/linux/openmpi/1.10.2/lib -Wl,-rpath,$HOME/sfw/linux/openmpi/1.10.2/lib" \\ --with-debugging=1 \\ --with-c++-support \\ --download-hypre=1 1 make && make test
7.2再编译optimize版:
1 export PETSC_DIR=$PWD 2 export PETSC_ARCH=linux-opt ./config/configure.py \\ --CC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicc \\ --CXX=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicxx \\ --FC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpif90 \\ --COPTFLAGS="-O3" \\ --CXXOPTFLAGS="-O3" \\ --FOPTFLAGS="-O3" \\ --LDFLAGS="-L$HOME/sfw/linux/openmpi/1.10.2/lib -Wl,-rpath,$HOME/sfw/linux/openmpi/1.10.2/lib" \\ --with-default-arch=0 \\ --PETSC_ARCH=$PETSC_ARCH \\ --with-debugging=0 \\ --with-c++-support \\ --with-hypre=1 \\ --download-hypre=1 \\ --with-x=0\\ 1 make && make test
8.安装SAMRAI
1 cd $HOME/sfw && mkdir samrai && cd samrai && mkdir 2.4.4&& cd 2.4.4 2 tar xvfz SAMRAI-v2.4.4.tar.gz && mv SAMRAI SAMRAI-2.4.4
然后要打一个补丁
1 wget https://github.com/IBAMR/IBAMR/releases/download/v0.1-rc1/SAMRAI-v2.4.4-patch-121212.gz 2 cd SAMRAI-2.4.4 3 gunzip -c ../SAMRAI-v2.4.4-patch-121212.gz | patch -p2 4 ./source/scripts/includes --link 5 cd $HOME/sfw/samrai/2.4.4 6 mkdir objs-debug && cd objs-debug ../SAMRAI-2.4.4/configure \\ --prefix=$HOME/sfw/samrai/2.4.4/linux-g++-debug \\ --with-CC=gcc \\ --with-CXX=g++ \\ --with-F77=gfortran \\ --with-MPICC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicc \\ --with-hdf5=$HOME/sfw/linux/hdf5/1.8.16 \\ --without-hypre \\ --with-silo=$HOME/sfw/linux/silo/4.10 \\ --without-blaslapack \\ --without-cubes \\ --without-eleven \\ --without-kinsol \\ --without-petsc \\ --without-sundials \\ --without-x \\ --with-doxygen \\ --with-dot \\ --enable-debug \\ --disable-opt \\ --enable-implicit-template-instantiation \\ --disable-deprecated 1 make -j8 && sudo make install
优化版本:
1 cd $HOME/sfw/samrai/2.4.4 &&mkdir objs-opt &&cd objs-opt ../SAMRAI-2.4.4/configure \\ CFLAGS="-O3" \\ CXXFLAGS="-O3" \\ FFLAGS="-O3" \\ --prefix=$HOME/sfw/samrai/2.4.4/linux-g++-opt \\ --with-CC=gcc \\ --with-CXX=g++ \\ --with-F77=gfortran \\ --with-MPICC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicc \\ --with-hdf5=$HOME/sfw/linux/hdf5/1.8.16 \\ --without-hypre \\ --with-silo=$HOME/sfw/linux/silo/4.10 \\ --without-blaslapack \\ --without-cubes \\ --without-eleven \\ --without-kinsol \\ --without-petsc \\ --without-sundials \\ --without-x \\ --with-doxygen \\ --with-dot \\ --disable-debug \\ --enable-opt \\ --enable-implicit-template-instantiation \\ --disable-deprecated 1 make -j8 && sudo make install
9.安装libMesh
1 cd $HOME/sfw/linux &&mkdir libmesh &&cd libmesh &&mkdir 1.0.0 &&cd 1.0.0 2 wget https://github.com/libMesh/libmesh/releases/download/v1.0.0/libmesh-1.0.0.tar.gz 3 THEN:4 tar xvfz libmesh-1.0.0.tar.gz && mv libmesh-1.0.0 LIBMESH &&cd $HOME/sfw/linux/libmesh/1.0.0 && mkdir objs-debug && cd objs-debug 5 export BOOST_ROOT=$HOME/sfw/linux/boost/1.6.0 ../LIBMESH/configure \\ --prefix=$HOME/sfw/linux/libmesh/1.0.0/1.0.0-debug \\ --with-methods=dbg \\ PETSC_DIR=$HOME/sfw/petsc/3.7.2 \\ PETSC_ARCH=linux-debug \\ CC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicc \\ CXX=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicxx \\ FC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpif90 \\ F77=$HOME/sfw/linux/openmpi/1.10.2/bin/mpif90 \\ --enable-triangle \\ --disable-cxx11 \\ --disable-openmp \\ --disable-perflog \\ --disable-strict-lgpl \\ --disable-pthreads \\ --disable-cppthreads \\ --disable-unique-ptr 1 make -j8 && sudo make install
然后安装优化版:
1 cd $HOME/sfw/linux/libmesh/1.0.0 &&mkdir objs-opt &&cd objs-opt 2 export BOOST_ROOT=$HOME/sfw/linux/boost/1.6.0 ../LIBMESH/configure \\ --prefix=$HOME/sfw/linux/libmesh/1.0.0/1.0.0-opt \\ --with-methods=opt \\ PETSC_DIR=$HOME/sfw/petsc/3.7.2 \\ PETSC_ARCH=linux-opt \\ CC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicc \\ CXX=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicxx \\ FC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpif90 \\ F77=$HOME/sfw/linux/openmpi/1.10.2/bin/mpif90 \\ --enable-triangle \\ --disable-cxx11 \\ --disable-openmp \\ --disable-perflog \\ --disable-strict-lgpl \\ --disable-pthreads \\ --disable-cppthreads \\ --disable-unique-ptr 1 make -j8 && sudo make install
终于到了主角,10.安装IBAMR
1 cd $HOME/sfw && mkdir ibamr && cd ibamr 2 git clone https://github.com/IBAMR/IBAMR.git 3 THEN:4
4 tar xvfj ibamr.tar.bz2 && cd $HOME/sfw/ibamr && mkdir ibamr-objs-dbg && cd ibamr-objs-dbg 5 export BOOST_ROOT=$HOME/sfw/linux/boost/1.6.0 && export PETSC_ARCH=linux-debug && export PETSC_DIR=$HOME/sfw/petsc/3.7.2 ../IBAMR/configure \\ CFLAGS="-g -O1 -Wall" \\ CXXFLAGS="-g -O1 -Wall" \\ FCFLAGS="-g -O1 -Wall" \\ CC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicc \\ CXX=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicxx \\ FC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpif90 \\ CPPFLAGS="-DOMPI_SKIP_MPICXX" \\ --with-hypre=$PETSC_DIR/$PETSC_ARCH \\ --with-samrai=$HOME/sfw/samrai/2.4.4/linux-g++-debug \\ --with-hdf5=$HOME/sfw/linux/hdf5/1.8.16 \\ --with-silo=$HOME/sfw/linux/silo/4.10 \\ --with-boost=$HOME/sfw/linux/boost/1.6.0 \\ --enable-libmesh \\ --with-libmesh=$HOME/sfw/linux/libmesh/1.0.0/1.0.0-debug \\ --with-libmesh-method=dbg 1 make lib -j8 && make examples -j8
然后安装优化版本
1 cd $HOME/sfw/ibamr && mkdir ibamr-objs-opt && cd ibamr-objs-opt && export PETSC_ARCH=linux-opt && export PETSC_DIR=$HOME/sfw/petsc/3.7.2 ../IBAMR/configure \\ CC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicc \\ CXX=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicxx \\ F77=$HOME/sfw/linux/openmpi/1.10.2/bin/mpif90 \\ FC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpif90 \\ MPICC=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicc \\ MPICXX=$HOME/sfw/linux/openmpi/1.10.2/bin/mpicxx \\ CFLAGS="-O3 -Wall" \\ CXXFLAGS="-O3 -Wall -std=gnu++11" \\ FFLAGS="-O3 -Wall" \\ FCFLAGS="-O3 -Wall" \\ CPPFLAGS="-DOMPI_SKIP_MPICXX" \\ --with-hypre=$PETSC_DIR/$PETSC_ARCH \\ --with-samrai=$HOME/sfw/samrai/2.4.4/linux-g++-opt \\ --with-hdf5=$HOME/sfw/linux/hdf5/1.8.16 \\ --with-silo=$HOME/sfw/linux/silo/4.10 \\ --with-boost=$HOME/sfw/linux/boost/1.6.0 \\ --enable-libmesh \\ --with-libmesh=$HOME/sfw/linux/libmesh/1.0.0/1.0.0-opt \\ --with-libmesh-method=opt make -j8 &&make check
运行实例程序:
1 cd $HOME/sfw/ibamr/ibamr-objs-opt/examples/IB/staggered_grid/explicit/ex1 2 make examples 3 ./main2d input2d
完,qsy。
以上是关于Advanced Simulation Library(ASL)&& An adaptive and distributed-memory parallel implementatio的主要内容,如果未能解决你的问题,请参考以下文章