Open t-sakashita opened 9 years ago
早めに行う。
お願いします。 @wistaria
556a114d693cf7bf6b9bf90b6e757edd43a2c96a
関数化した。 6defd1a004a2b4077a72a9b451d2a4c7535c3856 5c8f3e96a28207a5bdd69fcf7de892992549e786
ScaLAPACKの三重対角行列に対する固有値計算ルーチンを用いる。
内積の並列版が必要。
template<typename T, int SIZE>
T inner_product(const Eigen::Vector<T, SIZE>& v, const Eigen::Vector<T, SIZE>& w, MPI_Comm comm) {
T local_sum = v.dot(w);
T sum;
MPI_AllReduce(&local_sum, &sum, 1, rokko::mpi_type<T>,
MPI_SUM, comm);
return sum;
}
template<typename T, int SIZE>
T norm(const Eigen::Vector<T, SIZE>& v, MPI_Comm comm) {
T local_sum = v.squaredNorm();
T sum;
MPI_AllReduce(&local_sum, &sum, 1, rokko::mpi_type<T>,
MPI_SUM, comm);
return sum;
}
da0923098ce50255837de92bf7ed97e2a2f69aa5
現状では、全MPIプロセスで、同じ計算を実行している。 少ないメモリで巨大な行列の固有ベクトルを求めるためには、以下を行うべき。
u
に保存しない。
original
は本番計算用ではなく、コードの簡単なため、今のところ、上記は実装の改良はしない。
tutorial/titpack2にあるLanczos法のコードを、Rokkoの疎行列ソルバに組み込む。
目的