Problem regarding saving data in parallel

Hi

I want to save my function in .xyz form, but the problem is that when I work in parallel, for example, using 2 process, then it turns out that in some time steps, only the data in one of the process was stored. My code is something like the following:

XYZFile file("results/data.xyz");
file.write(*f);

does anyone know what is the reason, or is there any safe way to save the data when I work in parallel.

Thanks very much!

Without a minimal reproducible example, it is very hard to give you any guidance on this, especially since it is a rarely used/mentioned format in Legacy DOLFIN.

As seen from the source code, you should get terminal output stating what is written to file in your terminal:
https://bitbucket.org/fenics-project/dolfin/src/fd662efc1c0ddefa341c1dac753f717f6b6292a8/dolfin/io/XYZFile.cpp?at=master#lines-53:66