Re: Memory issue: Does linint2_Wrap hold on to anything in memory? Does dble2flt conversion allocate more memory than simple float array?

From: Bridget Thrasher <bthrasher_at_nyahnyahspammersnyahnyah>
Date: Thu Oct 22 2009 - 15:02:54 MDT

OK, I added a couple more statements. Now I'm running:

...
factors = fdata->factors ; this variable is a float
printVarSummary(factors)
factors_int = linint2_Wrap(lons,lats,factors,True,obs_lons,obs_lats,0)
printVarSummary(factors_int)
delete(factors)
bcsd->$var$ = factors_int
delete(factors_int)
x = fdata->$var$
printVarSummary(x)
dvar = dble2flt(x)
printVarSummary(dvar)
delete(x)
dvar_int = linint2_Wrap(lons,lats,dvar,True,obs_lons,obs_lats,0)
...

Resulting in:

Variable: factors
Type: float
Total Size: 118591200 bytes
            29647800 values
Number of Dimensions: 3
Dimensions and sizes: [time | 1800] x [lat | 91] x [lon | 181]
Coordinates:
            time: [ 15..54771]
            lat: [ -90.. 90]
            lon: [ 0.. 360]
Number Of Attributes: 1
  _FillValue : 1e+20
(0) changeCaseChar: this function has been deprecated.
(0) Will use str_switch.
(0) changeCaseChar: this function has been deprecated.
(0) Will use str_switch.

Variable: factors_int
Type: float
Total Size: 1866240000 bytes
            466560000 values
Number of Dimensions: 3
Dimensions and sizes: [time | 1800] x [LAT | 360] x [LON | 720]
Coordinates:
            time: [ 15..54771]
            LAT: [-89.75..89.75]
            LON: [0.25..359.75]
Number Of Attributes: 1
  _FillValue : 1e+20

Variable: x
Type: double
Total Size: 237182400 bytes
            29647800 values
Number of Dimensions: 3
Dimensions and sizes: [time | 1800] x [lat | 91] x [lon | 181]
Coordinates:
            time: [ 15..54771]
            lat: [ -90.. 90]
            lon: [ 0.. 360]
Number Of Attributes: 3
  name : variable_61
  missing_value : 1e+20
  _FillValue : 1e+20

Variable: dvar
Type: float
Total Size: 118591200 bytes
            29647800 values
Number of Dimensions: 3
Dimensions and sizes: [time | 1800] x [lat | 91] x [lon | 181]
Coordinates:
            time: [15..54771]
            lat: [-90..90]
            lon: [ 0..360]
Number Of Attributes: 4
  _FillValue : 1e+20
  name : variable_61
  missing_value : 1e+20
  typeConversion_op_ncl : double converted to float

ncl(27897) malloc: *** mmap(size=1866240000) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
fatal:linint2: Unable to allocate memory for output array
fatal:Execute: Error occurred at or near line 3784 in file
$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl

So it's trying to allocate memory for an array of the same size as it did
previously (and successfully). Any idea why can be done once but not a
second time even though I've deleted the big arrays that are no longer
needed?

-B

On Thu, Oct 22, 2009 at 12:32 PM, Dennis Shea <shea@ucar.edu> wrote:

> linint2_Wrap should have *trivial* memory overhead.
>
> How much memory do you have available?
>
> When you have
> dvar = dble2flt(fdata->$var$)
>
> How big is
> x = fdata->$var$
> printVarSummary(x)
>
> The dble2flt creates a new array that is half the (byte) size of the
> double array [ 8 bytes for double and 4 bytes for float].
>
> dvar = dble2flt (x )
>
> I do not know how NCL allocates memory for this type of tranfer.
>
> D
>
>
>
>

-- 
Bridget Thrasher, PhD
Postdoctoral Researcher
Climate Central
www.climatecentral.org

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Oct 22 15:02:51 2009

This archive was generated by hypermail 2.1.8 : Fri Oct 23 2009 - 11:36:30 MDT