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

Add Trilinos for linear solver #69

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

xDarkLemon
Copy link
Contributor

No description provided.

@xDarkLemon xDarkLemon changed the title Add Trilinos Add Trilinos for linear solver Feb 14, 2024
Copy link
Member

@teseoch teseoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you try to add to the ci (UNIX only) trilinos installed with apt?

@@ -153,6 +155,16 @@
],
"doc": "Settings for the AMGCL solver."
},
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think you need any of these, there are no options for trilinos

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to add the options from trilinos

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Eigen::MatrixXd test_vertices;
Eigen::MatrixXd init_vertices;
std::vector<int> test_boundary_nodes;
Eigen::MatrixXd remove_boundary_vertices(const Eigen::MatrixXd &vertices, const std::vector<int> &boundary_nodes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -25,6 +34,11 @@ namespace spdlog

namespace polysolve::linear
{
#ifdef POLYSOLVE_LARGE_INDEX
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why these changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

{
if (params.contains("Trilinos"))
{
if (params["Trilinos"].contains("block_size"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add these options to the spec

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now the block size is a method

extern Eigen::MatrixXd init_vertices;
extern Eigen::MatrixXd test_vertices;
extern std::vector<int> test_boundary_nodes;
Eigen::MatrixXd remove_boundary_vertices(const Eigen::MatrixXd &vertices, const std::vector<int> &boundary_nodes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be inside trilinos, not here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

CMakeLists.txt Show resolved Hide resolved
Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.84%. Comparing base (0cd21ba) to head (f920ea4).

Files Patch % Lines
src/polysolve/linear/Solver.hpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
- Coverage   81.20%   80.84%   -0.37%     
==========================================
  Files          49       47       -2     
  Lines        2001     1879     -122     
  Branches      267      257      -10     
==========================================
- Hits         1625     1519     -106     
+ Misses        376      360      -16     
Flag Coverage Δ
polysolve 80.84% <0.00%> (-0.37%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@teseoch teseoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need unit test, with and without block size and null space

@@ -77,9 +77,11 @@ option(POLYSOLVE_WITH_SUPERLU "Enable SuperLU library"
option(POLYSOLVE_WITH_MKL "Enable MKL library" ${POLYSOLVE_NOT_ON_APPLE_SILICON})
option(POLYSOLVE_WITH_CUSOLVER "Enable cuSOLVER library" OFF)
option(POLYSOLVE_WITH_PARDISO "Enable Pardiso library" OFF)
option(POLYSOLVE_WITH_HYPRE "Enable hypre" ON)
option(POLYSOLVE_WITH_HYPRE "Enable hypre" OFF)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on

@@ -4,6 +4,10 @@

#include <memory>

#include <Eigen/Dense>
#include <Eigen/Sparse>
#include <vector>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are not necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

{
if (params.contains("Trilinos"))
{
if (params["Trilinos"].contains("block_size"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now the block size is a method

{
conv_tol_ = params["Trilinos"]["tolerance"];
}
if (params["Trilinos"].contains("is_nullspace"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also a method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_nullspace is not necessary to exist anymore, so it is removed.

{
if (test_vertices.cols()==3)
{
reduced_vertices=remove_boundary_vertices(test_vertices,test_boundary_nodes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shoudnt be here, the null space is a method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is removed.

Eigen::MatrixXd test_vertices;
Eigen::MatrixXd init_vertices;
std::vector<int> test_boundary_nodes;
Eigen::MatrixXd remove_boundary_vertices(const Eigen::MatrixXd &vertices, const std::vector<int> &boundary_nodes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be inside an util file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved.

#include <Eigen/Sparse>
#include <vector>

#ifdef HAVE_MPI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mpi is always here?

// column-major matrix, the solver will actually solve A^T x = b.
//

extern Eigen::MatrixXd init_vertices;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no extern, this is not part of the api

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

#include "Teuchos_CommandLineProcessor.hpp"
#include "Epetra_Map.h"
#include "Epetra_Vector.h"
#include "Epetra_CrsMatrix.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need all these includes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are all pointers, we could forward declare

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants