Re: ncl performance

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 15 Jun 2009 14:15:41 -0600 (MDT)

Hi Micah,

Just as an FYI: you can improveme performance in a general by
watching out for the following things:

   - Nested "do" loops: try to keep things out of a do loop
     if possible. Check for code that can be moved out of
     a loop. Use NCL's array arithmetic capabilities where
     possible.

   - If you are reordering the same variable again and again,
     then you store it to another local variable, and use this instead.

   - In V5.1.0 (soon), we have some new dim_xxxx_n functions that
     operate on any dimension (unlike dim_xxxx which only operates
     on the rightmost dimension). Use these functions to avoid
     reordering.

  - Delete arrays (especially large ones) if you no longer need them,
    using the "delete" procedure:

       delete(x)

  - If you don't need metadata to be copied, then do straight
    variable copies with:

       xnew = (/x/)

    instead of:

       xnew = x

  - If you are 1) generating several images in a single file,
    2) using the same gsn_xxxxx call over and over, and
    3) just changing a few resources inside the do loop,
    then instead of calling gsn_xxxxx every time, it can
    be more efficient to call it once outside the loop and
    then use "setvalues" to change the data and resources.

    See example 1 at:

       http://www.ncl.ucar.edu/Applications/animate.shtml

--Mary

On Fri, 12 Jun 2009, Micah Sklut wrote:

> Hi NCL,
>
> Its been a while, since my last questions, but I believe I have a straight
> forward one here.
>
> What is the best way to increase performance for ncl scripts.
> I have batch jobs where I read in large grib files, and output lots of
> images.
>
> Will performance improve by increasing RAM ?
> Will performance improve by increasing Processor Speed?
>
> My guess, is that the memory is going to be the biggest factor, and then
> processor speed second.
>
> Thanks for your help!
>
> Micah
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 15 2009 - 14:15:41 MDT

This archive was generated by hypermail 2.2.0 : Tue Jun 16 2009 - 10:05:45 MDT