Skip to content

Commit 14560dc

Browse files
committed
debug meme issue
1 parent ad2febe commit 14560dc

4 files changed

Lines changed: 49 additions & 227 deletions

File tree

.github/workflows/pytest-core-nompi.yaml

Lines changed: 15 additions & 227 deletions
Original file line numberDiff line numberDiff line change
@@ -3,259 +3,47 @@ name: CI-core
33
permissions:
44
contents: read
55

6-
concurrency:
7-
group: ${{ github.workflow }}-${{ github.ref }}
8-
cancel-in-progress: true
9-
106
on:
117
# Trigger the workflow on push or pull request, but only for the main branch
128
push:
139
branches:
14-
- main
15-
pull_request:
16-
branches:
17-
- main
10+
- debug-data-failuer
1811

1912
jobs:
2013
test-nompi-basic:
21-
name: ${{ matrix.name }}-${{ matrix.set }}
22-
runs-on: "${{ matrix.os }}"
14+
name: pytest-ubuntu-py311-gcc10-noomp-base
15+
runs-on: ubuntu-latest
2316

2417
env:
25-
DEVITO_ARCH: "${{ matrix.arch }}"
26-
DEVITO_LANGUAGE: ${{ matrix.language }}
18+
DEVITO_ARCH: "gcc"
19+
DEVITO_LANGUAGE: "C"
2720
OMP_NUM_THREADS: 2
2821

2922
strategy:
3023
# Prevent cancellation if a single workflow fails
3124
fail-fast: false
3225

33-
matrix:
34-
name: [
35-
pytest-osx-py312-clang-omp,
36-
pytest-ubuntu-py310-gcc14-omp,
37-
pytest-ubuntu-py310-gcc9-omp,
38-
pytest-ubuntu-py311-gcc10-noomp,
39-
pytest-ubuntu-py311-gcc11-cxxnoomp,
40-
pytest-ubuntu-py312-gcc12-cxxomp,
41-
pytest-ubuntu-py312-gcc13-omp,
42-
pytest-ubuntu-py313-gcc14-omp
43-
]
44-
set: [base, adjoint]
45-
46-
include:
47-
- name: pytest-ubuntu-py311-gcc11-cxxnoomp
48-
python-version: '3.11'
49-
os: ubuntu-22.04
50-
arch: "gcc-11"
51-
language: "CXX"
52-
sympy: "1.14"
53-
54-
- name: pytest-ubuntu-py312-gcc12-cxxomp
55-
python-version: '3.12'
56-
os: ubuntu-24.04
57-
arch: "gcc-12"
58-
language: "CXXopenmp"
59-
sympy: "1.13"
60-
61-
- name: pytest-ubuntu-py310-gcc14-omp
62-
python-version: '3.10'
63-
os: ubuntu-24.04
64-
arch: "gcc-14"
65-
language: "openmp"
66-
sympy: "1.12"
67-
68-
- name: pytest-ubuntu-py311-gcc10-noomp
69-
python-version: '3.11'
70-
os: ubuntu-22.04
71-
arch: "gcc-10"
72-
language: "C"
73-
sympy: "1.14"
74-
75-
- name: pytest-ubuntu-py312-gcc13-omp
76-
python-version: '3.12'
77-
os: ubuntu-24.04
78-
arch: "gcc-13"
79-
language: "openmp"
80-
sympy: "1.13"
81-
82-
- name: pytest-ubuntu-py310-gcc9-omp
83-
python-version: '3.10'
84-
os: ubuntu-22.04
85-
arch: "custom"
86-
language: "openmp"
87-
sympy: "1.12"
88-
89-
- name: pytest-osx-py312-clang-omp
90-
python-version: '3.12'
91-
os: macos-latest
92-
arch: "clang"
93-
language: "openmp"
94-
sympy: "1.12"
95-
96-
- name: pytest-ubuntu-py313-gcc14-omp
97-
python-version: '3.13'
98-
os: ubuntu-24.04
99-
arch: "gcc-14"
100-
language: "openmp"
101-
sympy: "1.14"
102-
103-
- set: base
104-
test-set: 'not adjoint'
105-
106-
- set: adjoint
107-
test-set: 'adjoint'
108-
109-
exclude:
110-
- name: pytest-osx-py312-clang-omp
111-
set: adjoint
112-
11326
steps:
11427
- name: Checkout devito
11528
uses: actions/checkout@v6
11629

