overflow allocating smatrix
-
- Posts: 5
- Joined: Mon Nov 26, 2012 12:31 pm
Re: overflow allocating smatrix
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
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
-
- Posts: 1384
- Joined: Mon Oct 19, 2009 10:34 am
Re: overflow allocating smatrix
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:
to:
We will consider adding a runmlwin option to control this in a future release.
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
Code: Select all
file write `macro1' "OPTS 1" _n
-
- Posts: 5
- Joined: Mon Nov 26, 2012 12:31 pm
Re: overflow allocating smatrix
Many, many thanks, Chris!
It now works perfectly.
It now works perfectly.
-
- Posts: 9
- Joined: Wed Nov 21, 2012 12:24 pm
Re: overflow allocating smatrix
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!
I've tried this solution that Chris posted last and it seems to have solved the problem.
Thanks!
Re: overflow allocating smatrix
I am very appreciate your site,and your article is useful, thank for sharing us this information.-
Re: overflow allocating smatrix
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.
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.
-
- Posts: 1384
- Joined: Mon Oct 19, 2009 10:34 am
Re: overflow allocating smatrix
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.
-
- Posts: 31
- Joined: Mon Apr 02, 2012 3:26 pm
Re: overflow allocating smatrix
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
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
-
- Posts: 1384
- Joined: Mon Oct 19, 2009 10:34 am
Re: overflow allocating smatrix
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).
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).
-
- Posts: 31
- Joined: Mon Apr 02, 2012 3:26 pm
Re: overflow allocating smatrix
Thanks very much. That simple step resolved my issues. Thanks also for the timely reminder to update my software.