Skip to content

Commit 5ec3fc7

Browse files
committed
time tracking : backend with critical points
1 parent fac0085 commit 5ec3fc7

File tree

51 files changed

+1371
-326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1371
-326
lines changed

.github/workflows/package.yml

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -180,43 +180,44 @@ jobs:
180180
runs-on: ${{ matrix.os }}
181181
strategy:
182182
matrix:
183-
os: [macos-12, macos-14]
183+
os: [macos-13, macos-14, macos-15]
184184
env:
185185
DYLD_LIBRARY_PATH: /usr/local/lib
186186

187187
steps:
188188
- uses: actions/checkout@v4
189189
name: Checkout TTK source code
190190

191-
- name: Remove hosted Python
192-
run: |
193-
sudo rm -rf /Library/Frameworks/Python.framework/
194-
sudo rm -rf /usr/local/Frameworks/Python.framework/
191+
- uses: actions/setup-python@v5
192+
with:
193+
python-version: '3.12'
195194

196195
- name: Install macOS dependencies
197196
run: |
198197
# ParaView dependencies
199-
brew reinstall python
200198
brew install --cask xquartz
201199
brew install llvm mesa glew qt@5 ninja
202200
# TTK dependencies
203201
brew install boost eigen graphviz spectra sqlite zlib numpy qhull
204202
203+
- name: Install and setup sccache
204+
uses: f3d-app/sccache-setup-action@v1
205+
with:
206+
key: macos-0
207+
205208
- name: Install optional dependencies
206209
uses: ./.github/actions/install-deps-unix
207210

