Utilities::MPI::broadcas doesn't work

32 views
Skip to first unread message

ztdep...@gmail.com

unread,
Nov 2, 2023, 10:26:46 AM11/2/23
to deal.II User Group
I tried to sent a double vector with size of 5 to all other cpus. 
but it seems no values have been broadcase out.
only the root has values in tt vector. all other cpus only have zero values in tt. 
 Could you please help me out.

vector<double> tt(5);
 if(Utilities::MPI::this_mpi_process(mpi_communicator)==0) {
      for(int i=0;i<tt.size();i++) tt[i]=1.0*i;}
  Utilities::MPI::broadcast(mpi_communicator,tt);
 
  

Bruno Turcksin

unread,
Nov 2, 2023, 11:40:29 AM11/2/23
to deal.II User Group
Hello,

broadcast returns the updated value. tt is unchanged. See the documentation here

Best,

Bruno
Reply all
Reply to author
Forward
0 new messages