diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..cc53bef --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,66 @@ +--- +Checks: 'bugprone-*, + -bugprone-exception-escape, + clang-diagnostic-*, + clang-analyzer-*, + corecppguidelines-*, + modernize-*, + -modernize-use-nodiscard, + readability-*, + -readability-magic-numbers, + -readability-identifier-naming, + -readability-isolate-declaration, + -readability-avoid-const-params-in-decls, + -readability-identifier-length, + -readability-function-cognitive-complexity' +WarningsAsErrors: '' +HeaderFilterRegex: '.*' +AnalyzeTemporaryDtors: false +FormatStyle: none +User: user +CheckOptions: + - key: cert-dcl16-c.NewSuffixes + value: 'L;LL;LU;LLU' + - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField + value: '0' + - key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons + value: '0' + - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors + value: '1' + - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: '1' + - key: google-readability-braces-around-statements.ShortStatementLines + value: '1' + - key: google-readability-function-size.StatementThreshold + value: '800' + - key: google-readability-namespace-comments.ShortNamespaceLines + value: '10' + - key: google-readability-namespace-comments.SpacesBeforeComments + value: '2' + - key: llvm-else-after-return.WarnOnConditionVariables + value: '0' + - key: llvm-else-after-return.WarnOnUnfixable + value: '0' + - key: llvm-qualified-auto.AddConstToQualified + value: '0' + - key: modernize-loop-convert.MaxCopySize + value: '16' + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: modernize-loop-convert.NamingStyle + value: CamelCase + - key: modernize-pass-by-value.IncludeStyle + value: llvm + - key: modernize-replace-auto-ptr.IncludeStyle + value: llvm + - key: modernize-use-nullptr.NullMacros + value: 'NULL' + - { key: readability-identifier-naming.NamespaceCase, value: lower_case } + - { key: readability-identifier-naming.ClassCase, value: CamelCase } + - { key: readability-identifier-naming.PrivateMemberPrefix, value: m_ } + - { key: readability-identifier-naming.ProtectedMemberPrefix, value: m_ } + - { key: readability-identifier-naming.StructCase, value: CamelCase } + - { key: readability-identifier-naming.FunctionCase, value: lower_case } + - { key: readability-identifier-naming.VariableCase, value: lower_case } + - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } +... diff --git a/.codespell-ignore-words b/.codespell-ignore-words new file mode 100644 index 0000000..e886a25 --- /dev/null +++ b/.codespell-ignore-words @@ -0,0 +1,2 @@ +inout +nd \ No newline at end of file diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..5df52a8 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,3 @@ +[codespell] +skip = .git,*.ipynb,*.bib,*.ps,*.patch,spack-build-*,*/build,,__pycache__,.ccls,.ccls-cache,*.pdf,*.f90,*.f,*.bak +ignore-words = .codespell-ignore-words \ No newline at end of file diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 0000000..ef59873 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,6 @@ +name: "AMR-Wind CodeQL config" + +query-filters: + - exclude: + id: cpp/poorly-documented-function + diff --git a/.github/problem-matchers/gcc.json b/.github/problem-matchers/gcc.json new file mode 100644 index 0000000..9ab0679 --- /dev/null +++ b/.github/problem-matchers/gcc.json @@ -0,0 +1,18 @@ +{ + "__comment": "Taken from vscode-cpptools's Extension/package.json gcc rule", + "problemMatcher": [ + { + "owner": "gcc-problem-matcher", + "pattern": [ + { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + ] + } + ] +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4830fc0..34fe682 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,53 +3,237 @@ name: TIOGA CI on: push: branches: - - master - exawind pull_request: branches: - - master - exawind +concurrency: + group: ${{github.ref}}-${{github.head_ref}}-ci + cancel-in-progress: true + jobs: - build: + Formatting: + runs-on: ubuntu-latest + steps: + - name: Clone + uses: actions/checkout@v4 + - name: Check formatting + uses: DoozyX/clang-format-lint-action@v0.16.2 + with: + source: './src' + exclude: '.' + extensions: 'h,cpp' + clangFormatVersion: 16 + CPU: + needs: Formatting runs-on: ${{matrix.os}} strategy: matrix: - #os: [ubuntu-latest, macos-latest] - os: [ ubuntu-latest ] + os: [ubuntu-latest, macos-latest] build_type: [Release, Debug] include: - # - os: macos-latest - # build_deps: brew install open-mpi && brew link gcc + - os: macos-latest + install_deps: brew install mpich ccache + comp: llvm + procs: $(sysctl -n hw.ncpu) + ccache_cache: /Users/runner/Library/Caches/ccache + ccache_size: 50M - os: ubuntu-latest - build_deps: sudo apt-get install mpich libmpich-dev - name: ${{matrix.os}} - ${{matrix.build_type}} + install_deps: sudo apt-get install -y mpich libmpich-dev + comp: gnu + procs: $(nproc) + ccache_cache: ~/.cache/ccache + ccache_size: 50M + steps: + - name: Clone + uses: actions/checkout@v4 + with: + submodules: true + - name: Dependencies + run: ${{matrix.install_deps}} + - name: Setup + run: | + echo "NPROCS=${{matrix.procs}}" >> $GITHUB_ENV + echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV + echo "CCACHE_COMPRESSLEVEL=1" >> $GITHUB_ENV + echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV + echo "CCACHE_MAXSIZE=${{matrix.ccache_size}}" >> $GITHUB_ENV + - name: Install Ccache + run: | + if [ "${RUNNER_OS}" != "macOS" ]; then + wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz + tar xvf ccache-4.8-linux-x86_64.tar.xz + sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/ + fi + - name: Set Up Ccache + uses: actions/cache@v4 + with: + path: ${{matrix.ccache_cache}} + key: ccache-${{github.workflow}}-${{github.job}}-${{matrix.os}}-${{matrix.build_type}}-git-${{github.sha}} + restore-keys: | + ccache-${{github.workflow}}-${{github.job}}-${{matrix.os}}-${{matrix.build_type}}-git- + - name: Configure + run: | + cmake -B ${{runner.workspace}}/build-ci-${{matrix.build_type}} \ + -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install-${{matrix.build_type}} \ + -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} \ + -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ + ${{github.workspace}} + - name: Build + run: | + echo "::add-matcher::.github/problem-matchers/gcc.json" + ccache -z + set -eu -o pipefail + cmake --build ${{runner.workspace}}/build-ci-${{matrix.build_type}} --parallel ${{env.NPROCS}} 2>&1 | \ + tee -a ${{runner.workspace}}/build-ci-${{matrix.build_type}}/build-output.txt + - name: Ccache Report + run: | + ccache -s + ls ${{matrix.ccache_cache}} + du -hs ${{matrix.ccache_cache}} + - name: Report + working-directory: ${{runner.workspace}}/build-ci-${{matrix.build_type}} + run: | + echo "::add-matcher::.github/problem-matchers/gcc.json" + egrep "warning:|error:" build-output.txt | egrep -v "submods" \ + | egrep -v "ld: warning:" | egrep -v "lto-wrapper: warning:" | sort | uniq \ + | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > build-output-warnings.txt + cat build-output-warnings.txt + exit $(tail -n 1 build-output-warnings.txt | awk '{print $2}') + Lint-clang-tidy: + needs: Formatting + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: ${{matrix.build_deps}} - - name: Configure and build + - name: Clone + uses: actions/checkout@v4 + with: + submodules: true + - name: Setup run: | - cmake -Bbuild -DCMAKE_Fortran_COMPILER=$(which mpif90) . - cmake --build build -- -j $(nproc) - - # analyze: - # name: CodeQL analysis - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - - # - name: Install dependencies - # run: sudo apt-get install mpich libmpich-dev - - # - name: Initialize CodeQL - # uses: github/codeql-action/init@v1 - # with: - # languages: cpp - - # - name: Configure and build - # uses: github/codeql-action/autobuild@v1 - - # - name: Analyze - # uses: github/codeql-action/analyze@v1 + echo "NPROCS=$(nproc)" >> $GITHUB_ENV + echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV + echo "CCACHE_COMPRESSLEVEL=1" >> $GITHUB_ENV + echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV + echo "CCACHE_EXTRAFILES=${{github.workspace}}/.clang-tidy" >> $GITHUB_ENV + echo "CCACHE_MAXSIZE=50M" >> $GITHUB_ENV + echo "CTCACHE_DIR=~/.cache/ctcache" >> $GITHUB_ENV + - name: Install Ccache + run: | + wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz + sudo curl https://raw.githubusercontent.com/matus-chochlik/ctcache/7fd516e91c17779cbc6fc18bd119313d9532dd90/clang-tidy-cache -Lo /usr/bin/clang-tidy-cache + tar xvf ccache-4.8-linux-x86_64.tar.xz + sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/ + sudo chmod +x /usr/bin/clang-tidy-cache + mkdir -p ~/.cache/ctcache + - name: Set Up Ccache + uses: actions/cache@v4 + with: + path: ~/.cache + key: ccache-${{github.workflow}}-${{github.job}}-git-${{github.sha}} + restore-keys: | + ccache-${{github.workflow}}-${{github.job}}-git- + - name: Dependencies + run: sudo apt-get install -y mpich libmpich-dev + - name: Configure + run: | + export MPICH_CXX=$(which clang++) + export MPICH_CC=$(which clang) + cmake \ + -B ${{runner.workspace}}/build-clang-tidy \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_CXX_COMPILER:STRING=mpicxx \ + -DCMAKE_C_COMPILER:STRING=mpicc \ + -DTIOGA_ENABLE_CLANG_TIDY:BOOL=ON \ + -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ + ${{github.workspace}} + - name: Check + working-directory: ${{runner.workspace}}/build-clang-tidy + run: | + cmake --build . --parallel ${{env.NPROCS}} 2>&1 | tee -a clang-tidy-full-report.txt + cat clang-tidy-full-report.txt | grep "warning:" | grep -v "submods" | sort | uniq | \ + awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > clang-tidy-ci-report.txt + - name: Ccache Report + run: | + ls ~/.cache + ls ~/.cache/ccache + du -hs ~/.cache/ccache + ls ~/.cache/ctcache + du -hs ~/.cache/ctcache + ccache -s + - name: Full report + working-directory: ${{runner.workspace}}/build-clang-tidy + run: cat clang-tidy-full-report.txt + - name: Short report + working-directory: ${{runner.workspace}}/build-clang-tidy + run: | + echo "::add-matcher::.github/problem-matchers/gcc.json" + cat clang-tidy-ci-report.txt + exit $(tail -n 1 clang-tidy-ci-report.txt | awk '{print $2}') + Lint-codeql: + needs: Formatting + runs-on: ubuntu-latest + steps: + - name: Clone + uses: actions/checkout@v4 + with: + submodules: true + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: cpp + queries: +security-and-quality + config-file: ./.github/codeql/codeql-config.yml + - name: Dependencies + run: sudo apt-get install -y mpich libmpich-dev + - name: Configure + run: | + echo "NPROCS=$(nproc)" >> $GITHUB_ENV + export MPICH_CXX=$(which clang++) + export MPICH_CC=$(which clang) + cmake \ + -B ${{runner.workspace}}/build-ci-codeql \ + -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install-codeql \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DCMAKE_CXX_COMPILER:STRING=mpicxx \ + -DCMAKE_C_COMPILER:STRING=mpicc \ + ${{github.workspace}} + - name: Build + run: | + cmake --build ${{runner.workspace}}/build-ci-codeql --parallel ${{env.NPROCS}} + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:cpp" + upload: False + output: sarif-results + - name: Filter CodeQL sarif + uses: advanced-security/filter-sarif@v1 + with: + patterns: | + -**/submods/** + input: sarif-results/cpp.sarif + output: sarif-results/cpp.sarif + - name: Upload CodeQL sarif + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: sarif-results/cpp.sarif + Lint-codespell: + needs: Formatting + runs-on: ubuntu-latest + steps: + - name: Clone + uses: actions/checkout@v4 + with: + submodules: false + - name: Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Dependencies + run: | + # Install Python packages + python -m pip install --upgrade pip + pip install codespell + - name: Run codespell + run: codespell diff --git a/.github/workflows/cuda-ci.yml b/.github/workflows/cuda-ci.yml deleted file mode 100644 index f8a97eb..0000000 --- a/.github/workflows/cuda-ci.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: CUDA CI - -on: - push: - branches: - - exawind - pull_request: - branches: - - exawind - -jobs: - cuda-build: - runs-on: ubuntu-latest - name: CUDA v${{matrix.cuda_ver}} - strategy: - matrix: - cuda_pkg: [11-0, 10-2] - include: - - cuda_ver: "11.0" - cuda_pkg: 11-0 - cuda_extra: libcurand-dev-11-0 cuda-cupti-dev-11-0 - - cuda_ver: "10.2" - cuda_pkg: 10-2 - cuda_extra: cuda-curand-dev-10-2 cuda-cupti-dev-10-2 - # - cuda_ver: "10.1" - # cuda_pkg: 10-1 - # cuda_extra: cuda-curand-dev-10-1 cuda-cupti-10-1 - # - cuda_ver: "10.0" - # cuda_pkg: 10-0 - # cuda_extra: cuda-curand-dev-10-0 cuda-cupti-10-0 - steps: - - uses: actions/checkout@v2 - - name: Prepare CUDA environment - run: | - export DEBIAN_FRONTEND=noninteractive - wget -q -O - https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | sudo apt-key add - - echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list - echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" | sudo tee /etc/apt/sources.list.d/nvidia-ml.list - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - libopenmpi-dev cuda-command-line-tools-${{matrix.cuda_pkg}} cuda-compiler-${{matrix.cuda_pkg}} cuda-minimal-build-${{matrix.cuda_pkg}} cuda-nvml-dev-${{matrix.cuda_pkg}} cuda-nvtx-${{matrix.cuda_pkg}} ${{matrix.cuda_extra}} - - name: Configure and build - run: | - export PATH=/usr/local/nvidia/bin:/usr/local/cuda-${{matrix.cuda_ver}}/bin:${PATH} - export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib:${LD_LIBRARY_PATH} - cmake -Bbuild-${{matrix.cuda_pkg}} \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DCMAKE_Fortran_COMPILER=$(which mpif90) \ - -DTIOGA_ENABLE_CUDA=ON \ - -DTIOGA_CUDA_SM=70 . - cmake --build build-${{matrix.cuda_pkg}} -- -j $(nproc) diff --git a/.github/workflows/hip-ci.yml b/.github/workflows/hip-ci.yml deleted file mode 100644 index 05508f1..0000000 --- a/.github/workflows/hip-ci.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: HIP CI - -on: - push: - branches: - - exawind - pull_request: - branches: - - exawind - -jobs: - hip-build: - runs-on: ubuntu-latest - name: HIP/ROCm - steps: - - uses: actions/checkout@v2 - - name: Prepare HIP/ROCm environment - run: | - export DEBIAN_FRONTEND=noninteractive - wget -q -O - http://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - - echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main' | sudo tee /etc/apt/sources.list.d/rocm.list - sudo apt-get update - sudo apt-get install -y libopenmpi-dev rocm-dev rocm-libs - - name: Configure and build - run: | - echo 'export PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin' | sudo tee -a /etc/profile.d/rocm.sh - source /etc/profile.d/rocm.sh - cmake -Bbuild \ - -DCMAKE_CXX_COMPILER=$(which hipcc) \ - -DCMAKE_C_COMPILER=$(which hipcc) \ - -DCMAKE_Fortran_COMPILER=$(which mpif90) \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DTIOGA_ENABLE_HIP=ON \ - -DTIOGA_HIP_ARCH="gfx906,gfx908" . - cmake --build build -- -j $(nproc) diff --git a/.gitignore b/.gitignore index 631a6f3..da57a53 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ GPATH GRTAGS GTAGS +.ccls-cache +.DS_Store \ No newline at end of file diff --git a/BUILDING b/BUILDING deleted file mode 100644 index deda702..0000000 --- a/BUILDING +++ /dev/null @@ -1,27 +0,0 @@ -To build the library "libtioga.so" ---------------------------------- -[user@machine tioga]$ cd build -[user@machine tioga]$ cmake .. -[user@machine tioga]$ make - -To run the test the case ---------------------------- -[user@machine tioga]$ cd case;./run.sh 16 - -run.sh does two things: - -1. builds a sample grid system that is composed of - a prizmatic sphere grid and a background hex grid - The argument "16" above says how many cores you want - to test this problem. - -2. performs connectivity using tioga and verifies that - the interpolation accuracy for a linear field - -To run the accuracy test -------------------------- -[user@machine tioga]$ cd case; ../build/driver/poisson_mms.exe - -Default option will check if 2nd order accuracy is obtained with -grid refinement for the 5-point Laplacian using method of manufactured -solutions (MMS) diff --git a/CMakeBuild.md b/CMakeBuild.md deleted file mode 100644 index 3b1bf53..0000000 --- a/CMakeBuild.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Building and installing TIOGA using CMake - -TIOGA has been configured to use CMake to configure, build, and install the -library. The user can choose standard CMake options as well as additional -TIOGA-specific options to customize the build and installation process. A brief -description of the CMake-based build process and configuration options are -described in this document. - -The minimal dependencies to build TIOGA on your system are CMake, a working C, -C++, and Fortran compilers as well as an MPI library along with its headers. If -the dependencies are satisfied, then execute the following commands to clone and -build TIOGA: - -``` -git clone -cd tioga - -# Create a build directory -mkdir build - -# Configure build using auto-discovered parameters -cmake ../ - -# Build the library -make -``` - -When the steps are successfully executed, the compiled static library is located -in `tioga/build/src/libtioga.a`. - -## Building `driver` and `gridGen` executables - -By default, CMake does not build the `tioga.exe` driver code or the `buildGrid` -executable. To enable these at configure phase: - -``` -cmake -DBUILD_TIOGA_EXE:BOOL=ON -DBUILD_GRIDGEN_EXE:BOOL=ON ../ -``` - -followed by `make`. The executables will be located in `build/driver/tioga.exe` -and `build/gridGen/buildGrid` respectively. - -## Customizing compilers - -To use different compilers other than what is detected by CMake use the -following configure command: - -``` -CC=mpicc CXX=mpicxx FC=mpif90 cmake ../ -``` - -## Release, Debug, and other compilation options - -Use `-DCMAKE_BUILD_TYPE` with `Release`, `Debug` or `RelWithDebInfo` to build -with different optimization or debugging flags. For example, - -``` -cmake -DCMAKE_BUILD_TYPE=Release ../ -``` - -You can also use `CMAKE_CXX_FLAGS`, `CMAKE_C_FLAGS`, and `CMAKE_Fortran_FLAGS` -to specify additional compile time flags of your choosing. For example, - -``` -cmake \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_Fortran_FLAGS="-fbounds-check -fbacktrace" \ - ../ -``` - -## Custom install location - -Finally, it is usually desirable to specify the install location when using -`make install` when using TIOGA with other codes. - -``` -# Configure TIOGA several options -CC=mpicc CXX=mpicxx FC=mpif90 cmake \ - -DCMAKE_INSTALL_PREFIX=${HOME}/software/ \ - -DBUILD_TIOGA_EXE=ON \ - -DBUILD_GRIDGEN_EXE=ON \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_Fortran_FLAGS="-fbounds-check -fbacktrace" \ - ../ - -# Compile library and install at user-defined location -make && make install -``` diff --git a/CMakeLists.txt b/CMakeLists.txt index 80fd688..ac0b007 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ option(TIOGA_OUTPUT_STATS "Output statistics for TIOGA holecutting (default: off option(TIOGA_ENABLE_CUDA "Enable CUDA support (default: off)" OFF) option(TIOGA_ENABLE_HIP "Enable AMD HIP support (default: off)" OFF) option(TIOGA_ENABLE_ARBORX "Enable ArborX (default: off)" OFF) +option(TIOGA_ENABLE_CLANG_TIDY "Compile with clang-tidy static analysis" OFF) # CUDA specific options #set(TIOGA_CUDA_SM "70" CACHE STRING "CUDA arch option") @@ -64,6 +65,25 @@ if (BUILD_GRIDGEN_EXE) add_subdirectory(gridGen) endif() +if(TIOGA_ENABLE_CLANG_TIDY) + find_program(CLANG_TIDY_EXE NAMES "clang-tidy") + if(CLANG_TIDY_EXE) + message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") + #find_program (CLANG_TIDY_CACHE_EXE NAMES "clang-tidy-cache") + #if(CLANG_TIDY_CACHE_EXE) + # message(STATUS "clang-tidy-cache found: ${CLANG_TIDY_CACHE_EXE}") + # set(CLANG_TIDY_EXE "${CLANG_TIDY_CACHE_PATH};${CLANG_TIDY_EXE}" + # CACHE STRING "A combined command to run clang-tidy with caching wrapper") + #endif() + else() + message(WARNING "clang-tidy not found.") + endif() +endif() +if(CLANG_TIDY_EXE) + set_target_properties(tioga + PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};--config-file=${CMAKE_SOURCE_DIR}/.clang-tidy") +endif() + # CMake installation configuration install(EXPORT TIOGALibraries diff --git a/README b/README deleted file mode 100755 index c584f5e..0000000 --- a/README +++ /dev/null @@ -1,78 +0,0 @@ -Tioga is a library for overset grid assembly on parallel distributed systems -Copyright (C) 2015 Jay Sitaraman - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Contact: - -Jay Sitaraman -Parallel Geometric Algorithms LLC -814 S Mary Ave, -Sunnyvale, -CA 94087 - -jsitaraman@gmail.com -(301) 741 3216TIOGA - Topology Independent Overset Grid Assmebler - -Functionality: --------------- - -TIOGA can perform overset grid connectivity in 3-D between -multiple unstructured (or structured) meshes that are in a distributed -computing environment, i.e. each mesh is partitioned in to multiple -parts. It can accept high-order call-back functions to perform p-consistent -interpolation and searches for formulations with internal degrees of freedom -within a computational element. - -Authored by Jay Sitaraman -jsitaraman@gmail.com -(301) 741 3216 - -Notes: ------- - -TIOGA is free software since it was developed in the personal -time of the author. It is expected to serve as an academic/research -counterpart for PUNDIT (which is the product of the CREATE A/V program -and is export controlled). TIOGA has a subset of the functionality of -PUNDIT and is about 3x slower owing to the use of Alternating Digital Tree (ADT) -searches as the baseline point-location algorithm. - -News: ------ -TIOGA is currently under development with funding from the DoE ExaWind program -towards developing overset capability in the DoE NALU code for large scale -wind farm simulations - -See tioga/LICENSE - - -References: ------------ - - -Michael J. Brazell, Jayanarayanan Sitaraman, Dimitri J. Mavriplis, An overset mesh approach for 3D mixed element -high-order discretizations, In Journal of Computational Physics, Volume 322, 2016, -Pages 33-51, ISSN 0021-9991, https://doi.org/10.1016/j.jcp.2016.06.031. -(http://www.sciencedirect.com/science/article/pii/S002199911630256X) - - -Roget, B. and Sitaraman, J., "Robust and efficient overset grid assembly for partitioned unstructured meshes", -Journal of Computational Physics, v 260, March 2014, Pages 1-24 - -Brazell, M., Sitaraman J. and Mavriplis D.,"An Overset Mesh Approach for 3D Mixed -Element High Order Discretizations", Proceedings of 2014 Overset Grid Symposium, -Atlanta, GA, Oct 6-9, 2014. -http://2014.oversetgridsymposium.org/assets/presentations/3_1/Brazell_ogs_2014.pdf diff --git a/README.md b/README.md new file mode 100755 index 0000000..5b06779 --- /dev/null +++ b/README.md @@ -0,0 +1,154 @@ +# TIOGA - Topology Independent Overset Grid Assembler + +[![TIOGA CI](https://github.com/Exawind/tioga/actions/workflows/ci.yml/badge.svg)](https://github.com/Exawind/tioga/actions/workflows/ci.yml) + +TIOGA is a library for overset grid assembly on parallel distributed systems +Copyright (C) 2015 Jay Sitaraman + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Contact: Jay Sitaraman, jsitaraman@gmail.com, (301) 741 3216, Parallel Geometric Algorithms LLC, 814 S Mary Ave, Sunnyvale, CA 94087 + +## Functionality + +TIOGA can perform overset grid connectivity in 3-D between +multiple unstructured (or structured) meshes that are in a distributed +computing environment, i.e. each mesh is partitioned in to multiple +parts. It can accept high-order call-back functions to perform p-consistent +interpolation and searches for formulations with internal degrees of freedom +within a computational element. + +## Notes + +TIOGA is free software since it was developed in the personal +time of the author. It is expected to serve as an academic/research +counterpart for PUNDIT (which is the product of the CREATE A/V program +and is export controlled). TIOGA has a subset of the functionality of +PUNDIT and is about 3x slower owing to the use of Alternating Digital Tree (ADT) +searches as the baseline point-location algorithm. + +## News + +TIOGA is currently under development with funding from the DoE ExaWind +program towards developing overset capability in the DoE ExaWind codes +for large scale wind farm simulations. The original code is available +[here](https://github.com/jsitaraman/tioga). + +## References + +Michael J. Brazell, Jayanarayanan Sitaraman, Dimitri J. Mavriplis, An overset mesh approach for 3D mixed element +high-order discretizations, In Journal of Computational Physics, Volume 322, 2016, +Pages 33-51, ISSN 0021-9991, https://doi.org/10.1016/j.jcp.2016.06.031. +(http://www.sciencedirect.com/science/article/pii/S002199911630256X) + + +Roget, B. and Sitaraman, J., "Robust and efficient overset grid assembly for partitioned unstructured meshes", +Journal of Computational Physics, v 260, March 2014, Pages 1-24 + +Brazell, M., Sitaraman J. and Mavriplis D.,"An Overset Mesh Approach for 3D Mixed +Element High Order Discretizations", Proceedings of 2014 Overset Grid Symposium, +Atlanta, GA, Oct 6-9, 2014. +http://2014.oversetgridsymposium.org/assets/presentations/3_1/Brazell_ogs_2014.pdf + +## Building + +### Building and installing TIOGA using CMake + +TIOGA has been configured to use CMake to configure, build, and install the +library. The user can choose standard CMake options as well as additional +TIOGA-specific options to customize the build and installation process. A brief +description of the CMake-based build process and configuration options are +described in this document. + +The minimal dependencies to build TIOGA on your system are CMake, a working C, +C++, and Fortran compilers as well as an MPI library along with its headers. If +the dependencies are satisfied, then execute the following commands to clone and +build TIOGA: + +``` +git clone +cd tioga + +# Create a build directory +mkdir build + +# Configure build using auto-discovered parameters +cmake ../ + +# Build the library +make +``` + +When the steps are successfully executed, the compiled static library is located +in `tioga/build/src/libtioga.a`. + +#### Building `driver` and `gridGen` executables + +By default, CMake does not build the `tioga.exe` driver code or the `buildGrid` +executable. To enable these at configure phase: + +``` +cmake -DBUILD_TIOGA_EXE:BOOL=ON -DBUILD_GRIDGEN_EXE:BOOL=ON ../ +``` + +followed by `make`. The executables will be located in `build/driver/tioga.exe` +and `build/gridGen/buildGrid` respectively. + +#### Customizing compilers + +To use different compilers other than what is detected by CMake use the +following configure command: + +``` +CC=mpicc CXX=mpicxx FC=mpif90 cmake ../ +``` + +#### Release, Debug, and other compilation options + +Use `-DCMAKE_BUILD_TYPE` with `Release`, `Debug` or `RelWithDebInfo` to build +with different optimization or debugging flags. For example, + +``` +cmake -DCMAKE_BUILD_TYPE=Release ../ +``` + +You can also use `CMAKE_CXX_FLAGS`, `CMAKE_C_FLAGS`, and `CMAKE_Fortran_FLAGS` +to specify additional compile time flags of your choosing. For example, + +``` +cmake \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_Fortran_FLAGS="-fbounds-check -fbacktrace" \ + ../ +``` + +##### Custom install location + +Finally, it is usually desirable to specify the install location when using +`make install` when using TIOGA with other codes. + +``` +# Configure TIOGA several options +CC=mpicc CXX=mpicxx FC=mpif90 cmake \ + -DCMAKE_INSTALL_PREFIX=${HOME}/software/ \ + -DBUILD_TIOGA_EXE=ON \ + -DBUILD_GRIDGEN_EXE=ON \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_Fortran_FLAGS="-fbounds-check -fbacktrace" \ + ../ + +# Compile library and install at user-defined location +make && make install +``` diff --git a/clean.sh b/clean.sh deleted file mode 100755 index 605a17f..0000000 --- a/clean.sh +++ /dev/null @@ -1,4 +0,0 @@ -cd src;make clean;cd .. -cd driver;make clean;cd .. -cd gridGen;make clean;cd .. -cd case;./clean.sh 2>/dev/null;cd - diff --git a/TODO b/notes/TODO similarity index 100% rename from TODO rename to notes/TODO diff --git a/TODO.gpu b/notes/TODO.gpu similarity index 100% rename from TODO.gpu rename to notes/TODO.gpu diff --git a/test.sh b/test.sh deleted file mode 100755 index 542aff8..0000000 --- a/test.sh +++ /dev/null @@ -1,6 +0,0 @@ -mkdir build -cd build -cmake -DTIOGA_HAS_NODEGID:BOOL=off -DTIOGA_ENABLE_TIMERS:BOOL=on .. -make -cd .. -cd case/;./run.sh 8;cd - diff --git a/test_summit.sh b/test_summit.sh deleted file mode 100755 index c897bfc..0000000 --- a/test_summit.sh +++ /dev/null @@ -1,7 +0,0 @@ -module load gcc/7.4.0 cmake/3.15.2 -mkdir build -cd build -cmake -DTIOGA_HAS_NODEGID:BOOL=off -DTIOGA_ENABLE_TIMERS:BOOL=on .. -make -cd .. -cd case/;./run_summit.sh 8;cd -