This forum has been archived. All content is frozen. Please use KDE Discuss instead.

use mpicxx to compile an eigen code

Tags: None
(comma "," separated)
liwan
Registered Member
Posts
1
Karma
0

use mpicxx to compile an eigen code

Thu Sep 03, 2020 1:18 am
I Implemented the eigen memeber " ComplexEigenSolver<MatrixXcd>" in a MPI code and use mpicxx command to compile the code. It seems the eigen3 of version 3.2.10 works pretty good, but fails for the eigen3 of the new version 3.3.7. The code can be simplified to be

Code: Select all
#define MPICH_SKIP_MPICXX
#include <mpi.h>
#include <cmath>
#include <complex>
#include <Eigen/Eigenvalues>
using namespace std;
using namespace Eigen;


int main(int argc, char **argv)
{
MPI_Status status;
int my_id,  ierr, num_procs;
ierr = MPI_Init(&argc, &argv);
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &my_id);
ierr = MPI_Comm_size(MPI_COMM_WORLD, &num_procs);



MatrixXcd A=MatrixXcd:: Random(3,3);



if(my_id==0)
{
ComplexEigenSolver<MatrixXcd> es(A);
cout<<"es.eigenvalues() ="<<endl<< es.eigenvalues()<<endl;
}

ierr = MPI_Finalize();
return 0;
}


Then, I can use the command "mpicxx filename -o a" to compile this code sucessfully if version 3.2.10 of eigen3 is used. But fail for the version 3.3.7. The erro shows "Eigen/src/JacobiJacobi.h(455) : erro: expression must have a constant value Vectorizable>:: run(x, incrx, y, incry, size,c,s)".

Though I am not clear about what is the advantage of the new version over the previous version, I still intend to use the new one. But how to fix the problem for the compiling if the new version is included?


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]