I'm working on monitoring CPU and memory usage of Stata/MP (the multicore version of Stata/SE) but I am not a Stata programmer (more of a Perl guy).
Can anyone post some code that utilizes a public data set to generate enough load on Stata/MP such that four CPU cores are utilized (or even maxed out) for several minutes or so?
If you can provide me with a .do file and a .dta file (or whatever I may need for this), I think I can take it from there. Thanks in advance!
To run Stata/MP, you can use a desktop computer with a dual-core or quad-core processor, or you can use a server with multiple processors. Whether a computer has separate processors or one processor with multiple cores makes no difference. More processors or cores make Stata/MP run faster.
With Stata/MP, you can process up to 24.4 billion observations on a computer with 1.5 TB of memory. Or more, if there are few enough variables.
The multicore version of Stata—Stata/MP—runs over half of Stata's estimation commands at least 1.8 times faster on dual-core machines, at least 2.8 times faster on quad-core machines, and at least 4 times faster on computers with 8 cores. You don't have to do anything to your commands or your do-files.
'- Stata/MP is the fastest and largest version of Stata (for quad-core, dual-core, and multicore/multiprocessor computers) that can analyze the most data. – Stata/MP allows datasets up to 65,532 variables.
This should do it:
sysuse auto
expand 10000
bootstrap: logistic foreign price-gear_ratio
// 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 some comments, some setup, and an extra bootstrap command that generates less load. You can put this into a file called "load.do" and execute it in Stata with File -> Do. Click the Break button to stop execution.
Please feel free to merge this into the earlier answer if that is more appropriate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With