t-sakashita / rokko

Integrated Interface for libraries of eigenvalue decomposition
Boost Software License 1.0
10 stars 2 forks source link

Lanczos法をRokkoのインターフェースに組み込む #158

Open t-sakashita opened 9 years ago

t-sakashita commented 9 years ago

tutorial/titpack2にあるLanczos法のコードを、Rokkoの疎行列ソルバに組み込む。

目的

t-sakashita commented 5 years ago

早めに行う。

t-sakashita commented 5 years ago

お願いします。 @wistaria

t-sakashita commented 4 years ago

556a114d693cf7bf6b9bf90b6e757edd43a2c96a

t-sakashita commented 4 years ago

関数化した。 6defd1a004a2b4077a72a9b451d2a4c7535c3856 5c8f3e96a28207a5bdd69fcf7de892992549e786

t-sakashita commented 4 years ago

ScaLAPACKの三重対角行列に対する固有値計算ルーチンを用いる。

t-sakashita commented 4 years ago

内積の並列版が必要。

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

t-sakashita commented 3 years ago

現状では、全MPIプロセスで、同じ計算を実行している。 少ないメモリで巨大な行列の固有ベクトルを求めるためには、以下を行うべき。