Re: Unable to allocate memory when using round function

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 30 2009 - 13:00:42 MST

Bridget,

I don't know what the rest of your script looks like, but you have
memory taken up by other arrays, then your memory will be depleted by
the time you get to these lines in your script.

You might try deleting some of your other arrays if you don't need
them any more, before you get to the "data_all" code.

Also, I believe doing operations on an array causes a temporary
allocation (Dave Brown will have to verify this), so you might want
to consolidate the operations:

data_all = round(doubletofloat(fdata->$var$)*100.,0)/100.

--Mary

On Nov 30, 2009, at 12:46 PM, Bridget Thrasher wrote:

> Can anyone explain what might be causing this error? The array is
> <1GB, so in theory, it should be possible.
>
> These lines:
>
> data_all = doubletofloat(fdata->$var$)
> printVarSummary(data_all)
> data_all = round(data_all*100.,0)/100.
> printVarSummary(data_all)
>
>
> Create this output:
>
> Copyright (C) 1995-2009 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.1.1
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
>
> Variable: data_all
> Type: float
> Total Size: 466560000 bytes
> 116640000 values
> Number of Dimensions: 3
> Dimensions and sizes: [1800] x [180] x [360]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : 1e+20
>
> ncl(1813) malloc: *** mmap(size=933122048) failed (error code=12)
> *** error: can't allocate region
> *** set a breakpoint in malloc_error_break to debug
> fatal:round: Unable to allocate memory for output arrays
>
>
> Thanks!
>
> --
> 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Nov 30 13:00:50 2009

This archive was generated by hypermail 2.1.8 : Thu Dec 03 2009 - 09:53:22 MST