Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time tracking : backend with critical points #1087

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 43 additions & 34 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,43 +180,44 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, macos-14]
os: [macos-13, macos-14, macos-15]
env:
DYLD_LIBRARY_PATH: /usr/local/lib

steps:
- uses: actions/checkout@v4
name: Checkout TTK source code

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

- name: Install macOS dependencies
run: |
# ParaView dependencies
brew reinstall python
brew install --cask xquartz
brew install llvm mesa glew qt@5 ninja
# TTK dependencies
brew install boost eigen graphviz spectra sqlite zlib numpy qhull

- name: Install and setup sccache
uses: f3d-app/sccache-setup-action@v1
with:
key: macos-0

- name: Install optional dependencies
uses: ./.github/actions/install-deps-unix

- name: Fetch & install TTK-ParaView
run: |
if [[ "${{ matrix.os }}" == "macos-12" ]]; then
wget https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
tar xzf ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
fi
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
wget https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}-arm64.tar.gz
tar xzf ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}-arm64.tar.gz
fi
wget https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
tar xzf ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
sudo cp -r ttk-paraview/* /usr/local
# pvpython does not embed the correct PYTHONPATH
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
pvpython -m pip install --break-system-packages scikit-learn
# pvpython is expecting a vtkpython executable at this path
sudo ln -s /usr/local/bin/pvpython /Library/Frameworks/Python.framework/Versions/3.12/vtkpython

- name: Set compilers as environment variables
run: |
Expand All @@ -230,8 +231,6 @@ jobs:
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5 \
-DPython3_FIND_STRATEGY=LOCATION \
-DPython3_ROOT_DIR=$(brew --prefix python) \
-DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \
-DTTK_BUILD_VTK_WRAPPERS=TRUE \
-DTTK_BUILD_STANDALONE_APPS=TRUE \
Expand Down Expand Up @@ -266,36 +265,36 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, macos-14]
os: [macos-13, macos-14, macos-15]
env:
DYLD_LIBRARY_PATH: /usr/local/lib
steps:
- uses: actions/checkout@v4
name: Checkout TTK source code

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

- name: Install macOS dependencies
run: |
# ParaView dependencies
brew reinstall python
brew install --cask xquartz
brew install llvm mesa glew qt@5 ninja
# TTK dependencies
brew install boost eigen graphviz spectra sqlite zlib numpy qhull

- name: Install and setup sccache
uses: f3d-app/sccache-setup-action@v1
with:
key: macos-0

- name: Install optional dependencies
uses: ./.github/actions/install-deps-unix

- name: Fetch TTK-ParaView
run: |
if [[ "${{ matrix.os }}" == "macos-12" ]]; then
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
fi
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
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
fi

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

- name: Fetch TTK .tar.gz artifact
uses: actions/[email protected]
Expand All @@ -317,6 +316,8 @@ jobs:
echo "CMAKE_PREFIX_PATH=$(brew --prefix qt@5)/lib/cmake:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV
# pvpython does not embed the correct PYTHONPATH
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
# pvpython is expecting a vtkpython executable at this path
sudo ln -s /usr/local/bin/pvpython /Library/Frameworks/Python.framework/Versions/3.12/vtkpython

- name: Run TTK tests
uses: ./.github/actions/test-ttk-unix
Expand All @@ -337,7 +338,7 @@ jobs:
# remove examples which fill up the memory
rm python/topologicalOptimization_darkSky.py
# some cases fail only with version 12
if [[ "${{ matrix.os }}" == "macos-12" ]]; then
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
rm python/contourTreeAlignment.py
rm python/geometryApproximation.py
rm python/harmonicSkeleton.py
Expand Down Expand Up @@ -659,21 +660,29 @@ jobs:
file: ttk-ubuntu-24.04.deb/ttk.deb
asset_name: ttk-$tag-ubuntu-24.04.deb

- name: Upload MacOS 12 binary archives as Release Asset
- name: Upload MacOS 13 binary archives as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-macos-12.tar.gz/ttk.tar.gz
asset_name: ttk-$tag-macos-12.tar.gz
file: ttk-macos-13.tar.gz/ttk.tar.gz
asset_name: ttk-$tag-macos-13.tar.gz

- name: Upload MacOS 14 binary archives as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-macos-14.tar.gz/ttk.tar.gz
asset_name: ttk-$tag-macos-14-arm64.tar.gz
asset_name: ttk-$tag-macos-14.tar.gz

- name: Upload MacOS 15 binary archives as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-macos-15.tar.gz/ttk.tar.gz
asset_name: ttk-$tag-macos-15.tar.gz

- name: Upload Windows .exe as Release Asset
uses: svenstaro/upload-release-action@v2
Expand Down
31 changes: 12 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, macos-14]
os: [macos-13, macos-14, macos-15]
if: ${{ github.repository_owner == 'topology-tool-kit' || !contains(github.ref, 'heads') }}
env:
DYLD_LIBRARY_PATH: /usr/local/lib
Expand All @@ -280,14 +280,13 @@ jobs:
- uses: actions/checkout@v4
name: Checkout TTK source code

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

- name: Install macOS dependencies
run: |
# ParaView dependencies
brew reinstall python
brew install --cask xquartz
brew install llvm ninja open-mpi
# TTK dependencies
Expand All @@ -303,20 +302,18 @@ jobs:

- name: Fetch TTK-ParaView headless macOS binary archive
run: |
if [[ "${{ matrix.os }}" == "macos-12" ]]; then
wget -O ttk-paraview-headless.tar.gz \
https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-headless-${{ matrix.os }}.tar.gz
fi
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
wget -O ttk-paraview-headless.tar.gz \
https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-headless-${{ matrix.os }}-arm64.tar.gz
fi

- name: Install ParaView
run: |
tar xzf ttk-paraview-headless.tar.gz
sudo cp -r ttk-paraview/* /usr/local
# pvpython does not embed the correct PYTHONPATH
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
pvpython -m pip install --break-system-packages scikit-learn
# pvpython is expecting a vtkpython executable at this path
sudo ln -s /usr/local/bin/pvpython /Library/Frameworks/Python.framework/Versions/3.12/vtkpython

- name: Set compilers as environment variables
run: |
Expand Down Expand Up @@ -355,11 +352,6 @@ jobs:
shell: bash
run: sccache --show-stats

- name: Set PYTHONPATH for macOS pvpython
run: |
# pvpython does not embed the correct PYTHONPATH
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV

- name: Run TTK tests
uses: ./.github/actions/test-ttk-unix

Expand All @@ -371,7 +363,6 @@ jobs:
name: Checkout ttk-data

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

Expand Down
15 changes: 6 additions & 9 deletions core/base/approximateTopology/ApproximateTopology.h
Original file line number Diff line number Diff line change
Expand Up @@ -1067,12 +1067,10 @@ bool ttk::ApproximateTopology::printPolarity(
std::stringstream mymsg;
std::vector<std::pair<polarity, polarity>> &vlp
= vertexLinkPolarity[vertexId];
mymsg << "POLARITY PRINT"
<< "\n";
mymsg << "POLARITY PRINT" << "\n";
mymsg << "vertex " << vertexId << " has "
<< multiresTriangulation_.getVertexNeighborNumber(vertexId)
<< " neighbors"
<< "\n";
<< " neighbors" << "\n";
mymsg << "\tself f:" << fakeScalars[vertexId] << " s:" << scalars[vertexId]
<< " o:" << offsets[vertexId] << " m:" << monotonyOffsets[vertexId]
<< " isnew: " << (int)isNew[vertexId] << "\n";
Expand Down Expand Up @@ -1115,13 +1113,12 @@ bool ttk::ApproximateTopology::printPolarity(
mymsg << " " << i << "th: " << nId << " f:" << fakeScalars[nId]
<< " s:" << scalars[nId] << " o:" << offsets[nId]
<< " m:" << monotonyOffsets[nId] << " , pol:" << (bool)vlp[i].first
<< "(" << (bool)vlp[i].second << ")"
<< " rpol:" << (bool)rpol << " true pol:" << (bool)isUpper
<< " init " << init << " isnew: " << (int)isNew[nId] << "\n";
<< "(" << (bool)vlp[i].second << ")" << " rpol:" << (bool)rpol
<< " true pol:" << (bool)isUpper << " init " << init
<< " isnew: " << (int)isNew[nId] << "\n";
if((rpol == isUpper and !vlp2.empty())
or (isUpper != vlp[i].first and !vlp[i].second)) {
mymsg << "POLARITY ERROR "
<< "\n";
mymsg << "POLARITY ERROR " << "\n";
error = true;
}
}
Expand Down
4 changes: 3 additions & 1 deletion core/base/arrayPreconditioning/ArrayPreconditioning.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ namespace ttk {
std::vector<globalOrder::vertexToSort<DT>> verticesToSort;
verticesToSort.reserve(nVerts);
#ifdef TTK_ENABLE_OPENMP
#pragma omp declare reduction (merge : std::vector<globalOrder::vertexToSort<DT>> : omp_out.insert(omp_out.end(), omp_in.begin(), omp_in.end()))
#pragma omp declare reduction( \
merge : std::vector<globalOrder::vertexToSort<DT>> : omp_out.insert( \
omp_out.end(), omp_in.begin(), omp_in.end()))
#pragma omp parallel for reduction(merge : verticesToSort) schedule(static)
#endif
for(size_t i = 0; i < nVerts; i++) {
Expand Down
1 change: 1 addition & 0 deletions core/base/assignmentSolver/AssignmentAuction.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ namespace ttk {
initFirstRound();
while(not stoppingCriterion(this->costMatrix)) {
initBiddersAndGoods();

runAuctionRound(this->costMatrix);

dataType cost = getMatchingDistance(this->costMatrix);
Expand Down
6 changes: 4 additions & 2 deletions core/base/clusteringMetrics/ClusteringMetrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ int ttk::ClusteringMetrics::computeARI(

double sumNChooseContingency = 0;
#ifdef TTK_ENABLE_OPENMP
#pragma omp parallel for num_threads(this->threadNumber_) reduction(+:sumNChooseContingency)
#pragma omp parallel for num_threads(this->threadNumber_) \
reduction(+ : sumNChooseContingency)
#endif // TTK_ENABLE_OPENMP
for(size_t i1 = 0; i1 < nCluster1; i1++) {
for(size_t i2 = 0; i2 < nCluster2; i2++)
Expand Down Expand Up @@ -165,7 +166,8 @@ int ttk::ClusteringMetrics::computeNMI(
double mutualInfo = 0;
bool invalidCell = false;
#ifdef TTK_ENABLE_OPENMP
#pragma omp parallel for num_threads(this->threadNumber_) reduction(+:mutualInfo)
#pragma omp parallel for num_threads(this->threadNumber_) \
reduction(+ : mutualInfo)
#endif // TTK_ENABLE_OPENMP
for(size_t i1 = 0; i1 < nCluster1; i1++) {
for(size_t i2 = 0; i2 < nCluster2; i2++) {
Expand Down
2 changes: 1 addition & 1 deletion core/base/common/Os.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <string>
#include <vector>

//#define SINGLE_PRECISION
// #define SINGLE_PRECISION

#ifdef SINGLE_PRECISION
#define REAL_TYPE float
Expand Down
Loading
Loading