-
Notifications
You must be signed in to change notification settings - Fork 53
Fixes dask out of memory error (sets max chunks) #166
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
Conversation
|
@xylar and @milenaveneziani, I went back and dug into the code. I need to do some more work on this but this is the correct approach. |
e390db0 to
d643154
Compare
|
@xylar and @milenaveneziani, this fix should solve #161 for the target case. Please let me know if this works for you. It is working for me and it is fairly fast too-- I don't think you'll be as disappointed as in #164. Note, we still need some type of fix in #164 to prevent loading of computed results into memory, which could produce a memory error at large enough scale. But, if we stay with xarray datasets they can be larger than memory and still get written to disk, which is a huge benefit. |
|
@pwolfram: can you please explain a bit more what this does? Is it going to solve the issue of loading big 3d data of the kind we need to load in for the MOC calculation? |
|
@pwolfram, this is great! I'm still testing the EC60to30 on my laptop now with I'll run a longer test on Edison and then I'm happy to merge. |
|
@pwolfram, I'm going to remove the |
|
@pwolfram, I'm currently trying to test this on Edison but am running into trouble with batch jobs (unrelated to this PR). Specifically, when I try to access Normally, I use a different python environment that is set up for POPSICLES, not MPAS, so NCO is not available. I tried on an interactive job and everything worked fine, as expected, so I don't know what is going wrong with my batch jobs. I'm trying again with |
This essentially ensures that calculations done with xarray and dask don't overflow memory. It turns out this is something that is the user responsibility for now (pydata/xarray#1338). This PR solves the immediate issue but is incomplete.
We also need #164 for even larger datasets, but it is less time sensitive than this PR. |
| # select only the data in the specified range of dates | ||
| ds = ds.sel(Time=slice(startDate, endDate)) | ||
|
|
||
| # limit chunk size to prevent memory error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xylar, I'm thinking that this should this be moved as a function into mpas_xarray's preprocess with the argument maxChunkSize because this is a problem that needs handled for general use of xarray. This seems better organized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with that change. In that case, add the mpas_xarray tag back.
3bc1713 to
affae3f
Compare
affae3f to
3b08774
Compare
|
@pwolfram, I still haven't been able to run any of the analysis that uses ncremap on the compute nodes, which I would have preferred to be able to do. But I'm running MOC on its own right now. As soon as it's done and I have a chance to make sure the results look reasonable, I'll merge. |
|
Okay, everything seems to be behaving well both on Edison and on my laptop. Nice work! |
This specifies a maximum chunk size for each multifile dataset that is opened to avoid dask out of memory errors.