-
Notifications
You must be signed in to change notification settings - Fork 35
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
Weights are returned in memory instead of being written to disk #3
Conversation
…ead_weights. added tests.
@huard I have a lot of cases using weights computed outside of xESMF and that I import into it using the filename argument. Can we maintain this functionality? to be more specific, I'd really like to keep these arguments and their behaviors so that I don't have to update a bunch of notebooks that are currently tested in CI/CD with different versions of xESMF |
I think it's maintained, I just changed the keyword parameter from |
yeah I think reinstating filename and reuse_weights and passing the value of filename to weights would work. Your weights are more generic and it solves problems/add capabilities but I'm gonna guess a lot of users (like myself) are now used to the filename/reuse_weights combination so I don't think we should make this go away. Keeping them in the API does not break anything, right? |
on a sidenote, I've been using pretty intensely the parallel ESMF_RegridWeightGen for large size problems that my workstation cannot handle. I was able to create weights for fairly large matrices (13000x13000 to 3000x43200) using 200+ cores and importing the computed weights in xESMF using the filename and reuse_weights arguments. I was thinking of putting a little chapter about this in the xESMF documentation since there are some "tricks" to get this working right. |
Sounds good ! I'll only be able to look at this in a couple of weeks though, so if you want to move forward faster, please go ahead and update the PR. |
@huard I'll try to work on this off your PR while I'm in my ESMF streak |
PR pending on Ouranosinc/xESMF#1 that fixes the retro-compatibility issues of this PR |
re-enable legacy args
Hello, I'm new to xesmf, and I'd like to take advantage of holding weights in memory. However, I'm currently getting the error |
@jeffreysward xESMF is being moved to pangeo-data so that @JiaweiZhuang can get the help he needs with maintaining the package. thanks for the bug report, @huard and myself should look into it shortly |
@jeffreysward Which version of ESMpy is installed ? I realize that the |
@huard it's version 7.1.0 from conda-forge. I chose this one as the quick remedy to the |
I typically install ESMF/ESMPy with MPI support, else it does not work, properly, see here: https://github.com/raphaeldussin/OM4p125_tideamp/blob/master/repro.yml |
I believe the in-memory support in esmpy was added in 8.0. |
Okay, I've switched to esmpy v8.0.1 and successfully did a curvilinear bilinear regridding without creating a weights file (Although it still appears to set a default file name at some stage). Unfortunately, the MPI support creates peripheral problems on my cluster as in JiaweiZhuang/xESMF#102 |
it defines a filename so we can be retro-compatible. I had issues with other circumstances with conda installed MPI on HPC. The hack is to recompile mpi4py from sources using the path to the MPI libs from your HPC system. See mpi4py |
This sets
factor=True
andfilename=None
in the call toESMF.Regrid
, and then callsget_weight_dict
to obtain a dictionary of weights in memory instead of writing the weights to disk.The Regridder interface is changed to pass weights explicitly (weights replacing filename and reuse_weights=True).
Computed weights are saved to disk using a
to_netcdf
method.Fixes JiaweiZhuang/xESMF#75
See JiaweiZhuang/xESMF#91