[GRASS5] r.terraflow performance tweak

Ludwig M Brinckmann ludwigbrinckmann at hotmail.com
Fri Apr 14 11:17:35 EDT 2006

Looking through the code of r.terraflow I discovered that there is one 
compile time only option that significantly reduces/improves the performance 
of r.terraflow. At the moment builds produce the less performant version by 
default, which for such a long running program is not good. Only those who 
read and modify the source code can get the faster version.

options.h, l. 47, #defines OUTPUT_TCI by default, causing additional files 
generated and in my case a significant (I think millions) number of error 
messages from this TCI option from sweep.cc line 143 (tci negative).

Not being a GIS person I have no idea what the error means, the output from 
r.terraflow seemed to correlate with reality despite the message, and even 
the author of this bit seemed not sure what the error signified: see line 
141: is this true?. Printing the error a zillion times added a night to my 
program run.

The very quickest way of fixing this would be to have another build of 
r.terraflow added to the makefile, to compile it with TCI disabled and have 
yet another executable.

There is also the possibilty of making it a command line option, but I 
assume that the original authors of r.terraflow have made this a compile 
time option to avoid the runtime checks this would bring, so there is some 
argument for a separate executable at the expense of bloating binary 


More information about the grass-dev mailing list