List Info

Thread: R-GRASS link problem




R-GRASS link problem
country flaguser name
Spain
2007-08-08 08:55:06
Hi;
I've already reported this problem to the R list, but it is
probable
that the source of the problem is GRASS (5.4) instead of R.
I'm using the library GRASS in R to carry out a sequence of
operation in
a set of GRASS maps.
After a couple of loops I obtain the warning message:
"Too many open raster files"
and the communication between R and GRASS does not work
anymore for that
moment on.

The fact is that I'm opening a sequence of maps, but the
destination
name in R is always the same, so it does not seem to be an R
problem but
a GRASS one.

Could you advise me about how to solve this?

Thanks and best regards,

Javier
------------------------

-- 
Javier García-Pintado
Institute of Earth Sciences Jaume Almera (CSIC)
Lluis Sole Sabaris s/n, 08028 Barcelona
Phone: +34 934095410
Fax:   +34 934110012
e-mail:jgarciaija.csic.es 


_______________________________________________
statsgrass mailing list
statsgrassgrass.itc.it
http:
//grass.itc.it/mailman/listinfo/statsgrass

  
Re: R-GRASS link problem
country flaguser name
Norway
2007-08-08 09:24:58
On Wed, 8 Aug 2007, javier garcia-pintado wrote:

> Hi;
> I've already reported this problem to the R list, but
it is probable
> that the source of the problem is GRASS (5.4) instead
of R.

You wrote to R-help, not to R-sig-geo, which is the correct
list on the R 
side.

> I'm using the library GRASS in R to carry out a
sequence of operation in
> a set of GRASS maps.
> After a couple of loops I obtain the warning message:
> "Too many open raster files"
> and the communication between R and GRASS does not work
anymore for that
> moment on.
>
> The fact is that I'm opening a sequence of maps, but
the destination
> name in R is always the same, so it does not seem to be
an R problem but
> a GRASS one.
>

The GRASS package for legacy GRASS 5 has its own copy of the
GRASS library 
files that it calls, and the problem occurs when the number
of "open" 
files exceeds MAXFILES 256. You can change this in
src/include/G.h and 
re-build if you like, but since the C source of rastget
shows you, it is 
careful to close the file handles, line 214 in
src/rastget.c. This leads 
me to think that this is an OS story, and so we need to know
your OS. 
Here, Windows or cygwin may behave very differently when
freeing system 
resources from say Linux.

For me on Linux, running example(rast.get) outside GRASS (I
do not have a 
working GRASS 5 installation any more) and then running:

for (i in 1:260) {
  print(i)
  exget <- rast.get(G, rlist=c("ex.Zn.grid.in",
"ex.tr3.in",
   "ex.Zn.grid.o.in"),
catlabels=as.logical(c(FALSE, FALSE, TRUE)))
}

did not show any problems.

Roger

> Could you advise me about how to solve this?
>
> Thanks and best regards,
>
> Javier
> ------------------------
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics,
Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045
Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivandnhh.no

_______________________________________________
statsgrass mailing list
statsgrassgrass.itc.it
http:
//grass.itc.it/mailman/listinfo/statsgrass

Re: R-GRASS link problem
country flaguser name
United States
2007-08-08 15:35:55
Hi,

just to note that these limitations no longer exist in
recent GRASS 6.

Markus


Roger Bivand wrote:
> 
> On Wed, 8 Aug 2007, javier garcia-pintado wrote:
> 
>> Hi;
>> I've already reported this problem to the R list,
but it is probable
>> that the source of the problem is GRASS (5.4)
instead of R.
> 
> You wrote to R-help, not to R-sig-geo, which is the
correct list on the R 
> side.
> 
>> I'm using the library GRASS in R to carry out a
sequence of operation in
>> a set of GRASS maps.
>> After a couple of loops I obtain the warning
message:
>> "Too many open raster files"
>> and the communication between R and GRASS does not
work anymore for that
>> moment on.
>>
>> The fact is that I'm opening a sequence of maps,
but the destination
>> name in R is always the same, so it does not seem
to be an R problem but
>> a GRASS one.
>>
> 
> The GRASS package for legacy GRASS 5 has its own copy
of the GRASS library 
> files that it calls, and the problem occurs when the
number of "open" 
> files exceeds MAXFILES 256. You can change this in
src/include/G.h and 
> re-build if you like, but since the C source of rastget
shows you, it is 
> careful to close the file handles, line 214 in
src/rastget.c. This leads 
> me to think that this is an OS story, and so we need to
know your OS. 
> Here, Windows or cygwin may behave very differently
when freeing system 
> resources from say Linux.
> 
> For me on Linux, running example(rast.get) outside
GRASS (I do not have a 
> working GRASS 5 installation any more) and then
running:
> 
> for (i in 1:260) {
>   print(i)
>   exget <- rast.get(G,
rlist=c("ex.Zn.grid.in", "ex.tr3.in",
>    "ex.Zn.grid.o.in"),
catlabels=as.logical(c(FALSE, FALSE, TRUE)))
> }
> 
> did not show any problems.
> 
> Roger
> 
>> Could you advise me about how to solve this?
>>
>> Thanks and best regards,
>>
>> Javier
>> ------------------------
>>
>>
> 
> -- 
> Roger Bivand
> Economic Geography Section, Department of Economics,
Norwegian School of
> Economics and Business Administration, Helleveien 30,
N-5045 Bergen,
> Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
> e-mail: Roger.Bivandnhh.no
> 

-- 
View this message in context: http://www.nabble.com/R-GRASS-link-problem-tf
4236573.html#a12061387
Sent from the Grass - Stats mailing list archive at
Nabble.com.

_______________________________________________
statsgrass mailing list
statsgrassgrass.itc.it
http:
//grass.itc.it/mailman/listinfo/statsgrass

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )