Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfonba committed Mar 22, 2024
2 parents 537725f + bebf7bf commit cb36a64
Show file tree
Hide file tree
Showing 58 changed files with 1,426 additions and 1,103 deletions.
9 changes: 9 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Security Policy

## Supported Versions

Only the latest `master` git branch can be expected to include fixes for security issues.

## Reporting a Vulnerability

Please email <[email protected]> with security issues.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v2
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ jobs:
cancel-in-progress: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# We build doxygen from source because of
# https://github.com/doxygen/doxygen/issues/9016
- name: Build Doxygen
run: |
sudo apt install cmake ninja-build graphviz graphviz
sudo apt update -y
sudo apt install -y cmake ninja-build graphviz graphviz
git clone https://github.com/doxygen/doxygen.git ../doxygen
cmake -S ../doxygen -B ../doxygen/build -G Ninja
sudo ninja -C ../doxygen/build install
Expand All @@ -35,6 +36,22 @@ jobs:
cmake -S . -B build -G Ninja --install-prefix=$(pwd)/build/install -D MFC_DOCUMENTATION=ON
ninja -C build install
# From here https://github.com/cicirello/generate-sitemap
- name: Generate the sitemap
id: sitemap
uses: cicirello/generate-sitemap@v1
with:
base-url-path: https://mflowcode.github.io/
path-to-root: build/install/docs/mfc
include-pdf: false
sitemap-format: txt

- name: Output stats
run: |
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
- name: Publish Documentation
run: |
set +e
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Lint the toolchain
run: ./mfc.sh lint
4 changes: 2 additions & 2 deletions .github/workflows/pretty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check formatting
run: |
./mfc.sh format
./mfc.sh format -j $(nproc)
git diff --exit-code
2 changes: 1 addition & 1 deletion .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Spell Check
uses: crate-ci/typos@master
12 changes: 5 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ${{ matrix.os }}-latest
steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup MacOS
if: matrix.os == 'macos'
Expand All @@ -46,10 +46,7 @@ jobs:
- name: (MacOS) Build OpenMPI
if: matrix.os == 'macos' && matrix.mpi == 'mpi'
run: |
echo "OMPI_FC=gfortran-13" >> $GITHUB_ENV
echo "OMPI_CXX=g++-13" >> $GITHUB_ENV
echo "OMPI_MPICC=gcc-13" >> $GITHUB_ENV
HOMEBREW_MAKE_JOBS=$(nproc) brew install --cc=gcc-13 --verbose --build-from-source open-mpi
brew install mpich
- name: Setup Ubuntu
if: matrix.os == 'ubuntu' && matrix.intel == false
Expand All @@ -60,7 +57,8 @@ jobs:
- name: Setup Ubuntu (Intel)
if: matrix.os == 'ubuntu' && matrix.intel == true
run: |
sudo apt install tar wget make cmake python3 python3-dev
sudo apt update -y
sudo apt install -y tar wget make cmake python3 python3-dev
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
Expand Down Expand Up @@ -95,7 +93,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Test
run: sudo ./mfc.sh docker ./mfc.sh test -j $(nproc) -a
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,9 @@ benchmarks/*.jpg
benchmarks/*.png

*.mod

# Video Files
*.mp4
*.mov
*.mkv
*.avi
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

"cmake.configureOnOpen": false,

"python.defaultInterpreterPath": "${workspaceFolder}/build/venv/bin/python3",

"fortran.preferredCase": "lowercase",
"fortran.linter.includePaths": [ "${workspacefolder}/src/**" ],
"fortran.linter.fypp.enabled": true
}
39 changes: 31 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
-fcheck=all,no-array-temps
-fbacktrace
-fimplicit-none
)
#-ffpe-trap=invalid,zero,denormal,overflow
)
endif()

if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 10)
Expand Down Expand Up @@ -153,11 +154,20 @@ elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_
add_compile_options(
$<$<COMPILE_LANGUAGE:Fortran:-minline>
)
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(
$<$<COMPILE_LANGUAGE:Fortran:-O0>
)
endif()

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-C -g -O0 -traceback -Mchkptr -Mchkstk -Minform=inform -Mbounds)
endif()

if (DEFINED ENV{MFC_CUDA_CC})
string(REGEX MATCHALL "[0-9]+" MFC_CUDA_CC $ENV{MFC_CUDA_CC})
message(STATUS "Found $MFC_CUDA_CC specified. GPU code will be generated for ${MFC_CUDA_CC}.")
endif()
endif()

if (CMAKE_BUILD_TYPE STREQUAL "Release")
Expand Down Expand Up @@ -395,13 +405,19 @@ function(MFC_SETUP_TARGET)
target_compile_definitions(${ARGS_TARGET} PRIVATE MFC_cuTENSOR)
endif()

if (CMAKE_BUILD_TYPE STREQUAL "Release")
foreach (cc ${MFC_CUDA_CC})
target_compile_options(${ARGS_TARGET}
PRIVATE -gpu=keep,ptxinfo,lineinfo
PRIVATE -gpu=cc${cc}
)
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
endforeach()

target_compile_options(${ARGS_TARGET}
PRIVATE -gpu=keep,ptxinfo,lineinfo
)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(${ARGS_TARGET}
PRIVATE -gpu=keep,ptxinfo,lineinfo,autocompare,debug -O0
PRIVATE -gpu=autocompare,debug
)
endif()
endif()
Expand Down Expand Up @@ -470,8 +486,12 @@ if (MFC_DOCUMENTATION)

macro(GEN_DOCS target name)
set(DOXYGEN_PROJECT_NAME "\"${name}\"")
set(DOXYGEN_INPUT "\"${CMAKE_CURRENT_SOURCE_DIR}/src/${target}\"\
\"${CMAKE_CURRENT_SOURCE_DIR}/docs/${target}\"")
set(DOXYGEN_INPUT "\"${CMAKE_CURRENT_SOURCE_DIR}/docs/${target}\"")

foreach (f90 ${${target}_SRCs})
set(DOXYGEN_INPUT "${DOXYGEN_INPUT} \"${f90}\"")
endforeach()

set(DOXYGEN_HTML_HEADER "\"${CMAKE_CURRENT_SOURCE_DIR}/docs/header.html\"")
set(DOXYGEN_HTML_FOOTER "\"${CMAKE_CURRENT_SOURCE_DIR}/docs/footer.html\"")
set(DOXYGEN_HTML_OUTPUT "\"${CMAKE_CURRENT_BINARY_DIR}/${target}\"")
Expand Down Expand Up @@ -547,6 +567,9 @@ if (MFC_DOCUMENTATION)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/docs/res"
DESTINATION "docs/mfc")

install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/docs/robots.txt"
DESTINATION "docs/mfc")

install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/docs/index.html"
DESTINATION "docs/mfc")
endif()
Expand Down
Loading

0 comments on commit cb36a64

Please sign in to comment.