Thanks Glynn-<div><br></div><div>that&#39;s exactly the problem. I&#39;ve never heard of ulimit (I try not to keep so many files open!). SO glad I know! </div><div><br></div><div>Cheers, </div><div><br></div><div>James</div>


<div><br></div><div><br><br><div class="gmail_quote">On Wed, Aug 18, 2010 at 8:11 PM, Glynn Clements <span dir="ltr">&lt;<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br>
James McCreight wrote:<br>
<br>
&gt; I&#39;ve been forced in to development by this bug (ie i have a only a vague<br>
&gt; idea of what I&#39;m doing). Help greatly appreciated (need to work on thesis<br>
&gt; not bugs).<br>
&gt;<br>
&gt; Summary:<br>
&gt;<br>
&gt; I&#39;ve generated a location and a mapset, in this mapset I have files named<br>
&gt; input_file.0001, ... , input_file.nnnn, ... , input_file.3313<br>
&gt;<br>
&gt; I&#39;m running  r.hydro.CASC2 (used to be in GRASS), which i&#39;ve built from gipe<br>
&gt; add-on package.<br>
&gt; When it gets to approximately nnnn=1016, i get (i&#39;ll use the real rast and<br>
&gt; mapset names, in case they are relevant):<br>
&gt;<br>
&gt; WARNING: Unable to open raster map<br>
&gt; &lt;SBB_runoff_lumped_05.1016@lumped_05_9930&gt;<br>
<br>
</div>If it&#39;s happening after ~1000 files, I strongly suspect you&#39;re hitting<br>
an OS limit on the number of open file descriptors. It&#39;s common to<br>
have a limit of 1024 open files per process.<br>
<br>
Run &quot;ulimit -n&quot; in the shell to determine the soft limit. If this is<br>
too low, use &quot;ulimit -Hn&quot; to determine the hard limit. The soft limit<br>
is what the OS actually checks against; you can change the soft limit<br>
with e.g. &quot;ulimit -n 5000&quot;, but you cannot increase it above the hard<br>
limit, and a non-root user cannot increase the hard limit.<br>
<br>
On systems which use PAM, these limits are set in the file<br>
/etc/security/limits.conf and any files in the directory<br>
/etc/security/limits.d. This file is read by PAM (specifically, the<br>
pam_limits.so module) at login, which sets the limits before dropping<br>
root privilege and switching to the logged in user.<br>
<br>
If you have the ability to change that file, a line such as:<br>
<br>
        *               hard    nofile             5000<br>
<br>
will increase the hard limit to 5000. The limit will take effect for<br>
subsequent logins (you can run &quot;login&quot; in an xterm to get a shell with<br>
the new limits if you don&#39;t want to quit your current desktop<br>
session).<br>
<font color="#888888"><br>
--<br>
Glynn Clements &lt;<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>&gt;<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>- <br>******************************************************************************<br>James McCreight                                  mccreigh @at@ <a href="http://colorado.edu" target="_blank">colorado.edu</a><br>


NASA Earth Science Fellow<br>PhD Candidate, Water Resources and Environmental Fluid Mechanics<br>University of Colorado, Boulder<br>cell: (831) 261-5149<br><div>VoIP (to cell): (720) 897-7546</div><br>
</div>