NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ Reduce_timestep() [5/7]

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

MPI reduce for the herm_matrix to a herm_matrix_timestep

Purpose

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

Parameters
tstp

time step

root

Index of root

Gred

The reduced herm_matrix_timestep on rank root.

G

The herm_matrix on the individual ranks.

Definition at line 230 of file cntr_mpitools_impl.hpp.

References cntr::herm_matrix< T >::get_timestep(), 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_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().

231  {
232  assert(tstp <= G.nt());
233  int taskid;
234  MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
235  if (taskid == root) {
236  assert(tstp == Gred.tstp());
237  assert(G.ntau() == Gred.ntau());
238  assert(G.size1() == Gred.size1());
239  assert(G.size2() == Gred.size2());
240  }
241 
242  herm_matrix_timestep<T> Gtemp;
243  Gtemp.resize(tstp, G.ntau(), G.size1());
244  G.get_timestep(tstp, Gtemp);
245 
246  Reduce_timestep(tstp, root, Gred, Gtemp);
247 
248 }
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: