【问题标题】:How can I generate multicore load on Stata/MP?如何在 Stata/MP 上生成多核负载?
【发布时间】:2011-03-03 15:51:17
【问题描述】:

我正在监控 Stata/MP(Stata/SE 的多核版本)的 CPU 和内存使用情况,但我不是 Stata 程序员(更像是 Perl 人)。

任何人都可以发布一些代码,利用公共数据集在 Stata/MP 上产生足够的负载,从而在几分钟左右使用(甚至最大化)四个 CPU 内核吗?

如果你能给我提供一个 .do 文件和一个 .dta 文件(或我可能需要的任何文件),我想我可以从那里拿走。提前致谢!

【问题讨论】:

  • 这个问题,因为它不涉及统计分析,所以在统计网站上并不合适。您可能会从 Stata 用户的列表服务stata.com/statalist 获得快速而权威的答案。同时,让我们将其迁移到相关的 Stack Exchange 论坛。

标签: stata


【解决方案1】:

应该这样做:

sysuse auto
expand 10000
bootstrap: logistic foreign price-gear_ratio

【讨论】:

  • 非常感谢!这是完美的!
【解决方案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

这个答案基于earlier answer,但我添加了一些 cmets、一些设置和一个额外的引导命令,以减少负载。您可以将其放入一个名为“load.do”的文件中,并在 Stata 中使用 File -> Do 执行它。点击 Break 按钮停止执行。

如果更合适,请随时将其合并到较早的答案中。

【讨论】:

    猜你喜欢
    • 2011-08-30
    • 1970-01-01
    • 2021-01-06
    • 2012-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-27
    相关资源
    最近更新 更多