[GRASS-user] r.neighbors velocity

Sören Gebbert soerengebbert at googlemail.com
Sun Jul 21 05:57:52 PDT 2013

Hi Ivan,

2013/7/17 Ivan Marchesini <ivan.marchesini at gmail.com>:
> Dear Soeren, Hamish, Markus M., Markus N,.
> sorry for the delay in the answer but I didn't believe that my question
> could have determined so many answers and I was on holiday for 10 days
> with no way to test your code.
> First of all a quick answer to Markus N.
> My collegue is working on high resolution images and DEMs. In this case,
> in particular, he is working on a 1 meter resolution raster map
> concerning landslides. He said me that, due to the landslides
> dimensions, he need to use a kernel of 501*501 in order to catch the
> "signatures" of the phenomena (I don't know exactly the details.. I'm
> sorry).

I think it will be good if you could ask your colleague for more details,
since we are all very curious about his computational approach.

> I'm not a C developer but reading your e-mails it seems that the
> performances of the C codes (and r.neigbors is written in C) strongly
> depend on the compiler.
> does it mean that compiling in a different way (I don't know how) the
> r.neigbours module we can obtain better results?
> We have tested the last code of Soeren in the same machine where the
> proprietary software (it is ENVI 5.x) showed those good performances.

The performance is good indeed. Unfortunately you need to set the
moving windows size from 23 to 501, to receive a comparable result to
the computation of your colleague.

./neighbor 5000 5000 501

This will call the neíghbour computation with 25,000,000 cells and a
moving window with 501x501 pixel.

Best regards

> These are the results:
> gcc -Wall -fopenmp -lgomp -Ofast main.c -o neighbor
> export OMP_NUM_THREADS=1
> time ./neighbor 5000 5000 23
> real    0m16.598s
> user    0m16.477s
> sys    0m0.080s
> export OMP_NUM_THREADS=2
> time ./neighbor 5000 5000 23
> real    0m8.977s
> user    0m17.573s
> sys    0m0.080s
> export OMP_NUM_THREADS=4
> time ./neighbor 5000 5000 23
> real    0m5.993s
> user    0m20.277s
> sys    0m0.088s
> export OMP_NUM_THREADS=6
> time ./neighbor 5000 5000 23
> real    0m4.784s
> user    0m25.770s
> sys    0m0.096s
> Many thanks for your answers

More information about the grass-user mailing list