Hi! Attached to this mail, you find a patch for gram.y setting a #define CONTEXT_STACK_SIZE for the context stack size and replacing the following constants 50 and 49 by CONTEXT_STACK_SIZE and CONTEXT_STACK_SIZE-1. The new #define makes setting the stack size much more easy; I also have increased it to 500, because 50 is too small (we use R to iterate through sets of simulation parameters, which requires a context stack size of around 100). I have also discovered that yacc is only invoked when R is configured with "--enable-maintainer-mode", i.e. the redundant output file gram.c is part of the source distribution. Would is not be better to always generate gram.c from gram.y instead of providing gram.y and gram.c? Best regards -- ====================================================================== Dipl.-Inform. Thomas Dreibholz University of Essen, Room ES210 Inst. for Experimental Mathematics Ellernstra?e 29 Computer Networking Technology Group D-45326 Essen/Germany ----------------------------------------------------------------------- E-Mail: dreibh at exp-math.uni-essen.de Homepage: http://www.exp-math.uni-essen.de/~dreibh ======================================================================-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: not available Url : https://stat.ethz.ch/pipermail/r-devel/attachments/20060531/2fc8a345/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: gram.y.diff.gz Type: application/x-gzip Size: 2070 bytes Desc: not available Url : https://stat.ethz.ch/pipermail/r-devel/attachments/20060531/2fc8a345/attachment.gz
On Wed, 31 May 2006, Thomas Dreibholz wrote:> Hi! > > Attached to this mail, you find a patch for gram.y setting a #define > CONTEXT_STACK_SIZE for the context stack size and replacing the following > constants 50 and 49 by CONTEXT_STACK_SIZE and CONTEXT_STACK_SIZE-1. The new > #define makes setting the stack size much more easy; I also have increased it > to 500, because 50 is too small (we use R to iterate through sets of > simulation parameters, which requires a context stack size of around 100).I think you will have to explain in detail why you need this, when for a decade R users have not reported a need for it. It is not related to iteration in R, rather to the depth of recursion needed to parse R code.> I have also discovered that yacc is only invoked when R is configured with > "--enable-maintainer-mode", i.e. the redundant output file gram.c is part of > the source distribution. Would is not be better to always generate gram.c > from gram.y instead of providing gram.y and gram.c?We do not require end users to have yacc, and Windows users definitely do not have it. Nor do those of lots of other platforms, e.g. Solaris. Please read the R-admin manual to discover the requirements (it is always a good idea to read the manual before posting). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On Wednesday 31 May 2006 15:26, Prof Brian Ripley wrote:> On Wed, 31 May 2006, Thomas Dreibholz wrote: > > Hi! > > > > Attached to this mail, you find a patch for gram.y setting a #define > > CONTEXT_STACK_SIZE for the context stack size and replacing the following > > constants 50 and 49 by CONTEXT_STACK_SIZE and CONTEXT_STACK_SIZE-1. The > > new #define makes setting the stack size much more easy; I also have > > increased it to 500, because 50 is too small (we use R to iterate through > > sets of simulation parameters, which requires a context stack size of > > around 100). > > I think you will have to explain in detail why you need this, when for a > decade R users have not reported a need for it. It is not related to > iteration in R, rather to the depth of recursion needed to parse R code.We use R to create input files for OMNeT++ simulations. The simulation parameters are defined like this: param01Set <- c(...) param02Set <- c(...) ... paramXYSet <- c(...) Most of these sets only contain a single element. The input file generation, which should be usable for all simulations, works as follows: for(param01 in param01Set) { for(param02 in param02Set) { ... for(paramXY in paramXYSet) { Generate input file for these parameter settings } ... } } The simulation has more than 50 different parameters, so a "contextstack overflow" error will be the result. Increasing the context stack size in gram.y solves this problem. (Clearly, only using "for" iterations for sets consisting of more than one element would solve the problem - but this requires a special version of the parameter generation function for every simulation.) Best regards -- ====================================================================== Dipl.-Inform. Thomas Dreibholz University of Essen, Room ES210 Inst. for Experimental Mathematics Ellernstra?e 29 Computer Networking Technology Group D-45326 Essen/Germany ----------------------------------------------------------------------- E-Mail: dreibh at exp-math.uni-essen.de Homepage: http://www.exp-math.uni-essen.de/~dreibh ======================================================================-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: not available Url : https://stat.ethz.ch/pipermail/r-devel/attachments/20060531/138dbfbd/attachment.bin