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

eigenvector I/O is too slow #56

Open
kostrzewa opened this issue Apr 8, 2018 · 2 comments
Open

eigenvector I/O is too slow #56

kostrzewa opened this issue Apr 8, 2018 · 2 comments

Comments

@kostrzewa
Copy link
Member

kostrzewa commented Apr 8, 2018

eigenvectors are read one eigenvector at a time and vector elements are copied one element at at time into (V[t])(nrow,ncol).

  1. Eigensystem should be read into buffer in one go (per time slice)
  2. Copying should be done one full eigenvector at a time

Does Eigen store row or column major layout by default? Is the data pointer accessible? One could perhaps perform a fast transposition if the reading buffer is taken as the storage buffer for an Eigen matrix.

@kostrzewa
Copy link
Member Author

The eigenvectors on disk are stored in a column-major order (with the N_ev columns corresponding to 3xL^3 complex vectors). Eigen uses column-major order by default too, so it should be possible to rather straightforwardly write into the V[t] matrices one full eigenvector at a time.

@kostrzewa
Copy link
Member Author

kostrzewa commented Apr 8, 2018

The other option would be to directly use Eigen::Map on top of the readin buffer and perform a simple assigment to copy the data into V[t], it would likely be quite efficient.

Something like

Eigen::Map<MatrixXcd> buff_matrix(buffer, row_length, N_ev);
(V[t]).col(ncol) = buff_matrix.col(ncol);

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

No branches or pull requests

2 participants