From e3159ffe7782ab391f11bb9699b8157e260ac849 Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Sat, 1 Jun 2024 18:53:32 -0400
Subject: [PATCH 01/15] Added Coverage CI with codecov
---
.github/workflows/coverage.yml | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 .github/workflows/coverage.yml
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
new file mode 100644
index 0000000000..8a29ca706d
--- /dev/null
+++ b/.github/workflows/coverage.yml
@@ -0,0 +1,15 @@
+- name: Coverage Check
+on:
+ push:
+
+ pull_request:
+
+ workflow_dispatch:
+
+
+ jobs:
+ - name: Upload coverage reports to Codecov
+ uses: codecov/codecov-action@v4.0.1
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ gcov: true
\ No newline at end of file
From 21dfce8ecc8fb2d7e4cff129c4cad95c5eea6625 Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Sat, 1 Jun 2024 19:22:07 -0400
Subject: [PATCH 02/15] CI coverage workflow fixed?
---
.github/workflows/coverage.yml | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 8a29ca706d..b911cd353a 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -1,14 +1,33 @@
-- name: Coverage Check
+name: Coverage Check
on:
push:
-
pull_request:
-
workflow_dispatch:
+jobs:
+ run:
+ name: Coverage Test on CodeCov
+ runs-on: "ubuntu-latest"
+ steps:
+ - name: Setup Ubuntu
+ run: |
+ sudo apt update -y
+ sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev
+
+ - name: Clone - PR
+ uses: actions/checkout@v3
+ with:
+ path: pr
+
+ - name: Clone - Master
+ uses: actions/checkout@v3
+ with:
+ repository: MFlowCode/MFC
+ ref: master
+ path: master
+
- jobs:
- - name: Upload coverage reports to Codecov
+ - name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
From d8f0132b657d32e55dda880c2d7b4c8ceeabd659 Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Sat, 1 Jun 2024 19:28:16 -0400
Subject: [PATCH 03/15] test removed gcov
---
.github/workflows/coverage.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index b911cd353a..b6a760e6b5 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -30,5 +30,4 @@ jobs:
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
- token: ${{ secrets.CODECOV_TOKEN }}
- gcov: true
\ No newline at end of file
+ token: ${{ secrets.CODECOV_TOKEN }}
\ No newline at end of file
From 92125615628708be1a517c5f035593e50806503f Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Sat, 1 Jun 2024 19:35:16 -0400
Subject: [PATCH 04/15] fixed coverage.yml hopefully
---
.github/workflows/coverage.yml | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index b6a760e6b5..33d5a6504b 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -14,18 +14,14 @@ jobs:
sudo apt update -y
sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev
- - name: Clone - PR
- uses: actions/checkout@v3
- with:
- path: pr
-
- - name: Clone - Master
- uses: actions/checkout@v3
- with:
- repository: MFlowCode/MFC
- ref: master
- path: master
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Build
+ run: /bin/bash mfc.sh build -j $(nproc)
+ - name: Test
+ run: /bin/bash mfc.sh test -j $(nproc)
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
From 28d9220b94cae6fb3f32929f37866bb7021ee3b0 Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Sat, 1 Jun 2024 20:18:09 -0400
Subject: [PATCH 05/15] added compile time flags
---
.github/workflows/coverage.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 33d5a6504b..bf1a90c324 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -14,11 +14,11 @@ jobs:
sudo apt update -y
sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev
- - name: Checkout
+ - name: Checkouts
uses: actions/checkout@v4
- name: Build
- run: /bin/bash mfc.sh build -j $(nproc)
+ run: /bin/bash mfc.sh build -j $(nproc) --debug
- name: Test
run: /bin/bash mfc.sh test -j $(nproc)
From 2fd57d7f8ab702fa3f2aac40a620a0f96d071b32 Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Sun, 2 Jun 2024 15:09:31 -0400
Subject: [PATCH 06/15] added more missing compiler flags
---
.github/workflows/coverage.yml | 6 ++----
CMakeLists.txt | 14 ++++++++++++--
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index bf1a90c324..9092e83ec6 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -1,8 +1,6 @@
name: Coverage Check
-on:
- push:
- pull_request:
- workflow_dispatch:
+
+on: [push, pull_request, workflow_dispatch]
jobs:
run:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f2ef51fb9..ea571e2c01 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,8 +111,18 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
-fcheck=all,no-array-temps
-fbacktrace
-fimplicit-none
- #-ffpe-trap=invalid,zero,denormal,overflow
- )
+ $<$:-fprofile-arcs>
+ $<$:-ftest-coverage>
+ # Stops error on this warning
+ # Casued by invalid linenum macros
+ if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 11)
+ -Wno-error=coverage-invalid-line-number
+ endif()
+ )
+ add_link_options(
+ $<$:-lgcov>
+ $<$:--coverage>
+ )
endif()
if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 10)
From f58b6b51caeac339d6d5a3065a3e742f87197a5c Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Sun, 2 Jun 2024 15:11:47 -0400
Subject: [PATCH 07/15] fixed -wnoerror on compiler coverage flag
---
CMakeLists.txt | 5 -----
1 file changed, 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea571e2c01..cc11bf4b9f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,11 +113,6 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
-fimplicit-none
$<$:-fprofile-arcs>
$<$:-ftest-coverage>
- # Stops error on this warning
- # Casued by invalid linenum macros
- if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 11)
- -Wno-error=coverage-invalid-line-number
- endif()
)
add_link_options(
$<$:-lgcov>
From c467a5fd9a3a19f76df83bdd251c40145923010a Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Mon, 3 Jun 2024 14:28:17 -0400
Subject: [PATCH 08/15] Set -gcov as a build parameter, updated some syntax to
be clearer in CI
---
.github/workflows/bench.yml | 3 +--
.github/workflows/count.yml | 6 +-----
.github/workflows/coverage.yml | 4 ++--
.github/workflows/lint.yml | 7 +------
.github/workflows/pretty.yml | 7 +------
.github/workflows/spelling.yml | 5 ++---
CMakeLists.txt | 24 ++++++++++++++++++++----
toolchain/mfc/build.py | 5 +++--
toolchain/mfc/common.py | 4 +++-
toolchain/mfc/state.py | 7 ++++---
10 files changed, 38 insertions(+), 34 deletions(-)
diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml
index b1cd4ee1fb..5fbdef5c4e 100644
--- a/.github/workflows/bench.yml
+++ b/.github/workflows/bench.yml
@@ -1,7 +1,6 @@
name: 'Benchmark'
-on:
- pull_request:
+on: pull_request
jobs:
self:
diff --git a/.github/workflows/count.yml b/.github/workflows/count.yml
index 552e12b5e0..b0040b22ca 100644
--- a/.github/workflows/count.yml
+++ b/.github/workflows/count.yml
@@ -1,10 +1,6 @@
name: Check Line Counts
-on:
- push:
- pull_request:
-
- workflow_dispatch:
+on: [push, pull_request, workflow_dispatch]
jobs:
sz:
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 9092e83ec6..9d80fac80d 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -16,10 +16,10 @@ jobs:
uses: actions/checkout@v4
- name: Build
- run: /bin/bash mfc.sh build -j $(nproc) --debug
+ run: /bin/bash mfc.sh build -j $(nproc) --gcov
- name: Test
- run: /bin/bash mfc.sh test -j $(nproc)
+ run: /bin/bash mfc.sh test -a -j $(nproc)
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index ca22f9705f..acb1025b6e 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -1,11 +1,6 @@
name: Lint
-on:
- push:
-
- pull_request:
-
- workflow_dispatch:
+on: [push, pull_request, workflow_dispatch]
jobs:
docs:
diff --git a/.github/workflows/pretty.yml b/.github/workflows/pretty.yml
index 9181addf8a..b74ea79f3d 100644
--- a/.github/workflows/pretty.yml
+++ b/.github/workflows/pretty.yml
@@ -1,11 +1,6 @@
name: Pretty
-on:
- push:
-
- pull_request:
-
- workflow_dispatch:
+on: [push, pull_request, workflow_dispatch]
jobs:
docs:
diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml
index 53f24e0024..582a91de95 100644
--- a/.github/workflows/spelling.yml
+++ b/.github/workflows/spelling.yml
@@ -1,7 +1,6 @@
name: Spell Check
-on:
- push:
- workflow_dispatch:
+
+on: [push, workflow_dispatch]
jobs:
run:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc11bf4b9f..3d7db0d364 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,7 @@ project(MFC LANGUAGES C CXX Fortran)
option(MFC_MPI "Build with MPI" ON)
option(MFC_OpenACC "Build with OpenACC" OFF)
+option(MFC_GCov "Build with GCov" OFF)
option(MFC_PRE_PROCESS "Build pre_process" OFF)
option(MFC_SIMULATION "Build simulation" OFF)
option(MFC_POST_PROCESS "Build post_process" OFF)
@@ -106,20 +107,35 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
$<$:-ffree-line-length-none>
)
- if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ if (MFC_GCov)
+
+ # Warning present in gcc versions > 11 that is treated as an error
+ # This flag doesn't exist in gcc versions <= 11
+ if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 11)
+ add_compile_options(
+ -Wno-error=coverage-invalid-line-number
+ )
+ endif()
+
add_compile_options(
- -fcheck=all,no-array-temps
- -fbacktrace
- -fimplicit-none
$<$:-fprofile-arcs>
$<$:-ftest-coverage>
)
+
add_link_options(
$<$:-lgcov>
$<$:--coverage>
)
endif()
+ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ add_compile_options(
+ -fcheck=all,no-array-temps
+ -fbacktrace
+ -fimplicit-none
+ )
+ endif()
+
if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 10)
add_compile_options(
$<$:-fallow-invalid-boz>
diff --git a/toolchain/mfc/build.py b/toolchain/mfc/build.py
index 700e1c90d2..9b6946a523 100644
--- a/toolchain/mfc/build.py
+++ b/toolchain/mfc/build.py
@@ -142,8 +142,9 @@ def configure(self, case: input.MFCInputFile):
flags.append('--debug-find')
if not self.isDependency:
- flags.append(f"-DMFC_MPI={ 'ON' if ARG('mpi') else 'OFF'}")
- flags.append(f"-DMFC_OpenACC={'ON' if ARG('gpu') else 'OFF'}")
+ flags.append(f"-DMFC_MPI={ 'ON' if ARG('mpi') else 'OFF'}")
+ flags.append(f"-DMFC_OpenACC={'ON' if ARG('gpu') else 'OFF'}")
+ flags.append(f"-DMFC_GCov={ 'ON' if ARG('gcov') else 'OFF'}")
command = ["cmake"] + flags + ["-S", cmake_dirpath, "-B", build_dirpath]
diff --git a/toolchain/mfc/common.py b/toolchain/mfc/common.py
index 56cf9c5828..5bf2af361b 100644
--- a/toolchain/mfc/common.py
+++ b/toolchain/mfc/common.py
@@ -21,7 +21,9 @@
.:++=----------====+*= ==..:%.....
.:-=++++===--==+=-+= +. :=
+#=::::::::=%=. -+: =+ *:
-.*=-=*=.. :=+*+: -...--\
+.*=-=*=.. :=+*+: -...--
+
+\
"""
diff --git a/toolchain/mfc/state.py b/toolchain/mfc/state.py
index 1b06ed4cb0..bf606f37cb 100644
--- a/toolchain/mfc/state.py
+++ b/toolchain/mfc/state.py
@@ -6,6 +6,7 @@ class MFCConfig:
mpi: bool = True
gpu: bool = False
debug: bool = False
+ gcov: bool = False
@staticmethod
def from_dict(d: dict):
@@ -23,12 +24,12 @@ def items(self) -> typing.List[typing.Tuple[str, bool]]:
def make_options(self) -> typing.List[str]:
""" Returns a list of options that could be passed to mfc.sh again.
- Example: --no-debug --mpi --no-gpu """
+ Example: --no-debug --mpi --no-gpu --no-gcov"""
return [ f"--{'no-' if not v else ''}{k}" for k, v in self.items() ]
def make_slug(self) -> str:
""" Sort the items by key, then join them with underscores. This uniquely
- identifies the configuration. Example: no-debug_no-gpu_mpi """
+ identifies the configuration. Example: no-debug no-gpu no_mpi """
return '_'.join([ f"{'no-' if not v else ''}{k}" for k, v in sorted(self.items(), key=lambda x: x[0]) ])
def __eq__(self, other) -> bool:
@@ -40,7 +41,7 @@ def __eq__(self, other) -> bool:
return True
def __str__(self) -> str:
- """ Returns a string like "mpi=No & gpu=No & debug=No" """
+ """ Returns a string like "mpi=No & gpu=No & debug=No" & gcov=No """
return ' & '.join([ f"{k}={'Yes' if v else 'No'}" for k, v in self.items() ])
From ce44c8eb8aa09da4d6a08b504cd977b92a4701b6 Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Mon, 3 Jun 2024 14:47:52 -0400
Subject: [PATCH 09/15] added to documentation & fixed gnu warning/error
---
CMakeLists.txt | 6 ++--
docs/documentation/getting-started.md | 46 +++++++++++++++------------
2 files changed, 29 insertions(+), 23 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3d7db0d364..a4173a5f3c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -109,9 +109,9 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
if (MFC_GCov)
- # Warning present in gcc versions > 11 that is treated as an error
- # This flag doesn't exist in gcc versions <= 11
- if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 11)
+ # Warning present in gcc versions >= 12 that is treated as an error
+ # This flag doesn't exist in gcc versions < 12
+ if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 12)
add_compile_options(
-Wno-error=coverage-invalid-line-number
)
diff --git a/docs/documentation/getting-started.md b/docs/documentation/getting-started.md
index 271d9a086d..b891fa7bc3 100644
--- a/docs/documentation/getting-started.md
+++ b/docs/documentation/getting-started.md
@@ -4,7 +4,7 @@
You can either download MFC's [latest release from GitHub](https://github.com/MFlowCode/MFC/releases/latest) or clone the repository:
-```shell
+```shell {"id":"01HZFPNJRJKJ897YPN2PVNS40H"}
git clone https://github.com/MFlowCode/MFC.git
cd MFC
```
@@ -19,13 +19,13 @@ Please select your desired configuration from the list bellow:
- **On supported clusters:** Load environment modules
-```shell
+```shell {"id":"01HZFPNJRJKJ897YPN2QRHCH0W"}
. ./mfc.sh load
```
- **Via [Aptitude](https://wiki.debian.org/Aptitude):**
-```shell
+```shell {"id":"01HZFPNJRJKJ897YPN2RCHGDB3"}
sudo apt update
sudo apt upgrade
sudo apt install tar wget make cmake gcc g++ \
@@ -36,7 +36,7 @@ sudo apt install tar wget make cmake gcc g++ \
- **Via [Pacman](https://wiki.archlinux.org/title/pacman):**
-```shell
+```shell {"id":"01HZFPNJRJKJ897YPN2SYBY4ZR"}
sudo pacman -Syu
sudo pacman -S base-devel coreutils \
git ninja gcc-fortran \
@@ -62,12 +62,14 @@ On Windows, you can either use Intel Compilers with the standard Microsoft toolc
Windows + Intel (Native)
Install the latest version of:
+
- [Microsoft Visual Studio Community](https://visualstudio.microsoft.com/)
- [Intel® oneAPI Base Toolkit](https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html)
- [Intel® oneAPI HPC Toolkit](https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit-download.html)
Then, in order to initialize your development environment, open a terminal window and run:
-```shell
+
+```shell {"id":"01HZFPNJRJKJ897YPN2TFT7D3V"}
"C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
```
@@ -90,20 +92,20 @@ You can now follow the appropriate instructions for your distribution.
MacOS
- - **If you use [ZSH]** (Verify with `echo $SHELL`)
+- **If you use [ZSH]** (Verify with `echo $SHELL`)
-```shell
+```shell {"id":"01HZFPNJRJKJ897YPN2V88SDBX"}
touch ~/.zshrc
open ~/.zshrc
```
- - **If you use [BASH]** (Verify with `echo $SHELL`)
-
-```shell
+- **If you use [BASH]** (Verify with `echo $SHELL`)
+
+```shell {"id":"01HZFPNJRJKJ897YPN2XN8DXFZ"}
touch ~/.bash_profile
open ~/.bash_profile
```
-
+
An editor should open.
Please paste the following lines into it before saving the file.
If you wish to use a version of GNU's GCC other than 13, modify the first assignment.
@@ -111,7 +113,7 @@ These lines ensure that LLVM's Clang, and Apple's modified version of GCC, won't
Further reading on `open-mpi` incompatibility with `clang`-based `gcc` on macOS: [here](https://stackoverflow.com/questions/27930481/how-to-build-openmpi-with-homebrew-and-gcc-4-9).
We do *not* support `clang` due to conflicts with the Silo dependency.
-```shell
+```shell {"id":"01HZFPNJRJKJ897YPN2ZTZJWVH"}
export MFC_GCC_VER=13
export CC=gcc-$MFC_GCC_VER
export CXX=g++-$MFC_GCC_VER
@@ -120,7 +122,7 @@ export FC=gfortran-$MFC_GCC_VER
**Close the open editor and terminal window**. Open a **new terminal** window before executing the commands below.
-```shell
+```shell {"id":"01HZFPNJRJKJ897YPN31QHVWXQ"}
brew install wget python cmake gcc@$MFC_GCC_VER mpich
```
@@ -133,19 +135,21 @@ They will download the dependencies MFC requires to build itself.
Docker is a lightweight, cross-platform, and performant alternative to Virtual Machines (VMs).
We build a Docker Image that contains the packages required to build and run MFC on your local machine.
-
+
First install Docker and Git:
+
- Windows: [Docker](https://docs.docker.com/get-docker/) + [Git](https://git-scm.com/downloads).
- macOS: `brew install git docker` (requires [Homebrew](https://brew.sh/)).
- Other systems:
-```shell
+
+```shell {"id":"01HZFPNJRJKJ897YPN34Y40YAF"}
sudo apt install git docker # Debian / Ubuntu via Aptitude
sudo pacman -S git docker # Arch Linux via Pacman
```
Once Docker and Git are installed on your system, clone MFC with
-```shell
+```shell {"id":"01HZFPNJRJKJ897YPN383W8K9Y"}
git clone https://github.com/MFlowCode/MFC
cd MFC
```
@@ -153,7 +157,7 @@ cd MFC
To fetch the prebuilt Docker image and enter an interactive bash session with the
recommended settings applied, run
-```shell
+```shell {"id":"01HZFPNJRJKJ897YPN385851V3"}
./mfc.sh docker # If on \*nix/macOS
.\mfc.bat docker # If on Windows
```
@@ -177,6 +181,7 @@ MFC can be built with support for various (compile-time) features:
| **MPI** | `--mpi` | `--no-mpi` | On | Lets MFC run on multiple processors (and nodes) simultaneously. |
| **GPU** | `--gpu` | `--no-gpu` | Off | Enables GPU acceleration via OpenACC. |
| **Debug** | `--debug` | `--no-debug` | Off | Requests the compiler build MFC in debug mode. |
+| **GCov** | `--gcov` | `--no-gcov` | Off | Builds MFC with coverage flags on. |
_⚠️ The `--gpu` option requires that your compiler supports OpenACC for Fortran for your target GPU architecture._
@@ -190,7 +195,8 @@ To only select a subset, use the `-t` (i.e., `--targets`) argument.
For a detailed list of options, arguments, and features, please refer to `./mfc.sh build --help`.
Most first-time users will want to build MFC using 8 threads (or more!) with MPI support:
-```shell
+
+```shell {"id":"01HZFPNJRJKJ897YPN3A0RW6CX"}
./mfc.sh build -j 8
```
@@ -204,7 +210,7 @@ Examples:
Run MFC's test suite with 8 threads:
-```shell
+```shell {"id":"01HZFPNJRJKJ897YPN3DZTCCQ7"}
./mfc.sh test -j 8
```
@@ -214,7 +220,7 @@ Please refer to the [Testing](testing.md) document for more information.
MFC has example cases in the `examples` folder. You can run such a case interactively using 2 tasks by typing:
-```shell
+```shell {"id":"01HZFPNJRJKJ897YPN3FKXVQH9"}
./mfc.sh run examples/2D_shockbubble/case.py -n 2
```
From 2f0bcfd96d037c8d8074619c3d7f246ca8c70fb0 Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Mon, 3 Jun 2024 16:04:17 -0400
Subject: [PATCH 10/15] added badge to readme & added removed comment to cmake
---
CMakeLists.txt | 1 +
README.md | 65 ++++++++++++++++++++++++++++++++------------------
2 files changed, 43 insertions(+), 23 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a4173a5f3c..bb36dd1862 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -133,6 +133,7 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
-fcheck=all,no-array-temps
-fbacktrace
-fimplicit-none
+ #-ffpe-trap=invalid,zero,denormal,overflow
)
endif()
diff --git a/README.md b/README.md
index 20f9ff9ec3..a1d5383f2c 100644
--- a/README.md
+++ b/README.md
@@ -17,18 +17,20 @@
+
+
+
Welcome to the home of MFC!
-MFC simulates compressible multi-component and multi-phase flows, [amongst other things](#what-else-can-this-thing-do).
-It scales ideally to exascale; [tens of thousands of GPUs on NVIDIA- and AMD-GPU machines](#is-this-really-exascale), like Oak Ridge Summit and Frontier.
+MFC simulates compressible multi-component and multi-phase flows, [amongst other things](#what-else-can-this-thing-do).
+It scales ideally to exascale; [tens of thousands of GPUs on NVIDIA- and AMD-GPU machines](#is-this-really-exascale), like Oak Ridge Summit and Frontier.
MFC is written in Fortran and makes use of metaprogramming to keep the code short (about 20K lines).
-
-Get in touch with the maintainers, like Spencer, if you have questions!
+
+Get in touch with the maintainers, like Spencer, if you have questions!
We have an [active Slack channel](https://join.slack.com/t/mflowcode/shared_invite/zt-y75wibvk-g~zztjknjYkK1hFgCuJxVw) and development team.
MFC has high-level documentation, visualizations, and more on [its website](https://mflowcode.github.io/).
-
## An example
We keep many examples.
@@ -45,55 +47,63 @@ Another example is the high-Mach flow over an airfoil, shown below.

-
## Getting started
You can navigate [to this webpage](https://mflowcode.github.io/documentation/md_getting-started.html) to get started using MFC!
It's rather straightforward.
We'll give a brief intro. here for MacOS.
Using [brew](https://brew.sh), install MFC's modest set of dependencies:
+
```shell
brew install wget python cmake gcc@13 mpich
```
+
You're now ready to build and test MFC!
Put it to a convenient directory via
+
```shell
git clone https://github.com/mflowcode/MFC.git
cd MFC
```
+
and make sure MFC knows what compilers to use by putting the following in your `~/.profile`
+
```shell
export CC=gcc-13
export CXX=g++-13
export FC=gfortran-13
```
+
and source that file, build, and test!
+
```shell
source ~/.profile
./mfc.sh build -j 8
./mfc.sh test -j 8
```
+
And... you're done!
You can learn more about MFC's capabilities [via its documentation](https://mflowcode.github.io/documentation/index.html) or play with the examples located in the `examples/` directory (some are [shown here](https://mflowcode.github.io/documentation/md_examples.html))!
The shock-droplet interaction case above was run via
+
```shell
./mfc.sh run ./examples/3d_shockdroplet/case.py -n 8
```
+
where `8` is the number of cores the example will run on.
You can visualize the output data, located in `examples/3d_shockdroplet/silo_hdf5`, via Paraview, Visit, or your other favorite software.
## Is this really exascale
[OLCF Frontier](https://www.olcf.ornl.gov/frontier/) is the first exascale supercomputer.
-The weak scaling of MFC on this machine is below, showing near-ideal utilization.
+The weak scaling of MFC on this machine is below, showing near-ideal utilization.
-
## What else can this thing do
MFC has many features.
@@ -105,30 +115,36 @@ They are organized below, just click the drop-downs!
* 1-3D
* Compressible
* Multi- and single-component
- * 4, 5, and 6 equation models for multi-component/phase features
-* Multi- and single-phase
- * Phase change via p, pT, and pTg schemes
+ * 4, 5, and 6 equation models for multi-component/phase features
+
+* Multi- and single-phase
+ * Phase change via p, pT, and pTg schemes
+
* Grids
- * 1-3D Cartesian, cylindrical, axi-symmetric.
- * Arbitrary grid stretching for multiple domain regions available.
- * Complex/arbitrary geometries via immersed boundary methods
- * STL geometry files supported
+ * 1-3D Cartesian, cylindrical, axi-symmetric.
+ * Arbitrary grid stretching for multiple domain regions available.
+ * Complex/arbitrary geometries via immersed boundary methods
+ * STL geometry files supported
+
* Sub-grid Euler-Euler multiphase models for bubble dynamics and similar
* Viscous effects (high-order accurate representations)
* Ideal and stiffened gas equations of state
* Acoustic wave generation (one- and two-way sound sources)
+
Numerics
* Shock and interface capturing schemes
- * First-order upwinding, WENO3 and 5.
- * Reliable handling of high density ratios.
+ * First-order upwinding, WENO3 and 5.
+ * Reliable handling of high density ratios.
+
* Exact and approximate (e.g., HLL, HLLC) Riemann solvers
* Boundary conditions: Periodic, reflective, extrapolation/Neumann, slip/no-slip, non-reflecting characteristic buffers, inflows, outflows, and more.
* Runge-Kutta orders 1-3 (SSP TVD)
* Interface sharpening (THINC-like)
+
@@ -136,9 +152,11 @@ They are organized below, just click the drop-downs!
* GPU compatible on NVIDIA (P/V/A/H100, etc.) and AMD (MI200+) hardware
* Ideal weak scaling to 100% of leadership class machines
- * \>10K GPUs on [OLCF Summit](https://www.olcf.ornl.gov/summit/) (V100-based)
- * \>60K GPUs on world's first exascale computer, [OLCF Frontier](https://www.olcf.ornl.gov/frontier/) (MI250X-based)
+ * \>10K GPUs on [OLCF Summit](https://www.olcf.ornl.gov/summit/) (V100-based)
+ * \>60K GPUs on world's first exascale computer, [OLCF Frontier](https://www.olcf.ornl.gov/frontier/) (MI250X-based)
+
* Near roofline behavior
+
@@ -146,11 +164,12 @@ They are organized below, just click the drop-downs!
* [Fypp](https://fypp.readthedocs.io/en/stable/fypp.html) metaprogramming for code readability, performance, and portability
* Continuous Integration (CI)
- * Regression test cases on CPU and GPU hardware with each PR. Performed with GNU, Intel, and NVIDIA compilers.
- * Benchmarking to avoid performance regressions and identify speed-ups
+ * Regression test cases on CPU and GPU hardware with each PR. Performed with GNU, Intel, and NVIDIA compilers.
+ * Benchmarking to avoid performance regressions and identify speed-ups
+
* Continuous Deployment (CD) of [website](https://mflowcode.github.io) and [API documentation](https://mflowcode.github.io/documentation/index.html)
-
+
## Citation
@@ -174,7 +193,7 @@ If you use MFC, consider citing it:
```
## License
-
+
Copyright 2021-2024 Spencer Bryngelson and Tim Colonius.
MFC is under the MIT license (see [LICENSE](LICENSE) file for full text).
From 4c4456570195906736e8e7b459ef4ef5929693f0 Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Mon, 3 Jun 2024 16:11:10 -0400
Subject: [PATCH 11/15] fixed readme
---
README.md | 64 +++++++++++++++++++++----------------------------------
1 file changed, 24 insertions(+), 40 deletions(-)
diff --git a/README.md b/README.md
index a1d5383f2c..735ff94bfa 100644
--- a/README.md
+++ b/README.md
@@ -18,19 +18,20 @@
-
+
Welcome to the home of MFC!
-MFC simulates compressible multi-component and multi-phase flows, [amongst other things](#what-else-can-this-thing-do).
-It scales ideally to exascale; [tens of thousands of GPUs on NVIDIA- and AMD-GPU machines](#is-this-really-exascale), like Oak Ridge Summit and Frontier.
+MFC simulates compressible multi-component and multi-phase flows, [amongst other things](#what-else-can-this-thing-do).
+It scales ideally to exascale; [tens of thousands of GPUs on NVIDIA- and AMD-GPU machines](#is-this-really-exascale), like Oak Ridge Summit and Frontier.
MFC is written in Fortran and makes use of metaprogramming to keep the code short (about 20K lines).
-
-Get in touch with the maintainers, like Spencer, if you have questions!
+
+Get in touch with the maintainers, like Spencer, if you have questions!
We have an [active Slack channel](https://join.slack.com/t/mflowcode/shared_invite/zt-y75wibvk-g~zztjknjYkK1hFgCuJxVw) and development team.
MFC has high-level documentation, visualizations, and more on [its website](https://mflowcode.github.io/).
+
## An example
We keep many examples.
@@ -47,63 +48,55 @@ Another example is the high-Mach flow over an airfoil, shown below.

+
## Getting started
You can navigate [to this webpage](https://mflowcode.github.io/documentation/md_getting-started.html) to get started using MFC!
It's rather straightforward.
We'll give a brief intro. here for MacOS.
Using [brew](https://brew.sh), install MFC's modest set of dependencies:
-
```shell
brew install wget python cmake gcc@13 mpich
```
-
You're now ready to build and test MFC!
Put it to a convenient directory via
-
```shell
git clone https://github.com/mflowcode/MFC.git
cd MFC
```
-
and make sure MFC knows what compilers to use by putting the following in your `~/.profile`
-
```shell
export CC=gcc-13
export CXX=g++-13
export FC=gfortran-13
```
-
and source that file, build, and test!
-
```shell
source ~/.profile
./mfc.sh build -j 8
./mfc.sh test -j 8
```
-
And... you're done!
You can learn more about MFC's capabilities [via its documentation](https://mflowcode.github.io/documentation/index.html) or play with the examples located in the `examples/` directory (some are [shown here](https://mflowcode.github.io/documentation/md_examples.html))!
The shock-droplet interaction case above was run via
-
```shell
./mfc.sh run ./examples/3d_shockdroplet/case.py -n 8
```
-
where `8` is the number of cores the example will run on.
You can visualize the output data, located in `examples/3d_shockdroplet/silo_hdf5`, via Paraview, Visit, or your other favorite software.
## Is this really exascale
[OLCF Frontier](https://www.olcf.ornl.gov/frontier/) is the first exascale supercomputer.
-The weak scaling of MFC on this machine is below, showing near-ideal utilization.
+The weak scaling of MFC on this machine is below, showing near-ideal utilization.
+
## What else can this thing do
MFC has many features.
@@ -115,36 +108,30 @@ They are organized below, just click the drop-downs!
* 1-3D
* Compressible
* Multi- and single-component
- * 4, 5, and 6 equation models for multi-component/phase features
-
-* Multi- and single-phase
- * Phase change via p, pT, and pTg schemes
-
+ * 4, 5, and 6 equation models for multi-component/phase features
+* Multi- and single-phase
+ * Phase change via p, pT, and pTg schemes
* Grids
- * 1-3D Cartesian, cylindrical, axi-symmetric.
- * Arbitrary grid stretching for multiple domain regions available.
- * Complex/arbitrary geometries via immersed boundary methods
- * STL geometry files supported
-
+ * 1-3D Cartesian, cylindrical, axi-symmetric.
+ * Arbitrary grid stretching for multiple domain regions available.
+ * Complex/arbitrary geometries via immersed boundary methods
+ * STL geometry files supported
* Sub-grid Euler-Euler multiphase models for bubble dynamics and similar
* Viscous effects (high-order accurate representations)
* Ideal and stiffened gas equations of state
* Acoustic wave generation (one- and two-way sound sources)
-
Numerics
* Shock and interface capturing schemes
- * First-order upwinding, WENO3 and 5.
- * Reliable handling of high density ratios.
-
+ * First-order upwinding, WENO3 and 5.
+ * Reliable handling of high density ratios.
* Exact and approximate (e.g., HLL, HLLC) Riemann solvers
* Boundary conditions: Periodic, reflective, extrapolation/Neumann, slip/no-slip, non-reflecting characteristic buffers, inflows, outflows, and more.
* Runge-Kutta orders 1-3 (SSP TVD)
* Interface sharpening (THINC-like)
-
@@ -152,11 +139,9 @@ They are organized below, just click the drop-downs!
* GPU compatible on NVIDIA (P/V/A/H100, etc.) and AMD (MI200+) hardware
* Ideal weak scaling to 100% of leadership class machines
- * \>10K GPUs on [OLCF Summit](https://www.olcf.ornl.gov/summit/) (V100-based)
- * \>60K GPUs on world's first exascale computer, [OLCF Frontier](https://www.olcf.ornl.gov/frontier/) (MI250X-based)
-
+ * \>10K GPUs on [OLCF Summit](https://www.olcf.ornl.gov/summit/) (V100-based)
+ * \>60K GPUs on world's first exascale computer, [OLCF Frontier](https://www.olcf.ornl.gov/frontier/) (MI250X-based)
* Near roofline behavior
-
@@ -164,13 +149,12 @@ They are organized below, just click the drop-downs!
* [Fypp](https://fypp.readthedocs.io/en/stable/fypp.html) metaprogramming for code readability, performance, and portability
* Continuous Integration (CI)
- * Regression test cases on CPU and GPU hardware with each PR. Performed with GNU, Intel, and NVIDIA compilers.
- * Benchmarking to avoid performance regressions and identify speed-ups
-
+ * Regression test cases on CPU and GPU hardware with each PR. Performed with GNU, Intel, and NVIDIA compilers.
+ * Benchmarking to avoid performance regressions and identify speed-ups
* Continuous Deployment (CD) of [website](https://mflowcode.github.io) and [API documentation](https://mflowcode.github.io/documentation/index.html)
-
+
## Citation
If you use MFC, consider citing it:
@@ -193,7 +177,7 @@ If you use MFC, consider citing it:
```
## License
-
+
Copyright 2021-2024 Spencer Bryngelson and Tim Colonius.
MFC is under the MIT license (see [LICENSE](LICENSE) file for full text).
From 4876a6860ab846232aa8891cde24f1aec56d75ba Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Mon, 3 Jun 2024 16:27:05 -0400
Subject: [PATCH 12/15] fixed getting_started.md
---
docs/documentation/getting-started.md | 45 ++++++++++++---------------
1 file changed, 20 insertions(+), 25 deletions(-)
diff --git a/docs/documentation/getting-started.md b/docs/documentation/getting-started.md
index b891fa7bc3..75b39270f0 100644
--- a/docs/documentation/getting-started.md
+++ b/docs/documentation/getting-started.md
@@ -4,7 +4,7 @@
You can either download MFC's [latest release from GitHub](https://github.com/MFlowCode/MFC/releases/latest) or clone the repository:
-```shell {"id":"01HZFPNJRJKJ897YPN2PVNS40H"}
+```shell
git clone https://github.com/MFlowCode/MFC.git
cd MFC
```
@@ -19,13 +19,13 @@ Please select your desired configuration from the list bellow:
- **On supported clusters:** Load environment modules
-```shell {"id":"01HZFPNJRJKJ897YPN2QRHCH0W"}
+```shell
. ./mfc.sh load
```
- **Via [Aptitude](https://wiki.debian.org/Aptitude):**
-```shell {"id":"01HZFPNJRJKJ897YPN2RCHGDB3"}
+```shell
sudo apt update
sudo apt upgrade
sudo apt install tar wget make cmake gcc g++ \
@@ -36,7 +36,7 @@ sudo apt install tar wget make cmake gcc g++ \
- **Via [Pacman](https://wiki.archlinux.org/title/pacman):**
-```shell {"id":"01HZFPNJRJKJ897YPN2SYBY4ZR"}
+```shell
sudo pacman -Syu
sudo pacman -S base-devel coreutils \
git ninja gcc-fortran \
@@ -62,14 +62,12 @@ On Windows, you can either use Intel Compilers with the standard Microsoft toolc
Windows + Intel (Native)
Install the latest version of:
-
- [Microsoft Visual Studio Community](https://visualstudio.microsoft.com/)
- [Intel® oneAPI Base Toolkit](https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html)
- [Intel® oneAPI HPC Toolkit](https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit-download.html)
Then, in order to initialize your development environment, open a terminal window and run:
-
-```shell {"id":"01HZFPNJRJKJ897YPN2TFT7D3V"}
+```shell
"C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
```
@@ -92,20 +90,20 @@ You can now follow the appropriate instructions for your distribution.
MacOS
-- **If you use [ZSH]** (Verify with `echo $SHELL`)
+ - **If you use [ZSH]** (Verify with `echo $SHELL`)
-```shell {"id":"01HZFPNJRJKJ897YPN2V88SDBX"}
+```shell
touch ~/.zshrc
open ~/.zshrc
```
-- **If you use [BASH]** (Verify with `echo $SHELL`)
-
-```shell {"id":"01HZFPNJRJKJ897YPN2XN8DXFZ"}
+ - **If you use [BASH]** (Verify with `echo $SHELL`)
+
+```shell
touch ~/.bash_profile
open ~/.bash_profile
```
-
+
An editor should open.
Please paste the following lines into it before saving the file.
If you wish to use a version of GNU's GCC other than 13, modify the first assignment.
@@ -113,7 +111,7 @@ These lines ensure that LLVM's Clang, and Apple's modified version of GCC, won't
Further reading on `open-mpi` incompatibility with `clang`-based `gcc` on macOS: [here](https://stackoverflow.com/questions/27930481/how-to-build-openmpi-with-homebrew-and-gcc-4-9).
We do *not* support `clang` due to conflicts with the Silo dependency.
-```shell {"id":"01HZFPNJRJKJ897YPN2ZTZJWVH"}
+```shell
export MFC_GCC_VER=13
export CC=gcc-$MFC_GCC_VER
export CXX=g++-$MFC_GCC_VER
@@ -122,7 +120,7 @@ export FC=gfortran-$MFC_GCC_VER
**Close the open editor and terminal window**. Open a **new terminal** window before executing the commands below.
-```shell {"id":"01HZFPNJRJKJ897YPN31QHVWXQ"}
+```shell
brew install wget python cmake gcc@$MFC_GCC_VER mpich
```
@@ -135,21 +133,19 @@ They will download the dependencies MFC requires to build itself.
Docker is a lightweight, cross-platform, and performant alternative to Virtual Machines (VMs).
We build a Docker Image that contains the packages required to build and run MFC on your local machine.
-
+
First install Docker and Git:
-
- Windows: [Docker](https://docs.docker.com/get-docker/) + [Git](https://git-scm.com/downloads).
- macOS: `brew install git docker` (requires [Homebrew](https://brew.sh/)).
- Other systems:
-
-```shell {"id":"01HZFPNJRJKJ897YPN34Y40YAF"}
+```shell
sudo apt install git docker # Debian / Ubuntu via Aptitude
sudo pacman -S git docker # Arch Linux via Pacman
```
Once Docker and Git are installed on your system, clone MFC with
-```shell {"id":"01HZFPNJRJKJ897YPN383W8K9Y"}
+```shell
git clone https://github.com/MFlowCode/MFC
cd MFC
```
@@ -157,7 +153,7 @@ cd MFC
To fetch the prebuilt Docker image and enter an interactive bash session with the
recommended settings applied, run
-```shell {"id":"01HZFPNJRJKJ897YPN385851V3"}
+```shell
./mfc.sh docker # If on \*nix/macOS
.\mfc.bat docker # If on Windows
```
@@ -195,8 +191,7 @@ To only select a subset, use the `-t` (i.e., `--targets`) argument.
For a detailed list of options, arguments, and features, please refer to `./mfc.sh build --help`.
Most first-time users will want to build MFC using 8 threads (or more!) with MPI support:
-
-```shell {"id":"01HZFPNJRJKJ897YPN3A0RW6CX"}
+```shell
./mfc.sh build -j 8
```
@@ -210,7 +205,7 @@ Examples:
Run MFC's test suite with 8 threads:
-```shell {"id":"01HZFPNJRJKJ897YPN3DZTCCQ7"}
+```shell
./mfc.sh test -j 8
```
@@ -220,7 +215,7 @@ Please refer to the [Testing](testing.md) document for more information.
MFC has example cases in the `examples` folder. You can run such a case interactively using 2 tasks by typing:
-```shell {"id":"01HZFPNJRJKJ897YPN3FKXVQH9"}
+```shell
./mfc.sh run examples/2D_shockbubble/case.py -n 2
```
From 17b21dd2831b7c8749044e54955b31c3e7934db9 Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Mon, 3 Jun 2024 16:34:22 -0400
Subject: [PATCH 13/15] fixed bench.yml not sure how this happened
---
.github/workflows/bench.yml | 156 +++++++++++++++++++++++++++++-------
1 file changed, 128 insertions(+), 28 deletions(-)
diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml
index 5fbdef5c4e..e6e2cc24be 100644
--- a/.github/workflows/bench.yml
+++ b/.github/workflows/bench.yml
@@ -1,48 +1,148 @@
-name: 'Benchmark'
+name: 'Test Suite'
-on: pull_request
+on:
+ push:
+ paths:
+ - '**.f90'
+ - '**.fpp'
+ - '**.py'
+ - '**.yml'
+ - 'mfc.sh'
+ - 'golden.txt'
+ - 'CMakeLists.txt'
+ - 'requirements.txt'
+ pull_request:
+
+ workflow_dispatch:
+
jobs:
+ github:
+ name: Github
+ strategy:
+ matrix:
+ os: ['ubuntu', 'macos']
+ mpi: ['mpi']
+ debug: ['debug', 'no-debug']
+ intel: [true, false]
+ exclude:
+ - os: macos
+ intel: true
+
+ include:
+ - os: ubuntu
+ mpi: no-mpi
+ debug: no-debug
+ intel: false
+
+ fail-fast: false
+ continue-on-error: true
+ runs-on: ${{ matrix.os }}-latest
+ steps:
+ - name: Clone
+ uses: actions/checkout@v4
+
+ - name: Setup MacOS
+ if: matrix.os == 'macos'
+ run: |
+ brew install wget make python make cmake coreutils gcc@14
+ echo "CC=gcc-14" >> $GITHUB_ENV
+ echo "CXX=g++-14" >> $GITHUB_ENV
+ echo "FC=gfortran-14" >> $GITHUB_ENV
+
+ - name: (MacOS) Build OpenMPI
+ if: matrix.os == 'macos' && matrix.mpi == 'mpi'
+ run: |
+ brew install mpich
+
+ - name: Setup Ubuntu
+ if: matrix.os == 'ubuntu' && matrix.intel == false
+ run: |
+ sudo apt update -y
+ sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev
+
+ - name: Setup Ubuntu (Intel)
+ if: matrix.os == 'ubuntu' && matrix.intel == true
+ run: |
+ 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
+ sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
+ sudo apt-get update
+ sudo apt-get install -y intel-oneapi-common-vars intel-oneapi-compiler-fortran-2022.1.0 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2022.1.0 intel-oneapi-mkl-2021.4.0 intel-oneapi-mpi-2021.7.1 intel-oneapi-mpi-devel-2021.7.1
+ source /opt/intel/oneapi/setvars.sh
+ echo "CXX=$(which icpc)" >> $GITHUB_ENV
+ echo "CC=$(which icc)" >> $GITHUB_ENV
+ echo "FC=$(which ifort)" >> $GITHUB_ENV
+ echo "OMPI_FC=$(which ifort)" >> $GITHUB_ENV
+ echo "OMPI_CXX=$(which icpc)" >> $GITHUB_ENV
+ echo "OMPI_MPICC=$(which icc)" >> $GITHUB_ENV
+ echo "MPI_HOME=/opt/intel/oneapi/mpi/2021.7.1/" >> $GITHUB_ENV
+ echo "I_MPI_ROOT=/opt/intel/oneapi/mpi/2021.7.1/" >> $GITHUB_ENV
+
+ - name: Build
+ run: |
+ if [ '${{ matrix.intel }}' == 'true' ]; then source /opt/intel/oneapi/setvars.sh; fi
+ /bin/bash mfc.sh build -j $(nproc) --${{ matrix.debug }} --${{ matrix.mpi }}
+
+ - name: Test
+ run: |
+ if [ '${{ matrix.intel }}' == 'true' ]; then source /opt/intel/oneapi/setvars.sh; fi
+ /bin/bash mfc.sh test -j $(nproc) $OPT1 $OPT2
+ env:
+ OPT1: ${{ matrix.mpi == 'mpi' && '--test-all' || '' }}
+ OPT2: ${{ matrix.debug == 'debug' && '-% 20' || '' }}
+
+ docker:
+ name: Github | Docker
+ runs-on: ubuntu-latest
+ steps:
+ - name: Clone
+ uses: actions/checkout@v4
+
+ - name: Test
+ run: sudo ./mfc.sh docker ./mfc.sh test -j $(nproc) -a
+
self:
- name: Georgia Tech | Phoenix (NVHPC)
+ name: Self Hosted
if: github.repository == 'MFlowCode/MFC'
+ continue-on-error: true
strategy:
matrix:
device: ['cpu', 'gpu']
+ lbl: ['gt', 'frontier']
+ exclude:
+ - device: cpu
+ lbl: frontier
runs-on:
group: phoenix
- labels: gt
+ labels: ${{ matrix.lbl }}
steps:
- - name: Clone - PR
+ - name: Clone
uses: actions/checkout@v3
- with:
- path: pr
- - name: Clone - Master
- uses: actions/checkout@v3
- with:
- repository: MFlowCode/MFC
- ref: master
- path: master
+ - name: Build & Test
+ if: matrix.lbl == 'gt'
+ run: bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/test.sh ${{ matrix.device }}
- - name: Bench (Master v. PR)
- run: |
- (cd pr && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }}) &
- (cd master && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }}) &
- wait %1 && wait %2
+ - name: Build
+ if: matrix.lbl == 'frontier'
+ run: bash .github/workflows/frontier/build.sh
- - name: Generate & Post Comment
- run: |
- . ./mfc.sh load -c p -m g
- ./mfc.sh bench_diff master/bench-${{ matrix.device }}.yaml pr/bench-${{ matrix.device }}.yaml
+ - name: Test
+ if: matrix.lbl == 'frontier'
+ run: bash .github/workflows/frontier/submit.sh .github/workflows/frontier/test.sh ${{matrix.device}}
+
+ - name: Print Logs
+ if: always()
+ run: cat test-${{ matrix.device }}.out
- name: Archive Logs
uses: actions/upload-artifact@v3
if: always()
with:
- name: logs-${{ matrix.device }}
- path: |
- pr/bench-${{ matrix.device }}.*
- pr/build/benchmarks/*
- master/bench-${{ matrix.device }}.*
- master/build/benchmarks/*
+ name: logs
+ path: test-${{ matrix.device }}.out
+
From f8c6a809c2d9a910cfbd12b071f03950fd31776b Mon Sep 17 00:00:00 2001
From: Brian Ok
Date: Mon, 3 Jun 2024 16:36:46 -0400
Subject: [PATCH 14/15] revert bench.yml
---
.github/workflows/bench.yml | 156 +++++++-----------------------------
1 file changed, 28 insertions(+), 128 deletions(-)
diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml
index e6e2cc24be..5fbdef5c4e 100644
--- a/.github/workflows/bench.yml
+++ b/.github/workflows/bench.yml
@@ -1,148 +1,48 @@
-name: 'Test Suite'
+name: 'Benchmark'
-on:
- push:
- paths:
- - '**.f90'
- - '**.fpp'
- - '**.py'
- - '**.yml'
- - 'mfc.sh'
- - 'golden.txt'
- - 'CMakeLists.txt'
- - 'requirements.txt'
+on: pull_request
- pull_request:
-
- workflow_dispatch:
-
jobs:
- github:
- name: Github
- strategy:
- matrix:
- os: ['ubuntu', 'macos']
- mpi: ['mpi']
- debug: ['debug', 'no-debug']
- intel: [true, false]
- exclude:
- - os: macos
- intel: true
-
- include:
- - os: ubuntu
- mpi: no-mpi
- debug: no-debug
- intel: false
-
- fail-fast: false
- continue-on-error: true
- runs-on: ${{ matrix.os }}-latest
- steps:
- - name: Clone
- uses: actions/checkout@v4
-
- - name: Setup MacOS
- if: matrix.os == 'macos'
- run: |
- brew install wget make python make cmake coreutils gcc@14
- echo "CC=gcc-14" >> $GITHUB_ENV
- echo "CXX=g++-14" >> $GITHUB_ENV
- echo "FC=gfortran-14" >> $GITHUB_ENV
-
- - name: (MacOS) Build OpenMPI
- if: matrix.os == 'macos' && matrix.mpi == 'mpi'
- run: |
- brew install mpich
-
- - name: Setup Ubuntu
- if: matrix.os == 'ubuntu' && matrix.intel == false
- run: |
- sudo apt update -y
- sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev
-
- - name: Setup Ubuntu (Intel)
- if: matrix.os == 'ubuntu' && matrix.intel == true
- run: |
- 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
- sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
- sudo apt-get update
- sudo apt-get install -y intel-oneapi-common-vars intel-oneapi-compiler-fortran-2022.1.0 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2022.1.0 intel-oneapi-mkl-2021.4.0 intel-oneapi-mpi-2021.7.1 intel-oneapi-mpi-devel-2021.7.1
- source /opt/intel/oneapi/setvars.sh
- echo "CXX=$(which icpc)" >> $GITHUB_ENV
- echo "CC=$(which icc)" >> $GITHUB_ENV
- echo "FC=$(which ifort)" >> $GITHUB_ENV
- echo "OMPI_FC=$(which ifort)" >> $GITHUB_ENV
- echo "OMPI_CXX=$(which icpc)" >> $GITHUB_ENV
- echo "OMPI_MPICC=$(which icc)" >> $GITHUB_ENV
- echo "MPI_HOME=/opt/intel/oneapi/mpi/2021.7.1/" >> $GITHUB_ENV
- echo "I_MPI_ROOT=/opt/intel/oneapi/mpi/2021.7.1/" >> $GITHUB_ENV
-
- - name: Build
- run: |
- if [ '${{ matrix.intel }}' == 'true' ]; then source /opt/intel/oneapi/setvars.sh; fi
- /bin/bash mfc.sh build -j $(nproc) --${{ matrix.debug }} --${{ matrix.mpi }}
-
- - name: Test
- run: |
- if [ '${{ matrix.intel }}' == 'true' ]; then source /opt/intel/oneapi/setvars.sh; fi
- /bin/bash mfc.sh test -j $(nproc) $OPT1 $OPT2
- env:
- OPT1: ${{ matrix.mpi == 'mpi' && '--test-all' || '' }}
- OPT2: ${{ matrix.debug == 'debug' && '-% 20' || '' }}
-
- docker:
- name: Github | Docker
- runs-on: ubuntu-latest
- steps:
- - name: Clone
- uses: actions/checkout@v4
-
- - name: Test
- run: sudo ./mfc.sh docker ./mfc.sh test -j $(nproc) -a
-
self:
- name: Self Hosted
+ name: Georgia Tech | Phoenix (NVHPC)
if: github.repository == 'MFlowCode/MFC'
- continue-on-error: true
strategy:
matrix:
device: ['cpu', 'gpu']
- lbl: ['gt', 'frontier']
- exclude:
- - device: cpu
- lbl: frontier
runs-on:
group: phoenix
- labels: ${{ matrix.lbl }}
+ labels: gt
steps:
- - name: Clone
+ - name: Clone - PR
uses: actions/checkout@v3
+ with:
+ path: pr
- - name: Build & Test
- if: matrix.lbl == 'gt'
- run: bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/test.sh ${{ matrix.device }}
-
- - name: Build
- if: matrix.lbl == 'frontier'
- run: bash .github/workflows/frontier/build.sh
+ - name: Clone - Master
+ uses: actions/checkout@v3
+ with:
+ repository: MFlowCode/MFC
+ ref: master
+ path: master
- - name: Test
- if: matrix.lbl == 'frontier'
- run: bash .github/workflows/frontier/submit.sh .github/workflows/frontier/test.sh ${{matrix.device}}
+ - name: Bench (Master v. PR)
+ run: |
+ (cd pr && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }}) &
+ (cd master && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }}) &
+ wait %1 && wait %2
- - name: Print Logs
- if: always()
- run: cat test-${{ matrix.device }}.out
+ - name: Generate & Post Comment
+ run: |
+ . ./mfc.sh load -c p -m g
+ ./mfc.sh bench_diff master/bench-${{ matrix.device }}.yaml pr/bench-${{ matrix.device }}.yaml
- name: Archive Logs
uses: actions/upload-artifact@v3
if: always()
with:
- name: logs
- path: test-${{ matrix.device }}.out
-
+ name: logs-${{ matrix.device }}
+ path: |
+ pr/bench-${{ matrix.device }}.*
+ pr/build/benchmarks/*
+ master/bench-${{ matrix.device }}.*
+ master/build/benchmarks/*
From c79279a2bd2aa77260eeadd7c179e26144ea0165 Mon Sep 17 00:00:00 2001
From: Henry LE BERRE
Date: Thu, 6 Jun 2024 10:36:46 +0200
Subject: [PATCH 15/15] Review: Small tweaks & fixes
---
toolchain/main.py | 10 +++++-----
toolchain/mfc/common.py | 2 --
toolchain/mfc/lock.py | 2 +-
toolchain/mfc/state.py | 4 ++--
4 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/toolchain/main.py b/toolchain/main.py
index af10904ac4..6465c3622a 100644
--- a/toolchain/main.py
+++ b/toolchain/main.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-import signal, getpass, platform, itertools, dataclasses
+import signal, getpass, platform, itertools
from mfc import args, lock, build, bench, state, count
from mfc.state import ARG
@@ -21,11 +21,11 @@ def __print_greeting():
MFC_SIDEBAR_LINES = [
f"[bold]{host_line}[/bold]",
'-' * len(host_line),
- f"[bold]--jobs [magenta]{ARG('jobs')}[/magenta][/bold]"
- ] + [
- f"[bold]--{'' if getattr(state.gCFG, field.name) else 'no-'}{field.name}[/bold]" for field in dataclasses.fields(state.gCFG)
- ] + [
+ '',
+ f"[bold]--jobs [magenta]{ARG('jobs')}[/magenta][/bold]",
+ f"[bold]{' '.join(state.gCFG.make_options())}[/bold]",
targets_line if ARG("command") != "test" else "",
+ '',
'-' * len(help_line),
f"[yellow]{help_line}[/yellow]",
]
diff --git a/toolchain/mfc/common.py b/toolchain/mfc/common.py
index 5bf2af361b..d91b68cc04 100644
--- a/toolchain/mfc/common.py
+++ b/toolchain/mfc/common.py
@@ -22,8 +22,6 @@
.:-=++++===--==+=-+= +. :=
+#=::::::::=%=. -+: =+ *:
.*=-=*=.. :=+*+: -...--
-
-\
"""
diff --git a/toolchain/mfc/lock.py b/toolchain/mfc/lock.py
index 1513a8a43f..14139f9fff 100644
--- a/toolchain/mfc/lock.py
+++ b/toolchain/mfc/lock.py
@@ -5,7 +5,7 @@
from .printer import cons
-MFC_LOCK_CURRENT_VERSION: int = 3
+MFC_LOCK_CURRENT_VERSION: int = 4
@dataclasses.dataclass
diff --git a/toolchain/mfc/state.py b/toolchain/mfc/state.py
index bf606f37cb..1b69f0ed33 100644
--- a/toolchain/mfc/state.py
+++ b/toolchain/mfc/state.py
@@ -29,7 +29,7 @@ def make_options(self) -> typing.List[str]:
def make_slug(self) -> str:
""" Sort the items by key, then join them with underscores. This uniquely
- identifies the configuration. Example: no-debug no-gpu no_mpi """
+ identifies the configuration. Example: no-debug_no-gpu_no_mpi_no-gcov """
return '_'.join([ f"{'no-' if not v else ''}{k}" for k, v in sorted(self.items(), key=lambda x: x[0]) ])
def __eq__(self, other) -> bool:
@@ -41,7 +41,7 @@ def __eq__(self, other) -> bool:
return True
def __str__(self) -> str:
- """ Returns a string like "mpi=No & gpu=No & debug=No" & gcov=No """
+ """ Returns a string like "mpi=No & gpu=No & debug=No & gcov=No" """
return ' & '.join([ f"{k}={'Yes' if v else 'No'}" for k, v in self.items() ])