Skip to content

Commit f8bf7d6

Browse files
committed
mfc.sh test: Add -% to speed up debug CI
1 parent c7e26f2 commit f8bf7d6

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,26 @@ jobs:
2525
mpi: ['mpi', 'no-mpi']
2626
debug: ['debug', 'no-debug']
2727
intel: [true, false]
28+
exclude:
29+
- intel: true
30+
os: macos
2831
fail-fast: false
2932
continue-on-error: true
3033
runs-on: ${{ matrix.os }}-latest
3134
steps:
3235
- name: Clone
33-
if: matrix.os == 'ubuntu' || (matrix.os == 'macos' && matrix.intel == false)
3436
uses: actions/checkout@v3
3537

3638
- name: Setup MacOS
37-
if: matrix.os == 'macos' && matrix.intel == false
39+
if: matrix.os == 'macos'
3840
run: |
3941
echo "CC=gcc-13" >> $GITHUB_ENV
4042
echo "CXX=g++-13" >> $GITHUB_ENV
4143
echo "FC=gfortran-13" >> $GITHUB_ENV
4244
brew install wget make python make cmake coreutils gcc@13
4345
4446
- name: (MacOS) Build OpenMPI
45-
if: matrix.os == 'macos' && matrix.mpi == 'mpi' && matrix.intel == false
47+
if: matrix.os == 'macos' && matrix.mpi == 'mpi'
4648
run: |
4749
echo "OMPI_FC=gfortran-13" >> $GITHUB_ENV
4850
echo "OMPI_CXX=g++-13" >> $GITHUB_ENV
@@ -75,27 +77,18 @@ jobs:
7577
echo "MPI_HOME=/opt/intel/oneapi/mpi/2021.7.1/" >> $GITHUB_ENV
7678
echo "I_MPI_ROOT=/opt/intel/oneapi/mpi/2021.7.1/" >> $GITHUB_ENV
7779
78-
- name: Build-intel
79-
if: matrix.intel == true && matrix.os == 'ubuntu'
80-
run: |
81-
source /opt/intel/oneapi/setvars.sh
82-
/bin/bash mfc.sh build -j $(nproc) --${{ matrix.debug }} --${{ matrix.mpi }}
83-
8480
- name: Build
85-
if: matrix.intel == false
8681
run: |
82+
if [ '${{ matrix.intel }}' == 'true' ]; then source /opt/intel/oneapi/setvars.sh; fi
8783
/bin/bash mfc.sh build -j $(nproc) --${{ matrix.debug }} --${{ matrix.mpi }}
8884
89-
- name: Test-intel
90-
if: matrix.intel == true && matrix.os == 'ubuntu'
91-
run: |
92-
source /opt/intel/oneapi/setvars.sh
93-
/bin/bash mfc.sh test -j $(nproc) $(if [ "${{ matrix.mpi }}" == "mpi" ]; then echo "--test-all"; fi)
94-
9585
- name: Test
96-
if: matrix.intel == false
9786
run: |
98-
/bin/bash mfc.sh test -j $(nproc) $(if [ "${{ matrix.mpi }}" == "mpi" ]; then echo "--test-all"; fi)
87+
if [ '${{ matrix.intel }}' == 'true' ]; then source /opt/intel/oneapi/setvars.sh; fi
88+
/bin/bash mfc.sh test -j $(nproc) $OPT1 $OPT2
89+
env:
90+
OPT1: ${{ matrix.mpi == 'mpi' && '--test-all' || '' }}
91+
OPT2: ${{ matrix.debug == 'debug' && '-% 75' || '' }}
9992

10093
docker:
10194
name: Github | Docker

misc/run-phoenix-release-cpu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ cd "$SLURM_SUBMIT_DIR"
1212
echo "Running in $(pwd):"
1313

1414
. ./mfc.sh load -c p -m gpu
15-
./mfc.sh test -j 12 -b mpirun -a
15+
./mfc.sh test -j $(nproc) -b mpirun -a
1616

misc/run-phoenix-release-gpu.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ set -x
1616

1717
. ./mfc.sh load -c p -m GPU
1818

19+
gpu_count=$(nvidia-smi -L | wc -l) # number of GPUs on node
20+
gpu_ids=$(seq -s ',' 0 $(($gpu_count-1))) # 0,1,2,...,gpu_count-1
21+
1922
./mfc.sh test -a -b mpirun -j $(nproc) \
20-
--gpu -g $(seq -s ',' 0 $(($(nvidia-smi -L | wc -l)-1)))
23+
--gpu -g $gpu_ids
2124

toolchain/mfc/args.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def add_common_arguments(p, mask = None):
8282
test.add_argument("-r", "--relentless", action="store_true", default=False, help="Run all tests, even if multiple fail.")
8383
test.add_argument("-a", "--test-all", action="store_true", default=False, help="Run the Post Process Tests too.")
8484
test.add_argument("-g", "--gpus", type=str, default="0", help="(GPU) Comma separated list of GPU #s to use.")
85+
test.add_argument("-%", "--percent", type=int, default=100, help="Percentage of tests to run.")
8586

8687
test.add_argument("--case-optimization", action="store_true", default=False, help="(GPU Optimization) Compile MFC targets with some case parameters hard-coded.")
8788

toolchain/mfc/test/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os, math, shutil
22

3+
from random import sample
34
from ..printer import cons
45
from .. import common
56
from ..state import ARG
@@ -55,6 +56,11 @@ def __filter():
5556
if case.ppn > 1:
5657
CASES.remove(case)
5758

59+
if ARG("percent") == 100:
60+
return
61+
62+
CASES = sample(CASES, k=int(len(CASES)*ARG("percent")/100.0))
63+
5864

5965
def test():
6066
global CASES, nFAIL

0 commit comments

Comments
 (0)