Writing to MED file using MEDCoupling [Python]


I am using the MEDCoupling library for storing results from my numeric library.

My scenario consists of taking a time series input data and produce N arrays on each time slice. These I then convert to MEDCoupling Fields and write to the resulting MED file. What I now observed is, when I have a lot of time slices, over time the writing the fields to the MED file becomes slower and slower.

Right now my resulting MED file is 50GB (med file with only mesh is 400MB) and adding a new time slice of fields is taking 20 minutes.

I checked the documentation and the MEDCoupling/Loader examples but couldn’t find any information on what to do or avoid.

Best regards,
Gregor Simic

Never mind, after writing a test script that puts random data (same number of fields and type of fields) I realized that in the workflow I did not clear the data buffers, meaning that instead of adding just the recent fields at each time step I was writing all the so-far obtained fields.

I will just leave the comment then that I enjoy the MEDCoupling/Loader interface as it provides a very powerful interface in I/O of the data, especially the easy way of writing or getting numpy arrays.