# Question about saving the output in a more compact manner in parallel

**URL:** <https://fenicsproject.discourse.group/t/question-about-saving-the-output-in-a-more-compact-manner-in-parallel/4749>\
**Category:** Uncategorized\
**Created:** [December 16, 2020, 3:07am UTC](https://fenicsproject.discourse.group/t/question-about-saving-the-output-in-a-more-compact-manner-in-parallel/4749 "2020-12-16T03:07:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nami](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/nami/32/141_2.png) [@nami](https://fenicsproject.discourse.group/u/nami)\
**Post date:** [December 16, 2020, 3:07am UTC](https://fenicsproject.discourse.group/t/question-about-saving-the-output-in-a-more-compact-manner-in-parallel/4749/1 "2020-12-16T03:07:56Z")

</div>

Hi,

I was wondering if there is a way besides using .pvd to save the outputs. When I run a time dependent code on 40 processors and save the output in .pvd it saves 40 chunks of the domain for each processor in .vtu. Then a .pvtu that gathers them for each time and then a .pvd that collects everything. I was wondering if there was a more compact and parallel compatible way to do this. Thank you so much for your help.

Best,

---

<div class="post-metadata">

**Author:** ![nate](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/nate/32/17_2.png) [@nate](https://fenicsproject.discourse.group/u/nate)\
**Post date:** [December 16, 2020, 4:18am UTC](https://fenicsproject.discourse.group/t/question-about-saving-the-output-in-a-more-compact-manner-in-parallel/4749/2 "2020-12-16T04:18:18Z")

</div>

Look into using the scalable `XDMFFile` with `h5` binary data. E.g. `XDMFFile("something.xdmf").write(mesh)`

---

<div class="post-metadata">

**Author:** ![nami](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/nami/32/141_2.png) [@nami](https://fenicsproject.discourse.group/u/nami)\
**Post date:** [December 18, 2020, 7:28pm UTC](https://fenicsproject.discourse.group/t/question-about-saving-the-output-in-a-more-compact-manner-in-parallel/4749/3 "2020-12-18T19:28:11Z")

</div>

Thank you Nate. I tried it and it works fine with functions changing in time. However, I have issues with meshfunctions. Suppose I have a mesh function that changes in time and I want to save it at each time step using the code below:

> ```
> from fenics import *
> mesh = UnitSquareMesh(10, 10)
> Inside = MeshFunction("size_t",mesh,2)
> V= VectorFunctionSpace(mesh,'P',1)
> u = Expression(('1','1'),degree=0)
> U = project(u,V)
> t = 0.0
> n=0
> file1 = XDMFFile(MPI.comm_world, "Inside.xdmf")
> file1.parameters["flush_output"] = True
> for n in range(100):
> ALE.move(mesh,U)
> file1.write(Inside)
> t+=1.0
> 
> ```

This will give me an error on Paraview saying “unable to read data”. And when I replace

> file1.write(Inside)

with

> file1.write(Inside,t)

I get the following AttributeError from my code:

> ‘dolfin.cpp.mesh.MeshFunctionSizet’ object has no attribute ‘\_cpp\_object’

Do you know what’s happening here?
