# Parallelization save data

**URL:** <https://community.freefem.org/t/parallelization-save-data/1066>\
**Category:** General Discussion\
**Created:** [June 28, 2021, 8:59am UTC](https://community.freefem.org/t/parallelization-save-data/1066 "2021-06-28T08:59:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yhao](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@yhao](https://community.freefem.org/u/yhao)\
**Post date:** [June 28, 2021, 8:59am UTC](https://community.freefem.org/t/parallelization-save-data/1066/1 "2021-06-28T08:59:24Z")

</div>

Dear all,

I am now using PETSc for solving the Navier-Stokes equation in 16 cores, but when I want to save the data of the velocity for x=0.5 (export as a txt file), it always repeatedly store some parts that are repeated in 16 divisions. The code is as follow:

```auto
ofstream ff("velocity_simulation.txt", append);
  for (real yaxis = 0; yaxis <= 1; yaxis += 0.001){
    ff<<umag(0.5, yaxis)<<endl;
  }

```

Could you please help me with this?

Thanks in advance. Look forward for your kind reply.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [June 28, 2021, 9:06am UTC](https://community.freefem.org/t/parallelization-save-data/1066/2 "2021-06-28T09:06:52Z")

</div>

Please look at [Pierre Jolivet introduction to parallel FreeFEM part 1 - YouTube](https://youtu.be/-Aw2O46V2bo?t=5283) to understand how to gather the solution on a single rank so that you can save data using only a single process so there is no duplication.

---

<div class="post-metadata">

**Author:** ![yhao](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@yhao](https://community.freefem.org/u/yhao)\
**Post date:** [June 28, 2021, 6:22pm UTC](https://community.freefem.org/t/parallelization-save-data/1066/3 "2021-06-28T18:22:36Z")

</div>

Thank you! I am going to check this!