208211
- name: Fetch & install TTK-ParaView
209212
run: |
210-
if [[ "${{ matrix.os }}" == "macos-12" ]]; then
211-
wget https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
212-
tar xzf ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
213-
fi
214-
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
215-
wget https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}-arm64.tar.gz
216-
tar xzf ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}-arm64.tar.gz
217-
fi
213+
wget https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
214+
tar xzf ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
218215
sudo cp -r ttk-paraview/* /usr/local
216+
# pvpython does not embed the correct PYTHONPATH
217+
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
219218
pvpython -m pip install --break-system-packages scikit-learn
219+
# pvpython is expecting a vtkpython executable at this path
220+
sudo ln -s /usr/local/bin/pvpython /Library/Frameworks/Python.framework/Versions/3.12/vtkpython
220221
221222
- name: Set compilers as environment variables
222223
run: |
@@ -230,8 +231,6 @@ jobs:
230231
cmake \
231232
-DCMAKE_BUILD_TYPE=Release \
232233
-DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5 \
233-
-DPython3_FIND_STRATEGY=LOCATION \
234-
-DPython3_ROOT_DIR=$(brew --prefix python) \
235234
-DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \
236235
-DTTK_BUILD_VTK_WRAPPERS=TRUE \
237236
-DTTK_BUILD_STANDALONE_APPS=TRUE \
@@ -266,36 +265,36 @@ jobs:
266265
runs-on: ${{ matrix.os }}
267266
strategy:
268267
matrix:
269-
os: [macos-12, macos-14]
268+
os: [macos-13, macos-14, macos-15]
270269
env:
271270
DYLD_LIBRARY_PATH: /usr/local/lib
272271
steps:
273272
- uses: actions/checkout@v4
274273
name: Checkout TTK source code
275274

276-
- name: Remove hosted Python
277-
run: |
278-
sudo rm -rf /Library/Frameworks/Python.framework
279-
sudo rm -rf /usr/local/Frameworks/Python.framework
275+
- uses: actions/setup-python@v5
276+
with:
277+
python-version: '3.12'
280278

281279
- name: Install macOS dependencies
282280
run: |
283281
# ParaView dependencies
284-
brew reinstall python
285282
brew install --cask xquartz
286283
brew install llvm mesa glew qt@5 ninja
287284
# TTK dependencies
288285
brew install boost eigen graphviz spectra sqlite zlib numpy qhull
289286
287+
- name: Install and setup sccache
288+
uses: f3d-app/sccache-setup-action@v1
289+
with:
290+
key: macos-0
291+
292+
- name: Install optional dependencies
293+
uses: ./.github/actions/install-deps-unix
294+
290295
- name: Fetch TTK-ParaView
291296
run: |
292-
if [[ "${{ matrix.os }}" == "macos-12" ]]; then
293-
wget -O ttk-paraview.tar.gz https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
294-
fi
295-
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
296-
wget -O ttk-paraview.tar.gz https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}-arm64.tar.gz
297-
fi
298-
297+
wget -O ttk-paraview.tar.gz https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
299298
300299
- name: Fetch TTK .tar.gz artifact
301300
uses: actions/download-artifact@v4.1.7
@@ -317,6 +316,8 @@ jobs:
317316
echo "CMAKE_PREFIX_PATH=$(brew --prefix qt@5)/lib/cmake:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV
318317
# pvpython does not embed the correct PYTHONPATH
319318
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
319+
# pvpython is expecting a vtkpython executable at this path
320+
sudo ln -s /usr/local/bin/pvpython /Library/Frameworks/Python.framework/Versions/3.12/vtkpython
320321
321322
- name: Run TTK tests
322323
uses: ./.github/actions/test-ttk-unix
@@ -337,7 +338,7 @@ jobs:
337338
# remove examples which fill up the memory
338339
rm python/topologicalOptimization_darkSky.py
339340
# some cases fail only with version 12
340-
if [[ "${{ matrix.os }}" == "macos-12" ]]; then
341+
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
341342
rm python/contourTreeAlignment.py
342343
rm python/geometryApproximation.py
343344
rm python/harmonicSkeleton.py
@@ -659,21 +660,29 @@ jobs:
659660
file: ttk-ubuntu-24.04.deb/ttk.deb
660661
asset_name: ttk-$tag-ubuntu-24.04.deb
661662

662-
- name: Upload MacOS 12 binary archives as Release Asset
663+
- name: Upload MacOS 13 binary archives as Release Asset
663664
uses: svenstaro/upload-release-action@v2
664665
with:
665666
repo_token: ${{ secrets.GITHUB_TOKEN }}
666667
tag: ${{ github.ref }}
667-
file: ttk-macos-12.tar.gz/ttk.tar.gz
668-
asset_name: ttk-$tag-macos-12.tar.gz
668+
file: ttk-macos-13.tar.gz/ttk.tar.gz
669+
asset_name: ttk-$tag-macos-13.tar.gz
669670

670671
- name: Upload MacOS 14 binary archives as Release Asset
671672
uses: svenstaro/upload-release-action@v2
672673
with:
673674
repo_token: ${{ secrets.GITHUB_TOKEN }}
674675
tag: ${{ github.ref }}
675676
file: ttk-macos-14.tar.gz/ttk.tar.gz
676-
asset_name: ttk-$tag-macos-14-arm64.tar.gz
677+
asset_name: ttk-$tag-macos-14.tar.gz
678+
679+
- name: Upload MacOS 15 binary archives as Release Asset
680+
uses: svenstaro/upload-release-action@v2
681+
with:
682+
repo_token: ${{ secrets.GITHUB_TOKEN }}
683+
tag: ${{ github.ref }}
684+
file: ttk-macos-15.tar.gz/ttk.tar.gz
685+
asset_name: ttk-$tag-macos-15.tar.gz
677686

678687
- name: Upload Windows .exe as Release Asset
679688
uses: svenstaro/upload-release-action@v2

.github/workflows/test.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ jobs:
271271
runs-on: ${{ matrix.os }}
272272
strategy:
273273
matrix:
274-
os: [macos-12, macos-14]
274+
os: [macos-13, macos-14, macos-15]
275275
if: ${{ github.repository_owner == 'topology-tool-kit' || !contains(github.ref, 'heads') }}
276276
env:
277277
DYLD_LIBRARY_PATH: /usr/local/lib
@@ -280,14 +280,13 @@ jobs:
280280
- uses: actions/checkout@v4
281281
name: Checkout TTK source code
282282

283-
- name: Remove hosted Python
284-
run: |
285-
sudo rm -rf /Library/Frameworks/Python.framework/
286-
sudo rm -rf /usr/local/Frameworks/Python.framework/
283+
- uses: actions/setup-python@v5
284+
with:
285+
python-version: '3.12'
286+
287287
- name: Install macOS dependencies
288288
run: |
289289
# ParaView dependencies
290-
brew reinstall python
291290
brew install --cask xquartz
292291
brew install llvm ninja open-mpi
293292
# TTK dependencies
@@ -303,20 +302,18 @@ jobs:
303302

304303
- name: Fetch TTK-ParaView headless macOS binary archive
305304
run: |
306-
if [[ "${{ matrix.os }}" == "macos-12" ]]; then
307305
wget -O ttk-paraview-headless.tar.gz \
308306
https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-headless-${{ matrix.os }}.tar.gz
309-
fi
310-
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
311-
wget -O ttk-paraview-headless.tar.gz \
312-
https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-headless-${{ matrix.os }}-arm64.tar.gz
313-
fi
314307
315308
- name: Install ParaView
316309
run: |
317310
tar xzf ttk-paraview-headless.tar.gz
318311
sudo cp -r ttk-paraview/* /usr/local
312+
# pvpython does not embed the correct PYTHONPATH
313+
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
319314
pvpython -m pip install --break-system-packages scikit-learn
315+
# pvpython is expecting a vtkpython executable at this path
316+
sudo ln -s /usr/local/bin/pvpython /Library/Frameworks/Python.framework/Versions/3.12/vtkpython
320317
321318
- name: Set compilers as environment variables
322319
run: |
@@ -355,11 +352,6 @@ jobs:
355352
shell: bash
356353
run: sccache --show-stats
357354

358-
- name: Set PYTHONPATH for macOS pvpython
359-
run: |
360-
# pvpython does not embed the correct PYTHONPATH
361-
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
362-
363355
- name: Run TTK tests
364356
uses: ./.github/actions/test-ttk-unix
365357

@@ -371,7 +363,6 @@ jobs:
371363
name: Checkout ttk-data
372364

373365
- name: Run ttk-data states [NOT ENFORCED]
374-
if: false
375366
id: validate
376367
continue-on-error: true
377368
run: |
@@ -380,6 +371,8 @@ jobs:
380371
rm ttk-data/states/nestedTrackingFromOverlap.py
381372
# remove examples which fill up the memory
382373
rm ttk-data/states/topologicalOptimization_darkSky.pvsm
374+
# remove examples that take too long to render under mac
375+
rm ttk-data/states/persistentGenerators_householdAnalysis.pvsm
383376
cd ttk-data/tests
384377
mkdir output_screenshots
385378
pvpython -u validate.py || (tar zcf screenshots.tar.gz output_screenshots && false)
@@ -390,7 +383,7 @@ jobs:
390383
if: steps.validate.outcome == 'failure'
391384
uses: actions/upload-artifact@v4
392385
with:
393-
name: screenshots-macOS.tar.gz
386+
name: screenshots-${{ matrix.os }}.tar.gz
394387
path: ttk-data/tests/screenshots.tar.gz
395388
retention-days: 10
396389

core/base/approximateTopology/ApproximateTopology.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,12 +1067,10 @@ bool ttk::ApproximateTopology::printPolarity(
10671067
std::stringstream mymsg;
10681068
std::vector<std::pair<polarity, polarity>> &vlp
10691069
= vertexLinkPolarity[vertexId];
1070-
mymsg << "POLARITY PRINT"
1071-
<< "\n";
1070+
mymsg << "POLARITY PRINT" << "\n";
10721071
mymsg << "vertex " << vertexId << " has "
10731072
<< multiresTriangulation_.getVertexNeighborNumber(vertexId)
1074-
<< " neighbors"
1075-
<< "\n";
1073+
<< " neighbors" << "\n";
10761074
mymsg << "\tself f:" << fakeScalars[vertexId] << " s:" << scalars[vertexId]
10771075
<< " o:" << offsets[vertexId] << " m:" << monotonyOffsets[vertexId]
10781076
<< " isnew: " << (int)isNew[vertexId] << "\n";
@@ -1115,13 +1113,12 @@ bool ttk::ApproximateTopology::printPolarity(
11151113
mymsg << " " << i << "th: " << nId << " f:" << fakeScalars[nId]
11161114
<< " s:" << scalars[nId] << " o:" << offsets[nId]
11171115
<< " m:" << monotonyOffsets[nId] << " , pol:" << (bool)vlp[i].first
1118-
<< "(" << (bool)vlp[i].second << ")"
1119-
<< " rpol:" << (bool)rpol << " true pol:" << (bool)isUpper
1120-
<< " init " << init << " isnew: " << (int)isNew[nId] << "\n";
1116+
<< "(" << (bool)vlp[i].second << ")" << " rpol:" << (bool)rpol
1117+
<< " true pol:" << (bool)isUpper << " init " << init
1118+
<< " isnew: " << (int)isNew[nId] << "\n";
11211119
if((rpol == isUpper and !vlp2.empty())
11221120
or (isUpper != vlp[i].first and !vlp[i].second)) {
1123-
mymsg << "POLARITY ERROR "
1124-
<< "\n";
1121+
mymsg << "POLARITY ERROR " << "\n";
11251122
error = true;
11261123
}
11271124
}

core/base/arrayPreconditioning/ArrayPreconditioning.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ namespace ttk {
293293
std::vector<globalOrder::vertexToSort<DT>> verticesToSort;
294294
verticesToSort.reserve(nVerts);
295295
#ifdef TTK_ENABLE_OPENMP
296-
#pragma omp declare reduction (merge : std::vector<globalOrder::vertexToSort<DT>> : omp_out.insert(omp_out.end(), omp_in.begin(), omp_in.end()))
296+
#pragma omp declare reduction( \
297+
merge : std::vector<globalOrder::vertexToSort<DT>> : omp_out.insert( \
298+
omp_out.end(), omp_in.begin(), omp_in.end()))
297299
#pragma omp parallel for reduction(merge : verticesToSort) schedule(static)
298300
#endif
299301
for(size_t i = 0; i < nVerts; i++) {

core/base/assignmentSolver/AssignmentAuction.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ namespace ttk {
275275
initFirstRound();
276276
while(not stoppingCriterion(this->costMatrix)) {
277277
initBiddersAndGoods();
278+
278279
runAuctionRound(this->costMatrix);
279280

280281
dataType cost = getMatchingDistance(this->costMatrix);

core/base/clusteringMetrics/ClusteringMetrics.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ int ttk::ClusteringMetrics::computeARI(
114114

115115
double sumNChooseContingency = 0;
116116
#ifdef TTK_ENABLE_OPENMP
117-
#pragma omp parallel for num_threads(this->threadNumber_) reduction(+:sumNChooseContingency)
117+
#pragma omp parallel for num_threads(this->threadNumber_) \
118+
reduction(+ : sumNChooseContingency)
118119
#endif // TTK_ENABLE_OPENMP
119120
for(size_t i1 = 0; i1 < nCluster1; i1++) {
120121
for(size_t i2 = 0; i2 < nCluster2; i2++)
@@ -165,7 +166,8 @@ int ttk::ClusteringMetrics::computeNMI(
165166
double mutualInfo = 0;
166167
bool invalidCell = false;
167168
#ifdef TTK_ENABLE_OPENMP
168-
#pragma omp parallel for num_threads(this->threadNumber_) reduction(+:mutualInfo)
169+
#pragma omp parallel for num_threads(this->threadNumber_) \
170+
reduction(+ : mutualInfo)
169171
#endif // TTK_ENABLE_OPENMP
170172
for(size_t i1 = 0; i1 < nCluster1; i1++) {
171173
for(size_t i2 = 0; i2 < nCluster2; i2++) {

core/base/common/Os.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <string>
2626
#include <vector>
2727

28-
//#define SINGLE_PRECISION
28+
// #define SINGLE_PRECISION
2929

3030
#ifdef SINGLE_PRECISION
3131
#define REAL_TYPE float

0 commit comments

Comments
 (0)