I am using the following ncks command to perform the operation:
ncks -O --mk_rec_dmn y fileIn.nc fileOut.nc
What is the max memory that I should expect to need to perform that operation?
I thought it would likely be 2 times Memory required to store the largest variable to be processed in an input file but I have more than double that available and it's still running out.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do you mind trying to run that command against the attached file for me? I'm trying on RHEL with what should be plenty of memory and ncks just runs until it consumes all the memory available and the OS kills it.
This 19 MB file requires ~500 MB RAM for this command. Apparently the netCDF4 library requires extra overhead to decompress the data. The chunking might also be an issue. This is actually a huge dataset that is very efficiently compressed, and re-writing requires decompression/recompression.
Charlie - thanks for the explanation. Any ideas why the ncks process is literally taking up over 8GB of memory before being killed for me? Were you able to successfully execute it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It executes fine on my Mac and Linux machines with ~500 MB RAM required. Unclear why 8 GB for you. Try instead ncks -O -t 0 --mk_rec_dmn y fileIn.nc fileOut.nc
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You must have an old (and possibly buggy) version of NCO. Suggest upgrading. Command works fine on recent NCO's. Try a conda install if you need but do not have root permissions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Wow - you're right. Eventhough I installed it less than a month ago I'm only on version 4.4.4. I'll have to try the conda install instead of wherever I got these rpms from.
The file I had uploaded was the original file, but it looks like the one that was actually failing is a hyperslab of that which had the record dimension set to 'x' already. And ncks was trying to change it to y. Hopefully there was a bug that was fixed between. 4.4.4 and 4.6.6 which handles that.
Thanks for you're fast responses as always!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My workaround prior to re-installing the nco tools was to add an extra command in that set x to a fixed dimension and then the settting of y to the record dimension works fine
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just a quick follow-up question for you. Why do you just multiple the dimensions when you calculate the uncompressed size? If I use ncdump to extract the BaseReflMosaic variable I actually get a file that's almost 1.9GB.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have a netCDF file that I'm trying to change a fixed dimension to a record dimension and my process is being killed for too much memory usage.
I saw the Memory Requirements listed here: http://nco.sourceforge.net/nco.html#Memory-Requirements but I don't see my situation specified.
I am using the following ncks command to perform the operation:
What is the max memory that I should expect to need to perform that operation?
I thought it would likely be 2 times Memory required to store the largest variable to be processed in an input file but I have more than double that available and it's still running out.
Thanks!
Yes, max memory for this should be ~2x sizeof(largest variable). We have seen issues where Windows bails with much less memory.
Do you mind trying to run that command against the attached file for me? I'm trying on RHEL with what should be plenty of memory and ncks just runs until it consumes all the memory available and the OS kills it.
This 19 MB file requires ~500 MB RAM for this command. Apparently the netCDF4 library requires extra overhead to decompress the data. The chunking might also be an issue. This is actually a huge dataset that is very efficiently compressed, and re-writing requires decompression/recompression.
Actually the max required RAM is only ~1xsizeof(uncompressed largest variable). Yours is 25880x18080=467910400 B
Charlie - thanks for the explanation. Any ideas why the ncks process is literally taking up over 8GB of memory before being killed for me? Were you able to successfully execute it?
It executes fine on my Mac and Linux machines with ~500 MB RAM required. Unclear why 8 GB for you. Try instead
ncks -O -t 0 --mk_rec_dmn y fileIn.nc fileOut.nc-t doesn't seem to be an option for me
Last edit: silverhawk 2017-04-13
You must have an old (and possibly buggy) version of NCO. Suggest upgrading. Command works fine on recent NCO's. Try a conda install if you need but do not have root permissions.
Wow - you're right. Eventhough I installed it less than a month ago I'm only on version 4.4.4. I'll have to try the conda install instead of wherever I got these rpms from.
The file I had uploaded was the original file, but it looks like the one that was actually failing is a hyperslab of that which had the record dimension set to 'x' already. And ncks was trying to change it to y. Hopefully there was a bug that was fixed between. 4.4.4 and 4.6.6 which handles that.
Thanks for you're fast responses as always!
My workaround prior to re-installing the nco tools was to add an extra command in that set x to a fixed dimension and then the settting of y to the record dimension works fine
Charlie,
Just a quick follow-up question for you. Why do you just multiple the dimensions when you calculate the uncompressed size? If I use ncdump to extract the BaseReflMosaic variable I actually get a file that's almost 1.9GB.
I computed size in RAM which is always much less than size of formatted ASCII text file on disk.