Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
408 views
in Technique[技术] by (71.8m points)

windows - different behavior when using different number of multicoring workers

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...