Skip to content
Prev 11851 / 21312 Next

[Bioc-devel] library() calls removed in simpleSingleCell workflow

I haven't tried (= had to do it) myself, so I don't know exactly what
it takes, but you can configure this "ulimit" of number of open files,
e.g. instructions in https://stackoverflow.com/a/34645/1072091.  I
suspect it requires admin rights, but I'm not sure - maybe this is
what goes on when you run it in different types terminals.

About this open file/DLL limit: in src/main/Rdynload.c
(https://github.com/wch/r-source/blob/tags/R-3-4-2/src/main/Rdynload.c#L173-L180)
there's the following comment/clarification:

/* Note that it is likely that dlopen will use up at least one file
descriptor for each DLL loaded (it may load further dynamically
linked libraries), so we do not want to get close to the fd limit
(which may be as low as 256). By default, the maximum number of DLLs
that can be loaded is 100. When the fd limit is known, we allow
increasing the maximum number of DLLs via environment variable up to
60% of the limit on open files, but to no more than 1000. g
*/

I always thought that "as low as 256" was for some archaic system,
but, as Wolfgang points out, it's a relevant limit.  Since 0.6*256 =
153, this explains that the choice of the current default of a maximum
100 DLLs is reasonable and requests to bump it up much higher may not
be feasible (not cross-platform).


Related to this - "Garbage collection of DLLs":

I've implemented R.utils::gcDLLs() that "Identifies and removes
["stray"] DLLs of packages already unloaded".  This function will free
up DLL slots otherwise occupied by unloaded packages.  I've used is
successfully in many places, e.g. trying to load and unload all my
installed packages in a single R session (don't ask why ;)).

However, as argued by Karl Millar
(https://stat.ethz.ch/pipermail/r-devel/2016-December/073528.html),
there is a risk that unregistering such DLLs may render the state of R
unstable because we cannot know for sure whether there are some
registered finalizers that rely on such DLLs that yet haven't been
called.  R.utils::gcDLLs() forces the garbage collector to run prior
to unregistering DLLs, which should eliminate the risk for this
problem.  As far as I understand the current R implementation, this
should be enough.  On the other hand, I've been wrong before, I don't
know about future version of R, and it has only been tested so much.
Guaranteeing reentrancy of finalizers is really tricky.

/Henrik
On Fri, Oct 6, 2017 at 10:16 AM, Wolfgang Huber <wolfgang.huber at embl.de> wrote:

Thread (20 messages)

Aaron Lun library() calls removed in simpleSingleCell workflow Oct 4 Kasper Daniel Hansen library() calls removed in simpleSingleCell workflow Oct 4 Obenchain, Valerie library() calls removed in simpleSingleCell workflow Oct 4 Turaga, Nitesh library() calls removed in simpleSingleCell workflow Oct 4 Wolfgang Huber library() calls removed in simpleSingleCell workflow Oct 4 Aaron Lun library() calls removed in simpleSingleCell workflow Oct 4 Laurent Gatto library() calls removed in simpleSingleCell workflow Oct 4 Wolfgang Huber library() calls removed in simpleSingleCell workflow Oct 5 Aaron Lun library() calls removed in simpleSingleCell workflow Oct 5 Wolfgang Huber library() calls removed in simpleSingleCell workflow Oct 5 Aaron Lun library() calls removed in simpleSingleCell workflow Oct 5 Obenchain, Valerie library() calls removed in simpleSingleCell workflow Oct 5 Henrik Bengtsson library() calls removed in simpleSingleCell workflow Oct 5 Aaron Lun library() calls removed in simpleSingleCell workflow Oct 5 Wolfgang Huber library() calls removed in simpleSingleCell workflow Oct 6 Kasper Daniel Hansen library() calls removed in simpleSingleCell workflow Oct 6 Wolfgang Huber library() calls removed in simpleSingleCell workflow Oct 6 Henrik Bengtsson library() calls removed in simpleSingleCell workflow Oct 6 Nan Xiao library() calls removed in simpleSingleCell workflow Oct 6 Martin Morgan library() calls removed in simpleSingleCell workflow Oct 12