-
Notifications
You must be signed in to change notification settings - Fork 9
Building and Running Tusas
Create and cd to a build directory:
pn1512687:~/work/tusas_git$ mkdir build;cd build
As you enter the CMake command to build the tusas executable, the path to your Trilinos download must be provided as TRILINOS_DIR, shown below.
pn1512687:~/work/tusas_git/build$ cmake -DTRILINOS_DIR:string=/Users/cnewman/src/trilinos-11.12.1-Source/GCC_4_9_2_MPI_OMP_OPT/ ../
pn1512687:~/work/tusas_git/build$ make
If any mistakes are made with this CMake command, make sure to delete
CMakeCache.txt, CMakeFiles, Makefile, and cmake_install.cmake, to be sure that the corrected commands may go through properly.
There are several build options that can be passed to CMake via the -D option:
-
TRILINOS_DIRspecifies the Trilinos build location. Mandatory. Ex:-DTRILINOS_DIR:string=/Users/cnewman/src/trilinos-11.12.1-Source/GCC_4_9_2_MPI_OMP_OPT/ -
TUSAS_CXX_FLAGSspecifies additional compilation flags. Ex:-DTUSAS_CXX_FLAGS="-DTUSAS_KOKKOS_PRINT_CONFIG -DTUSAS_NEW_MUELU -w"
Some common options forTUSAS_CXX_FLAGSare:
-
-wturn off warnings for GCC. -
-DTUSAS_KOKKOS_PRINT_CONFIGspecifies to print the Kokkos configuration at the beginning of a Tusas run. -
-DTUSAS_NEW_MUELUspecifies to use the MueLu interface found in the Trilinos master branch. If utilizing a previous release version, do not use this. -
TUSAS_HAVE_MKLspecifies to use MKL blas and lapack. -
TUSAS_NO_LAPACKdo not compile Lapack code; ie disables the error estimator. -
TUSAS_HAVE_CLAPACKuse Clapack interface rather than standard lapack.
Ninja can be a little faster than make. Add the -GNinja generator to the cmake line:
pn1931313:~/work/tusas_git/VOTD_KOKKOS$ cmake -DTRILINOS_DIR:string=/Users/cnewman/src/Trilinos/VOTD_KOKKOS/ -DTUSAS_CXX_FLAGS=“-DTUSAS_KOKKOS_PRINT_CONFIG -DTUSAS_NEW_MUELU -w” -GNinja ../
pn1931313:~/work/tusas_git/VOTD_KOKKOS$ ninja
Similar to make, use the following:
pn1931313:~/work/tusas_git/VOTD_KOKKOS$ ninja clean
pn1931313:~/work/tusas_git/VOTD_KOKKOS$ ninja -j 20
See https://ninja-build.org/manual.html
To be updated…
We need a section on valgrind and clang address sanitizer. For clang address sanitizer:
$ cmake -DTRILINOS_DIR:string=/Users/cnewman/src/trilinos-12.6.4-Source/LLVM_6_0_0_MPI_OMP_OPT/ -DTUSAS_CXX_FLAGS="-fsanitize=address -O1 -fno-omit-frame-pointer -g" ../../
$ ./tusas --input-file=tusas.xml
- An example xml input file is
tusas/trunk/tusas.xml. Options and default values can be found in the filetusas/trunk/input/include/ParamNames.h. - The xml file points to a meshfile (in exodusII format). There are example meshfiles in
tusas/trunk/meshes. Meshfiles can be produced with: http://cubit.sandia.gov Contact cnewman at lanl.gov for a copy of cubit. - Linear solver options can be found at: https://trilinos.org/docs/dev/packages/stratimikos/doc/html/classStratimikos_1_1DefaultLinearSolverBuilder.html
- Nonlinear solver options can be found at: https://trilinos.org/docs/dev/packages/nox/doc/html/parameters.html
- ML options can be found at: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwisuJPerYzXAhVLj1QKHZ8SA4cQFggoMAA&url=https%3A%2F%2Ftrilinos.org%2Foldsite%2Fpackages%2Fml%2Fmlguide5.pdf&usg=AOvVaw3vV-77r1zAOsGshZtHXbvC
There are three (optionally four) output files produced by Tusas.
-
results.eis an ExodusII (binary) file that contains the solution on the mesh. It can be viewed easily with Paraview: http://www.paraview.org
Two useful tools can be found in the$(TRILINOS_DIR)/bindirectory.exodiffcan be used to difference two ExodusII files.exotxtcan be used to dump the contents of an ExodusII file in text to the terminal or a file. -
time.datis an ASCI file that provides solver timing diagnostics. -
jfnk.datis an ASCI file that provides solver performance diagnostics. - Some test cases produce an ASCI file
vtip.datthat contains dendrite tip velocity and position along the x-axis as a function of time.
There are three additional runtime options for Tusas.
-
--writedecompParticularly with slurm on HPC machines and on some linux machines, the decomposition scripts spawned by Tusas do not get run properly. This option writes the filesdecompscriptandepuscriptwhich can be used to manually decompose and join the mesh files respectively. -
--skipdecompAssumes the decomposed mesh files already exist indecomp/; Tusas does not spawn the decomposition scripts. The workflow to employ these options 1 and 2 is as follows:
$ mpirun -np 4 ./tusas —input-file=tusas.xml —writedecomp
$ bash decompscript
$ mpirun -np 4 ./tusas —input-file=tusas.xml —skipdecomp
$ bash epuscript
Note that to rerun Tusas with the same decomposition, onlympirun -np 4 ./tusas --input-file=tusas.xml --skipdecompis needed. -
--restartRestart from the last output found indecomp/results.*. Assumes the identical simulation parameters as previous run.
We utilize CTest, a testing tool that is distributed with CMake. All tests are created and run from within Test, which is a subdirectory of trunk.
The build process outlined above configures the ctest testing system.
It is recommended to run tests using 1 openmp thread; from within the build directory, you can run the testing suite as follows:
pn1512687:~/work/tusas_git/build$ OMP_NUM_THREADS=1 ctest
Additionally, you may use these features of ctest to specify certain conditions you may want.
-
$ OMP_NUM_THREADS=1 ctest —rerun-failed
This will show the results of only the tests that failed in the last execution ofctest -
$ OMP_NUM_THREADS=1 ctest -R MyTest
This will show the results of only the tests that contain the phrase “MyTest” in their title. -
$ ctest —help
For morectestinformation.
Building the Tusas documentation currently requires doxygen 1.8.12:
http://www.stack.nl/~dimitri/doxygen/download.html
and graphviz-2.40:
http://www.graphviz.org/Download..php
To build the doxygen generated documentation, change to the doc directory, execute:
$ cmake .
$ make doc
The doxygen generated files will be located at
doc/html/index.html.
The process described above builds Tusas with limited OpenMP support. The default is loop level parallelization. To build with OpenMP enabled residual and Jacobian fills, configure Tusas as follows:
$ cmake -DTRILINOS_DIR=/Users/cnewman/src/trilinos-12.6.4-Source/GCC_6_2_0_MPI_OMP_OPT/ -DTUSAS_CXX_FLAGS=-DTUSAS_COLOR_CPU .
Note that many tests will diff in this configuration, as the tests were generated with the default configuration.
Currently OpenMP offloading support for GPU is being tested on guido.lanl.gov. To build it is necessary to use the build script on guido. This is due to cmake not knowing about multiple targets at this time.
/usr/bin/mpicxx -v -DTUSAS_COLOR_GPU -flto -fopenmp -foffload=nvptx-none="-lm" \ -I. -I/home/cnewman/src/trilinos-12.6.4-Source/GCC_7_2_0_MPI_OPT//include -I./mesh/include \ -I./basis/include -I./preconditioner/include -I./timestep/include -I./input/include \ -I./error_estimator/include -I./elem_color/include -I./post_process/include -I./periodic_bc/include \ -I./projection/include -I../src/install/include \ tusas.cpp basis/basis.cpp mesh/Mesh.C input/ReadInput.cpp elem_color/elem_color.cpp periodic_bc/periodic_bc.cpp \ post_process/post_process.cpp error_estimator/error_estimator.cpp -o tusas.x \ -L/home/cnewman/src/trilinos-12.6.4-Source/GCC_7_2_0_MPI_OPT//lib \ -lnoxepetra -lnox -lstratimikos -lstratimikosbelos \ -lstratimikosaztecoo -lstratimikosamesos -lstratimikosml -lstratimikosifpack -lifpack2-adapters -lifpack2 \ -lnemesis -lexodus \ -lbelosepetra -lbelos -lml -lifpack -lamesos -laztecoo -lisorropia \ -lthyraepetra -lthyracore -lepetraext -ltpetraext -ltpetrainout -ltpetra \ -ltpetraclassic -lzoltan -lepetra -lrtop \ -lteuchosremainder -lteuchosnumerics -lteuchoscomm -lteuchosparameterlist -lteuchoscore \ -lkokkoscore \ /usr/lib/x86_64-linux-gnu/libX11.so /home/cnewman/src/install/lib/libnetcdf.so /usr/lib/liblapack.so.3 /usr/lib/libblas.so.3