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

Segmentation fault at SymEigsShiftSolver initialization #66

Closed
jdbancal opened this issue May 18, 2019 · 4 comments
Closed

Segmentation fault at SymEigsShiftSolver initialization #66

jdbancal opened this issue May 18, 2019 · 4 comments

Comments

@jdbancal
Copy link
Contributor

When I run the following code, compiled with g++ -Ieigen -Ispectra/include smallestEigenvaluesError_simple.cpp, it reaches the initialization stage, but never goes any further. Did I do something wrong?

#include <iostream>
#include <Spectra/SymEigsShiftSolver.h>
#include <Spectra/MatOp/DenseSymShiftSolve.h>

int main () {


    { // This doesn't seem to work
        std::cout << "-- test --" << std::endl << std::flush;
        Eigen::Matrix< double, 8, 8> mat;
        mat <<                         0,                       0,                       0,                       0,                       0,  -2.4475453650814500000,  -3.5205938631136300000,  -1.0524810451403000000,
                                       0,                       0,                       0,                       0,   2.4475453650814500000,                       0,  -1.5069700890882000000,  -1.8131783397941900000,
                                       0,                       0,                       0,                       0,   3.5205938631136300000,   1.5069700890882000000,                       0,   2.4080291768596200000,
                                       0,                       0,                       0,                       0,   1.0524810451403000000,   1.8131783397941900000,  -2.4080291768596200000,                       0,
                                       0,   2.4475453650814500000,   3.5205938631136300000,   1.0524810451403000000,                       0,                       0,                       0,                       0,
                  -2.4475453650814500000,                       0,   1.5069700890882000000,   1.8131783397941900000,                       0,                       0,                       0,                       0,
                  -3.5205938631136300000,  -1.5069700890882000000,                       0,  -2.4080291768596200000,                       0,                       0,                       0,                       0,
                  -1.0524810451403000000,  -1.8131783397941900000,   2.4080291768596200000,                       0,                       0,                       0,                       0,                       0;

        // Desired number of eigenvalues
        int nbEigenvalues(1);

        // Construct eigen solver object, requesting desired eigenvalues
        Spectra::DenseSymShiftSolve<double> op(mat);
        int ncv(std::min(3+std::max(1+nbEigenvalues,2*nbEigenvalues), 8));
        Spectra::SymEigsShiftSolver< double, Spectra::LARGEST_MAGN, Spectra::DenseSymShiftSolve<double> > eigs(&op, nbEigenvalues, ncv, 1.0);

        // Initialize and compute
        std::cout << "Before initialization" << std::endl << std::flush;
        eigs.init();
        std::cout << "Initialization completed" << std::endl << std::flush;

        int maxIter(1000);
        int nconv = eigs.compute(maxIter, 0.000001, Spectra::LARGEST_MAGN);
        std::cout << "eigenvalues computed" << std::endl << std::flush;
    }

    return 0;
}

Here is the output I observe:

-- test --
Before initialization
Segmentation fault
@yixuan
Copy link
Owner

yixuan commented May 24, 2019

Was a bit busy on other duties. I will look into this shortly.

@jdbancal
Copy link
Contributor Author

Thanks! No big hurry on my side ;)

@yixuan
Copy link
Owner

yixuan commented Jun 1, 2019

Turns out to be a bug in BKLDLT and it has now been fixed.

@yixuan yixuan closed this as completed Jun 1, 2019
@jdbancal
Copy link
Contributor Author

Awesome, thanks!

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

No branches or pull requests

2 participants