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

Solve and Assemble Sparse Matrices #194

Open
3 of 4 tasks
HenningScheufler opened this issue Dec 15, 2024 · 2 comments
Open
3 of 4 tasks

Solve and Assemble Sparse Matrices #194

HenningScheufler opened this issue Dec 15, 2024 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@HenningScheufler
Copy link
Collaborator

HenningScheufler commented Dec 15, 2024

This feature adds the capability to create sparse matrices.

This requires the following features:

  • sparse matrix class (CSR)
  • design API to assemble matrix (minimal solution)
  • pass matrix to external solvers (Ginkgo and Petsc)
  • solve linear system with different algorithm (by specifying dictionary entires)
@HenningScheufler HenningScheufler added this to the 0.2 Release milestone Dec 15, 2024
@HenningScheufler HenningScheufler added the enhancement New feature or request label Dec 15, 2024
@greole greole added planing planning issues which are needed to structure our roadmap and removed planing planning issues which are needed to structure our roadmap labels Dec 26, 2024
@happyKitesurfer
Copy link
Collaborator

happyKitesurfer commented Jan 2, 2025

Hello, do you plan to download and configure petsc with the cmake functionality? I'm trying to accomplish this (I'm still working on a small test):

cmake_minimum_required(VERSION 3.22.0)
project(petsc_test)


message("${CMAKE_BINARY_DIR}")

include(ExternalProject)
include(CheckLanguage)
message("installing petsc")
check_language(CUDA)
  if(CMAKE_CUDA_COMPILER)
          set(PETSC_ENABLE_CUDA 1)
else()
      set(PETSC_ENABLE_CUDA 0)
endif()

message("${PETSC_ENABLE_CUDA}")
message("${CMAKE_CUDA_COMPILER}")
cmake_path(GET "${CMAKE_CUDA_COMPILER}" PARENT_PATH CUDA_D)

ExternalProject_Add(
  petsc
 GIT_SHALLOW ON
 GIT_REPOSITORY "https://gitlab.com/petsc/petsc.git"
 GIT_TAG v3.22.2
 PREFIX ${CMAKE_BINARY_DIR}/petsc
 #BINARY_DIR ${CMAKE_BINARY_DIR}/petsc
 BUILD_IN_SOURCE YES
 #SOURCE_DIR ${CMAKE_BINARY_DIR}/petsc
#    SOURCE_DIR /home/michael/NeoFOAM/NeoFOAM/build/develop/_deps/petsc-src 
    #CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
 CONFIGURE_COMMAND   ./configure  --with-64-bit-indices=0 --with-precision=double --with-cuda=${PETSC_ENABLE_CUDA} --with-cuda-dir=/usr/local/cuda-12.3 --with-mpi=1 --with-fc=0 --force --with-32bits-pci-domain=1  --with-cc=mpicc --with-cxx=mpicxx --with-debugging=no --prefix=${CMAKE_BINARY_DIR}/petsc/opt/petsc
  BUILD_COMMAND make PETSC_DIR=${CMAKE_BINARY_DIR}/petsc/src/petsc PETSC_ARCH=arch-linux-c-opt all
 INSTALL_COMMAND make PETSC_DIR=${CMAKE_BINARY_DIR}/petsc/src/petsc PETSC_ARCH=arch-linux-c-opt install
)

When the download, configuration, build and installation works, I plan to write a small test in catch2 which includes petsc and solves a small matrix. Still have to replace some configuration options with cmake internal variables.

Should I make a branch and implement this?

@greole
Copy link
Contributor

greole commented Jan 2, 2025

Please also take a look at #201 (currently i fail to propagate the compile definitions to ginkgo though). If you have a working version of building with PETSc please feel free to open a PR against the stack/linalg branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants