Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long time to save nc simulation #18

Open
gab1092 opened this issue Dec 22, 2021 · 4 comments
Open

Long time to save nc simulation #18

gab1092 opened this issue Dec 22, 2021 · 4 comments

Comments

@gab1092
Copy link

gab1092 commented Dec 22, 2021

Hello! I have a doub, I'm running a simulation with 1000 elements for gas and 3000 for oil, the simulation run good but when I want save the data in a netcdf file the procces run during hours and I don't know if is normal. Is normal that save the output take many hours? I used the save_sim option to save the data. I need use less elements?
Thank you for your help.

@socolofs
Copy link
Owner

socolofs commented Dec 23, 2021 via email

@ChrisBarker-NOAA
Copy link
Collaborator

Is there any advantage to running that many elements in TAMOC?

Anyway -- how is the output stored in netCDF?. I have had issues with really slow (and huge) netcdf files if the data aren't stored in an efficient manner.

from a quick look at save_particle_to_nc_file in dispersed_phases.py, it looks like the data are stored in large 1D arrays, which used to be painfully bad in netcdf4, but I think that's been fixed.

However, it looks like the code loops through each particle and writes the data to the netcdf file one by one -- that could be the issue here. It is far more efficient to write an array of data at once.

you wouldn't notice with, say, < 10 particles, but with thousands, that could explain it.

If there is a use case for that many particles, perhaps the code could be refactored to save the data out a full array at at time.

@gab1092
Copy link
Author

gab1092 commented Dec 23, 2021

@socolofs Thank you! I tried with fewer elements; as you said, the problem is with many elements.
@ChrisBarker-NOAA I probed with a differing number of elements; in a quick revision, I didn't find any advantage to simulate with many elements for my simulation. I will simulate with a few elements. I will try to use the output of TAMOC as the initial condition for a simulation of surface spill using GNOME. Hence, I tried with a similar number of elements in the two simulations as an initial phase.
Thank you for the help, and happy Christmas to all!

@ChrisBarker-NOAA
Copy link
Collaborator

Ahh -- yes, that's a trick. It may make sense to create thousand of GNOME elements from a few TAMOC elements. You only need many elements if they are going to do something different :-) In GNOME, diffusion will spread them out, and then they will be subject to different currents, winds, etc -- so you may need a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants