29#ifndef _MPTENSOR_LOAD_HPP_
30#define _MPTENSOR_LOAD_HPP_
52template <
typename MatrixType>
54 const bool comm_root = (get_comm_rank() == 0);
79 if (
dummy !=
"mptensor") {
94 Mat.bcast(
ibuf, 8, 0);
127 std::clog <<
"Info: Load a tensor directly." << std::endl;
134 std::clog <<
"Info: Load a non-distributed tensor." << std::endl;
141 <<
"Info: Load a tensor distributed on different-size communicator."
159template <
typename MatrixType>
160void Tensor<MatrixType>::load_ver_0_2(
const char*
filename) {
167 if (get_comm_rank() == 0) {
168 std::clog <<
"Warning: \"" <<
filename
169 <<
"\" will be loaded using v0.2 interface." << std::endl;
174 if (get_comm_rank() == 0) {
180 const size_t count = 2 *
n + 1;
183 if (get_comm_rank() == 0) {
195 init(shape,
urank, map);
204 fin.read(
reinterpret_cast<char*
>(get_matrix().head()),
205 sizeof(value_type) * local_size());
void load(const std::string &filename)
Load a tensor from files.
Definition load.hpp:53
std::string filename(const std::string &prefix, int proc_size)
Definition common.hpp:32
std::complex< double > complex
Definition complex.hpp:38
Header file of helper functions for file io.
constexpr size_t MATRIX_TYPE_TAG_LAPACK
Definition matrix.hpp:34
constexpr size_t MATRIX_TYPE_TAG_SCALAPACK
Definition matrix.hpp:35
mptensor::complex complex
Definition matrix_lapack.cc:36
constexpr bool debug
Definition io_helper.hpp:46
void load_binary(const std::string &prefix, int comm_rank, C *data_head, std::size_t local_size)
Definition io_helper.hpp:66
void load_scalapack(const std::string &prefix, int loaded_comm_size, Matrix< C > &mat)
Definition io_helper.hpp:125
Definition complex.hpp:34
Index Shape
Definition tensor.hpp:46
Index Axes
Definition tensor.hpp:45