[deal.II] Re: Access specific element within a distributed triangulation

2017-03-08 Thread 'Seyed Ali Mohseni' via deal.II User Group
Dear Bruno, Thanks. That's even better and even in just a single line of code. ;) MPI_Bcast(, 1, MPI_DOUBLE, max_rank, mpi_com); Best, Seyed Ali -- 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 ---

[deal.II] Re: Access specific element within a distributed triangulation

2017-03-08 Thread 'Seyed Ali Mohseni' via deal.II User Group
Dear Bruno, Thanks. That's even better and even in just a single line of code. ;) MPI_Bcast(, 1, MPI_DOUBLE, max_rank, mpi_com); Best, Seyed Ali -- 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

[deal.II] Re: Access specific element within a distributed triangulation

2017-03-08 Thread Bruno Turcksin
Seyed, you probably want to use MPI_Bcast instead of your code (see http://mpitutorial.com/tutorials/mpi-broadcast-and-collective-communication/) Best, Bruno On Wednesday, March 8, 2017 at 9:51:50 AM UTC-5, Seyed Ali Mohseni wrote: > > Dear all, > > I was able to solve the MPI variable

[deal.II] Re: Access specific element within a distributed triangulation

2017-03-08 Thread 'Seyed Ali Mohseni' via deal.II User Group
Dear all, I was able to solve the MPI variable problem. For the users who may have the same issue once: if ( this_mpi_process == max_rank ) { for (unsigned int i = 0; i < n_mpi_processes; ++i) { if ( i != max_rank ) MPI_Send(, 1, MPI_DOUBLE, i, 0, mpi_com); } } else {

[deal.II] Re: Access specific element within a distributed triangulation

2017-03-08 Thread 'Seyed Ali Mohseni' via deal.II User Group
Dear all, I was able to solve the MPI variable problem. For the users who may have the same issue once: if ( this_mpi_process == max_rank ) { for (unsigned int i = 0; i < n_mpi_processes; ++i) { if ( i != max_rank ) MPI_Send(, 1, MPI_DOUBLE, i, 0, mpi_com); } } else {

[deal.II] Re: Access specific element within a distributed triangulation

2017-03-08 Thread Jean-Paul Pelteret
Dear Seyed, > Extra question: Can we store variables or copy them to all processors? > Since I am filling a variable in a locally owned cell, currently on rank 3. > Then my other ranks, especially the root rank 0 has no clue of the values > which are set. Hence, there has to be a possibility

[deal.II] Re: Access specific element within a distributed triangulation

2017-03-08 Thread 'Seyed Ali Mohseni' via deal.II User Group
@Prof. Bangerth: I will try to learn debugging parallel code and also to follow your words of advice. Please do not apologize since I don't think you ever became rude. I mean, after 1 emails I would definitely not be as calm as you. Thank you. :) @Daniel: Thumbs up. From your words I