Skip to content

Commit

Permalink
Split into RAPtor and RAPtor-sparse
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanda Bienz authored and Amanda Bienz committed Jul 11, 2024
1 parent 985337d commit f3fd130
Show file tree
Hide file tree
Showing 147 changed files with 162 additions and 19,385 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "external/googletest"]
path = external/googletest
url = https://github.com/google/googletest.git
[submodule "raptor-sparse"]
path = raptor-sparse
url = https://github.com/raptor-library/raptor-sparse.git
52 changes: 14 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ enable_language(CXX)
set(CMAKE_CXX_STANDARD 11)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wredundant-decls -Wcast-align -Wshadow")
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -funroll-loops")


add_compile_definitions(RAPTOR_SPARSE_TEST_FOLDER="${CMAKE_SOURCE_DIR}/raptor-sparse/src/tests/")
add_compile_definitions(RAPTOR_TEST_FOLDER="${CMAKE_SOURCE_DIR}/raptor/tests/")

include(FeatureSummary)

Expand All @@ -18,15 +21,13 @@ option(WITH_HYPRE "Add Hypre" OFF)
option(WITH_MUELU "Add Trilinos MueLu" OFF)
option(WITH_MFEM "Add MFEM" OFF)
option(WITH_PETSC "Add Petsc" OFF)
option(WITH_AMPI "Using AMPI" OFF)
option(WITH_MPI "Using MPI" ON)
option(WITH_HOSTFILE "Use a Hostfile with MPI" OFF)

add_feature_info(hypre WITH_HYPRE "Hypre preconditioner")
add_feature_info(ml WITH_MUELU "Trilinos MueLu preconditioner")
add_feature_info(mfem WITH_MFEM "MFEM matrix gallery")
add_feature_info(petsc WITH_PETSC "Petsc Interface")
add_feature_info(ampi WITH_AMPI "Compile with AMPI")
add_feature_info(crayxe CRAYXE "Compile on CrayXE")
add_feature_info(bgq BGQ "Compile on BGQ")
add_feature_info(ptscotch WITH_PTSCOTCH "Enable PTScotch Partitioning")
Expand All @@ -45,8 +46,9 @@ if (WITH_MPI)
SET(MPIRUN mpirun)
endif (WITH_MPI)

#include_directories("external")
set(raptor_INCDIR ${CMAKE_CURRENT_SOURCE_DIR}/raptor)
set(raptor_sparse_DIR raptor-sparse/src)
set(raptor_sparse_INCDIR ${CMAKE_CURRENT_SOURCE_DIR}/${raptor_sparse_DIR})
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

SET(HYPRE_DIR "" CACHE STRING "Directory of HYPRE")
Expand All @@ -58,37 +60,12 @@ SET(PETSC_DIR "" CACHE STRING "Directory of petsc")
SET(PTSCOTCH_DIR "" CACHE STRING "Directory of Ptscotch")
SET(PARMETIS_DIR "" CACHE STRING "Directory of ParMetis")
SET(HOSTFILE "" CACHE STRING "Set Hostfile")
SET(BLAS_PATH "" CACHE STRING "/usr/linb/x86_64-linux-gnu")
SET(LAPACK_PATH "" CACHE STRING "/usr/linb/x86_64-linux-gnu")

if (CRAYXE)
set(EXTERNAL_LIBS "")
set(MPIRUN aprun)
set(CMAKE_AR "gcc-ar-4.7")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_FINISH true)
elseif (BGQ)
find_library(LAPACK_LIB NAMES liblapack lapack HINTS
"/soft/libraries/alcf/current/xl/LAPACK/lib")
find_library(BLAS_LIB NAMES libblas blas HINTS
"/soft/libraries/alcf/current/xl/BLAS/lib")
find_library(ESSL_LIB NAMES libesslbg esslbg HINTS
"/soft/libraries/essl/current/essl/5.1/lib64")
find_library(XLF_LIB NAMES libxlf90_r.a xlf90_r HINTS
"/soft/compilers/ibmcmp-may2016/xlf/bg/14.1/bglib64")
find_library(XLOPT_LIB NAMES libxlopt.a xlopt HINTS
"/soft/compilers/ibmcmp-may2016/xlf/bg/14.1/bglib64")
find_library(XLFMATH_LIB NAMES libxlfmath.a xlfmath HINTS
"/soft/compilers/ibmcmp-may2016/xlf/bg/14.1/bglib64")
find_library(XL_LIB NAMES libxl.a xl HINTS
"/soft/compilers/ibmcmp-may2016/xlf/bg/14.1/bglib64")
find_library(XLSMP_LIB NAMES libxlomp_ser.a xlomp_ser HINTS
"/soft/compilers/ibmcmp-may2016/xlsmp/bg/3.1/bglib64")
set(EXTERNAL_LIBS ${LAPACK_LIB} ${BLAS_LIB} ${ESSL_LIB} ${XLF_LIB}
${XLOPT_LIB} ${XLFMATH_LIB} ${XL_LIB} ${XLSMP_LIB})
else()
find_library(LAPACK_LIB NAMES liblapack.so.3 lapack HINTS "/usr/lib/x86_64-linux-gnu/")
find_library(BLAS_LIB NAMES libblas.so.3 blas HINTS "/usr/lib/x86_64-linux-gnu/")
set(EXTERNAL_LIBS ${LAPACK_LIB} ${BLAS_LIB})
endif()
find_library(LAPACK_LIB NAMES liblapack.so.3 lapack HINTS ${LAPACK_PATH})
find_library(BLAS_LIB NAMES libblas.so.3 blas HINTS ${BLAS_PATH})
set(EXTERNAL_LIBS ${LAPACK_LIB} ${BLAS_LIB})

