[GRASSLIST:3187] Re: advice on building a workstation PC for Grass

Glynn Clements glynn.clements at virgin.net
Thu Apr 15 14:51:02 EDT 2004

Philipp Molzer wrote:

> cr.yp.to's site has great advice.   He reccomends going with a dual-cpu. 
> I'm wondering if any of the GRASS components are written to be 
> multi-threaded, to take advantage of such a machine.

No. If you want parallelism, you have to implement it yourself (i.e. 
run multiple sessions).

> For example, my 
> underpowered machine has been r.patch'ing together 8  60MB rasters for 
> the last 5 hours, and is about 50% done.

That suggests a fundamental flaw in r.patch (or maybe the underlying
libraries). Patching rasters should have almost zero computational
overhead; it should be almost entirely I/O.

Someone should look into this (i.e. build GRASS with profiling
information and figure out where all the CPU time is going).

Unless you have a really slow CPU, or all of the maps are in RAM, it
should be possible to patch rasters together as fast as they can be
read from disk.

Unfortunately, there are some aspects of r.patch which could introduce
significant inefficiencies. Specifically, the body of the per-column
loop in do_patch() could take an order of magnitude (or more) longer
than it needs to. Functions such as G_is_null_value, G_raster_cpy etc
could potentially take dozens of clock cycles, when the underlying
operations (comparing/copying machine words) might only take a single
clock cycle.

Also, I don't know what the time complexity of G_update_cell_stats()
is; that could potentially dwarf the rest of the loop.

> Would a dual-cpu machine get it done twice as fast?


Glynn Clements <glynn.clements at virgin.net>

More information about the grass-user mailing list