From bc5b1e36ce3782b54a1b4ba42c19839e3361f76b Mon Sep 17 00:00:00 2001 From: haykh Date: Thu, 4 Dec 2025 15:55:10 -0500 Subject: [PATCH 1/7] actions --- .github/workflows/actions.yml | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index a5c546328..849b25cf8 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -62,3 +62,57 @@ jobs: - name: Run tests run: | ctest --test-dir build --output-on-failure --verbose + cputests: + name: Build and test (precision=${{ matrix.precision }}, mpi=${{ matrix.mpi }}, output=${{ matrix.output }}) + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + precision: [single, double] + mpi: [ON, OFF] + output: [ON, OFF] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install GCC 14 and build tools + run: | + sudo apt-get update + sudo apt-get install -y gcc-14 g++-14 gfortran-14 build-essential wget libevent-dev libhwloc-dev + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50 + sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-14 50 + gcc --version + g++ --version + - name: Install CMake (3.x) + run: | + sudo apt-get install -y cmake + cmake_major=$(cmake --version | head -n1 | awk '{print $3}' | cut -d. -f1) + if [ "$cmake_major" -gt 3 ]; then + echo "CMake major version must be at most 3.x" + exit 1 + fi + cmake --version + - name: Install OpenMPI 5 + run: | + wget -q https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.5.tar.gz + tar xf openmpi-5.0.5.tar.gz + cd openmpi-5.0.5 + ./configure --prefix=/usr/local + make -j"$(nproc)" + sudo make install + sudo ldconfig + mpirun --version + - name: Configure + run: | + if [ "${{ matrix.mpi }}" = "ON" ]; then + export CC=mpicc + export CXX=mpicxx + else + export CC=gcc-14 + export CXX=g++-14 + fi + cmake -B build -D TESTS=ON -D precision=${{ matrix.precision }} -D mpi=${{ matrix.mpi }} -D output=${{ matrix.output }} + - name: Compile + run: cmake --build build -j "$(nproc)" + - name: Run tests + run: ctest --test-dir build --output-on-failure From d122d424f3f3de5a2de8ddc3a69d8fa38aca3c88 Mon Sep 17 00:00:00 2001 From: haykh Date: Thu, 4 Dec 2025 16:01:52 -0500 Subject: [PATCH 2/7] ompi apt install in actions --- .github/workflows/actions.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 849b25cf8..7960e2371 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -94,13 +94,7 @@ jobs: cmake --version - name: Install OpenMPI 5 run: | - wget -q https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.5.tar.gz - tar xf openmpi-5.0.5.tar.gz - cd openmpi-5.0.5 - ./configure --prefix=/usr/local - make -j"$(nproc)" - sudo make install - sudo ldconfig + sudo apt-get install -y libopenmpi-dev openmpi-bin mpirun --version - name: Configure run: | From 57c9d838e5c77b59290b64b4fc276581accf83e4 Mon Sep 17 00:00:00 2001 From: haykh Date: Thu, 4 Dec 2025 16:08:19 -0500 Subject: [PATCH 3/7] actions --- .github/workflows/cpuarch.yml | 69 +++++++++++++++++++ .../workflows/{actions.yml => multiarch.yml} | 50 +------------- 2 files changed, 70 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/cpuarch.yml rename .github/workflows/{actions.yml => multiarch.yml} (52%) diff --git a/.github/workflows/cpuarch.yml b/.github/workflows/cpuarch.yml new file mode 100644 index 000000000..c97d25dec --- /dev/null +++ b/.github/workflows/cpuarch.yml @@ -0,0 +1,69 @@ +name: Build and Test on CPU + +on: + push: + pull_request: + +jobs: + build: + name: Build and test (precision=${{ matrix.precision }}, mpi=${{ matrix.mpi }}, output=${{ matrix.output }}) + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + precision: [single, double] + mpi: [ON, OFF] + output: [ON, OFF] + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install GCC 14 and build tools + run: | + sudo apt-get update + sudo apt-get install -y gcc-14 g++-14 gfortran-14 build-essential wget libevent-dev libhwloc-dev + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50 + sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-14 50 + gcc --version + g++ --version + + - name: Install CMake (3.x) + run: | + sudo apt-get install -y cmake + cmake_major=$(cmake --version | head -n1 | awk '{print $3}' | cut -d. -f1) + if [ "$cmake_major" -gt 3 ]; then + echo "CMake major version must be at most 3.x" + exit 1 + fi + cmake --version + + - name: Install OpenMPI 5 + run: | + sudo apt-get install -y libopenmpi-dev openmpi-bin + mpirun --version + mpirun_major=$(mpirun --version | head -n1 | awk '{print $3}' | cut -d. -f1) + if [ "$mpirun_major" -lt 5 ]; then + echo "OpenMPI 5.x is required" + exit 1 + fi + + - name: Configure + run: | + if [ "${{ matrix.mpi }}" = "ON" ]; then + export CC=mpicc + export CXX=mpicxx + else + export CC=gcc-14 + export CXX=g++-14 + fi + cmake -B build -D TESTS=ON -D precision=${{ matrix.precision }} -D mpi=${{ matrix.mpi }} -D output=${{ matrix.output }} + + - name: Compile + run: cmake --build build -j "$(nproc)" + + - name: Run tests + run: ctest --test-dir build --output-on-failure diff --git a/.github/workflows/actions.yml b/.github/workflows/multiarch.yml similarity index 52% rename from .github/workflows/actions.yml rename to .github/workflows/multiarch.yml index 7960e2371..fac378225 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/multiarch.yml @@ -1,4 +1,4 @@ -name: Unit tests +name: Build and Test on Multiple Architectures on: push: @@ -62,51 +62,3 @@ jobs: - name: Run tests run: | ctest --test-dir build --output-on-failure --verbose - cputests: - name: Build and test (precision=${{ matrix.precision }}, mpi=${{ matrix.mpi }}, output=${{ matrix.output }}) - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - matrix: - precision: [single, double] - mpi: [ON, OFF] - output: [ON, OFF] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install GCC 14 and build tools - run: | - sudo apt-get update - sudo apt-get install -y gcc-14 g++-14 gfortran-14 build-essential wget libevent-dev libhwloc-dev - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50 - sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-14 50 - gcc --version - g++ --version - - name: Install CMake (3.x) - run: | - sudo apt-get install -y cmake - cmake_major=$(cmake --version | head -n1 | awk '{print $3}' | cut -d. -f1) - if [ "$cmake_major" -gt 3 ]; then - echo "CMake major version must be at most 3.x" - exit 1 - fi - cmake --version - - name: Install OpenMPI 5 - run: | - sudo apt-get install -y libopenmpi-dev openmpi-bin - mpirun --version - - name: Configure - run: | - if [ "${{ matrix.mpi }}" = "ON" ]; then - export CC=mpicc - export CXX=mpicxx - else - export CC=gcc-14 - export CXX=g++-14 - fi - cmake -B build -D TESTS=ON -D precision=${{ matrix.precision }} -D mpi=${{ matrix.mpi }} -D output=${{ matrix.output }} - - name: Compile - run: cmake --build build -j "$(nproc)" - - name: Run tests - run: ctest --test-dir build --output-on-failure From af1a8455ed8a743c74252794d2cbf0461184409f Mon Sep 17 00:00:00 2001 From: haykh Date: Thu, 4 Dec 2025 16:30:19 -0500 Subject: [PATCH 4/7] CPUTEST --- .github/workflows/cpuarch.yml | 46 +++++++++++++++++++-------------- .github/workflows/multiarch.yml | 4 +-- compile_pgens.sh | 41 ----------------------------- 3 files changed, 28 insertions(+), 63 deletions(-) delete mode 100755 compile_pgens.sh diff --git a/.github/workflows/cpuarch.yml b/.github/workflows/cpuarch.yml index c97d25dec..bfaa67033 100644 --- a/.github/workflows/cpuarch.yml +++ b/.github/workflows/cpuarch.yml @@ -1,11 +1,27 @@ -name: Build and Test on CPU +name: Build and Test on GitHub Cloud on: push: - pull_request: jobs: - build: + check-commit: + runs-on: ubuntu-24.04 + outputs: + run_tests: ${{ steps.check_message.outputs.run_tests }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Check commit message + id: check_message + run: | + if git log -1 --pretty=%B | grep -q "CPUTEST"; then + echo "run_tests=true" >> "$GITHUB_OUTPUT" + else + echo "run_tests=false" >> "$GITHUB_OUTPUT" + fi + tests: + needs: check-commit + if: needs.check-commit.outputs.run_tests == 'true' name: Build and test (precision=${{ matrix.precision }}, mpi=${{ matrix.mpi }}, output=${{ matrix.output }}) runs-on: ubuntu-24.04 strategy: @@ -14,13 +30,18 @@ jobs: precision: [single, double] mpi: [ON, OFF] output: [ON, OFF] - + exclude: + - precision: single + mpi: ON + output: ON + - precision: double + mpi: ON + output: ON steps: - name: Checkout uses: actions/checkout@v4 with: submodules: recursive - - name: Install GCC 14 and build tools run: | sudo apt-get update @@ -30,27 +51,14 @@ jobs: sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-14 50 gcc --version g++ --version - - name: Install CMake (3.x) run: | sudo apt-get install -y cmake - cmake_major=$(cmake --version | head -n1 | awk '{print $3}' | cut -d. -f1) - if [ "$cmake_major" -gt 3 ]; then - echo "CMake major version must be at most 3.x" - exit 1 - fi cmake --version - - name: Install OpenMPI 5 run: | sudo apt-get install -y libopenmpi-dev openmpi-bin mpirun --version - mpirun_major=$(mpirun --version | head -n1 | awk '{print $3}' | cut -d. -f1) - if [ "$mpirun_major" -lt 5 ]; then - echo "OpenMPI 5.x is required" - exit 1 - fi - - name: Configure run: | if [ "${{ matrix.mpi }}" = "ON" ]; then @@ -61,9 +69,7 @@ jobs: export CXX=g++-14 fi cmake -B build -D TESTS=ON -D precision=${{ matrix.precision }} -D mpi=${{ matrix.mpi }} -D output=${{ matrix.output }} - - name: Compile run: cmake --build build -j "$(nproc)" - - name: Run tests run: ctest --test-dir build --output-on-failure diff --git a/.github/workflows/multiarch.yml b/.github/workflows/multiarch.yml index fac378225..5e43ccd70 100644 --- a/.github/workflows/multiarch.yml +++ b/.github/workflows/multiarch.yml @@ -5,7 +5,7 @@ on: jobs: check-commit: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: run_tests: ${{ steps.check_message.outputs.run_tests }} steps: @@ -14,7 +14,7 @@ jobs: - name: Check commit message id: check_message run: | - if git log -1 --pretty=%B | grep -q "RUNTEST"; then + if git log -1 --pretty=%B | grep -q "MARCHTEST"; then echo "run_tests=true" >> "$GITHUB_OUTPUT" else echo "run_tests=false" >> "$GITHUB_OUTPUT" diff --git a/compile_pgens.sh b/compile_pgens.sh deleted file mode 100755 index 2d5bdc9eb..000000000 --- a/compile_pgens.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -pgens=("magnetosphere" "reconnection" "turbulence" "shock" "streaming" "accretion" "wald") -flags=("OFFLINE=ON") - -for pgen in "${pgens[@]}"; do - echo "Compiling pgen: $pgen" - flags_d="-D pgen=${pgen} " - for flag in "${flags[@]}"; do - flags_d+="-D ${flag}" - done - - ( - cmake -B "builds/build-${pgen}" $flags_d && - cmake --build "builds/build-${pgen}" -j && - mkdir -p "temp/${pgen}" && - cp "builds/build-${pgen}/src/entity.xc" "temp/${pgen}/" && - cp "pgens/${pgen}/"*.toml "temp/${pgen}/" - ) || { - echo "Failed to compile pgen: $pgen" - exit 1 - } -done - -for pgen in "${pgens[@]}"; do - cd "temp/${pgen}" || { - echo "no temp directory for $pgen" - exit 1 - } - tomls=$(find . -type f -name "*.toml") - for toml in "${tomls[@]}"; do - ( - echo "Running pgen: $pgen with config $toml" && - ./entity.xc -input "$toml" && - cd ../../ - ) || { - echo "Failed to run $pgen with config $toml" - exit 1 - } - done -done From de1cc0ee33c4803fe9e7a0d1b03d95840d10c612 Mon Sep 17 00:00:00 2001 From: haykh Date: Thu, 4 Dec 2025 16:42:53 -0500 Subject: [PATCH 5/7] pgen builder CPUTEST --- .github/workflows/cpuarch.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/cpuarch.yml b/.github/workflows/cpuarch.yml index bfaa67033..cc7a05375 100644 --- a/.github/workflows/cpuarch.yml +++ b/.github/workflows/cpuarch.yml @@ -73,3 +73,35 @@ jobs: run: cmake --build build -j "$(nproc)" - name: Run tests run: ctest --test-dir build --output-on-failure + pgens: + needs: check-commit + if: needs.check-commit.outputs.run_tests == 'true' + name: Build pgen=${{ matrix.pgen }} + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + pgen: [streaming, turbulence, reconnection, shock, magnetosphere, accretion, wald] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install GCC 14 and build tools + run: | + sudo apt-get update + sudo apt-get install -y gcc-14 g++-14 gfortran-14 build-essential wget libevent-dev libhwloc-dev + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50 + sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-14 50 + gcc --version + g++ --version + - name: Install CMake (3.x) + run: | + sudo apt-get install -y cmake + cmake --version + - name: Configure + run: | + cmake -B build -D pgen=${{ matrix.pgen }} -D output=OFF + - name: Compile + run: cmake --build build -j "$(nproc)" From e3d86c32ed29beb16a98714731f4acdd0182b619 Mon Sep 17 00:00:00 2001 From: haykh Date: Thu, 4 Dec 2025 16:53:55 -0500 Subject: [PATCH 6/7] action names --- .github/workflows/cpuarch.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cpuarch.yml b/.github/workflows/cpuarch.yml index cc7a05375..672d26395 100644 --- a/.github/workflows/cpuarch.yml +++ b/.github/workflows/cpuarch.yml @@ -1,4 +1,4 @@ -name: Build and Test on GitHub Cloud +name: CPU Compilation/Unit Tests on: push: @@ -22,7 +22,7 @@ jobs: tests: needs: check-commit if: needs.check-commit.outputs.run_tests == 'true' - name: Build and test (precision=${{ matrix.precision }}, mpi=${{ matrix.mpi }}, output=${{ matrix.output }}) + name: UNIT_TESTS (precision=${{ matrix.precision }}, mpi=${{ matrix.mpi }}, output=${{ matrix.output }}) runs-on: ubuntu-24.04 strategy: fail-fast: false @@ -76,7 +76,7 @@ jobs: pgens: needs: check-commit if: needs.check-commit.outputs.run_tests == 'true' - name: Build pgen=${{ matrix.pgen }} + name: PGENS (pgen=${{ matrix.pgen }}) runs-on: ubuntu-24.04 strategy: fail-fast: false From f2d17d499b340c32208f233a2509d79eb7bc52ff Mon Sep 17 00:00:00 2001 From: haykh Date: Thu, 4 Dec 2025 16:54:50 -0500 Subject: [PATCH 7/7] action names --- .github/workflows/multiarch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/multiarch.yml b/.github/workflows/multiarch.yml index 5e43ccd70..89af03747 100644 --- a/.github/workflows/multiarch.yml +++ b/.github/workflows/multiarch.yml @@ -1,4 +1,4 @@ -name: Build and Test on Multiple Architectures +name: Multi-Arch Local Tests on: push: