Skip to content

Install OpenFOAM on workstation

Install OpenFOAM on workstation published on No Comments on Install OpenFOAM on workstation

0. Install gcc, mpich

1. Download from http://openfoam.org/

2. Put the source file and thirdparty file in the /scratch/***/OpenFOAM, unzip both

3. Modify etc/cshrc:
set foamInstall = /scratch/***/$WM_PROJECT
if use mpich, modify accordingly. remember add mpich directory to default system include/library environment.
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
LD_LIBRARY_PATH
LIBRARY_PATH

4. Download and install boost as
http://www.boost.org/doc/libs/1_61_0/more/getting_started/unix-variants.html#easy-build-and-install

5. Set WM_NCOMPPROCS for parallel compiling

6. Install openfoam as: http://openfoam.org/download/3-0-1-source/

7. To install paraview4, we need qt-4.8. However, even we indicate the library directory to our compiled qt, there is still problem says:
...undefined reference to `QListData::detach_grow(int*, int)'...
So we will compile the qt under thirdparty directory.

8. download qt-4.8.6 from https://download.qt.io/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz.mirrorlist

9. unzip in the ThirdParty directory, modify makeQt accordingly, and run to compile

10. Now we can compile paraview by
makeParaview4 -qt-4.8.6

Install Git without root

Install Git without root published on No Comments on Install Git without root

The old git version on workstation can not satisfy me. It is not convenient to used, and cannot push to GitHub. Then I want to install Git from source code. This really killing me. Here are some experience.

There are a lot of articles online to show that compile git from source code, as long as you can "sudo apt-get install ****(a lot of libraries)". This is ridiculous. If I can use sudo, why not directly install it from repository?

Here are some ideas about what we need to install. http://www.angularjs.cn/A0HC. However, the author use brew, which needs ruby to install. I don't know how to install ruby without root. However, this is an elegant idea to do this work, and can be referred if possible. The linuxbrew can be found at: http://linuxbrew.sh/. Besides, it seems that it requires curl supporting https, which is exactly the problem I will talk about next.

Install Git is not big. However, it depends several libraries. During the installation, it requires something like xmlto, asciidoc, etc. Just download and compile them, not big deal. Then we can

$ ./make configure
$ ./configure --prefix=$HOME/git
$ make & make install

Seems wonderful. It can be used without problem locally. However, when I want to push or clone from repository, it shows:
fatal: Unable to find remote helper for 'https'

After searching on the internet, it seems that this is caused by curl. We need to install the curl.

So, download and install as usual. It works, but without https support, when git push/pull, we have error

fatal: unable to access 'https://***@bitbucket.org/***/***': Protocol "https" not supported or disabled in libcurl

In order to configure curl with hppts, t seems we need libssh2

./configure --prefix=$HOME/curl --with-libssh2

Still cannot, there is no libssh2, so we download libssh2. Still cannot, since we need gnu-crypto, so download, it requires javac. There is no javac...... I want to stop. I think there is way to compile libssh2 with system crypto, but I have no time to try.

Do it another way. I found that there is also curl in anaconda package, so we can try to compile Git it like this (http://www.cnblogs.com/wowarsenal/p/4319002.html)

$ ./make configure
$ ./configure --prefix=$HOME/git --with-curl=$HOME/anaconda
$ make & make install

Configure without problem. However, when running, it shows:
git: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory

Obviously we still need this crypto library. Try this in the system lib, we can find a /usr/lib64/libcrypt.so. So here's a tricky,

$ mkdir -p $HOME/usr/lib
$ ln -s /usr/lib64/libcrypt.so libcrypto.so.1.0.0

Then add $HOME/usr/lib to LD_LIBRARY_DIR

Anyway, it works. So stop now.

 

PS:
1. There is still problem in the config.log
ac_cv_lib_curl_Curl_ssl_init=no
/usr/bin/ld: cannot find -lexpat ( it seems this is required, http://stackoverflow.com/questions/8329485/git-clone-fatal-unable-to-find-remote-helper-for-https)

2. make install will exit error, don't know why

3. make doc will have problem

New update on configure deal.ii with trilinos

New update on configure deal.ii with trilinos published on 1 Comment on New update on configure deal.ii with trilinos

Since mpi environment is essential and all package require the same mpi environment, it is better to separate the MPICH into the home folder, not downloaded with petsc. Here is some refined procedures

1,2,3,4. The same as "Tips on setting up deal.ii and petsc"

5. Download and install mpich-3.2.    https://www.mpich.org/. Setup environment variable,

$ export PATH=$PATH:HOME/mpich-3.2/bin

6. Download and install petsc, as in https://www.dealii.org/developer/external-libs/petsc.html. It should be noted that "--download-hypre=1" is required for deal.ii 8.4.0 and later, otherwise there  is error "undefined reference to `PCHYPRESetType' " when compiling program. MPI environment needs to be assigned. However, blas and lapack can be downloaded, since not all softwares require the same blas&lapack. Here is a configuration

