Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I generate multicore load on Stata/MP?

Tags:

stata

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!

like image 735
Philip Durbin Avatar asked Mar 03 '11 15:03

Philip Durbin


People also ask

Does Stata use multiple cores?

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.

How many observations can Stata MP handle?

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.

How much faster is Stata MP?

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.

What is MP 16 Stata?

'- 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.


2 Answers

This should do it:

sysuse auto
expand 10000
bootstrap: logistic foreign price-gear_ratio
like image 139
onestop Avatar answered Sep 22 '22 21:09

onestop


// 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.

like image 29
Philip Durbin Avatar answered Sep 24 '22 21:09

Philip Durbin