Fix IBMForcingTest: call apply_forcing before compute_forces #722
Workflow file for this run
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| jobs: | |
| build-and-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| build_type: [Release, Debug] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake build-essential | |
| - name: Build (CPU-only) | |
| run: | | |
| echo "=========================================" | |
| echo "Building CPU-only version (${{ matrix.build_type }})" | |
| echo "=========================================" | |
| echo "" | |
| echo "Note: This CI workflow tests CPU-only builds." | |
| echo "GPU offload is tested separately in gpu-ci.yml workflow." | |
| echo "" | |
| mkdir -p build_cpu | |
| cd build_cpu | |
| # Suppress unused variable warnings (common in GPU-only code paths) | |
| export CXXFLAGS="-Wno-unused-variable -Wno-unused-but-set-variable" | |
| cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DUSE_GPU_OFFLOAD=OFF -DBUILD_TESTS=ON | |
| make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) 2>&1 | tee build.log | |
| echo "" | |
| echo "=========================================" | |
| echo "Build complete" | |
| echo "=========================================" | |
| - name: Test (CPU-only) | |
| run: | | |
| echo "=========================================" | |
| echo "Running tests (${{ matrix.build_type }})" | |
| echo "=========================================" | |
| echo "" | |
| chmod +x scripts/ci.sh | |
| chmod +x scripts/check_code_sharing.sh | |
| # Debug builds run only fast tests with 4x timeout multiplier | |
| # Release builds run all tests with normal timeouts | |
| if [[ "${{ matrix.build_type }}" == "Debug" ]]; then | |
| echo "Running fast tests only (Debug build with 4x timeouts)" | |
| ./scripts/ci.sh --cpu --debug fast | |
| else | |
| echo "Running all tests (Release build)" | |
| ./scripts/ci.sh --cpu | |
| fi | |
| - name: Check for warnings | |
| if: matrix.build_type == 'Release' | |
| run: | | |
| cd build_cpu | |
| export CXXFLAGS="-Wno-unused-variable -Wno-unused-but-set-variable" | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_GPU_OFFLOAD=OFF | |
| make clean | |
| make 2>&1 | tee build.log | |
| # Check for warnings but exclude unused variable warnings (GPU-only code paths) | |
| if grep -i "warning:" build.log | grep -v "unused-variable" | grep -v "unused-but-set-variable"; then | |
| echo "Warnings detected (excluding unused-variable warnings)!" | |
| exit 1 | |
| fi | |
| echo "No warnings detected (unused-variable warnings excluded)" | |
| mpi-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake build-essential libopenmpi-dev openmpi-bin | |
| - name: Build with MPI | |
| run: | | |
| mkdir -p build_mpi && cd build_mpi | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_GPU_OFFLOAD=OFF \ | |
| -DUSE_MPI=ON -DBUILD_TESTS=ON | |
| make -j$(nproc) test_decomposition test_halo_exchange test_mpi_channel \ | |
| test_mpi_rank_invariance test_mpi_energy_allreduce test_mpi_ibm_3d | |
| - name: Run MPI tests (single-rank) | |
| run: | | |
| cd build_mpi | |
| echo "--- DecompositionTest (1 rank) ---" | |
| ./test_decomposition | |
| echo "--- HaloExchangeTest (1 rank) ---" | |
| ./test_halo_exchange | |
| echo "--- MPIChannelTest (1 rank) ---" | |
| ./test_mpi_channel | |
| echo "--- MPIRankInvarianceTest (1 rank) ---" | |
| ./test_mpi_rank_invariance | |
| echo "--- MPIEnergyAllreduceTest (1 rank) ---" | |
| ./test_mpi_energy_allreduce | |
| echo "--- MPIIBMTest3D (1 rank) ---" | |
| ./test_mpi_ibm_3d | |
| - name: Run MPI tests (2 ranks) | |
| run: | | |
| cd build_mpi | |
| echo "--- DecompositionTest (2 ranks) ---" | |
| mpirun --oversubscribe -n 2 ./test_decomposition | |
| echo "--- HaloExchangeTest (2 ranks) ---" | |
| mpirun --oversubscribe -n 2 ./test_halo_exchange | |
| echo "--- MPIChannelTest (2 ranks) ---" | |
| mpirun --oversubscribe -n 2 ./test_mpi_channel | |
| echo "--- MPIRankInvarianceTest (2 ranks) ---" | |
| mpirun --oversubscribe -n 2 ./test_mpi_rank_invariance | |
| echo "--- MPIEnergyAllreduceTest (2 ranks) ---" | |
| mpirun --oversubscribe -n 2 ./test_mpi_energy_allreduce | |
| echo "--- MPIIBMTest3D (2 ranks) ---" | |
| mpirun --oversubscribe -n 2 ./test_mpi_ibm_3d | |
| - name: Run MPI tests (4 ranks) | |
| run: | | |
| cd build_mpi | |
| echo "--- DecompositionTest (4 ranks) ---" | |
| mpirun --oversubscribe -n 4 ./test_decomposition | |
| echo "--- HaloExchangeTest (4 ranks) ---" | |
| mpirun --oversubscribe -n 4 ./test_halo_exchange | |
| echo "--- MPIChannelTest (4 ranks) ---" | |
| mpirun --oversubscribe -n 4 ./test_mpi_channel | |
| echo "--- MPIRankInvarianceTest (4 ranks) ---" | |
| mpirun --oversubscribe -n 4 ./test_mpi_rank_invariance | |
| echo "--- MPIEnergyAllreduceTest (4 ranks) ---" | |
| mpirun --oversubscribe -n 4 ./test_mpi_energy_allreduce | |
| echo "--- MPIIBMTest3D (4 ranks) ---" | |
| mpirun --oversubscribe -n 4 ./test_mpi_ibm_3d |