yes, -fopenmp is in the flag. I have tried many times. it doen'twork.

On 9/10/2020 20:47Gael Guennebaud<[email protected]> wrote:
Hi,

make sure to use Eigen's head, and to compile with OpenMP enabled on your compiler, for instance with -fopenmp with GCC.

Gaël

On Thu, Sep 10, 2020 at 6:25 AM ztdepyahoo <[email protected]> wrote:
I have set the tread =12 in the program .  Eigen::nbThreads( ) also feedbacks correct number. 
but the speed of solution seems doesn't change. 
what is the reason.
Regards



    Eigen::setNbThreads(12);
     int nthreads = Eigen::nbThreads( );
     std::cout << "THREADS = " << nthreads <<std::ends; // returns '1'
    BiCGSTAB<SparseMatrix<double, RowMajor>, IncompleteLUT<double>> solver;
    solver.setTolerance(1e-10);
    solver.setMaxIterations(1000);
    solver.compute(A);
    VectorXd x = solver.solve(b);

Reply via email to