Code Setup

install g3dflow from scratch

First install needed external packages and libraries

> mkdir externalpackages

download PETSc and place downloaded files in the externalpackages directory

> ./config/adm/install_external_packages.pl -petsc

If SLEPc routines will be used, download SLEPc archive and place in the externalpackages directory

> ./config/adm/install_external_packages.pl -slepc

If the CGNS file format will be used, download the CGNS archive and place in the externalpackages directory

> ./config/adm/install_external_packages.pl -cgns

If valgrind will be used (debugging end profiling tool), download the valgrind archive and place the valgrind directory in the externalpackages directory. Instalation of valgrind from source and usage of valgrind with g3dflow is described in more detail under debugging below

> ./config/adm/install_external_packages.pl -valgrind

configure g3dflow

> export PETSC_DIR=/path/to/petsc

> ./config/configure.pl

make g3dflow

> make all test

make targets

target description option
man extract code manual (html format)  
classtree extract html class tree  
codetree extract html code tree  
ca extract git archive  
tar extract local archive  
all build g3dflow DEBUG, VALGRIND, PROFILING
whipe remove object files and binaries DEBUG, VALGRIND, PROFILING
whipe_all remove all object files and binaries  
testdir set up test cases  

debugging g3dflow

The most efficeient way to find malloc or out-of-bound errors is to run the code in valgrind. valgrind might be available on your system but to be able to do debugging in multi-process mode valgrind has to be configured with the --with-mpicc=option, which is most likely not done in your system instalation. Moreover the mpicc must be that same as the one used by PETSc. So to be able to do debugging in parallel you might want to do a local installation of valgrind. For debugging in sequential mode, the system valgrind installation will do just fine.

To download the latest version from the valgrind subversion repository use:

> svn co svn://svn.valgrind.org/valgrind/trunk valgrind

installing valgrind

if you have downloaded an official release, unpack valgrind the tarball

> cd valgrind
> ./autogen.sh
> ./configure --prefix=installation_path --with-mpicc=mpicc_path
> make
> make install (must be run as root unless using the --prefix option)
  • The --prefix option is used when you do not have root privelages on your system (the default prefix is /usr/local/)
  • The mpicc_path should be the path used when compiling a g3dflow binary with the DEBUGG=1 option
  • Debugging using valgrind does not require a g3dflow_dbg binary but it is recomended since you will not get any information on where in the code an error is generated otherwise

running g3dflow with valgrind

Sequential debugging using valgrind:

> valgrind $G3D_PATH/bin/g3dflow_dbg -f runfile [options]

Parallel (or sequential) debugging using valgrind (requires g3dflow_dbg):

> $G3D_PATH/bin/g3d_run.pl -np N -f runfile [options] -valgrind

Other users guide pages