From b9e22f780fac8a83bad2860f194994c339fed0ba Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 10:46:06 -0700 Subject: [PATCH 01/20] Hook up CI --- .github/workflows/ci.yml | 58 +++++++++++++++++++++++++--------------- .gitignore | 2 ++ 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4830fc0..80bb0b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,35 +3,49 @@ 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: - runs-on: ${{matrix.os}} - strategy: - matrix: - #os: [ubuntu-latest, macos-latest] - os: [ ubuntu-latest ] - build_type: [Release, Debug] - include: - # - os: macos-latest - # build_deps: brew install open-mpi && brew link gcc - - os: ubuntu-latest - build_deps: sudo apt-get install mpich libmpich-dev - name: ${{matrix.os}} - ${{matrix.build_type}} + Formatting: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: ${{matrix.build_deps}} - - name: Configure and build - run: | - cmake -Bbuild -DCMAKE_Fortran_COMPILER=$(which mpif90) . - cmake --build build -- -j $(nproc) + - 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 + # build: + # runs-on: ${{matrix.os}} + # strategy: + # matrix: + # #os: [ubuntu-latest, macos-latest] + # os: [ ubuntu-latest ] + # build_type: [Release, Debug] + # include: + # # - os: macos-latest + # # build_deps: brew install open-mpi && brew link gcc + # - os: ubuntu-latest + # build_deps: sudo apt-get install mpich libmpich-dev + # name: ${{matrix.os}} - ${{matrix.build_type}} + # steps: + # - uses: actions/checkout@v2 + # - name: Install dependencies + # run: ${{matrix.build_deps}} + # - name: Configure and build + # run: | + # cmake -Bbuild -DCMAKE_Fortran_COMPILER=$(which mpif90) . + # cmake --build build -- -j $(nproc) # analyze: # name: CodeQL analysis 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 From ec9b12fd02574f6dc1644a8dc1f7c5ef4c3028a5 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 11:36:01 -0700 Subject: [PATCH 02/20] remove old ci --- .github/workflows/cuda-ci.yml | 51 ----------------------------------- .github/workflows/hip-ci.yml | 35 ------------------------ 2 files changed, 86 deletions(-) delete mode 100644 .github/workflows/cuda-ci.yml delete mode 100644 .github/workflows/hip-ci.yml 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) From 77afded7461188f80d3694773fbd327e9fce0083 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 11:42:29 -0700 Subject: [PATCH 03/20] try this --- .github/workflows/ci.yml | 118 +++++++++++++++++++++++++-------------- 1 file changed, 76 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80bb0b4..8f139dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,45 +25,79 @@ jobs: exclude: '.' extensions: 'h,cpp' clangFormatVersion: 16 - # build: - # runs-on: ${{matrix.os}} - # strategy: - # matrix: - # #os: [ubuntu-latest, macos-latest] - # os: [ ubuntu-latest ] - # build_type: [Release, Debug] - # include: - # # - os: macos-latest - # # build_deps: brew install open-mpi && brew link gcc - # - os: ubuntu-latest - # build_deps: sudo apt-get install mpich libmpich-dev - # name: ${{matrix.os}} - ${{matrix.build_type}} - # steps: - # - uses: actions/checkout@v2 - # - name: Install dependencies - # run: ${{matrix.build_deps}} - # - name: Configure and build - # 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 + CPU: + #needs: Formatting + runs-on: ${{matrix.os}} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + build_type: [Release, Debug] + include: + - 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 + 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}') From 12f77f7b085824fcfbe168febd7cf4fa607c2811 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 11:44:24 -0700 Subject: [PATCH 04/20] add problem matcher --- .github/problem-matchers/gcc.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/problem-matchers/gcc.json 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 + } + ] + } + ] +} From fed93c47b0ff0b0bc8296fac1d015664348c8daf Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 11:49:26 -0700 Subject: [PATCH 05/20] add codeql --- .github/codeql/codeql-config.yml | 6 +++ .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/codeql/codeql-config.yml 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/workflows/ci.yml b/.github/workflows/ci.yml index 8f139dc..01ef385 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,3 +101,66 @@ jobs: | 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-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: Configure + run: | + echo "NPROCS=$(nproc)" >> $GITHUB_ENV + cmake \ + -B ${{runner.workspace}}/build-ci-codeql \ + -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install-codeql \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DCMAKE_CXX_COMPILER:STRING=clang++ \ + -DCMAKE_C_COMPILER:STRING=clang \ + ${{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 From e7e59f7a041890df2283c8dc36d1263549e2fc9e Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 11:52:43 -0700 Subject: [PATCH 06/20] clang tidy and mpi --- .github/workflows/ci.yml | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01ef385..40973b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,6 +101,70 @@ jobs: | 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: + - name: Clone + uses: actions/checkout@v4 + with: + submodules: true + - name: Setup + run: | + 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: Configure + run: | + cmake \ + -B ${{runner.workspace}}/build-clang-tidy \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_CXX_COMPILER:STRING=clang++ \ + -DCMAKE_C_COMPILER:STRING=clang \ + -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 @@ -115,6 +179,8 @@ jobs: 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 From c4364a65bb8bf3dd456737f40dd4ee259306c0be Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 11:53:18 -0700 Subject: [PATCH 07/20] add config for clang tidy --- .clang-tidy | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..a3420ad --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,70 @@ +--- +Checks: 'bugprone-*, + -bugprone-easily-swappable-parameters, + -bugprone-exception-escape, + clang-diagnostic-*, + clang-analyzer-*, + corecppguidelines-*, + modernize-*, + -modernize-avoid-c-arrays, + -modernize-use-trailing-return-type, + -modernize-make-unique, + -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 } +... From dbca1a41319e4285569bd608db59785cb9e34e15 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 11:54:08 -0700 Subject: [PATCH 08/20] couple of fixes --- .clang-tidy | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index a3420ad..cc53bef 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,14 +1,10 @@ --- Checks: 'bugprone-*, - -bugprone-easily-swappable-parameters, -bugprone-exception-escape, clang-diagnostic-*, clang-analyzer-*, corecppguidelines-*, modernize-*, - -modernize-avoid-c-arrays, - -modernize-use-trailing-return-type, - -modernize-make-unique, -modernize-use-nodiscard, readability-*, -readability-magic-numbers, From c7ce677961a1bfaa2d8c740418ff5379ae34d835 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 11:56:53 -0700 Subject: [PATCH 09/20] need mpi --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40973b2..e0a47e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,6 +133,8 @@ jobs: 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: | cmake \ From 1a2d51dcd5cdc48b2e200ac09ec2ffee8f9e6b8c Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 12:10:14 -0700 Subject: [PATCH 10/20] try something --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0a47e9..af82bcb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,11 +137,13 @@ jobs: 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=clang++ \ - -DCMAKE_C_COMPILER:STRING=clang \ + -DCMAKE_CXX_COMPILER:STRING=mpicxx \ + -DCMAKE_C_COMPILER:STRING=mpicc \ -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ ${{github.workspace}} - name: Check From 25176eb53abe7bf5ae1ab07fa94b0cdfa334d648 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 12:13:12 -0700 Subject: [PATCH 11/20] something else --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af82bcb..56fad00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,12 +188,14 @@ jobs: - 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=clang++ \ - -DCMAKE_C_COMPILER:STRING=clang \ + -DCMAKE_CXX_COMPILER:STRING=mpicxx \ + -DCMAKE_C_COMPILER:STRING=mpicc \ ${{github.workspace}} - name: Build run: | From a33bd6e8b70f1e5f3c80bdef157a5353a828a7ed Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 12:25:30 -0700 Subject: [PATCH 12/20] hook up clang tidy --- .github/workflows/ci.yml | 1 + CMakeLists.txt | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56fad00..248b983 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,6 +144,7 @@ jobs: -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 80fd688..eecc86e 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 tiogadriver ${amr_wind_exe_name} + PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};--config-file=${CMAKE_SOURCE_DIR}/.clang-tidy") +endif() + # CMake installation configuration install(EXPORT TIOGALibraries From b79ae85e3ce9a5e21b507877a4298e2fa384c3a1 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 12:27:21 -0700 Subject: [PATCH 13/20] fix --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eecc86e..ac0b007 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,7 +80,7 @@ if(TIOGA_ENABLE_CLANG_TIDY) endif() endif() if(CLANG_TIDY_EXE) - set_target_properties(tioga tiogadriver ${amr_wind_exe_name} + set_target_properties(tioga PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};--config-file=${CMAKE_SOURCE_DIR}/.clang-tidy") endif() From 919d9ddcac9dc650a7794bfda3f8e68cb61cd4d8 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 28 Feb 2024 15:13:30 -0700 Subject: [PATCH 14/20] needs formatting --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 248b983..34fe682 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: extensions: 'h,cpp' clangFormatVersion: 16 CPU: - #needs: Formatting + needs: Formatting runs-on: ${{matrix.os}} strategy: matrix: @@ -102,7 +102,7 @@ jobs: cat build-output-warnings.txt exit $(tail -n 1 build-output-warnings.txt | awk '{print $2}') Lint-clang-tidy: - # needs: Formatting + needs: Formatting runs-on: ubuntu-latest steps: - name: Clone @@ -171,7 +171,7 @@ jobs: cat clang-tidy-ci-report.txt exit $(tail -n 1 clang-tidy-ci-report.txt | awk '{print $2}') Lint-codeql: - # needs: Formatting + needs: Formatting runs-on: ubuntu-latest steps: - name: Clone @@ -219,7 +219,7 @@ jobs: with: sarif_file: sarif-results/cpp.sarif Lint-codespell: - # needs: Formatting + needs: Formatting runs-on: ubuntu-latest steps: - name: Clone From e5736f64f1d593a5a81e1581ec0ee0190fca3bf7 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 29 Feb 2024 07:31:20 -0700 Subject: [PATCH 15/20] add codespell config --- .codespell-ignore-words | 2 ++ .codespellrc | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 .codespell-ignore-words create mode 100644 .codespellrc 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 From 475d0410f015de151ac6bff684b432dea988f957 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 29 Feb 2024 07:37:37 -0700 Subject: [PATCH 16/20] readme format --- README => README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) rename README => README.md (93%) diff --git a/README b/README.md similarity index 93% rename from README rename to README.md index c584f5e..4339797 100755 --- a/README +++ b/README.md @@ -1,3 +1,7 @@ +# Tioga + +[![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 @@ -26,8 +30,7 @@ CA 94087 jsitaraman@gmail.com (301) 741 3216TIOGA - Topology Independent Overset Grid Assmebler -Functionality: --------------- +## Functionality TIOGA can perform overset grid connectivity in 3-D between multiple unstructured (or structured) meshes that are in a distributed @@ -40,8 +43,7 @@ Authored by Jay Sitaraman jsitaraman@gmail.com (301) 741 3216 -Notes: ------- +# 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 @@ -50,18 +52,15 @@ 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: ------ +# 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: ------------ - +# 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, From c8644b6bfeb30dec5839efa3f38561a6dbc9a4e0 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 29 Feb 2024 07:41:43 -0700 Subject: [PATCH 17/20] more readme --- README.md | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 4339797..5feaff2 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Tioga +# 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) @@ -22,14 +22,13 @@ 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 -jsitaraman@gmail.com -(301) 741 3216TIOGA - Topology Independent Overset Grid Assmebler - ## Functionality TIOGA can perform overset grid connectivity in 3-D between @@ -39,36 +38,30 @@ 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 +## 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 +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 +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 +## 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 +## 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, +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", +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 From d053c5931889290d3b4f1ef31c66a94307841781 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 29 Feb 2024 07:44:13 -0700 Subject: [PATCH 18/20] tweak --- README.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5feaff2..99f5bb8 100755 --- a/README.md +++ b/README.md @@ -19,15 +19,7 @@ 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 +Contact: Jay Sitaraman, jsitaraman@gmail.com, (301) 741 3216, Parallel Geometric Algorithms LLC, 814 S Mary Ave, Sunnyvale, CA 94087 ## Functionality @@ -50,8 +42,8 @@ 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 +towards developing overset capability in the DoE ExaWind codes for large scale +wind farm simulations. ## References From 83afdab6098a7c25621341181f4ad320e33bbbd4 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 29 Feb 2024 08:46:07 -0700 Subject: [PATCH 19/20] Move some stuff around --- BUILDING | 27 ----------- CMakeBuild.md | 89 ------------------------------------ README.md | 93 +++++++++++++++++++++++++++++++++++++- clean.sh | 4 -- TODO => notes/TODO | 0 TODO.gpu => notes/TODO.gpu | 0 test.sh | 6 --- test_summit.sh | 7 --- 8 files changed, 92 insertions(+), 134 deletions(-) delete mode 100644 BUILDING delete mode 100644 CMakeBuild.md delete mode 100755 clean.sh rename TODO => notes/TODO (100%) rename TODO.gpu => notes/TODO.gpu (100%) delete mode 100755 test.sh delete mode 100755 test_summit.sh 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/README.md b/README.md index 99f5bb8..08c28a7 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![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 +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 @@ -60,3 +60,94 @@ Brazell, M., Sitaraman J. and Mavriplis D.,"An Overset Mesh Approach for 3D Mixe 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 - From ec754c3465c44065ca975e15202df08e45d7528b Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 29 Feb 2024 08:49:49 -0700 Subject: [PATCH 20/20] add link to original code --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 08c28a7..5b06779 100755 --- a/README.md +++ b/README.md @@ -41,9 +41,10 @@ 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. +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