117-
- name: Set up Python ${{ matrix.python-version }}
30+
- name: Set up Python
11831
uses: actions/setup-python@v6
11932
with:
120-
python-version: ${{ matrix.python-version }}
33+
python-version: 3.11
12134
allow-prereleases: true
12235

123-
- name: Install ${{ matrix.arch }} compiler
124-
if: "runner.os == 'linux' && matrix.arch !='custom' "
125-
run : |
126-
sudo apt-get install -y ${{ matrix.arch }}
127-
128-
- name: Set tests (reduced number for OSX)
129-
run : |
130-
if [ "${{ runner.os }}" == 'macOS' ]; then
131-
brew install llvm libomp
132-
echo "/opt/homebrew/opt/llvm/bin" >> "$GITHUB_PATH"
133-
fi
134-
id: set-tests
135-
136-
- name: Set pip flags for latest python (3.12)
137-
run: |
138-
ver="${{ matrix.python-version }}"
139-
major=${ver%%.*}
140-
minor=${ver#*.}; minor=${minor%%.*}
141-
if [ "$major" -eq 3 ] && [ "$minor" -ge 12 ]; then
142-
echo "PIPFLAGS='--break-system-packages'" >> "$GITHUB_ENV"
143-
fi
144-
14536
- name: Install dependencies
14637
run: |
147-
python3 -m pip install ${{ env.PIPFLAGS }} --upgrade pip
148-
python3 -m pip install ${{ env.PIPFLAGS }} -e ".[tests,extras]"
149-
python3 -m pip install ${{ env.PIPFLAGS }} sympy==${{matrix.sympy}}
38+
python3 -m pip install --upgrade pip
39+
python3 -m pip install -e ".[tests,extras]"
15040
151-
- name: Backward compat for numpy 1.26
152-
if: matrix.name == 'pytest-ubuntu-py310-gcc14-omp'
153-
run: python3 -m pip install ${{ env.PIPFLAGS }} numpy==1.26
154-
155-
- name: Check configuration
41+
- name: Install GDB
15642
run: |
157-
python3 \
158-
-c "from devito import configuration; \
159-
print(''.join(['%s: %s \n' % (k, v) for (k, v) in configuration.items()]))"
43+
sudo apt-get update
44+
sudo apt-get install -y gdb
16045
161-
- name: Test with pytest
46+
- name: Run debug script
16247
run: |
163-
pytest \
164-
-v \
165-
-k "${{ matrix.test-set }}" \
166-
-m "not parallel" \
167-
--cov \
168-
--cov-config=.coveragerc \
169-
--cov-report=xml \
170-
tests/
171-
172-
- name: Upload coverage to Codecov
173-
uses: codecov/codecov-action@v6
174-
with:
175-
token: ${{ secrets.CODECOV_TOKEN }}
176-
name: ${{ matrix.name }}
177-
178-
test-nompi-docker:
179-
name: ${{ matrix.name }}-${{ matrix.set }}
180-
runs-on: "${{ matrix.os }}"
181-
182-
env:
183-
DEVITO_ARCH: "${{ matrix.arch }}"
184-
DEVITO_LANGUAGE: ${{ matrix.language }}
185-
OMP_NUM_THREADS: 2
186-
187-
strategy:
188-
# Prevent cancellation if a single workflow fails
189-
fail-fast: false
190-
191-
matrix:
192-
name: [
193-
pytest-docker-py310-gcc-omp,
194-
pytest-docker-py310-gcc-omp-arm64,
195-
pytest-docker-py310-icx-omp,
196-
]
197-
set: [base, adjoint]
198-
199-
include:
200-
- name: pytest-docker-py310-gcc-omp
201-
python-version: '3.10'
202-
os: ubuntu-latest
203-
arch: "gcc"
204-
language: "openmp"
205-
sympy: "1.13"
206-
207-
- name: pytest-docker-py310-gcc-omp-arm64
208-
python-version: '3.10'
209-
os: ubuntu-24.04-arm
210-
arch: "gcc"
211-
language: "openmp"
212-
sympy: "1.13"
213-
214-
- name: pytest-docker-py310-icx-omp
215-
python-version: '3.10'
216-
os: ubuntu-latest
217-
arch: "icx"
218-
language: "openmp"
219-
sympy: "1.13"
220-
221-
- set: base
222-
test-set: 'not adjoint'
223-
224-
- set: adjoint
225-
test-set: 'adjoint'
226-
227-
steps:
228-
- name: Checkout devito
229-
uses: actions/checkout@v6
230-
231-
- id: build
232-
name: Build docker image
233-
uses: ./.github/actions/docker-build
234-
with:
235-
file: docker/Dockerfile.devito
236-
tag: ${{ matrix.name }}
237-
base: devitocodes/bases:cpu-${{ matrix.arch }}
238-
239-
- name: Test with pytest
240-
uses: ./.github/actions/docker-run
241-
with:
242-
uid: ${{ steps.build.outputs.unique }}
243-
tag: ${{ matrix.name }}
244-
env: |
245-
CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}
246-
command: |
247-
pytest \
248-
-v \
249-
-k "${{ matrix.test-set }}" \
250-
-m "not parallel" \
251-
--cov \
252-
--cov-config=.coveragerc \
253-
--cov-report=xml \
254-
tests/
255-
256-
- name: Cleanup docker image
257-
if: always()
258-
uses: ./.github/actions/docker-clean
259-
with:
260-
uid: ${{ steps.build.outputs.unique }}
261-
tag: ${{ matrix.name }}
48+
chmod +x debug_mem.sh
49+
./debug_mem.sh

