Skip to content

Commit

Permalink
Merge pull request #146 from yanurag994/master
Browse files Browse the repository at this point in the history
Merging Distributed Helix Algorithm into Master Branch
  • Loading branch information
yanurag994 authored Nov 1, 2024
2 parents fc145ba + 357bd97 commit d2498dc
Show file tree
Hide file tree
Showing 20 changed files with 1,156 additions and 210 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
run: vcpkg update && vcpkg install cgal eigen3 msmpi

# Checkout v2 : https://github.com/actions/checkout
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Check CMake Version
- name: Check CMake (${{ matrix.mpi }})
Expand Down
12 changes: 6 additions & 6 deletions Complex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ cmake_minimum_required(VERSION 3.10)

find_package(OpenMP REQUIRED)

add_library(simplexBase STATIC simplexBase.cpp simplexBase.hpp)
add_library(simplexBase STATIC simplexBase.cpp)
target_link_libraries(simplexBase PUBLIC utils pipePacket simplexTree simplexArrayList alphaComplex witnessComplex betaComplex)
target_include_directories(simplexBase PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/Utils)

add_library(simplexArrayList STATIC simplexArrayList.cpp simplexArrayList.hpp)
add_library(simplexArrayList STATIC simplexArrayList.cpp)
target_link_libraries(simplexArrayList PUBLIC simplexBase)
target_include_directories(simplexArrayList PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(alphaComplex STATIC alphaComplex.cpp alphaComplex.hpp)
add_library(alphaComplex STATIC alphaComplex.cpp)
target_link_libraries(alphaComplex PUBLIC utils kdTree simplexArrayList OpenMP::OpenMP_CXX)
target_include_directories(alphaComplex PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(witnessComplex STATIC witnessComplex.cpp witnessComplex.hpp)
add_library(witnessComplex STATIC witnessComplex.cpp)
target_link_libraries(witnessComplex PUBLIC simplexArrayList)
target_include_directories(witnessComplex PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(simplexTree STATIC simplexTree.cpp simplexTree.hpp)
add_library(simplexTree STATIC simplexTree.cpp)
target_link_libraries(simplexTree PUBLIC utils kdTree simplexBase)
target_include_directories(simplexTree PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(betaComplex STATIC betaComplex.cpp betaComplex.hpp)
add_library(betaComplex STATIC betaComplex.cpp)
target_link_libraries(betaComplex PUBLIC alphaComplex)
target_include_directories(betaComplex PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

Expand Down
2 changes: 1 addition & 1 deletion LHFmain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ include_directories(SYSTEM ${MPI_INCLUDE_PATH})
find_package(OpenMP REQUIRED)

#Add Source to this project's executable
add_library(LHFlib SHARED "LHF.cpp" "LHF.hpp")
add_library(LHFlib SHARED LHF.cpp)
set_target_properties(LHFlib PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(LHFlib PROPERTIES SOVERSION 1)
set_target_properties(LHFlib PROPERTIES POSITION_INDEPENDENT_CODE ON)
Expand Down
44 changes: 25 additions & 19 deletions Pipes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,77 +49,83 @@ endif()
find_package(OpenMP REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(TBB)
find_package(MPI REQUIRED)

add_library(pipePacket STATIC "pipePacket.cpp" "pipePacket.hpp")
add_library(pipePacket STATIC pipePacket.cpp)
target_link_libraries(pipePacket PUBLIC simplexBase)
target_include_directories(pipePacket PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/Complex)

add_library(basePipe STATIC "basePipe.cpp" "basePipe.hpp")
add_library(basePipe STATIC basePipe.cpp)
target_link_libraries(basePipe PUBLIC
distMatrixPipe neighGraphPipe
ripsPipe betaSkeletonBasedComplex betaSubSkeletonComplex
upscalePipe slidingWindow fastPersistence
incrementalPersistence naiveWindow qhullPipe delaunayPipe incrementalPipe)
incrementalPersistence naiveWindow qhullPipe delaunayPipe helixPipe helixDistPipe)
target_include_directories(basePipe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(distMatrixPipe STATIC "distMatrixPipe.cpp" "distMatrixPipe.hpp")
add_library(distMatrixPipe STATIC distMatrixPipe.cpp)
target_link_libraries(distMatrixPipe PUBLIC utils basePipe)
target_include_directories(distMatrixPipe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(neighGraphPipe STATIC "neighGraphPipe.cpp" "neighGraphPipe.hpp")
add_library(neighGraphPipe STATIC neighGraphPipe.cpp)
target_link_libraries(neighGraphPipe PUBLIC basePipe)
target_include_directories(neighGraphPipe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(ripsPipe STATIC "ripsPipe.cpp" "ripsPipe.hpp")
add_library(ripsPipe STATIC ripsPipe.cpp)
target_link_libraries(ripsPipe PUBLIC utils basePipe)
target_include_directories(ripsPipe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(betaSkeletonBasedComplex STATIC "betaSkeletonBasedComplex.cpp" "betaSkeletonBasedComplex.hpp")
add_library(betaSkeletonBasedComplex STATIC betaSkeletonBasedComplex.cpp)
target_link_libraries(betaSkeletonBasedComplex PUBLIC basePipe alphaComplex qhullPipe readInput utils kdTree qhullcpp qhull_r)
target_include_directories(betaSkeletonBasedComplex PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${qhullext_SOURCE_DIR}/src)

add_library(betaSubSkeletonComplex STATIC "betaSubSkeletonComplex.cpp" "betaSubSkeletonComplex.hpp")
add_library(betaSubSkeletonComplex STATIC betaSubSkeletonComplex.cpp)
target_link_libraries(betaSubSkeletonComplex PUBLIC basePipe alphaComplex readInput utils kdTree)
target_include_directories(betaSubSkeletonComplex PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(upscalePipe STATIC "upscalePipe.cpp" "upscalePipe.hpp")
add_library(upscalePipe STATIC upscalePipe.cpp)
target_link_libraries(upscalePipe PUBLIC basePipe utils)
target_include_directories(upscalePipe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(slidingWindow STATIC "slidingWindow.cpp" "slidingWindow.hpp")
add_library(slidingWindow STATIC slidingWindow.cpp)
target_link_libraries(slidingWindow PUBLIC basePipe readInput utils)
target_include_directories(slidingWindow PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(fastPersistence STATIC "fastPersistence.cpp" "fastPersistence.hpp")
add_library(fastPersistence STATIC fastPersistence.cpp)
target_link_libraries(fastPersistence PUBLIC basePipe utils unionFind)
target_include_directories(fastPersistence PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(incrementalPersistence STATIC "incrementalPersistence.cpp" "incrementalPersistence.hpp")
add_library(incrementalPersistence STATIC incrementalPersistence.cpp)
target_link_libraries(incrementalPersistence PUBLIC basePipe simplexBase simplexArrayList utils unionFind)
target_include_directories(incrementalPersistence PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(naiveWindow STATIC "naiveWindow.cpp" "naiveWindow.hpp")
add_library(naiveWindow STATIC naiveWindow.cpp)
target_link_libraries(naiveWindow PUBLIC basePipe readInput utils)
target_include_directories(naiveWindow PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(qhullPipe STATIC "qhullPipe.cpp" "qhullPipe.hpp")
add_library(qhullPipe STATIC qhullPipe.cpp)
target_link_libraries(qhullPipe PUBLIC basePipe utils alphaComplex qhullcpp qhull_r)
target_include_directories(qhullPipe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${qhullext_SOURCE_DIR}/src)

add_library(delaunayPipe STATIC "delaunayPipe.cpp" "delaunayPipe.hpp")
add_library(delaunayPipe STATIC delaunayPipe.cpp)
target_link_libraries(delaunayPipe PUBLIC basePipe alphaComplex utils CGAL::CGAL OpenMP::OpenMP_CXX)
target_include_directories(delaunayPipe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

if(APPLE)
add_compile_definitions(NO_PARALLEL_ALGORITHMS=1)
endif()

add_library(incrementalPipe STATIC "incrementalPipe.cpp" "incrementalPipe.hpp")
target_link_libraries(incrementalPipe PUBLIC basePipe utils OpenMP::OpenMP_CXX)
target_include_directories(incrementalPipe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${EIGEN3_INCLUDE_DIR})
add_library(helixPipe STATIC helixPipe.cpp)
target_link_libraries(helixPipe PUBLIC basePipe utils OpenMP::OpenMP_CXX)
target_include_directories(helixPipe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${EIGEN3_INCLUDE_DIR})

add_library(helixDistPipe STATIC helixDistPipe.cpp)
target_link_libraries(helixDistPipe PUBLIC basePipe readInput writeOutput multifileops utils OpenMP::OpenMP_CXX MPI::MPI_CXX)
target_include_directories(helixDistPipe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${EIGEN3_INCLUDE_DIR} ${MPI_INCLUDE_PATH})

if(TBB_FOUND)
target_link_libraries(incrementalPipe PUBLIC TBB::tbb)
target_link_libraries(helixPipe PUBLIC TBB::tbb)
target_link_libraries(helixDistPipe PUBLIC TBB::tbb)
endif()


Expand Down
28 changes: 18 additions & 10 deletions Pipes/basePipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
#include "fastPersistence.hpp"
#include "ripsPipe.hpp"
#include "naiveWindow.hpp"
// #include "betaSkeletonBasedComplex.hpp"
// #include "betaSubSkeletonComplex.hpp"
#include "betaSkeletonBasedComplex.hpp"
#include "betaSubSkeletonComplex.hpp"
#include "upscalePipe.hpp"
#include "qhullPipe.hpp"
#include "slidingWindow.hpp"
#include "delaunayPipe.hpp"
#include "incrementalPipe.hpp"
#include "helixPipe.hpp"
#include "helixDistPipe.hpp"

template <typename nodeType>
basePipe<nodeType> *basePipe<nodeType>::newPipe(const std::string &pipeType, const std::string &complexType)
Expand Down Expand Up @@ -65,12 +66,15 @@ basePipe<nodeType> *basePipe<nodeType>::newPipe(const std::string &pipeType, con
}
else if (pipeType == "upscale")
{
std::cout << "Building upscale" << std::endl;
return new upscalePipe<nodeType>();
//} else if (pipeType == "betaSkeletonBasedComplex"){
// return new betaSkeletonBasedComplex<nodeType>();
//} else if (pipeType == "betaSubSkeletonComplex"){
// return new betaSubSkeletonComplex<nodeType>();
}
else if (pipeType == "betaSkeletonBasedComplex")
{
return new betaSkeletonBasedComplex<nodeType>();
}
else if (pipeType == "betaSubSkeletonComplex")
{
return new betaSubSkeletonComplex<nodeType>();
}
else if (pipeType == "qhullPipe" || pipeType == "qhull" || pipeType == "alpha")
{
Expand All @@ -84,9 +88,13 @@ basePipe<nodeType> *basePipe<nodeType>::newPipe(const std::string &pipeType, con
{
return new delaunayPipe<nodeType>();
}
else if (pipeType == "incrementalPipe")
else if (pipeType == "helixPipe")
{
return new helixPipe<nodeType>();
}
else if (pipeType == "helixDistPipe")
{
return new incrementalPipe<nodeType>();
return new helixDistPipe<nodeType>();
}

return 0;
Expand Down
Loading

0 comments on commit d2498dc

Please sign in to comment.