[GRASS-dev] Re: [GRASS GIS] #520: r.terraflow/iostream does not respect STREAM_DIR option

GRASS GIS trac at osgeo.org
Thu Apr 9 08:24:10 EDT 2009


#520: r.terraflow/iostream does not respect STREAM_DIR option
---------------------+------------------------------------------------------
  Reporter:  mmetz   |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect  |      Status:  new                      
  Priority:  major   |   Milestone:  6.4.0                    
 Component:  Raster  |     Version:  svn-develbranch6         
Resolution:          |    Keywords:                           
  Platform:  All     |         Cpu:  All                      
---------------------+------------------------------------------------------
Comment (by hamish):

 Replying to [comment:9 neteler]:
 > > Question: change to lowercase which breaks the user interface
 > > (but uppercase fails)?

 that's very weird.

 > > Fixed in GRASS 7, r36632 (stream_dir is already lowercase
 > > there). Remains open for GRASS 6.

 since it was always broken in the past, maybe it doesn't hurt.
 On the other hand, changing it will break scripts (which will now work as
 expected instead of nooping).

 Replying to [comment:10 mmetz]:
 > /var/tmp does not exist on Windows, so this is not really a
 > good choice for default temp directory.

 that is a problem. If it were decided to keep it out of $MAPSET/.tmp/ we
 could use a compiler macro for C:\Temp\Grass\, like we do for /dev/null
 and NUL:.

 ISTR the output files are of some interest after the module has ended. is
 this the case? if so, putting them deep in a hidden .tmp/ dir isn't very
 nice.

 otherwise the lack of /var/tmp/ on MS-win makes a compelling case for
 moving it to $M/.tmp/ and short-circuiting this discussion.

 > It is ok to call G_tempfile() in
 > {{{
 > streamdir->answer     = G_store(dirname(G_tempfile()));
 > }}}
 > because this happens in r.terraflow after G_gisinit() is called, not
 before.

 sorry, that should have read "before G_parser() has run", not G_gisinit().

 see: http://trac.osgeo.org/grass/browser/grass/trunk/lib/gis/parser.c#L724

 {{{"The only functions which can legitimately be called before G_parser()
 are: ..."}}}

 > AFAIKT, G_tempfile() only returns a filename, a file is not
 > created (the description of G_tempfile() says so).

 don't trust the comments, test it. from past experience I think it
 creates a file. (at least the `g.tempfile` module does).


 > Increasing the memory option to e.g. 75% doesn't really help
 > for massive grids (the main aim of r.terraflow) unless there
 > are much more than 8GB of RAM available

 I am not sure, but I have the memory that it was not a 1:1 trade
 off, a bit more memory meant much less disk space? (untested)
 what I do remember is that when I had do do a real world run with a
 massive grid, I had to crank that up until I didn't hit the LFS limit of
 my 32bit system, which in turn made it run faster. I might have also had
 to compromise on the resolution that time, but I don't think so as I don't
 like doing that & so would have remembered :)


 > Last comment: any reason why STREAMTMP_DIR is set system-wide
 > and not with G_putenv()? Code in question is here:
 >
 >
 http://trac.osgeo.org/grass/browser/grass/branches/develbranch_6/raster/r.terraflow/main.cc#L503

 an environmental variable can not escape its process to the rest of the
 system (can not export to parent or siblings, only self and children).
 anyway, the code at lib/gis/putenv.c shows that G_putenv() is just a
 wrapper incase putenv() doesn't exist on that system.


 Hamish

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/520#comment:14>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list