debug_mem.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
export DEVITO_LOGGING=ERROR
4+
export DEVITO_DEVELOP=1
5+
6+
count=0
7+
8+
while true; do
9+
out=$(gdb --batch \
10+
-ex "set pagination off" \
11+
-ex "run" \
12+
-ex "thread apply all bt full" \
13+
-ex "set logging enabled off" \
14+
-ex "set print thread-events off" \
15+
--args python -m pytest -q -vvsx \
16+
--disable-warnings --no-header --no-summary \
17+
-m "not parallel" tests/test_data.py 2>&1)
18+
19+
status=$?
20+
21+
if [ $status -ne 0 ]; then
22+
echo "Failed after $count runs"
23+
echo "$out"
24+
exit $status
25+
fi
26+
27+
((count++))
28+
echo "$count"
29+
done
30+
31+
echo "Failed after $count runs"

devito/types/basic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ def __padding_setup__(self, padding=None, **kwargs):
897897
@cached_property
898898
def __padding_dtype__(self):
899899
v = configuration['autopadding']
900+
900901
if not self.is_autopaddable or not v:
901902
return None
902903
try:
@@ -924,6 +925,7 @@ def __padding_setup_smart__(self, **kwargs):
924925

925926
snp = self._size_nopad[d]
926927
remainder = snp % mmts
928+
927929
if remainder == 0:
928930
# Already a multiple of `mmts`, no need to pad
929931
return nopadding

devito/types/dense.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,7 @@ def __padding_setup__(self, **kwargs):
12911291

12921292
else:
12931293
raise TypeError(f"`padding` must be int or {self.ndim}-tuple of ints")
1294+
12941295
return DimensionTuple(*padding, getters=self.dimensions)
12951296

12961297
@property

0 commit comments

Comments
 (0)