使用不同数量的多核工人时的不同行为 [英] different behavior when using different number of multicoring workers

查看:75
本文介绍了使用不同数量的多核工人时的不同行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的程序上玩了一些(尝试多核一些部分),并且我发现"CPU历史记录"看起来有些不同,这取决于我要启动多少个工人. 2-4个工作人员似乎产生了稳定"的工作流程,但是将5-8个工作人员挂钩会产生不稳定的行为(从零到最大,请参见图片).我应该指出,所有运行都以平滑的"最大容量开始(例如,只有25%的2个内核),并且仅在一分钟左右后才开始表现出不稳定的行为. 这是怎么回事?我有4核处理器,您是否认为此行为可能与此事实有关?

I am playing around a bit with my program (trying to multicore a few parts) and I've noticed the "CPU history" looks a bit different, depend on how many workers I start. 2-4 workers seems to produce a "stable" workflow, however pegging 5-8 workers produces erratic behavior (from zero to max, see pictures). I should point out that all runs started out with "smooth" max capacity (e.g. 2 cores with only 25%), and started to exhibit erratic behavior only after a minute or so. What's going on? I have 4 core processor, and do you think this behavior may be related to this fact?

希望您能看到图片.

2名工人

3名工人

4名工人

5名工人

6名工人

7名工人

8名工人

推荐答案

这是具有超线程功能的四核处理器上的经典行为. R不能通过超线程获得收益,因为它经常使用完整的内核进行计算.因此,如果一个物理处理器使两个逻辑处理器相符,则该处理器必须在两个线程之间连续切换,这说明了模式.

This is classic behaviour on a quad-core with hyperthreading. R doesn't gain with hyperthreading, as it uses often the complete core for the calculations. Thus, if one physical processor makes 2 logical ones, the processor has to switch continuously between both threads, which explains the patterns.

对于R,我推迟了计算机上的超线程.相反,它只是无济于事.当像R一样正常使用一个线程时,您会失去容量(最大值是12.5%,而不是25%).

For R, I put off the hyperthreading on my computer. It just doesn't help, in contrary. When working with only one thread as R does normally, you lose capacity (max is 12.5% instead of 25%).

这篇关于使用不同数量的多核工人时的不同行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