[GRASS-dev] Re: grass-dev Digest, Vol 43, Issue 8

Laura Toma ltoma at bowdoin.edu
Mon Nov 9 17:23:36 EST 2009

Hi Markus,

>> How much memory was available  on the machine?
> 8 GB
>> If the machine had more than 512MB  RAM,  it is not fair to run
>> terracost running with mem=400MB, and compare it with an algorithm
>> that can use more memory.
> I don't understand, both modules can use more than 400MB of memory. I
> set r.terracost to use 400MB max and r.cost to use 135MB max. If
> anything, this is not fair for r.cost and gives an advantage to
> r.terracost. I did not mention that I gave r.terracost another  
> advantage
> by assigning the temporary directories to a folder on a separate, very
> fast hard drive that had nothing else to do but manage the temp  
> files of
> r.terracost. The temp files of r.cost are in the standard grass
> .tmp/$HOST directory, in my case that (slower) hard drive also had  
> other
> things to do than just manage r.cost's temp files. I really tried to
> give r.terracost a head start ;-)

my experience is that , if you want to see how an application would  
behave with 500 MB of RAM, you have to physically reboot the machine  
with 500 MB of RAM   (it's very easy to do this on a Mac, and  
relatively easy on Linux.  on windows, i don't know).

if the machine has more than 500MB RAM, even if you restrict the  
application to use less,  the system gives it all it can.    in your  
setup,  it is almost as if r.cost would run fully in memory, because  
even it it places the segments on disk, the system file cache fits all  
segments in memory.  the same is true for terracost, its streams fit  
in memory. but  using tiles has a big CPU overhead, which is why it  
is  slower.

when i did some preliminary testing, i rebooted the machine with 512MB  
RAM, and ran r.cost on  grids of 50M-100M cells.  it was slow,  
completely IO bound,  and  took several hours or more.   or if you use  
1GB of RAM,  you may need to go to larger grids.

>> However, I am surprised that withnumtiles=1,  it was slower than
>> r.cost.

it looks like i misread your numbers.

> BTW, I took the liberty to fix r.terracost, it works now with
> numtiles>1. See changelog for r39684
> https://trac.osgeo.org/grass/changeset/39684

great, thanks!   let's see if terracost is worthwhile :)


More information about the grass-dev mailing list