Skip to content

Commit

Permalink
Merge pull request #581 from mmuetzel/ci-ubuntu
Browse files Browse the repository at this point in the history
Build with rocALUTION in CI on Ubuntu (and fix some build issues)
  • Loading branch information
raback authored Sep 30, 2024
2 parents 1930737 + cc40079 commit 8f989c8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,19 @@ jobs:
$([ "${{ matrix.mpi }}" == "with" ] && echo "libhypre-dev") \
$([ "${{ matrix.mpi }}" == "with" ] && echo "libopenmpi-dev libmumps-dev libparmetis-dev") \
$([ "${{ matrix.compiler }}" == "gcc" ] && echo "libsuitesparse-dev") \
$([ "${{ matrix.compiler }}" == "gcc" ] && [ "${{ matrix.mpi }}" == "with" ] && echo "librocalution-dev") \
libqwt-qt5-dev qtscript5-dev libqt5svg5-dev \
libvtk9-qt-dev libglvnd-dev \
occt-misc libocct-data-exchange-dev libocct-draw-dev \
$([ "${{ matrix.mpi }}" == "with" ] && echo "trilinos-all-dev libptscotch-dev")
- name: configure
# CHOLMOD requires a working OpenMP package. So, disable it for clang.
# CHOLMOD and rocALUTION require a working OpenMP package. So, disable them for clang.
run: |
# work around error in the rocALUTION CMake config file distributed by Ubuntu
if [ "${{ matrix.compiler }}" == "gcc" ] && [ "${{ matrix.mpi }}" == "with" ]; then
sudo sed -i '/find_dependency(HIP)/d' /usr/lib/x86_64-linux-gnu/cmake/rocalution/rocalution-config.cmake
fi
mkdir ${GITHUB_WORKSPACE}/build
cd ${GITHUB_WORKSPACE}/build
cmake \
Expand All @@ -106,6 +111,7 @@ jobs:
$([ "${{ matrix.mpi }}" == "with" ] && echo "-DWITH_Mumps=ON" || echo "-DWITH_Mumps=OFF") \
$([ "${{ matrix.compiler }}" == "gcc" ] && echo "-DWITH_CHOLMOD=ON" || echo "-DWITH_CHOLMOD=OFF") \
$([ "${{ matrix.mpi }}" == "with" ] && echo "-DWITH_Hypre=ON -DHYPRE_INCLUDE_DIR=/usr/include/hypre" || echo "-DWITH_Hypre=OFF") \
$([ "${{ matrix.compiler }}" == "gcc" ] && [ "${{ matrix.mpi }}" == "with" ] && echo "-DWITH_ROCALUTION=ON" || echo "-DWITH_ROCALUTION=OFF") \
$([ "${{ matrix.mpi }}" == "with" ] && echo "-DWITH_ElmerIce=ON" || echo "-DWITH_ElmerIce=OFF") \
-DWITH_ELMERGUI=ON \
-DWITH_VTK=ON \
Expand Down
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ ENDIF(WITH_MPI)

IF (WITH_ROCALUTION)

IF(NOT WITH_MPI)
MESSAGE(FATAL_ERROR "Building with rocALUTION requires MPI")
ENDIF()

MESSAGE(STATUS "------------------------------------------------")
MESSAGE(STATUS "Looking for rocALUTION installation")

Expand All @@ -239,12 +243,6 @@ IF (WITH_ROCALUTION)

SET(HAVE_ROCALUTION TRUE CACHE BOOL "")
MARK_AS_ADVANCED(HAVE_ROCALUTION)
INCLUDE_DIRECTORIES("${ROCALUTION_INCLUDE_DIR}")
MESSAGE(STATUS " ---------------------------------")
MESSAGE(STATUS " ROCALTUION: " "${HAVE_ROCALUTION}")
MESSAGE(STATUS " ROCALTUON_INCLUDE_DIR: " "${ROCALUTION_INCLUDE_DIR}")
MESSAGE(STATUS " ROCALTUON_LIBRARY: " "${ROCALUTION_LIBRARY}")
# LINK_DIRECTORIES("${ROCALUTION_LINK_DIRECTORIES}")
ENDIF()


Expand Down
6 changes: 3 additions & 3 deletions fem/src/rocalution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ void elmer_distribute_matrix(const MPI_Comm* comm,
int boundary_nnz = 0;
int neighbors = 0;

std::vector<std::vector<PtrType>> boundary(num_procs, std::vector<PtrType>());
std::vector<std::vector<int>> boundary(num_procs, std::vector<int>());
std::vector<bool> neighbor(num_procs, false);
std::vector<std::map<int, bool>> checked(num_procs, std::map<int, bool>());

for(int i = 0; i < local_nrow; ++i)
{
for(PtrType j = local_row_offset[i]; j < local_row_offset[i + 1]; ++j)
for(int j = local_row_offset[i]; j < local_row_offset[i + 1]; ++j)
{

// Interior point
Expand Down Expand Up @@ -275,7 +275,7 @@ void elmer_distribute_matrix(const MPI_Comm* comm,
}

// Create boundary index array
std::vector<PtrType> boundary_index(nnz_boundary);
std::vector<int> boundary_index(nnz_boundary);

k = 0;
for(int i = 0; i < neighbors; ++i)
Expand Down

0 comments on commit 8f989c8

Please sign in to comment.