./config/configure.py PETSC_ARCH=arch-linux-release \
--with-shared=1 --with-x=0 --with-mpi=1 --download-hypre=1 --with-debugging=0 \
--with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 --download-fblaslapack
(or specify --with-blas-lapack-dir=$MYHOME/fblaslapack-3.4.2)

7. Download and install METIS, P4EST, OpenBLAS as before

8. Download and install trilinos using:

cmake \
-D Trilinos_ENABLE_Sacado=ON \
-D Trilinos_ENABLE_MueLu:BOOL=ON \
-D Trilinos_ENABLE_Anasazi:BOOL=ON \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_EpetraExt:BOOL=ON \
-D Trilinos_ENABLE_Triutils:BOOL=ON \
-D Trilinos_ENABLE_Belos:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
-D Trilinos_ENABLE_Stratimikos=ON \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_CXX_FLAGS="-g -O3" \
-D CMAKE_C_FLAGS="-g -O3" \
-D CMAKE_FORTRAN_FLAGS="-g -O5" \
-D Trilinos_EXTRA_LINK_FLAGS="-lgfortran -pthread" \
-D CMAKE_VERBOSE_MAKEFILE=ON \
-D Trilinos_VERBOSE_CONFIGURE=OFF \
-D TPL_ENABLE_MPI=ON \
-D MPI_BASE_DIR=$MYHOME/mpich-3.2/bin \
-D BUILD_SHARED_LIBS=ON \
\
-D TPL_ENABLE_BLAS:BOOL=ON \
-D BLAS_INCLUDE_DIRS=$MYHOME/OpenBLAS-0.2.15/include \
-D BLAS_LIBRARY_DIRS=$MYHOME/OpenBLAS-0.2.15/lib \
-D BLAS_LIBRARY_NAMES:STRING="libopenblas.a" \
-D TPL_ENABLE_LAPACK=ON \
-D LAPACK_INCLUDE_DIRS=$MYHOME/OpenBLAS-0.2.15/include \
-D LAPACK_LIBRARY_DIRS=$MYHOME/OpenBLAS-0.2.15/lib \
-D LAPACK_LIBRARY_NAMES:STRING="libopenblas.a" \
\
-D CMAKE_INSTALL_PREFIX:PATH=$MYHOME/trilinos-11.14.3 \
../

9. If we want to use UMFPACK compiled by ourselves (not significant speed change), download it from http://faculty.cse.tamu.edu/davis/suitesparse.html, unzip to the home folder. It requires blas&lapack, we can use OpenBLAS.
Add "$MYHOME/OpenBLAS-0.2.15/lib" to LD_LIBRARY_PATH, and LIBRARY_PATH environment variable$ make install BLAS=-lopenblas LAPACK=-lopenblas
Since SparseSuite needs to be found by dynamics link at runtime, we need to add $MYHOME/SparseSuite/lib to LD_LIBRARY_PATH

10. Download deal.II 8.4.0 and install (Be careful only deal.II 8.3.0 comes with meshconvert)

cmake \
-DCMAKE_C_COMPILER="mpicc" -DCMAKE_CXX_COMPILER="mpicxx" -DCMAKE_Fortran_COMPILER="mpif90" \
-DCMAKE_INSTALL_PREFIX=$MYHOME/dealii-8.4.0 \
-DDEAL_II_WITH_METIS=ON -DMETIS_DIR=$MYHOME/metis-5.1.0 \
-DDEAL_II_WITH_P4EST=ON -DP4EST_DIR=$MYHOME/p4est-1.1 \
-DDEAL_II_WITH_TRILINOS=ON -DTRILINOS_DIR=$MYHOME/trilinos-11.14.3 \
(-DUMFPACK_DIR=$MYHOME/SuiteSparse -DDEAL_II_COMPONENT_PARAMETER_GUI=ON ) ../

A practice of imposing *imperfection for post-buckling analysis in Abaqus

A practice of imposing *imperfection for post-buckling analysis in Abaqus published on No Comments on A practice of imposing *imperfection for post-buckling analysis in Abaqus

1. Step - Linear Perturbation - Buckle

2. Apply boundary conditions and force. This will essentially influence the result. Force direction is very important, but magnitude doesn't matter. Choose the number of eigenvalues we need, generally 10 is enough.

3. Edit inp file. In the output region, we add

** OUTPUT REQUESTS
*Node file, global=yes
U

The result node will be written in the *.fil

4. Observe in the result which mode we need. Try to adjust the scaling factor to see what is a appropriate value for imposing the imperfection, see 1e-5 for example

5. Edit the analysis inp file, add

