-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge github.com:xcompact3d/x3d2 into 2decomp-integration
- Loading branch information
Showing
31 changed files
with
1,340 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
workflow: | ||
rules: | ||
# Run pipeline on tags for the main project | ||
- if: $CI_COMMIT_TAG && $CI_PROJECT_PATH == "CFD-Xing/x3d2" | ||
# Run pipeline on the default branch for the main project | ||
- if: $CI_COMMIT_BRANCH == "main" && $CI_PROJECT_PATH == "CFD-Xing/x3d2" | ||
# DO NOT run pipeline if Draft | ||
- if: $CI_PIPELINE_SOURCE == "external_pull_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^(\[Draft\]|\(Draft\)|Draft:).*/ | ||
when: never | ||
# Other merge requests trigger pipelines | ||
- if: $CI_PIPELINE_SOURCE == "external_pull_request_event" | ||
changes: | ||
compare_to: 'refs/heads/main' | ||
paths: | ||
- "src/**/*" | ||
- "examples/**/*" | ||
- "tests/**/*" | ||
- .gitlab-ci.yml | ||
|
||
stages: | ||
- build-and-test | ||
- check-policies | ||
- build-docs | ||
|
||
.build-and-test-template: &build-and-test-template | ||
image: ubuntu:22.04 | ||
stage: build-and-test | ||
timeout: 1h | ||
script: | ||
- echo "Setup environment" | ||
- apt update | ||
- apt install -y environment-modules | ||
- echo "/apps/modules" >> /etc/environment-modules/modulespath | ||
- apt-get update | ||
- apt-get install -y ccache | ||
- apt-get install -y cmake | ||
- apt-get install -y gcc | ||
- apt-get install -y infiniband-diags ibverbs-utils | ||
- apt-get install -y libibverbs-dev libfabric1 libfabric-dev libpsm2-dev | ||
- apt-get install -y openmpi-bin openmpi-common libopenmpi-dev libgtk2.0-dev | ||
- apt-get install -y librdmacm-dev libpsm2-dev | ||
- . /etc/profile.d/modules.sh | ||
- ccache -s && ccache -M 5G | ||
- echo "Display GCC version number" | ||
- gcc --version | ||
- echo "Display nvcc version number" | ||
- module avail | ||
#- module load cuda | ||
#- nvcc --version | ||
- echo "Configure Debug build" | ||
- FC=mpif90 cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug | ||
- echo "Build with Debug (strict) flags" | ||
- make -C build | ||
- echo "Configure Release build" | ||
- FC=mpif90 cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | ||
- echo "Build tests" | ||
- make -C build | ||
- echo "Run the tests" | ||
- export OMPI_ALLOW_RUN_AS_ROOT=1 | ||
- export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | ||
- make -C build test | ||
tags: | ||
- gpu | ||
|
||
.check-formatting-template: &check-formatting-template | ||
image: python:3.9.19-bullseye | ||
stage: check-policies | ||
variables: | ||
FPRETTIFY_COMMAND: fprettify --config .fprettify.ini --diff --recursive src | ||
before_script: | ||
- pip install fprettify | ||
script: | ||
- cd $CI_PROJECT_DIR | ||
- $FPRETTIFY_COMMAND &> fprettify.log | ||
- if [[ ! -z "$(cat fprettify.log)" ]]; then echo "::warning::Code formatting issues detected. See log for details."; exit 1; fi | ||
allow_failure: false | ||
timeout: 15m | ||
artifacts: | ||
expire_in: 1 month | ||
when: on_failure | ||
paths: | ||
- fprettify.log | ||
|
||
.build-docs-template: &build-docs-template | ||
image: python:3.9.19-slim-bookworm | ||
stage: build-docs | ||
variables: | ||
PUBLISH_DIR: api/ | ||
FORD_OUTPUT_DIR: api-docs | ||
FORD_CFG: ford.md | ||
script: | ||
- cd $CI_PROJECT_DIR | ||
- apt update | ||
- apt install -y git | ||
- echo Install sphinx, ford and ghp-import | ||
- pip install -r docs/docs-requirements.txt | ||
- echo Install graphviz | ||
- apt install graphviz -y | ||
- echo Build sphinx docs | ||
- apt-get install make -y | ||
- make -C docs html | ||
- echo Deploy sphinx docs | ||
- git config user.name 'github-action' | ||
- git config user.email 'github-action' | ||
- git remote add upstream git@github.com:xcompact3d/x3d2.git | ||
- ghp-import -m 'Update sphinx docs' --push --remote upstream --branch gh-pages docs/build/html --no-jekyll --force | ||
- echo Build API docs with ford | ||
- ford $FORD_CFG -o $FORD_OUTPUT_DIR | ||
- echo Deploy api-docs | ||
- ghp-import -m 'Update API docs' --prefix $PUBLISH_DIR --push --remote upstream --branch gh-pages $FORD_OUTPUT_DIR --no-jekyll --force | ||
rules: | ||
- if: '$CI_COMMIT_BRANCH == "main"' | ||
when: on_success | ||
- when: never | ||
allow_failure: false | ||
timeout: 15m | ||
|
||
build-and-test: | ||
<<: *build-and-test-template | ||
needs: [] | ||
|
||
check-formatting: | ||
<<: *check-formatting-template | ||
needs: [] | ||
|
||
#build-docs: | ||
# <<: *build-docs-template | ||
# needs: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
&domain_params | ||
! Global number of cells in each direction | ||
L_global = 6.283185307179586d0, 6.283185307179586d0, 6.283185307179586d0 | ||
|
||
! Global domain dimensions | ||
dims_global = 256, 256, 256 | ||
|
||
! Domain decomposition in each direction | ||
nproc_dir = 1, 1, 2 | ||
|
||
! BC options are 'periodic' | 'neumann' | 'dirichlet' | ||
BC_x = 'periodic', 'periodic' | ||
BC_y = 'periodic', 'periodic' | ||
BC_z = 'periodic', 'periodic' | ||
/End | ||
|
||
&solver_params | ||
Re = 1600d0 | ||
time_intg = 'AB3' ! 'AB[1-4]' | 'RK[1-4]' | ||
dt = 0.001d0 | ||
n_iters = 20000 | ||
n_output = 100 | ||
poisson_solver_type = 'FFT' ! 'FFT' | 'CG' | ||
der1st_scheme = 'compact6' | ||
der2nd_scheme = 'compact6' ! 'compact6' | 'compact6-hyperviscous' | ||
interpl_scheme = 'classic' ! 'classic' | 'optimised' | 'aggressive' | ||
stagder_scheme = 'compact6' | ||
/End |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module m_cuda_exec_thom | ||
use cudafor | ||
|
||
use m_common, only: dp | ||
use m_cuda_kernels_thom, only: der_univ_thom, der_univ_thom_per | ||
use m_cuda_tdsops, only: cuda_tdsops_t | ||
|
||
implicit none | ||
|
||
contains | ||
|
||
subroutine exec_thom_tds_compact(du, u, tdsops, blocks, threads) | ||
implicit none | ||
|
||
real(dp), device, dimension(:, :, :), intent(out) :: du | ||
real(dp), device, dimension(:, :, :), intent(in) :: u | ||
type(cuda_tdsops_t), intent(in) :: tdsops | ||
type(dim3), intent(in) :: blocks, threads | ||
|
||
if (tdsops%periodic) then | ||
call der_univ_thom_per<<<blocks, threads>>>( & !& | ||
du, u, tdsops%coeffs_dev, tdsops%tds_n, tdsops%alpha, & | ||
tdsops%thom_f_dev, tdsops%thom_s_dev, & | ||
tdsops%thom_w_dev, tdsops%thom_p_dev & | ||
) | ||
else | ||
call der_univ_thom<<<blocks, threads>>>( & !& | ||
du, u, & | ||
tdsops%coeffs_s_dev, tdsops%coeffs_e_dev, tdsops%coeffs_dev, & | ||
tdsops%tds_n, tdsops%thom_f_dev, tdsops%thom_s_dev, & | ||
tdsops%thom_w_dev & | ||
) | ||
end if | ||
|
||
end subroutine exec_thom_tds_compact | ||
|
||
end module m_cuda_exec_thom |
Oops, something went wrong.