Skip to content

Commit 6490e05

Browse files
committed
Merge remote-tracking branch 'upstream/master' into MovingBubblesFresh-clean
2 parents 2db52ca + f1fd862 commit 6490e05

28 files changed

Lines changed: 3028 additions & 148 deletions

File tree

.github/Dockerfile

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,82 @@ ARG CXX_COMPILER
77
ARG FC_COMPILER
88
ARG COMPILER_PATH
99
ARG COMPILER_LD_LIBRARY_PATH
10+
ARG AFAR_VERSION
11+
ARG OLCF_AFAR_ROOT=""
12+
13+
ENV DEBIAN_FRONTEND=noninteractive
14+
ENV TZ=UTC
1015

1116
RUN apt-get update -y && \
12-
apt-get install -y software-properties-common ca-certificates gnupg && \
17+
apt-get install -y software-properties-common ca-certificates gnupg wget && \
1318
add-apt-repository ppa:deadsnakes/ppa && \
1419
apt-get update -y && \
15-
if [ "$TARGET" != "gpu" ]; then \
20+
if [ "$TARGET" = "cpu" ]; then \
1621
apt-get install -y \
1722
build-essential git make cmake gcc g++ gfortran bc \
1823
python3.12 python3.12-venv python3-pip \
1924
openmpi-bin libopenmpi-dev libfftw3-dev \
2025
mpich libmpich-dev; \
21-
else \
26+
elif [ "$TARGET" = "gpu" ]; then \
2227
apt-get install -y \
2328
build-essential git make cmake bc \
2429
python3.12 python3.12-venv python3-pip \
2530
libfftw3-dev \
2631
openmpi-bin libopenmpi-dev; \
32+
elif [ "$TARGET" = "amd" ]; then \
33+
apt-get install -y \
34+
build-essential git make gcc g++ gfortran bc \
35+
python3.12 python3.12-venv python3-pip \
36+
libfftw3-dev libnuma1 libdrm2 libdrm-amdgpu1; \
2737
fi && \
2838
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 2 && \
2939
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3040

41+
# AMD: download AFAR, install cmake 3.28 (Ubuntu 22.04 ships 3.22 which doesn't
42+
# recognize amdflang as LLVMFlang), then build MPICH with amdflang so the
43+
# generated mpi.mod is compiler-compatible.
44+
RUN if [ "$TARGET" = "amd" ] && [ -n "$AFAR_VERSION" ]; then \
45+
OLCF_AFAR_ROOT="/opt/${AFAR_VERSION}" && \
46+
wget -q "https://repo.radeon.com/rocm/misc/flang/${AFAR_VERSION}-ubuntu.tar.bz2" -O /tmp/afar.tar.bz2 && \
47+
tar -xjf /tmp/afar.tar.bz2 -C /opt/ && \
48+
rm /tmp/afar.tar.bz2 && \
49+
CMAKE_VER=3.28.6 && \
50+
wget -q "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-linux-x86_64.sh" \
51+
-O /tmp/cmake-install.sh && \
52+
chmod +x /tmp/cmake-install.sh && \
53+
/tmp/cmake-install.sh --prefix=/usr/local --skip-license --exclude-subdir && \
54+
rm /tmp/cmake-install.sh && \
55+
printf '#!/bin/bash\nargs=()\nwhile [ "$#" -gt 0 ]; do\n if [ "$1" = "-soname" ]; then\n args+=("-Wl,-soname,$2"); shift 2\n else\n args+=("$1"); shift\n fi\ndone\nexec '"${OLCF_AFAR_ROOT}"'/bin/amdflang "${args[@]}"\n' \
56+
> /usr/local/bin/amdflang-ld-wrap && \
57+
chmod +x /usr/local/bin/amdflang-ld-wrap && \
58+
MPICH_VER=3.4.3 && \
59+
wget -q "https://www.mpich.org/static/downloads/${MPICH_VER}/mpich-${MPICH_VER}.tar.gz" \
60+
-O /tmp/mpich.tar.gz && \
61+
mkdir -p /tmp/mpich-src && \
62+
tar -xzf /tmp/mpich.tar.gz -C /tmp/mpich-src --strip-components=1 && \
63+
cd /tmp/mpich-src && \
64+
FC=/usr/local/bin/amdflang-ld-wrap CC=gcc CXX=g++ \
65+
./configure --prefix=/opt/mpich --enable-shared --disable-static \
66+
--with-device=ch3 2>&1 && \
67+
make -j$(nproc) 2>&1 && \
68+
make install 2>&1 && \
69+
cd / && \
70+
rm -rf /tmp/mpich-src /tmp/mpich.tar.gz; \
71+
fi
72+
3173
ENV OMPI_ALLOW_RUN_AS_ROOT=1
3274
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
75+
ENV HYDRA_LAUNCHER=fork
3376
ENV PATH="/opt/MFC:$PATH"
3477

