29#ifndef _MPTENSOR_LOAD_HPP_
30#define _MPTENSOR_LOAD_HPP_
52template <
template <
typename>
class Matrix,
typename C>
54 const bool comm_root = (get_comm_rank() == 0);
79 if (
dummy !=
"mptensor") {
94 Mat.bcast(
ibuf, 8, 0);
129 std::clog <<
"Info: Load a tensor directly." << std::endl;
136 std::clog <<
"Info: Load a non-distributed tensor." << std::endl;
143 <<
"Info: Load a tensor distributed on different-size communicator."
161template <
template <
typename>
class Matrix,
typename C>
162void Tensor<Matrix, C>::load_ver_0_2(
const char*
filename) {
169 if (get_comm_rank() == 0) {
170 std::clog <<
"Warning: \"" <<
filename
171 <<
"\" will be loaded using v0.2 interface." << std::endl;
176 if (get_comm_rank() == 0) {
182 const size_t count = 2 *
n + 1;
185 if (get_comm_rank() == 0) {
199 init(shape,
urank, map);
208 fin.read(
reinterpret_cast<char*
>(get_matrix().head()),
209 sizeof(
C) * 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
tuple shape
Definition output.py:28