On 8/19/22 03:25, Uclus Heis wrote:
/
/
The way of extracting and exporting the solution with /testvec=locally_relevant_solution / is a bad practice? I am saving the locally relevant solution from many different processes in one single file for a given frequency. I am afraid that there is no synchronization between processes and the results will be saved without following the right order of DOF (which is needed for me). Is this statement correct?

Assuming that testvec is a vector that has all elements stored on the current process, then the assignment
  testvec = locally_relevant_solution;
synchronizes among all processes.

That said, from your code, it looks like all processes are opening the same file and writing to it. Nothing good will come of this. There is of course also the issue that importing all vector elements to one process cannot scale to large numbers of processes.


Another issue that I found is that this approach increases dramatically the computational time of the run() function. For a particular case, solving the domain takes 1h without exporting the domain, while it takes 8h adding the previous piece of code to export the domain. Is this because the print function is slow or there is some sync going on when calling /testvec=locally_relevant_solution?/

You can not tell which part of a code is expensive unless you actually time it. Take a look at the TimerOutput class used in step-40, for example, and how you can use it to time individual code blocks.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 [email protected]
                           www: http://www.math.colostate.edu/~bangerth/

--
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/a45bf115-aca2-a12c-d795-b4031d71d154%40colostate.edu.

Reply via email to