3578
COPY ../ /opt/MFC
3679

3780
ENV CC=${CC_COMPILER}
3881
ENV CXX=${CXX_COMPILER}
3982
ENV FC=${FC_COMPILER}
40-
ENV PATH="${COMPILER_PATH}:$PATH"
41-
ENV LD_LIBRARY_PATH="${COMPILER_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH:-}"
83+
ENV OLCF_AFAR_ROOT=${OLCF_AFAR_ROOT}
84+
ENV PATH="${COMPILER_PATH}:/opt/mpich/bin:$PATH"
85+
ENV LD_LIBRARY_PATH="${COMPILER_LD_LIBRARY_PATH}:/opt/mpich/lib:${LD_LIBRARY_PATH:-}"
4286

4387
# Pre-install numpy into the venv before mfc.sh runs, as it's required at
4488
# build time by several dependencies (pandas, cantera, matplotlib, etc.) that
@@ -50,14 +94,18 @@ RUN python3.12 -m venv /opt/MFC/build/venv && \
5094
RUN echo "TARGET=$TARGET CC=$CC_COMPILER FC=$FC_COMPILER" && \
5195
cd /opt/MFC && \
5296
if [ "$TARGET" = "gpu" ]; then \
53-
./mfc.sh build --gpu -j $(nproc); \
97+
./mfc.sh build --gpu acc -j $(nproc); \
98+
elif [ "$TARGET" = "amd" ]; then \
99+
./mfc.sh build --gpu mp -j $(nproc); \
54100
else \
55101
./mfc.sh build -j $(nproc); \
56102
fi
57103

58104
RUN cd /opt/MFC && \
59105
if [ "$TARGET" = "gpu" ]; then \
60-
./mfc.sh test -a --dry-run --gpu -j $(nproc); \
106+
./mfc.sh test -a --dry-run --gpu acc -j $(nproc); \
107+
elif [ "$TARGET" = "amd" ]; then \
108+
./mfc.sh test -a --dry-run --gpu mp -j $(nproc); \
61109
else \
62110
./mfc.sh test -a --dry-run -j $(nproc); \
63111
fi

.github/file-filter.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ yml: &yml
3030
- '.github/workflows/bench.yml'
3131
- '.github/workflows/test.yml'
3232
- '.github/workflows/formatting.yml'
33+
- '.github/workflows/fp-stability.yml'
34+
- '.github/workflows/convergence.yml'
3335

3436
checkall: &checkall
3537
- *fortran_src

.github/workflows/convergence.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Convergence
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
8+
workflow_dispatch:
9+
10+
env:
11+
OMPI_MCA_rmaps_base_oversubscribe: 1
12+
13+
jobs:
14+
file-changes:
15+
name: Detect File Changes
16+
runs-on: ubuntu-latest
17+
outputs:
18+
checkall: ${{ steps.changes.outputs.checkall }}
19+
steps:
20+
- name: Clone
21+
uses: actions/checkout@v4
22+
23+
- name: Detect Changes
24+
uses: dorny/paths-filter@v3
25+
id: changes
26+
with:
27+
filters: ".github/file-filter.yml"
28+
29+
convergence:
30+
name: "Convergence"
31+
runs-on: ubuntu-latest
32+
needs: [file-changes]
33+
if: >-
34+
!cancelled() &&
35+
needs.file-changes.result == 'success' &&
36+
(needs.file-changes.outputs.checkall == 'true' || github.event_name == 'workflow_dispatch')
37+
timeout-minutes: 240
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Setup Ubuntu
43+
run: |
44+
sudo apt update -y
45+
sudo apt install -y cmake gcc g++ python3 python3-dev \
46+
openmpi-bin libopenmpi-dev
47+
48+
- name: Setup Python
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: "3.12"
52+
53+
- name: Build MFC
54+
run: ./mfc.sh build -j 4
55+
56+
- name: Run convergence tests
57+
run: ./mfc.sh test --only Convergence --no-build -j 1

.github/workflows/deploy-tap.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
permissions:
2929
contents: write
3030
pull-requests: write
31+
environment:
32+
name: homebrew
33+
url: https://github.com/MFlowCode/homebrew-mfc
3134
steps:
3235
- name: Checkout MFC repository
3336
uses: actions/checkout@v4

0 commit comments

Comments
 (0)