diff --git a/src/solvers/tnlIterativeSolver_impl.h b/src/solvers/tnlIterativeSolver_impl.h index 670565d23ff50baa43281286ab6a3412ce309fdc..f6503520c3f22a66d55fd2e5c5942a51db2dca00 100644 --- a/src/solvers/tnlIterativeSolver_impl.h +++ b/src/solvers/tnlIterativeSolver_impl.h @@ -101,10 +101,10 @@ bool tnlIterativeSolver< Real, Index> :: nextIteration() solverMonitor->refresh(); } - if( std::isnan( this->getResidue() || + if( std::isnan( this->getResidue() ) || this->getIterations() > this->getMaxIterations() || - ( this->getResidue() > this->getDivergenceResidue() && this->getIterations() > this->minIterations ) ) || - ( this->getResidue() < this->getConvergenceResidue() && this->getIterations() > this->minIterations ) ) + ( this->getResidue() > this->getDivergenceResidue() && this->getIterations() > this->minIterations ) || + ( this->getResidue() < this->getConvergenceResidue() && this->getIterations() > this->minIterations ) ) return false; return true; } diff --git a/tests/benchmarks/share/tnl-matrix-solvers-benchmark.cfg.desc b/tests/benchmarks/share/tnl-matrix-solvers-benchmark.cfg.desc deleted file mode 100644 index 8e8280574470d15a71513a8cd49958af2ffdcafa..0000000000000000000000000000000000000000 --- a/tests/benchmarks/share/tnl-matrix-solvers-benchmark.cfg.desc +++ /dev/null @@ -1,19 +0,0 @@ -group IO -{ - string input-file(!) [Input binary file name.]; - string input-mtx-file("") [Input mtx file name.]; - string log-file("") [Log file name.]; - string matrix-stats-file("") [File for matrix statistics like size number of non-zero elements.]; - real stop-time(3.0) [How many seconds shell we iterate SpMV.]; - integer verbose(1) [Verbose mode.]; -},[Arguments describing input and output data.]; - -group solver -{ - string device("host") [On what device the solver will run. Can be host or cuda.]; - string solver-name(!) [Set matrix solver for benchmarking. It can be sor, cg, bicgstab, tfqmr, gmres. ]; - string solver-class("tnl") [Choose other library of solvers. It can be tnl or petsc.]; - real max-residue(1.0e-6) [Set what residue we want to achieve.]; - integer gmres-restarting(20) [Set restarting for GMRES method.]; - real sor-omega(1.0) [Omega parameter for the SOR method. Can be 0--2.]; -},[Arguments describing the solver.]; \ No newline at end of file diff --git a/tests/benchmarks/share/tnl-sparse-matrix-benchmark.cfg.desc b/tests/benchmarks/share/tnl-sparse-matrix-benchmark.cfg.desc deleted file mode 100644 index 9a3bde6ec250122dcb96fc681f8bd4f276bc5b9b..0000000000000000000000000000000000000000 --- a/tests/benchmarks/share/tnl-sparse-matrix-benchmark.cfg.desc +++ /dev/null @@ -1,12 +0,0 @@ -group IO -{ - string input-mtx-file(!) [Input mtx file name.]; - string input-file("") [Input binary file name.]; - string pdf-file("") [PDF file with matrix pattern.]; - string log-file("") [Log file name.]; - string precision("double") [Precision of the arithmetics.]; - real stop-time(3.0) [How many seconds shell we iterate SpMV.]; - integer max-iterations(100) [Maximum number of SpMV repetitions.]; - bool format-test( no ) [Turn on/off test of matrix formats.]; - integer verbose(1) [Verbose mode.]; -},[Arguments describing input and output data.]; \ No newline at end of file diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 77a12ce7e23fd423529a91853f5de6379e6d5cd2..8e955822b3e53c2f78e9d1e3fb39a23604fde6b4 100755 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,8 +1,9 @@ add_subdirectory (src) add_subdirectory (share) +add_subdirectory (tnl-quickstart) -CONFIGURE_FILE( "tnl-compile.in" "${PROJECT_TOOLS_PATH}/tnl-compile" ) -CONFIGURE_FILE( "tnl-link.in" "${PROJECT_TOOLS_PATH}/tnl-link" ) +CONFIGURE_FILE( "tnl-compile.in" "${PROJECT_TOOLS_PATH}/tnl-compile" @ONLY ) +CONFIGURE_FILE( "tnl-link.in" "${PROJECT_TOOLS_PATH}/tnl-link" @ONLY ) INSTALL( FILES ${PROJECT_TOOLS_PATH}/tnl-compile ${PROJECT_TOOLS_PATH}/tnl-link diff --git a/tools/tnl-compile.in b/tools/tnl-compile.in index fd1f1fb36a037aff91360b15ba6f516f8868b6dc..bfd09cca6d9d75248196500d795d6ec0ed906812 100644 --- a/tools/tnl-compile.in +++ b/tools/tnl-compile.in @@ -1,3 +1,14 @@ #!/usr/bin/env bash -echo -I@CMAKE_INSTALL_PREFIX@/include/tnl-@tnlVersion@ \ No newline at end of file +DEBUG_FLAGS = "-DNDEBUG -march=native" +CUDA_FLAGS = "" + +for option in "$@" +do + case $option in + --cuda ) CUDA_FLAGS="-DHAVE_CUDA -DHAVE_NOT_CXX11 `tnl-cuda-arch`" ;; + --debug ) DEBUG_FLAGS="-g -O0" + esac +done + +echo -I@CMAKE_INSTALL_PREFIX@/include/tnl-@tnlVersion@ ${CUDA_FLAGS} \ No newline at end of file diff --git a/tools/tnl-link.in b/tools/tnl-link.in index 5f389a560de55579caa86215b9daee569c81cb0d..52806a77bd008f9681bdc9a24974fb2b45f05ea3 100644 --- a/tools/tnl-link.in +++ b/tools/tnl-link.in @@ -1,3 +1,12 @@ #!/usr/bin/env bash -echo -L@CMAKE_INSTALL_PREFIX@/lib -ltnl-@tnlVersion@ \ No newline at end of file +DEBUG="" + +for option in "$@" +do + case $option in + --debug ) DEBUG="-dbg" + esac +done + +echo -L@CMAKE_INSTALL_PREFIX@/lib -ltnl${DEBUG}-@tnlVersion@ \ No newline at end of file diff --git a/tools/tnl-quickstart/CMakeLists.txt b/tools/tnl-quickstart/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..1a403b4bcfa9d1b644120456b40a799df138da77 --- /dev/null +++ b/tools/tnl-quickstart/CMakeLists.txt @@ -0,0 +1,4 @@ +INSTALL( FILES tnl-quickstart + tnl-quickstart.py + DESTINATION bin + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) \ No newline at end of file diff --git a/tools/tnl-quickstart/tnl-quickstart b/tools/tnl-quickstart/tnl-quickstart new file mode 100644 index 0000000000000000000000000000000000000000..4b720a11dd3c1ff5b5cb93d47845e628809c239d --- /dev/null +++ b/tools/tnl-quickstart/tnl-quickstart @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +tnl-quickstart.py \ No newline at end of file diff --git a/tools/tnl-quickstart/tnl-quickstart.py b/tools/tnl-quickstart/tnl-quickstart.py new file mode 100644 index 0000000000000000000000000000000000000000..e67080d0283ea9fc973524e664b2cc7d4dba5c80 --- /dev/null +++ b/tools/tnl-quickstart/tnl-quickstart.py @@ -0,0 +1,20 @@ +#! /usr/bin/python + +# To change this license header, choose License Headers in Project Properties. +# To change this template file, choose Tools | Templates +# and open the template in the editor. + +__author__ = "oberhuber" +__date__ = "$May 6, 2015 8:40:59 PM$" + + +def generateMakefile( solverName ): + file = open( "Makefile", "w" ) + file.write( "") + file.close() + +print( "TNL Quickstart -- solver generator") +print( "----------------------------------") +projectName = input( "Project name: (whitespace characters are allowed)" ) +solverName = input( "Solver name: (whitespace characters are NOT allowed)" ) +generateMakefile( solverName ) \ No newline at end of file