if (WITH_HOSTFILE)
find_file (FILE_OF_HOST, ${HOSTFILE})
Expand Down Expand Up @@ -180,10 +157,9 @@ if(WITH_PETSC)
endif(PETSC_FOUND)
endif(WITH_PETSC)

if (WITH_AMPI)
add_definitions(-DUSE_AMPI)
endif(WITH_AMPI)

include_directories(${CMAKE_SOURCE_DIR}/raptor-sparse)
include_directories(${CMAKE_SOURCE_DIR}/raptor-sparse/src)
add_subdirectory(raptor-sparse/src)
add_subdirectory(raptor)

if (BUILD_EXAMPLES)
Expand Down
8 changes: 8 additions & 0 deletions config/raptor-sparseConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@PACKAGE_INIT@

if(NOT TARGET raptor-sparse AND NOT raptor-sparse_BINARY_DIR)
include("${CMAKE_CURRENT_LIST_DIR}/raptor-sparseTargets.cmake")
endif()

find_package(Threads REQUIRED)
find_package(MPI COMPONENTS CXX REQUIRED)
1 change: 1 addition & 0 deletions raptor-sparse
Submodule raptor-sparse added at 0463db
22 changes: 8 additions & 14 deletions raptor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
add_subdirectory(core)
add_subdirectory(gallery)
add_subdirectory(util)
add_subdirectory(precondition)
add_subdirectory(ruge_stuben)
add_subdirectory(aggregation)
add_subdirectory(multilevel)
Expand All @@ -17,9 +15,10 @@ else()
)
endif()

add_library(raptor ${core_SOURCES} ${core_HEADERS}
${gallery_SOURCES} ${gallery_HEADERS} ${ext_gallery_HEADERS}
${util_SOURCES} ${util_HEADERS}
message(STATUS ${sparse_SOURCES})

add_library(raptor
${precond_SOURCES} ${precond_HEADERS}
${par_SOURCES} strength.cpp
${ruge_stuben_SOURCES} ${ruge_stuben_HEADERS}
${aggregation_SOURCES} ${aggregation_HEADERS}
Expand All @@ -28,7 +27,7 @@ add_library(raptor ${core_SOURCES} ${core_HEADERS}
${profile_SOURCES} ${profile_HEADERS}
${external_SOURCES} ${external_HEADERS})

target_link_libraries(raptor PUBLIC ${MPI_C_LIBRARIES} ${MFEM_LIBRARIES} ${METIS_LIBRARIES} ${HYPRE_LIBRARIES}
target_link_libraries(raptor PUBLIC raptor-sparse ${MPI_C_LIBRARIES} ${MFEM_LIBRARIES} ${METIS_LIBRARIES} ${HYPRE_LIBRARIES}
${MUELU_LIBRARIES} ${PETSC_LIBRARIES} ${PTSCOTCH_LIBRARIES} ${PARMETIS_LIBRARIES} ${EXTERNAL_LIBS})

target_include_directories(raptor
Expand All @@ -42,11 +41,8 @@ install(TARGETS raptor
EXPORT raptorTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES raptor.hpp DESTINATION "include/raptor")
install(FILES ${core_HEADERS} DESTINATION "include/raptor/core")
install(FILES ${gallery_HEADERS} DESTINATION "include/raptor/gallery")
install(FILES ${ext_gallery_HEADERS} DESTINATION "include/raptor/gallery/external")
install(FILES ${util_HEADERS} DESTINATION "include/raptor/util/linalg")
install(FILES ${ext_util_HEADERS} DESTINATION "include/raptor/util/linalg/external")
install(FILES ${precond_HEADERS} DESTINATION "include/raptor/precondition")
install(FILES ${ruge_stuben_HEADERS} DESTINATION "include/raptor/ruge_stuben")
install(FILES ${aggregation_HEADERS} DESTINATION "include/raptor/aggregation")
install(FILES ${multilevel_HEADERS} DESTINATION "include/raptor/multilevel")
Expand All @@ -72,12 +68,10 @@ install(

if(ENABLE_UNIT_TESTS)
add_subdirectory(tests)
add_subdirectory(core/tests)
add_subdirectory(util/tests)
add_subdirectory(precondition/tests)
add_subdirectory(ruge_stuben/tests)
add_subdirectory(aggregation/tests)
add_subdirectory(multilevel/tests)
add_subdirectory(gallery/tests)
add_subdirectory(krylov/tests)
add_subdirectory(external/tests)
endif()
3 changes: 1 addition & 2 deletions raptor/aggregation/aggregate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#ifndef RAPTOR_AGGREGATION_AGGREGATE_HPP
#define RAPTOR_AGGREGATION_AGGREGATE_HPP

#include "raptor/core/types.hpp"
#include "raptor/core/matrix.hpp"
#include "raptor-sparse.hpp"
#include "mis.hpp"

namespace raptor {
Expand Down
3 changes: 1 addition & 2 deletions raptor/aggregation/candidates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#ifndef RAPTOR_AGGREGATION_CANDIDATES_HPP
#define RAPTOR_AGGREGATION_CANDIDATES_HPP

#include "raptor/core/types.hpp"
#include "raptor/core/matrix.hpp"
#include "raptor-sparse.hpp"

namespace raptor {
// TODO -- currently only accepts constant vector
Expand Down
3 changes: 1 addition & 2 deletions raptor/aggregation/mis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#ifndef RAPTOR_AGGREGATION_MIS_HPP
#define RAPTOR_AGGREGATION_MIS_HPP

#include "raptor/core/types.hpp"
#include "raptor/core/matrix.hpp"
#include "raptor-sparse.hpp"

namespace raptor {

Expand Down
3 changes: 1 addition & 2 deletions raptor/aggregation/par_aggregate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#ifndef RAPTOR_AGGREGATION_PAR_AGGREGATE_HPP
#define RAPTOR_AGGREGATION_PAR_AGGREGATE_HPP

#include "raptor/core/types.hpp"
#include "raptor/core/par_matrix.hpp"
#include "raptor-sparse.hpp"
#include "par_mis.hpp"

namespace raptor {
Expand Down
3 changes: 1 addition & 2 deletions raptor/aggregation/par_candidates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#ifndef RAPTOR_AGGREGATION_PAR_CANDIDATES_HPP
#define RAPTOR_AGGREGATION_PAR_CANDIDATES_HPP

#include "raptor/core/types.hpp"
#include "raptor/core/par_matrix.hpp"
#include "raptor-sparse.hpp"

namespace raptor {
// TODO -- currently only accepts constant vector
Expand Down
3 changes: 1 addition & 2 deletions raptor/aggregation/par_mis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#ifndef RAPTOR_AGGREGATION_PAR_MIS_HPP
#define RAPTOR_AGGREGATION_PAR_MIS_HPP

#include "raptor/core/types.hpp"
#include "raptor/core/par_matrix.hpp"
#include "raptor-sparse.hpp"

namespace raptor {

Expand Down
4 changes: 1 addition & 3 deletions raptor/aggregation/par_prolongation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
#ifndef RAPTOR_AGGREGATION_PAR_PROLONGATION_HPP
#define RAPTOR_AGGREGATION_PAR_PROLONGATION_HPP

#include "raptor/core/types.hpp"
#include "raptor/core/par_matrix.hpp"
#include "raptor/core/par_vector.hpp"
#include "raptor-sparse.hpp"

namespace raptor {
ParCSRMatrix* jacobi_prolongation(ParCSRMatrix* A, ParCSRMatrix* T, bool tap_comm = false,
Expand Down
4 changes: 1 addition & 3 deletions raptor/aggregation/prolongation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
#ifndef RAPTOR_AGGREGATION_PROLONGATION_HPP
#define RAPTOR_AGGREGATION_PROLONGATION_HPP

#include "raptor/core/types.hpp"
#include "raptor/core/matrix.hpp"
#include "raptor/core/vector.hpp"
#include "raptor-sparse.hpp"

namespace raptor {
CSRMatrix* jacobi_prolongation(CSRMatrix* A, CSRMatrix* T, double omega = 4.0/3,
Expand Down
47 changes: 0 additions & 47 deletions raptor/core/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion raptor/core/README.md

This file was deleted.

88 changes: 0 additions & 88 deletions raptor/core/comm_data.cpp

This file was deleted.

Loading

0 comments on commit f3fd130

Please sign in to comment.