NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ Bcast_timestep()

template<typename T >
void cntr::function< T >::Bcast_timestep ( int  tstp,
int  root 
)

Broadcast a time step of the function using MPI

Purpose

Broadcast a time step of the function using MPI. The value at one time step is broadcasted from the root process to all other processes.

Parameters
tstp

the time step. The value at time point tstp is broadcasted

root

the root index. The process indexed by root will send its data. Others will receive data.

Definition at line 1097 of file cntr_function_impl.hpp.

1097  {
1098  int numtasks,taskid;
1099  cdmatrix ftemp;
1100  ftemp.resize(size1_,size2_);
1101  MPI_Comm_size(MPI_COMM_WORLD, &numtasks);
1102  MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
1103  if(taskid==root) this->get_value(tstp,ftemp);
1104  // if(sizeof(T)==sizeof(double)) MPI::COMM_WORLD.Bcast(ftemp.data(),ftemp.size(),MPI::DOUBLE_COMPLEX,root);
1105  // else MPI::COMM_WORLD.Bcast(ftemp.data(),ftemp.size(),MPI::COMPLEX,root);
1106  if(sizeof(T)==sizeof(double)) MPI_Bcast(ftemp.data(),ftemp.size(),MPI_DOUBLE_COMPLEX,root,MPI_COMM_WORLD);
1107  if(taskid!=root) this->set_value(tstp,ftemp);
1108 }
int size2_
Number of the rows in the Matrix form.
int size1_
Number of the colums in the Matrix form.
void get_value(int tstp, EigenMatrix &M) const
Get matrix value of this function object at a specific time point
void set_value(int tstp, EigenMatrix &M)
Set matrix value at a specific time point