NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ Reduce_timestep() [7/7]

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

MPI reduce for the herm_matrix to a herm_matrix

Purpose

MPI reduce for the herm_matrix 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 on the individual ranks.

Definition at line 312 of file cntr_mpitools_impl.hpp.

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

313  {
314  assert(tstp <= G.nt());
315  int taskid;
316  MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
317  if (taskid == root) {
318  assert(tstp <= Gred.nt());
319  assert(G.ntau() == Gred.ntau());
320  assert(G.size1() == Gred.size1());
321  assert(G.size2() == Gred.size2());
322  }
323 
324  bool check_tstp = (taskid == root);
325  herm_matrix_timestep_view<T> Gred_tmp(tstp, Gred, check_tstp);
326  herm_matrix_timestep_view<T> Garr_tmp(tstp, G);
327 
328  Reduce_timestep(tstp, root, Gred_tmp, Garr_tmp);
329 }
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: