Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Any suggestions for profile.do?


From   "Sergiy Radyakin" <[email protected]>
To   [email protected]
Subject   Re: st: RE: Any suggestions for profile.do?
Date   Mon, 17 Mar 2008 11:32:54 -0400

I believe you do it by changing the registry entry for .dta type
files. Unfortunately,
if Stata's command "restore file associations" is chosen it will
destroy the changes you've made in the registry and set the default
values. The robust way would be to look at the parameters that Stata
itself receives. This can be done with the help of a plugin, see
http://ca.geocities.com/radyakin/ for the binary (win32) and
instructions.

I would also doubt the validity of the formula you are using for
memory allocation.
For long narrow datasets, such as repetitive measurements of a
parameter, where the overhead becomes significant, your formula might
reserve not enough memory to even load the dataset.

To see this:
set obs 20000000
gen byte x=1
save "C:\temp\narrow.dta"

Now try to open it.

The problem with these kind of datasets is that the overhead that
Stata imposes becomes laregr than the data itself. Here 20 mln
observations size of 1 byte occupy not 20mb, but 100mb in regular
Stata and 180mb in Stata/MP (yes, MP version is more memory-hungry
than the regular version).

Best regards, Sergiy Radyakin





On 3/15/08, Jeph Herrin <[email protected]> wrote:
> In a "more is sometimes too much" vein:
>
> I use XP and often open datasets by double clicking the
> icon. Sometimes I need to open several datasets, and I
> thought the most efficient thing would be if "set mem"
> in profile.do could match the size of the dataset. Hence,
> my profile.do takes an argument and includes this to allocate
> 50% more memory than the file requires (unless Stata is
> being invoked with .do file):
>
> ========================================================
>
> set mem 100m
> if "`1'"~="" {
>        if (strpos("`1'",".dta")>0) {
>                d using "`1'", short
>                local size = int(r(width)*r(N)*1.5/(2^20))
>                local size = max(10,`size')
>                set mem `size'm
>                use "`1'"
>        }
>        else if (indexnot("`1'",".do")>0) {
>                do "`1'"
>        }
> }
>
> =======================================================
>
> (For reasons I don't understand, this does not work if
> I replace "indexnot" from old versions with "strpos()==0".)
>
> Of course, you then have to fiddle the command line for .dta
> and .do file types so that profile.do is invoked with an argument,
> so it's not for everyone.
>
> Jeph
>
>
> Nick Winter wrote:
> > In a "less is more" vein, I note that both -set mem- and -set matsize-
> > allow the -permanent- options, which removed the need to have them in
> > profile.do.
> >
> > And you can specify a different starting directory on installation.  Not
> > sure if that can be changed after installation...
> >
> > Nick Winter
> >
> > Nick Cox wrote:
> >> On your last question, proper installation through -net- or -ssc-
> >> (which is just an elaborate wrapper for -net-) takes care of that.
> >> Conversely, I don't think there is anything you could put in a
> >> profile.do that will stop you putting files in dopey places if you are
> >> so minded (except -exit, STATA-).
> >> I include this in my profile.do (local details suppressed)
> >> set httpproxy on
> >> set httpproxyhost <whatever> set httpproxyport 8080
> >> and that's essential when it's essential. See help on -netio-.
> >> There's software for which there's a deep art, or some kind of
> >> chutzpah, in building up a long personalised initialisation file full
> >> of clever tricks, but I am not sure that Stata is included under that
> >> heading.
> >> Nick
> >> Allan Joseph Medwick
> >>
> >> I just reinstalled Stata and I would like to keep my installation
> >> directory clean.  What are some good tips for making efficient use of
> >> profile.do?
> >>
> >> So far, I have included the following commands:
> >>
> >> set mem 500m
> >> set matsize 5000
> >> cd C:\Users\amedwick\Documents\Stata
> >>
> >> Is there a way to keep updates from STB, SJ, SSC in their own folders?
> >>  Anything else should I include?
> >>
> >> *
> >> *   For searches and help try:
> >> *   http://www.stata.com/support/faqs/res/findit.html
> >> *   http://www.stata.com/support/statalist/faq
> >> *   http://www.ats.ucla.edu/stat/stata/
> >
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index