6

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!

4

2 に答える 2

8

This should do it:

sysuse auto
expand 10000
bootstrap: logistic foreign price-gear_ratio
于 2011-03-03T16:11:01.693 に答える
2
// 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

この回答は以前の回答に基づいていますが、コメント、セットアップ、および負荷の少ない追加のブートストラップコマンドを追加しました。これを「load.do」というファイルに入れて、Stataで「ファイル」->「実行」を選択して実行できます。[ブレーク]ボタンをクリックして、実行を停止します。

それがより適切であるならば、これを以前の答えに自由にマージしてください。

于 2011-03-03T17:42:33.787 に答える