NCL termination due to memory problems

From: Robert F. Esswein <esswein_at_nyahnyahspammersnyahnyah>
Date: Thu, 27 Apr 2006 16:39:06 -0700

I have a NCL script which is being prematurely terminated by
the system, apparently because of memory allocation problems.
My efforts so far to find out why haven't gotten anywhere;
maybe someone else has a clue. (I am not an experienced NCL user.)

The structure of the script is more or less the following:

  ; some initialization
  do iday=0,nday-1
    ; some initialization
    do igrid=0,ngrid-1
      ; some initialization
      do istep=0,nstep-1
        ; some initialization
        ; Read one time step from input NetCDF file
        ; Interpolate to new grid
        print("writing output")
        ; Write to output NetCDF file. There is one output file per time step.
        print("file written")
      end do
    end do
  end do

In the present case nday and ngrid == 1.
The script dies at istep 20. (Some earlier versions ended at fewer
steps. The script takes too long for me
to investigate how reproducible this particular number is.)
The command "dmesg" shows
Out of Memory: Killed process 1892 (ncl).
There are no messages output by NCL.
There is no core dump.

Monitoring with the "top" program shows a gradual increase in
memory usage. Arrays used in the innermost loop have sizes determined
by the grid sizes of interest, which are constant for the whole script.
Arrays used outside the innermost loop do not amount to much.

An earlier version, with grid sizes not much different,
worked with no such problems.
The major way the new version is different from the old one is that
I am using my own procedure for interpolation instead of "linint2_Wrap".

I do not understand how memory usage can be increasing with
time, and why the innermost loop cannot complete. If it can complete
several iterations, why can't it complete an indefinite number?

The script exhibits additional strange behavior. For istep 9 and later
output from system("date") does not appear even though output from the
print statements just before and after it does appear.

I am using version 4.2.0.a033 on a Linux system,
Fedora Core release 3, kernel 2.6.9-1.667

ncl-talk mailing list
Received on Thu Apr 27 2006 - 17:39:06 MDT

This archive was generated by hypermail 2.2.0 : Fri Apr 28 2006 - 08:53:40 MDT