1 #ifndef CNTR_MPITOOLS_IMPL_H 2 #define CNTR_MPITOOLS_IMPL_H 36 assert(tstp == G.
tstp());
38 MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
40 assert(tstp == Gred.
tstp());
46 int len = 2 * (2 * (tstp + 1) + G.
ntau() + 1) * G.
size1() * G.
size2();
48 if (
sizeof(T) ==
sizeof(
double)) {
49 MPI_Reduce((
double *)G.data_, (
double *)Gred.data_, len, MPI_DOUBLE_PRECISION, MPI_SUM, root,
52 if (taskid == root) std::cerr <<
"herm_matrix_timestep<T>::MPI_Reduce only for double " << std::endl;
84 assert(tstp == G.
tstp());
86 MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
88 assert(tstp == Gred.
tstp());
94 int len_rt = 2 * (tstp + 1) * G.
size1() * G.
size2();
97 if (
sizeof(T) ==
sizeof(
double)) {
99 MPI_Reduce((
double *)G.mat_, (
double *)Gred.mat_, len_it, MPI_DOUBLE_PRECISION, MPI_SUM, root,
102 MPI_Reduce((
double *)G.les_, (
double *)Gred.les_, len_rt, MPI_DOUBLE_PRECISION, MPI_SUM, root,
104 MPI_Reduce((
double *)G.ret_, (
double *)Gred.ret_, len_rt, MPI_DOUBLE_PRECISION, MPI_SUM, root,
106 MPI_Reduce((
double *)G.tv_, (
double *)Gred.tv_, len_it, MPI_DOUBLE_PRECISION, MPI_SUM, root,
111 if (taskid == root) std::cerr <<
"herm_matrix_timestep_view<T>::MPI_Reduce only for double " << std::endl;
143 assert(tstp == G.
tstp());
145 MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
146 if (taskid == root) {
147 assert(tstp <= Gred.
nt());
190 assert(tstp == G.
tstp());
192 MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
193 if (taskid == root) {
194 assert(tstp <= Gred.
nt());
200 bool check_tstp = (taskid == root);
232 assert(tstp <= G.
nt());
234 MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
235 if (taskid == root) {
236 assert(tstp == Gred.
tstp());
274 assert(tstp <= G.
nt());
276 MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
277 if (taskid == root) {
278 assert(tstp == Gred.
tstp());
314 assert(tstp <= G.
nt());
316 MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
317 if (taskid == root) {
318 assert(tstp <= Gred.
nt());
324 bool check_tstp = (taskid == root);
336 #endif // CNTR_MPITOOLS_IMPL_H Class herm_matrix_timestep_view serves for interfacing with class herm_matrix_timestep without copyi...
void get_timestep(int tstp, herm_matrix_timestep< T > ×tep) const
Class herm_matrix_timestep deals with contour objects at a particular timestep .
void resize(int nt, int ntau, int size1)
Resizes herm_matrix_timestep object with respect to the number of points on the Matsubara branch and...
Class herm_matrix for two-time contour objects with hermitian symmetry.
void set_timestep(int tstp, herm_matrix &g1)
Sets all components at time step tstp to the components of a given herm_matrix. ...
void Reduce_timestep(int tstp, int root, herm_matrix_timestep< T > &Gred, herm_matrix_timestep< T > &G)
MPI reduce for the herm_matrix_timestep to a herm_matrix_timestep