NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ Reduce_timestep() [3/7]

template<typename T >
void cntr::Reduce_timestep ( int  tstp,
int  root,
herm_matrix< T > &  Gred,
herm_matrix_timestep< T > &  G 
)

MPI reduce for the herm_matrix_timestep to a herm_matrix

Purpose

MPI reduce for the herm_matrix_timestep to a herm_matrix on rank root. Works for scalar or square-matrix contour objects.

Parameters
tstp

time step

root

Index of root

Gred

The reduced herm_matrix on rank root.

G

The herm_matrix_timestep on the individual ranks.

Definition at line 141 of file cntr_mpitools_impl.hpp.

References cntr::herm_matrix< T >::nt(), cntr::herm_matrix_timestep< T >::ntau(), cntr::herm_matrix< T >::ntau(), Reduce_timestep(), cntr::herm_matrix_timestep< T >::resize(), cntr::herm_matrix< T >::set_timestep(), cntr::herm_matrix_timestep< T >::size1(), cntr::herm_matrix< T >::size1(), cntr::herm_matrix_timestep< T >::size2(), cntr::herm_matrix< T >::size2(), and cntr::herm_matrix_timestep< T >::tstp().

142  {
143  assert(tstp == G.tstp());
144  int taskid;
145  MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
146  if (taskid == root) {
147  assert(tstp <= Gred.nt());
148  assert(G.ntau() == Gred.ntau());
149  assert(G.size1() == Gred.size1());
150  assert(G.size2() == Gred.size2());
151  }
152 
153  herm_matrix_timestep<T> Gtemp;
154  if (taskid == root){
155  Gtemp.resize(tstp, G.ntau(), G.size1());
156  }
157 
158  Reduce_timestep(tstp, root, Gtemp, G);
159 
160  if (taskid == root){
161  Gred.set_timestep(tstp, Gtemp);
162  }
163 }
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
+ Here is the call graph for this function: