使用不同数量的多核工作线程时的不同行为

发布于 2024-09-15 18:32:18 字数 745 浏览 2 评论 0原文

我正在摆弄我的程序(尝试对几个部分进行多核处理),我注意到“CPU 历史记录”看起来有点不同,具体取决于我启动了多少个工作进程。 2-4 个工作人员似乎会产生“稳定”的工作流程,但是固定 5-8 个工作人员会产生不稳定的行为(从零到最大,请参见图片)。我应该指出,所有运行都以“平滑”最大容量开始(例如,2 个核心只有 25%),并且仅在一分钟左右后才开始表现出不稳定的行为。 这是怎么回事?我有 4 核处理器,您认为这种行为可能与此事实有关吗?

我希望你能看到这些照片。

2名工人 2 名工人

3 名工人 3 工人

4 名工人 4 名工人

5 名工人 5 工人

6 名工人 6 名工人

7 名工人 7 名工人

8 名工人 8 名工人

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?

I hope you can see the pics.

2 workers
2 workers

3 workers
3 workers

4 workers
4 workers

5 workers
5 workers

6 workers
6 workers

7 workers
7 workers

8 workers
8 workers

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

似最初 2024-09-22 18:32:18

这是具有超线程的四核上的经典行为。 R 并没有通过超线程获得优势,因为它经常使用完整的核心来进行计算。因此,如果一个物理处理器产生 2 个逻辑 1,则该处理器必须在两个线程之间连续切换,这解释了这些模式。

对于 R,我推迟了计算机上的超线程。相反,它只是没有帮助。当像 R 通常那样只使用一个线程时,您会损失容量(最大值为 12.5%,而不是 25%)。

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.

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%).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文