Dear Wolfgang, Thank you very much for your answer. Regarding what you mentioned:
"*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 coursealso the issue that importing all vector elements to one process cannot scaleto large numbers of processes."* What would you suggest to export in a text file the whole domain when running many processes ? A possible solution that I can think is to export for each frequency (loop iteration) a file per process. In addition, I would need to export (print) the locally_owned_dofs (IndexSet) to construct in an external environment the whole domain solution. How could I solve the issue of importing all vector elements to one process ? Thank you Regards El viernes, 19 de agosto de 2022 a las 18:57:05 UTC+2, Wolfgang Bangerth escribió: > 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/797bf029-8aa2-4a54-ab9a-9fda60fbbfadn%40googlegroups.com.
