[GRASS5] r.series, max files open

H Bowman hamish_nospam at yahoo.com
Wed May 7 01:11:53 EDT 2003


> > I am trying to get r.series to produce time series stats for 365
> > raster files.
> > It dies after opening about 254 files through. (sorry don't have the
> > exact error message on hand)
> > I assume it is running up against a max files open limit,
> 
> Yes. Specifically, libgis has a fixed limit of 256 open raster maps,
> set at the top of src/libes/gis/G.h:
> 	#define MAXFILES    256

Changing MAXFILES to 384 fixes the problem and r.series now runs with
365 input files. Thanks, that solves my immediate problem.


> > If it is a max file limit thing, r.series should be able to work
> > around that.. open 200, dump them to memory, fclose all, read
> > another 200, etc. until all are loaded and then do the math.
> 
> Store the entire series in memory?
> For large files, that would just replace an out-of-descriptors error
> with an out-of-memory error.

Maybe only load rasters above MAXFILES into memory until you run out. I
admit that doesn't seem like a very good solution either.
Maybe just put a note in the man page and leave it at that..?

> We could just increase the MAXFILES value. However, each slot uses 552
> bytes on x86, so memory consumption could be an issue (bearing in mind
> that it affects every process which uses libgis). Also, there's no
> point increasing it beyond the OS limit (so 8760 files may not be
> possible, even if you can afford an extra 4.6Mb per process).

Just curious if anyone knows what the operating system open file limits
are for Linux/Irix/Solaris/MacOSX/Win98/WinNT ?

What other modules besides r.patch and r.series would benefit from
increasing the MAXFILES value? 



Markus wrote:
> r.out.mpeg supports wildcards which may be an interesting addition
> also for r.series:
> 
>  r.out.mpeg view1="rain[1-9]","rain1[0-2]" view2="temp*"

Yes, that would be very useful and the code looks like it would copy
over well.


Hamish




More information about the grass-dev mailing list