Skip to content

Commit

Permalink
debug cache
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlaughlin committed Apr 16, 2024
1 parent db228b5 commit 8ac4efd
Showing 1 changed file with 60 additions and 57 deletions.
117 changes: 60 additions & 57 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
os: [ubuntu-latest]
#, macos-latest]
python-version: [3.9, 3.11]
python-version: [3.9]
#3.7, 3.8, 3.9, 3.10, 3.11

# right now, default is a hardcoded sha defined in setup.py:repos_sha
Expand All @@ -29,6 +29,9 @@ jobs:
# When phases==true, run each individual build step explicitly: mfem -> swig -> pymfem
phases: [false]

cuda-version: [12.4.1]
cuda-driver-version: [550.54.15]

exclude:
# CUDA does not support MacOS
- os: macos-latest
Expand All @@ -54,8 +57,8 @@ jobs:
(${{ matrix.parallel && 'parallel' || 'serial' }}${{ matrix.cuda && ' + cuda' || '' }}${{ matrix.libceed && ' + libceed' || '' }}${{ matrix.gslib && ' + gslib' || '' }})
env:
cuda-installer-url: https://developer.download.nvidia.com/compute/cuda/12.4.1/local_installers/cuda_12.4.1_550.54.15_linux.run
build-flags: >-
cuda-installer-url: https://developer.download.nvidia.com/compute/cuda/${{ matrix.cuda-version }}/local_installers/cuda_${{ matrix.cuda-version }}_${{ matrix.cuda-driver-version }}_linux.run
build-flags: >-
${{ matrix.parallel && '--with-parallel' || '' }}
${{ matrix.cuda && '--with-cuda' || '' }}
${{ matrix.libceed && '--with-libceed' || '' }}
Expand All @@ -80,7 +83,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/cuda.run
key: ${{ matrix.os }}-${{ env.cuda-installer-url }}
key: ${{ matrix.cuda-version }}_${{ matrix.cuda-driver-version }}

- name: Download CUDA
if: matrix.cuda && steps.cache-cuda.outputs.cache-hit != 'true'
Expand All @@ -99,56 +102,56 @@ jobs:
which nvcc
nvcc --version
- name: Install MPI
if: matrix.parallel
run: |
sudo apt-get install mpich libmpich-dev
pip install mpi4py
- name: Print python package versions
run: pip list

- name: Build MFEM (step 1)
if: matrix.phases
run: |
python setup.py clean --swig
python setup.py install --ext-only --verbose ${{ env.build-flags }}
- name: Build SWIG wrappers (step 2)
if: matrix.phases
run: python setup.py install --swig --verbose ${{ env.build-flags }}

- name: Build PyMFEM (step 3)
if: matrix.phases
run: python setup.py install --skip-ext --skip-swig --verbose ${{ env.build-flags }}

- name: Build all (steps 1-3)
if: matrix.phases == false
run: python setup.py install ${{ env.build-flags }}

- name: Run tests (serial)
if: matrix.parallel == false
run: |
cd test
python run_examples.py -serial -verbose
- name: Run tests (parallel)
if: matrix.parallel
run: |
cd test
python run_examples.py -parallel -verbose -np 2
- name: Generate test results artifact
id: generate-artifact
run: |
tar -cvzf sandbox.tar.gz test/sandbox
# generate a name for the artifact
txt=$(python -c "import datetime;print(datetime.datetime.now().strftime('%H_%M_%S_%f'))")
echo name="test_results_"${txt}"_"${{ github.run_id }}".tar.gz" >> $GITHUB_OUTPUT
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ steps.generate-artifact.outputs.name }}
path: sandbox.tar.gz
retention-days: 1
# - name: Install MPI
# if: matrix.parallel
# run: |
# sudo apt-get install mpich libmpich-dev
# pip install mpi4py

# - name: Print python package versions
# run: pip list

# - name: Build MFEM (step 1)
# if: matrix.phases
# run: |
# python setup.py clean --swig
# python setup.py install --ext-only --verbose ${{ env.build-flags }}

# - name: Build SWIG wrappers (step 2)
# if: matrix.phases
# run: python setup.py install --swig --verbose ${{ env.build-flags }}

# - name: Build PyMFEM (step 3)
# if: matrix.phases
# run: python setup.py install --skip-ext --skip-swig --verbose ${{ env.build-flags }}

# - name: Build all (steps 1-3)
# if: matrix.phases == false
# run: python setup.py install ${{ env.build-flags }}

# - name: Run tests (serial)
# if: matrix.parallel == false
# run: |
# cd test
# python run_examples.py -serial -verbose
# - name: Run tests (parallel)
# if: matrix.parallel
# run: |
# cd test
# python run_examples.py -parallel -verbose -np 2

# - name: Generate test results artifact
# id: generate-artifact
# run: |
# tar -cvzf sandbox.tar.gz test/sandbox
# # generate a name for the artifact
# txt=$(python -c "import datetime;print(datetime.datetime.now().strftime('%H_%M_%S_%f'))")
# echo name="test_results_"${txt}"_"${{ github.run_id }}".tar.gz" >> $GITHUB_OUTPUT

# - name: Upload Artifact
# uses: actions/upload-artifact@v4
# if: failure()
# with:
# name: ${{ steps.generate-artifact.outputs.name }}
# path: sandbox.tar.gz
# retention-days: 1

0 comments on commit 8ac4efd

Please sign in to comment.