*IMPERFECTION, FILE=aaa, STEP=1, (NSET=NodeSet)
7, 2e-5

This can be put just before all the steps.
When the NSET is used, be careful of the boundary condition and contact constrain if multiple instances exist in the assembly

6. Run the analysis

Install CalculiX

Install CalculiX published on No Comments on Install CalculiX

1. Download source code
http://www.dhondt.de/
http://www.netlib.org/linalg/spooles/spooles.2.2.html
http://www.caam.rice.edu/software/ARPACK/
What you get is:
cgx_2.8.all.tar.bz2
ccx_2.8p2.src.tar.bz2
spooles.2.2.tgz
arpack96.tar.gz, patch.tar.gz

2. upzip files
mkdir -p $HOME/CalculiX && cd $HOME/CalculiX
tar -xf cgx_2.8.all.tar.bz2
tar -xf ccx_2.8p2.src.tar.bz2
mkdir SPOOLES.2.2
tar -xf spooles.2.2.tgz -C SPOOLES.2.2
tar -xf arpack96.tar.gz

3. Compile cgx
cd $HOME/CalculiX/CalculiX/cgx_2.8
make

3. Compile SPOOLSE lib
cd $HOME/CalculiX/SPOOLES.2.2
modify Make.inc, let CC = gcc
make lib

4. Compile ARPACK lib
cd $HOME/CalculiX/ARPACK
modify ARmake.inc
home = $(HOME)/CalculiX/ARPACK
PLAT = INTEL
FC = gfortran
FFLAGS = -O
MAKE = make

modify Makefile
PRECISIONS = double ddrv

modify ARPACK\UTIL\second.f
commented:      C   EXTERNAL   ETIME

5. Compile ccx
cd $HOME/CalculiX/CalculiX/ccx_2.8p2/src
make

6. Move the bin files to a certain path (optional)
mkdir -p $HOME/CalculiX/bin
cp $HOME/CalculiX/CalculiX/ccx_2.8p2/src/ccx_2.8p2 $HOME/CalculiX/bin/
cp $HOME/CalculiX/CalculiX/cgx_2.8/src/cgx $HOME/CalculiX/bin/
ln -s $HOME/CalculiX/bin/ccx_2.8p2 $HOME/CalculiX/bin/ccx

==================================

DEBUG:

1. X11/Xmu/StdCmap.h: No such file or directory

libxmu-dev, libxmu-headers

2. X11/extensions/XInput.h: No such file or directory

We can solve this buy searching

apt-file search XInput.h
libxi-dev: /usr/include/X11/extensions/XInput.h

=====================================

An interesting website:

https://mechanicalhacks.wordpress.com/

https://mechanicalhacks.wordpress.com/2011/03/29/building-calculix-to-run-native-on-64-bit-windows/  (some information on install calculiX)

Tips on setting up deal.ii and petsc

Tips on setting up deal.ii and petsc published on No Comments on Tips on setting up deal.ii and petsc

Install deal.ii along is quite strait forward. We just need to download the latest package from http://dealii.org/download.html, and compile it according to the documents https://www.dealii.org/developer/readme.html

Generally, this can be down without any problem, and most of the cases in the example folder can be run correctly. However, when comes to the MPI, problem will occur. deall.ii requires to work together with petsc, but there are always some problems. Now I just record some tips which may help the successfully setup of both softwares. These procedures are just concepts and can only work for my case. The directory need to be modified in other system.

1. Deactive the environment setup of intel compiler. This will be investigated in the future.

2. Compile and install gcc-5.2.0, the version 4.8.4 used in ubuntu seems cannot work well with deal.ii+petsc+MPI+cxx11. Besides, in the company's computer, the gcc version is quite old, and we need to build ourselves gcc. Ref: https://gcc.gnu.org/wiki/InstallingGCC

3. Set environment variable,
export PATH=$HOME/gcc-5.2.0/bin:$PATH
export LD_LIBRARY_PATH=$HOME/gcc-5.2.0/lib64

4. In the company's computer, there is no cmake. So we need to compile it, and add it to the $PATH. Also download the boost if required. Boost do not need to install, just set env.

5. Download and install petsc. The most easy way to configure it is
./configure --download-fblaslapack --download-mpich
make all test

6. So we just use this mpich as our default mpi, set env
export PETSC_DIR=$HOME/petsc-3.6.1
export PETSC_ARCH=arch-linux2-c-debug
export PATH=$HOME/petsc-3.6.1/arch-linux2-c-debug/bin:$PATH   (this is for downloaded mpich)

7. In order to run MPI program in deal.ii, we also need a library call METIS. Download and compile it.

