Wiki

Clone wiki

pflotran / Developers / CodeDevelopment / CodeCoverage

Code Coverage

How to use Intel's Code Coverage with PFLOTRAN:

  1. Configure PETSc with the Intel compiler, if you haven't already done so. For example, from inside of the top-level petsc directory:

    source /opt/intel/bin/compilervars.csh intel64

    export PETSC_DIR=pwd

    ./config/configure.py --PETSC_ARCH=intel-c-opt --with-cc=icc --with-fc=ifort --with-cxx=icpc --with-clanguage=c --with-shared-libraries=0 --with-debugging=0 --download-hdf5=yes --with-valgrind=1 --download-parmetis=yes --download-metis=yes --download-hypre=yes --with-c2html=0 --download-mpich=http://www.mpich.org/static/downloads/3.2/mpich-3.2.tar.gz --with-blas-lapack-dir=/opt/intel/mkl FFLAGS='-diag-disable 5462'

  2. Compile PFLOTRAN using the Intel compiler, making sure to include the "-prof-gen:srcpos" flag. The easiest way to do this is to make a copy of the makefile in the pflotran source code directory, calling it makefile_codecov or similar. Add the flag -prof-gen:srcpos in the list of MYFLAGS near the top of the makefile. Finally, make sure you are using the PETSc architecture configured with Intel compiler when you compile.

    cd ~/software/pflotran/src/pflotran

    (in makefile_codecov) MYFLAGS = -I. -prof-gen:srcpos

    make -f makefile_codecov pflotran PETSC_ARCH=intel-c-opt

  3. Run the suite of regression tests. Each regression test should generate a .dyn file. Additionally, a .spi file should be generated (spi = static profile information). These files will be located in your PFLOTRAN source code directory (/src/pflotran). Note: some regression tests may fail

    cd ~/software/pflotran/regression_tests

    make test

  4. Run profmerge (in your PFLOTRAN source code directory) to merge all of the *.dyn files into one .dpi file (dpi = dynamic profile information). The default .dpi file is called pgopti.dpi.

    cd ~/software/pflotran/src/pflotran

    profmerge

  5. You should now see the .dpi file. Next, run the code coverage tool to generate a report.

    codecov -dpi pgopti.dpi -spi pgopti.spi

  6. You should now see an html file called CODE_COVERAGE.HTML. This is the code coverage report. Open this in your browser.

Updated