How can I generate multi-core load on Stata / MP?

I am working on monitoring CPU and memory usage of Stata / MP (multi-core version of Stata / SE), but I am not a Stata programmer (more of a Perl guy).

Can someone post some code that uses a public dataset to create enough load on Stata / MP, so that the four processor cores are used (or even exceeded) for several minutes or so?

If you can provide me with a .do file and a .dta file (or something else that I might need for this), I think I can take it from there. Thanks in advance!

+4
source share
2 answers

This should do it:

sysuse auto expand 10000 bootstrap: logistic foreign price-gear_ratio 
+7
source
 // Clear memory before each run // http://www.stata.com/help.cgi?clear clear all // Allocate plenty of memory // http://www.stata.com/help.cgi?memory set memory 1024m // Load data set: 1978 Automobile Data // (Use "sysuse dir" to list other data sets) // http://www.stata.com/help.cgi?sysuse sysuse auto // Duplicate observations // http://www.stata.com/help.cgi?expand expand 10000 // Bootstrap sampling and estimation // http://www.stata.com/help.cgi?bootstrap // Generate high load using example from bootstrap documentation bootstrap: regress mpg weight gear foreign // Generate even higher load and for a longer period //bootstrap: logistic foreign price-gear_ratio 

This answer is based on an earlier answer, but I added a few comments, some tweaking and an additional bootstrap command that creates less load. You can put this in a file called "load.do" and execute it in Stata using File -> Do. Click the Break button to stop execution.

Please feel free to merge this into an earlier answer if this is more appropriate.

+2
source

Source: https://habr.com/ru/post/1342148/


All Articles