Maxi, there is nothing special about MPI communication "with deal.II", it is just using MPI. I don't see enough information from your code snippet, so you have to investigate yourself. Some pointers: - make sure all processors participate - make sure module.data_size is the number of doubles, not the number of bytes - make sure all processors pass the same module.data_size
Best, Timo On Mon, Feb 19, 2018 at 5:39 AM, 'Maxi Miller' via deal.II User Group <[email protected]> wrote: > Hei, > I was wondering what the correct way is to use MPI_Bcast in a > deal.II-program. Currently I am using it in the following way: > print_status_update(pcout, std::string("Transmitting pulse data of > size ") + std::to_string(module.data_size) + std::string("\n"), true); > //MPI_Bcast(module.pulse_intensity.memptr(), module.data_size, > MPI_DOUBLE, Utilities::MPI::this_mpi_process(mpi_communicator), > MPI_COMM_WORLD); > print_status_update(pcout, std::string("Transmitting old pulse > data\n"), true); > MPI_Bcast(module.old_pulse_intensity.memptr(), module.data_size, > MPI_DOUBLE, 0, MPI_COMM_WORLD); > print_status_update(pcout, std::string("Both data matrices > transmitted\n"), true); > with module.old_pulse_intensity.memptr() the pointer to the memory to be > transmitted and module.data_size the amount of doubles to be transmitted, > from the root node to all the other nodes. Is that approach correct? > Currently my program hangs when executing this line (MPI_Bcast) when running > it on more than one node. Do I have to use something else than "0" for > indicating the root node? > > Thanks! > > -- > The deal.II project is located at > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dealii.org_&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=tnGBi40Mnj-dzPJCqcSw7C9XgqSYphIXZnOwrFLc9Ps&s=pWxgDSeJGn3574NbERT7BHh737iLkeKx46EstdRSTpE&e= > > For mailing list/forum options, see > https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_forum_dealii-3Fhl-3Den&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=tnGBi40Mnj-dzPJCqcSw7C9XgqSYphIXZnOwrFLc9Ps&s=ln9YPs6RYKaG-XNWThBlEgXRibYYeQisqZpb_hU4qZs&e= > > --- > You received this message because you are subscribed to the Google Groups > "deal.II User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit > https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=tnGBi40Mnj-dzPJCqcSw7C9XgqSYphIXZnOwrFLc9Ps&s=NzpTXzJxAX8O3St5vmQOpl_tnJ6xSe5R3H7vH58Dv0Q&e= > . -- Timo Heister http://www.math.clemson.edu/~heister/ -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