8. Download and configure deal.ii
cmake -DCMAKE_INSTALL_PREFIX=$HOME/dealii-8.3.0 -DDEAL_II_WITH_METIS=ON -DMETIS_DIR=$HOME/metis-5.1.0 ../
need to be notice whether the following terms on turn to ON
i.e. C++11, MPI, METIS, PETSC
then, make install(If problems occurs or MPI and PETSC cannot be configured correctly, try "export CC=mpicc CXX=mpicxx"

9. If deal.ii is compiled in the Virtualbox, DON'T compile in parallel

10. If ubuntu 14.04 (Trusty) is used, strange errors may occur during compiling. Ref: https://groups.google.com/forum/#!msg/dealii/1oM3cqR0pWU/zOlMHspD9n8J
The method to fix:
sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687
sudo apt-get update
sudo apt-get upgrade

--------------------------------------------------------------------------------

2015.10.07

If p4est and trilinos are required, refer to the following steps

11. Download the source code of p4est from: http://www.p4est.org/. Download the source package, and don't clone the git source.

12. Install p4est
$ ./configure --prefix=$HOME/p4est-1.1 --enable-mpi BLAS_LIBS=$MYHOME/petsc-3.6.1/arch-linux2-c-debug/lib/libfblas.a LAPACK_LIBS=$MYHOME/petsc-3.6.1/arch-linux2-c-debug/lib/libflapack.a
$ make -j2 && make install

13. Install netcdf, matio, glm(what's this? Required by trilinos)
$ sudo apt-get install libnetcdf-dev libmatio-dev libglm-dev

14. Unzip the trilinon source package, refer to the INSTALL file
$ mkdir build && cd build
$ cmake -DTPL_ENABLE_MPI=ON -DTrilinos_ENABLE_ALL_PACKAGES=ON \
-DCMAKE_INSTALL_PREFIX=<path to install Trilinos into> ../
$ make -j<n> install

15. Alternatively, maybe it is a better ideal to follow the guild on dealii website as https://www.dealii.org/developer/external-libs/trilinos.html. There are also many other guild regarding to the lib installation and worth reading.
cmake \
-D Trilinos_ENABLE_Sacado=ON \
-D Trilinos_ENABLE_MueLu:BOOL=ON \
-D Trilinos_ENABLE_Stratimikos=ON \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_CXX_FLAGS="-g -O3" \
-D CMAKE_C_FLAGS="-g -O3" \
-D CMAKE_FORTRAN_FLAGS="-g -O5" \
-D Trilinos_EXTRA_LINK_FLAGS="-lgfortran" \
-D CMAKE_VERBOSE_MAKEFILE=FALSE \
-D Trilinos_VERBOSE_CONFIGURE=FALSE \
-D TPL_ENABLE_MPI=ON \
-D BUILD_SHARED_LIBS=ON \
-D CMAKE_INSTALL_PREFIX:PATH=$HOME/share/trilinos \

if blas/lapack path need to be specified, we need

cmake \
-D Trilinos_ENABLE_Sacado=ON \
-D Trilinos_ENABLE_MueLu:BOOL=ON \
-D Trilinos_ENABLE_Stratimikos=ON \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_CXX_FLAGS="-g -O3" \
-D CMAKE_C_FLAGS="-g -O3" \
-D CMAKE_FORTRAN_FLAGS="-g -O5" \
-D Trilinos_EXTRA_LINK_FLAGS="-lgfortran -pthread" \
-D CMAKE_VERBOSE_MAKEFILE=FALSE \
-D Trilinos_VERBOSE_CONFIGURE=FALSE \
-D TPL_ENABLE_MPI=ON \
-D BUILD_SHARED_LIBS=ON \
\
-D TPL_ENABLE_BLAS:BOOL=ON \
-D BLAS_INCLUDE_DIRS=$MYHOME/OpenBLAS-0.2.14/include \
-D BLAS_LIBRARY_DIRS=$MYHOME/OpenBLAS-0.2.14/lib \
-D BLAS_LIBRARY_NAMES:STRING="libopenblas.a" \
-D TPL_ENABLE_LAPACK=ON \
-D LAPACK_INCLUDE_DIRS=$MYHOME/OpenBLAS-0.2.14/include \
-D LAPACK_LIBRARY_DIRS=$MYHOME/OpenBLAS-0.2.14/lib \
-D LAPACK_LIBRARY_NAMES:STRING="libopenblas.a" \
\
-D CMAKE_INSTALL_PREFIX:PATH=$MYHOME/trilinos-11.14.3 \
../

Currently, I found gcc-5.2.0 + OpenBLAS-0.2.41 + trilinos-11.14.3 can work. -pthread is very important here. otherwise errors occurs. Using other Blas semms problem

In order to instal OpenBLAS in virtualbox, use
make TARGET=NEHALEM

16. Then finally we can configure deal.ii by

cmake -DCMAKE_INSTALL_PREFIX=$HOME/dealii-8.3.0 -DDEAL_II_WITH_METIS=ON -DMETIS_DIR=$HOME/metis-5.1.0 -DDEAL_II_WITH_P4EST=ON -DP4EST_DIR=$HOME/p4est-1.1 -DDEAL_II_WITH_TRILINOS=ON -DTRILINOS_DIR=$HOME/trilinos-12.2.1 ../

17. We need also add -pthread in the CMakeLists.txt as
set (CMAKE_CXX_FLAGS "-pthread")
SET(CMAKE_CXX_FLAGS "-pthread")
what is the differences?

--------------------------------------------------------------------------------

2015.10.07

这两天在家调程序,发现如果使用了trilinos库,在家里的系统里编译的就一直有问题,总是出现错误。先是不认相关的库,比如对于

TrilinosWrappers::SparseMatrix tm;
TrilinosWrappers::MPI::Vector rhs;
总是说sparseMatrix不是TrilinosWrappers中的类型,或者MPI不是TrilinosWrappers中的类型。后来查了/include/deal.II/lac/trilinos_vector.h ,看起来应该是#ifdef DEAL_II_WITH_TRILINOS这个判断并没有支持trilinos,所以后面就不继续声明了。干脆重装trilinos并重新编译dealii,所有都通过了,程序编译也都成功了,结果总是出现错误

/usr/bin/ld: warning: libmpi.so.1, needed by /home/nicklj/trilinos-11.14.3/lib/libmuelu-adapters.so, may conflict with libmpi.so.12
/usr/bin/ld: warning: libmpi.so.1, needed by /home/nicklj/trilinos-11.14.3/lib/libmuelu-adapters.so, may conflict with libmpi.so.12
CMakeFiles/main.dir/src/DE_implicit.cc.o: In function `dealii::TrilinosWrappers::MPI::Vector& dealii::TrilinosWrappers::MPI::Vector::operator=<double>(dealii::Vector<double> const&)':
/home/nicklj/dealii-8.3.0/include/deal.II/lac/trilinos_vector.h:695: undefined reference to `Epetra_MpiComm::Epetra_MpiComm(int)'
/home/nicklj/dealii-8.3.0/lib/libdeal_II.g.so.8.3.0: undefined reference to `Teuchos::details::safeCommFree(int*)'
collect2: error: ld returned 1 exit status
make[2]: *** [main] Error 1
make[1]: *** [CMakeFiles/main.dir/all] Error 2

在网上找了好半天,发现这个帖子:https://groups.google.com/forum/#!topic/dealii/dX5VZ61JiZE

说应该主要原因是trilinos和dealii采用了不同的编译器,前面已经说了,编译dealii的时候,我们会声明export CC=mpicc, export CXX=mpicxx,因为我们设置过路径让petsc帮我们装过mpich为默认mpi,所以dealii编译应该是用的这个。检查trilinos编译目录下的Makefile.export.Trilinos,发现

Trilinos_CXX_COMPILER=/usr/bin/mpicxx
Trilinos_C_COMPILER=/usr/bin/mpicc
Trilinos_Fortran_COMPILER=/usr/bin/mpif90

说明trilinos选择的mpi是系统默认的,难怪会出现总题,现在我们要改trilinos的编译配置,加一句-D MPI_BASE_DIR=$HOME/petsc-3.6.1/arch-linux2-c-debug/bin,最终配置为

cmake \
-D Trilinos_ENABLE_Sacado=ON \
-D Trilinos_ENABLE_MueLu:BOOL=ON \
-D Trilinos_ENABLE_Anasazi:BOOL=ON \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_EpetraExt:BOOL=ON \
-D Trilinos_ENABLE_Triutils:BOOL=ON \
-D Trilinos_ENABLE_Belos:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
-D Trilinos_ENABLE_Stratimikos=ON \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_CXX_FLAGS="-g -O3" \
-D CMAKE_C_FLAGS="-g -O3" \
-D CMAKE_FORTRAN_FLAGS="-g -O5" \
-D Trilinos_EXTRA_LINK_FLAGS="-lgfortran -pthread" \
-D CMAKE_VERBOSE_MAKEFILE=FALSE \
-D Trilinos_VERBOSE_CONFIGURE=FALSE \
-D TPL_ENABLE_MPI=ON \
-D MPI_BASE_DIR=$HOME/petsc-3.6.1/arch-linux2-c-debug/bin \
-D BUILD_SHARED_LIBS=ON \
\
-D TPL_ENABLE_BLAS:BOOL=ON \
-D BLAS_INCLUDE_DIRS=$MYHOME/OpenBLAS-0.2.14/include \
-D BLAS_LIBRARY_DIRS=$MYHOME/OpenBLAS-0.2.14/lib \
-D BLAS_LIBRARY_NAMES:STRING="libopenblas.a" \
-D TPL_ENABLE_LAPACK=ON \
-D LAPACK_INCLUDE_DIRS=$MYHOME/OpenBLAS-0.2.14/include \
-D LAPACK_LIBRARY_DIRS=$MYHOME/OpenBLAS-0.2.14/lib \
-D LAPACK_LIBRARY_NAMES:STRING="libopenblas.a" \
\
-D CMAKE_INSTALL_PREFIX:PATH=$MYHOME/trilinos-11.14.3 \
../

最后补充一下,编译trilinos的时候似乎用单核编成功率更高?

-----------------------------------------------------------------------------------------------

2015.12.17

安装slepc库,用于eigenvalue求解

下载slepc,http://slepc.upv.es/download/download.php?filename=slepc-3.6.1.tar.gz,把最后的版本号改为和petsc相同的版本

在$HOME下解压

export SLEPC_DIR=$HOME/slepc-3.6.1
cd $HOME/slepc-3.6.1
./configure
make

配置dealii编译参数

cmake -DCMAKE_INSTALL_PREFIX=$HOME/dealii-8.3.0 -DDEAL_II_WITH_METIS=ON -DMETIS_DIR=$HOME/metis-5.1.0 -DDEAL_II_WITH_P4EST=ON -DP4EST_DIR=$HOME/p4est-1.1 -DDEAL_II_WITH_TRILINOS=ON -DTRILINOS_DIR=$HOME/trilinos-11.14.3 -DDEAL_II_WITH_SLEPC=ON -DSLEPC_DIR=$HOME/slepc-3.6.1 ../

 

北海道自驾游记

北海道自驾游记 published on No Comments on 北海道自驾游记

如果再不写这篇,估计就再也没时间写了(说好的维也纳游记呢?)。关于北海道自驾游,自从看了非诚勿扰(电影而不是综艺节目)以后,一直都是我的一个心愿,想去一趟那片美丽、寒冷、清净的土地上去看看。这次出游出于一次偶然的想法,一次酷航打折冲动的抢够,经历了后悔、想改计划、想取消行程、无奈、期望、害怕等等持续几个月复杂的心情后,终于还是于去年10月出发了。这个时间选的意图很明显,就是冲着枫叶去的,我觉得我们运气好,但不是非常好。看到了红叶,但和想像还是有一点点差距。但从结果上来说我还是非常非常满意的。关于这次旅行的交通安排、我们经历了自驾-JR-自驾-JR-自驾........反复无数的思想斗争,最后还是决定自驾,不圆这个心愿,一辈子都会遗憾。而让我们有这样一次反复的心里煎熬的原因,就是语言问题。如果自驾,行程又安排的紧,万一路上发生什么磕碰,在一个人生地不熟语言不通的环境,想想就觉得很可怕。然后再是驾驶问题,只有我一个司机,一个人每天几个小时的车程开上好几天,我是否能受的了,会不会犯困,我自己都没底。不过yy坚定的信念还是给了我很大的支持。不管了,事前做好充分的准备工作,查阅大量的资料,看看前人的经验,关于事故、关于保险等等的一系列问题都要有心里准备。很幸运,一路上非常顺利。最后一天交车钥匙以后,整个人心里的压力才算最终卸下来。但我相信,事前充分的准备是我能抵的住这些压力的前提。全部行程结束后,我很庆兴当时的冲动,也很满意当时理智的安排(我们放弃了很多景点,如果时间安排再紧一些其实是可以去到的)。

废话不多说了,或许我会再写一个攻略篇,详细介绍这次自驾游的经验,不过这篇就算了,主要是以贴照片和记游记为主。

因为我们主要是打算游玩道东一块,所以决定在旭川租车、札幌还车。

然而,就在我们准备出发的前一周,传说中的“黄蜂”超级台风开始肆虐冲绳,并预计在我们到达那两天经过东京。当时得到这个消息就快疯了,天天关注台风的新闻与预报。万辛,在我们抵达东京的前两天,台风刚刚从北海道撤离。老天真的是挺眷顾我们的。

第一天:新加坡-台北(转机)-东京(成田机场转羽田机场)-旭川

旭川是个小市,如果不是他们的动物园,或许知道的人更少。全市就只有一条比较繁华的商业街,但也就是因为这样,让这个城市多了许多生活化的气息。

Hokkaido-6

小清新交通灯,开始泛黄的枫叶

Hokkaido-11

唯一的商业街

Hokkaido-21

北海道很有名的“梅光轩”酱油拉面本店。新加坡的Takashimaya楼下也开的有。

IMG_3608 IMG_3602

典型的便利店早餐,饭团、炸鸡块、关东煮......我是多么希望新加坡超市有这些东西卖啊

IMG_3624 IMG_3623

对我们来说旭川只是路过,没有多做停留。租了车后,立即前往层云峡。层云峡温泉街其实就只有巴掌大一块地方,从头走到尾大概就五分钟吧。街边上的树红的黄的绿的都有,很漂亮。

Hokkaido-22

秋日的阳光透过金黄的树叶

Hokkaido-24

到此一游

Hokkaido-37

因为在层云峡只停留一天,远的地方玩不了,各种“岳”也无法一一爬到,传说中的大小函也无法目睹,因此就只上了一个温泉街上就可以直接缆车到的黑岳。可以看到,我们来的时间还是晚了两周,要是早点,满山的红叶,想想那场景就很激动。可惜,看红叶真的只能靠运气,虽然我参考了前几年的时间,但还是没抓住。不过换个角度想想,如果真早两个星期过来,那就正好赶上台风了........不过,满山的秃枝依然非常壮观。

Hokkaido-46

那个应该就是黑岳了,山上真冷啊

Hokkaido-53

因为玩的时间短,没太多可看的了,加上山上大冷风又大,早早就下来了。看时间还有点早,就去了附近的一个叫做银河瀑布的地方。有车就是好啊

Hokkaido-112

Hokkaido-102

层云峡的拉面店

IMG_3673 IMG_3760
IMG_3761                                   IMG_3751

温泉酒店的早餐,看到那大粒的鱼籽了吗?这是自己随便加啊~~~

IMG_3769

第二天,离开层云峡,前往曲斜路湖。沿途的田原风光

Hokkaido-122

因为有3个小时的车程,不敢连续开时间太长,就在中途找了一个休息站。北海道有许多这样的休息站,有一个专门的官方站点可供查询。有些地方宽广很有特色,有些地方狭小就只有一间小屋。不过这样的休息站有些最基本的功能:免费停车、卫生间,卖拉面盖饭之类的餐饮。长途驾驶途中,在这样的一些小站停靠还是很让人舒心的一件事。

之前忘照车了,补上车加车模一张。

Hokkaido-126

休息站的几个商铺,有卖传说中的北海道牛奶,那个浓郁的香啊,根本无法忘怀。再次喝到这么香浓的牛奶,应该就是在千岁机场了。回新加坡在westgate楼下的日本超市也有北海道十胜牛奶卖,价格死贵不说,味道实在差太太太远了。

Hokkaido-133 IMG_3803

继续乡间小路。北海道的路大多都是这样的风格,让人很舒服。看过非诚勿扰的同学,应该知道路边上那些箭头路标的作用吧:)

Hokkaido-150 IMG_3645

开车经过美幌,这是个听都没听说过的地方。本来根本没打算在这边停留,却被路边的一排排红叶震撼住了,立马停车观赏起来。之前看到的都是已经发黄了的叶子,这是来北海道第一次真正见到了红成这样的叶子,无论如何,不虚此行了。

Hokkaido-172

美幌有好多小寺庙

Hokkaido-160

某人开始玩文艺

Hokkaido-165 Hokkaido-181

Hokkaido-191 Hokkaido-187

还没欣赏够, 无奈天开始下大雨,只好躲回车内,继续前行。

Hokkaido-194

因为下雨,在山间,前一段路还是好好的,后一段路大雾突然开始弥漫,没有一点过渡。把车速降到15以内,依然胆颤心惊。这应该是我这一段旅行最害怕的时候了。无法形容雾有多大,下图是雾已经退散大半的场景。

IMG_3867

坎坎坷坷,终于来到了曲斜路湖旁。先搞定住宿为重。这里订的一间hostel藏在原野中,非常有特色的一栋小房子。

Hokkaido-198 Hokkaido-208

IMG_3894

旅店自制的咖喱鹿肉饭,相当美味,价格还便宜。

IMG_3940

相似的地点,不同的时刻,不同的光线,不同的感受

Hokkaido-211 Hokkaido-235
Hokkaido-237 Hokkaido-239

去到了传说中的秘汤-古当温泉

Hokkaido-248

男女汤中间就隔了个石头。。。。。图中是两日本人,都是穿了泳衣的。其实是有规定需要穿泳衣的,但因为基本没人,还是有日本大叔裸泡的。

Hokkaido-222

住了一晚上,第二天天气超好,运气不错。一大清早5点多就爬起来沿湖绕圈,顺道去硫磺山。下图继续摆拍

Hokkaido-285

清晨的街道。

Hokkaido-286

硫磺山,空无一人,连停车收费的人都不在。

Hokkaido-304

小清新的告示。

Hokkaido-312

天空蓝的让人无法直视。

Hokkaido-314

下一站摩周湖。在1931年测出能见深度41米,当时是全世界透明度最高的湖。现在降了一些,依然是全日本透明度最高的湖。这个湖终年被雾汽所笼盖,很难见得全貌,就连日本本地人见到过对岸的也不多,因此相传看到对岸的人恋爱、婚姻都会很不顺利。当然啦,这是为了安慰绝大多数看不到湖对岸的游客了。而我们运气超好,这一天是我们来北海道天气最好的一天,有幸一睹湖的全貌。天空蓝的让人惊艳,这种美的感觉已经无法用言语形容。

Hokkaido-320

必须到此一游

Hokkaido-341

继续日式小清新

Hokkaido-360

出了摩周湖,前往阿寒湖,阳光透过树林的感觉

Hokkaido-376

这就是因电影非诚勿扰而在中国大名鼎鼎的阿寒湖了。

Hokkaido-386

当时舒淇就是在这个酒店里泡温泉,鹤雅鄙之座,当地最高档次的温泉酒店,窗外就是阿寒湖全景。当然了,我等穷人肯定是没钱住这种地方的,过来饱一下眼福也好。

Hokkaido-406

和酒店接待说了说,他同意我们在一楼大厅参观。穿过大厅,下图就是酒店后院的湖景。

Hokkaido-409

离开了阿寒湖,下面这个地方是另一个休息站,很明显很个小站都有自己的特色了。

Hokkaido-429

阳光透过树林。这里用手机拍了一段慢镜头,超有感觉,不过没法分享了。本人不是文青,没法用语言形容,以下省略三千字感想

Hokkaido-455

上高速了,回札幌。这是一段超长的行程。第一次跑日本高速,感觉就是,路很好,但他们开车太快了。这里我必须吐槽说,谁说日本人开车文明了?我看到高速上牌子写的限速80(最高),听说日本人开车很守规矩,我不敢开高,怕被罚,一般90-100,结果尼马后面压一大长窜车啊。让我加速也不是,不加速也不是。而且日本高速大多数路段只有一个车道,别人都没办法超车,一般都是很长一段路后才提供一个2、3公里的超车道。反正开的我手里都是汗啊。不说高速,平常乡间道路也是这样,限速50,当然路况实在太好随便怎么开都容易超,我一般开到70-80,结果经常又是压一排车,不过乡间小路好处就是可以放慢让别人超。

好了,吐槽完毕,日本的路状确实很赞,这没得说,不过我还是不喜欢开高速,想让别人超车都没办法。

Hokkaido-477

看过这么多美景,札幌那些景点显然已经完全无法满足我们了。于是毫不犹豫放弃了札幌一日游。然后考虑多出来的一天是玩小樽,还是登别。小樽当然更有名了,中国人也去的非常多,不过看了很多介绍都没发现特别吸引我们的点。既然来北海道是玩风景,索性把风景看到底吧。出发,登别地狱谷。

不想走高速,所以打算经过支笏湖,沿海边走走玩玩。事实证明这个选择是对的。支笏湖的照片就不贴了,一路上湖太多了。不过沿着海边可以随时找个地方停靠休息。这是我们看到一个堤坝旁边壮观的海钓。

Hokkaido-536

不知名的海边小镇,装有奇怪饮料的自动售卖机,还有永远无法到达海边的少女.......好吧,没玩过air的估计根本不知道我在说啥

Hokkaido-537

抵达地狱谷,其实就是一座硫磺山,所以附近的温泉很有名。景色很壮观,不过这气味.........我实在是受不了,整个过程人都是晕晕的,只想早点离开,所以照片也没照多少。

Hokkaido-577

通往地狱之路

Hokkaido-591

大汤沼,里面的硫磺水水温大概有130度

Hokkaido-621

说是硫磺拉面........基本每家拉面馆都有自己的特色

IMG_4256

出来后,沿着盘山观景道走,看到一个很有意思的俱多乐湖,这是一个火山口,所以从上往下看整个湖非常非常圆。左边介绍的牌里里面有缩略图。

Hokkaido-685

北海道的最后一天,出登别后还有点时间,前往附近一个叫白老的小城市随便逛逛,当然,这不是景点,也没什么人听说过,所以风景无法和之前的比。但没有游客打扰的日本小镇同样有它自己的味道。

Hokkaido-697

最后以札幌的北海道烤肉和一家很有名的寿司作为结束吧

IMG_4179 IMG_4287

至此,北海道行程基本靠一段落了,至于后面的东京,确实没啥好写的了,基本就是秋叶原之旅。。。。。这次自驾游算是圆了自己的一个梦。当然世界那么大,还有更多的地方想去看看。或许后面会有很长一段时间都无法出游了,不过如果有机会,一定会再次出发的。

 

 

 

 

Setting the Number of OpenMP Threads

Setting the Number of OpenMP Threads published on No Comments on Setting the Number of OpenMP Threads

Using the OpenMP* API
The OpenMP* API specification provides the following standard ways to change the desired number of threads on the coprocessor:

1. Calling the function omp_set_num_threads(n) before the omp parallel region
2. Using the clause #pragma omp parallel num_threads(n)
3. Setting the environment variable OMP_NUM_THREADS=n