Page 2 of 2

Re: overflow allocating smatrix

Posted: Tue Nov 27, 2012 11:09 am
by GinaPotarca
Hi Chris,
I'm using Mlwin 26 and an up to date runmlwin. And I get the same errors:

'cannot allocate smatrix(fs)'
'error while obeying batch file C:\Users\EWP-GMW\AppData\Local\Temp\ST_00000007.tmp at line number 145: STAR
cannot allocate smatrix(fs)'

The only difference is now I get number 145(: STAR) instead of 148.

Gina

Re: overflow allocating smatrix

Posted: Tue Nov 27, 2012 2:50 pm
by ChrisCharlton
When allocating memory for holding matrices used within the algorithm MLwiN can either allocate them to be large enough for the worst-case situation in the algorithm (The maximum number of lowest level units within units at the highest level), or it can assume that the situation where these are needed won't occur and allocate them to be much smaller. If it assumes the latter then it's possible that there won't be enough space during estimation, causing an estimation error. Which option MLwiN chooses to take is controlled by the OPTS command. In runmlwin we use OPTS 0 which causes it to allocate enough for the worst-case, however in this case there are too many level 1 units in one of the regions for this to work, and hence the allocation failure.

To work around the error you need to change the following line in runmlwin.ado from:

Code: Select all

file write `macro1' "OPTS 0" _n
to:

Code: Select all

file write `macro1' "OPTS 1" _n
We will consider adding a runmlwin option to control this in a future release.

Re: overflow allocating smatrix

Posted: Tue Nov 27, 2012 3:34 pm
by GinaPotarca
Many, many thanks, Chris!
It now works perfectly.

Re: overflow allocating smatrix

Posted: Mon Dec 03, 2012 6:21 pm
by patriciotroncoso
I'm sorry for not replying before, I see that I'm not the only one with this problem.

I've tried this solution that Chris posted last and it seems to have solved the problem.

Thanks!

Re: overflow allocating smatrix

Posted: Thu Dec 13, 2012 11:28 am
by MAhmad12
I am very appreciate your site,and your article is useful, thank for sharing us this information.-

Re: overflow allocating smatrix

Posted: Sat Jan 12, 2013 4:24 pm
by rlocalio
Encountering the "cannot allocate smatrix(fs)" error as others have seen, and with dataset
that runs in MLwiN but fails when using runmlwin. The fix of editing runmlwin.ado
also did not seem to work. The only solution was to reduce the sample size within each
cluster, but that is not a solution because cluster sizes are large. Problem arises across
hardware, even with a machine with 16G central memory. Without using runmlwin
the problem ran easily with a central memory of only 3G. 2 levels, 25 clusters, 350,000
subjects.

Re: overflow allocating smatrix

Posted: Mon Jan 14, 2013 11:20 am
by ChrisCharlton
It may be that runmlwin is overestimating the amount of worksheet space required to hold the data. You could try overriding these settings to match what you use in the standalone context by using the worksheet() options in runmlwin. If you have a 64-bit machine you could also try setting your MLwiN_path global to mlnscript.exe in the x64 directory instead of mlwin.exe in the i386 directory as this will allow it to use all the memory in the machine. The downside to this would be that you would lose the equation and progress display.

Re: overflow allocating smatrix

Posted: Fri Jul 28, 2017 11:45 am
by rdmcdowell
Hello list users

I am having the same difficulty when working with runmlwin. It's a simple 1-level logistic regression model, for starters, with 3 independent predictors. The dataset contains approx 170,000 entries.

When I fit the model directly in mlwin, the estimates are correct and the workbook settings are worksheet size (100000), level(5), columns(1500), variables(150), groups(20).

When I try to fit the model using runmlwin, I get the usual "overflow allocating smatrix" error. Examination of the settings as stored in the macro are worksheet size(34127) columns(1500) level(6) groups(30).

When I alter the runmlwin settings to mirror the default settings found in mlwin directly I still get the error message, even when adding the tempmat option.

Has anyone any tips they can share about work arounds? The output is much more userfriendly in runmlwin, which is why I'd like to persevere!

I'm using Mlwin 2.32, Stata 12 on a 4bit WIndows PC.

Many thanks

Ron

Re: overflow allocating smatrix

Posted: Fri Jul 28, 2017 11:56 am
by ChrisCharlton
Could you try using the optimat option instead of tempmat and seeing if that works?

I would also suggest trying with a newer MLwiN version (updates can be requested at: https://www.cmm.bris.ac.uk/clients/softwaredownload/), as there have been a number of fixes since 2.32 (see: http://www.bristol.ac.uk/cmm/software/m ... fixes.html).

Re: overflow allocating smatrix

Posted: Tue Aug 01, 2017 7:36 am
by rdmcdowell
Thanks very much. That simple step resolved my issues. Thanks also for the timely reminder to update my software.