Re: Memory allocation failure

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Sat Oct 31 2009 - 09:17:29 MDT

Dear Lin,

You can't create the DUSTND variable as a local NCL, due to NCL
variable size restrictions. I decided to incrementally write this
variable to a file, since you *can* have variables larger than 2 Gb
on a file.

I'm not sure exactly what you were trying to accomplish with the
various summation commands, but I mimicked these in the attached
script, which also writes DUSTND to an output file called "dust.nc".
This script uses the "efficient" method to write a NetCDF file, which
means it defines everything it's going to write to the file, before
it writes the data to the file.

Please make sure the summation commands are correct. Note that I used
the new "dim_sum_n_Wrap" function where possible to avoid having to
reorder coordinate arrays.

http://www.ncl.ucar.edu/Document/Functions/Contributed/
dim_sum_n_Wrap.shtml

You'll need to upgrade your version of NCL to the current version if
you want to use dim_sum_n. Otherwise, you can go back to the original
method of using dimi_sum_Wrap and reordering your arrays to do the
summation. Reordering data can be an expensive operation, so try to
limit this.

Hope this helps you get further.

--Mary


>
> On Oct 30, 2009, at 10:51 AM, Lin Su wrote:
>
>> Hi Mary,
>>
>> Thanks for your response:)
>>
>> I have put the data(carma.cam2.h0.2007-02-21-10800.nc) and the NCL
>> script (calc_MarAsia_flx.ncl) under incoming directory. The
>> version of NCL I am running is 4.2.0.a034. I am using a 32-bit
>> system ( Darwin Kernel Version 8.11.1, i386). The error message is
>> as following:
>> ~~~~~~~~~~~~
>> ncl(7790) malloc: *** vm_allocate(size=2371719168) failed (error
>> code=3)
>> ncl(7790) malloc: *** error: can't allocate region
>> ncl(7790) malloc: *** set a breakpoint in szone_error to debug
>> fatal:NclMalloc Failed:[errno=12]:Cannot allocate memory
>> fatal:_NclBuildArray : Memory allocation failure
>>
>> fatal:Execute: Error occurred at or near line 38 in file
>> calc_MarAsia_flx.ncl
>> ~~~~~~~~~~~~~~~
>>
>> Many thanks,
>> -Lin
>> ---
>> Lin Su
>> http://atoc.colorado.edu/~sul/
>>
>>
>> ---- Original message ----
>>> Date: Fri, 30 Oct 2009 09:15:55 -0600
>>> From: Mary Haley <haley@ucar.edu>
>>> Subject: Re: Memory allocation failure
>>> To: Lin Su <Lin.Su@Colorado.EDU>
>>> Cc: ncl-talk@ucar.edu
>>>
>>>
>>> Dear Lin,
>>>
>>> We need more information, like how big are the variables you are
>>> trying to read, are you running on a 64-bit system, etc.
>>>
>>> Can you provide us with a data file and/or a script that shows the
>>> problem, and email us with the exact error message?
>>>
>>> See the following for information about where you can put the file
>>> and script:
>>>
>>> http://www.ncl.ucar.edu/report_bug.shtml
>>>
>>> Thanks,
>>>
>>> --Mary
>>>
>>> On Oct 30, 2009, at 12:07 AM, Lin Su wrote:
>>>
>>>> Dear NCL users,
>>>>
>>>> Could you please give me some ideas to fix the "Memory allocation
>>>> failure" problem when I am using NCL to read netcdf files?
>>>>
>>>> Many thanks,
>>>> -Lin
>>>> ---
>>>> Lin Su
>>>> http://atoc.colorado.edu/~sul/
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Oct 31 09:17:16 2009

This archive was generated by hypermail 2.1.8 : Mon Nov 02 2009 - 08:49:47 MST