← Back to team overview

yade-dev team mailing list archive

Re: cpu affinity problem

 

and a further question is, why did that happen to our machines?
Even my new virtual box shows this behavior you describe.
I am always usung Ubuntu 12.04 LTS 64bit, shall that be the problem?


-----Ursprüngliche Nachricht-----
Von: Yade-dev [mailto:yade-dev-bounces+alexander.eulitz=iwf.tu-berlin.de@xxxxxxxxxxxxxxxxxxx] Im Auftrag von Christian Jakob
Gesendet: Freitag, 28. Februar 2014 10:52
An: Yade Development Group
Betreff: [Yade-dev] cpu affinity problem

Hi there,

I just tried to find out what is not working at my machine in parallel mode (using yade -jN). First thing I recognized is different MHz for my CPUs are used:

me@debian ~/YADE/build >less /proc/cpuinfo | grep MHz
cpu MHz         : 3167.68
cpu MHz         : 2000.0
cpu MHz         : 2000.0
cpu MHz         : 2000.0
cpu MHz         : 2000.0
cpu MHz         : 2000.0
cpu MHz         : 2000.0
cpu MHz         : 2000.0

I disabled GV1/GV3 and C mode for CPU performance in BIOS:

(I skipped the part where I had to reinstall kde and graphic driver because PC was running for 276 days and there was a kernel update, which broke my graphics module, which leads to black screen when starting kdm, which .... whatever ... )

me@debian ~/YADE/build >less /proc/cpuinfo | grep MHz
cpu MHz         : 3158.704
cpu MHz         : 3158.704
cpu MHz         : 3158.704
cpu MHz         : 3158.704
cpu MHz         : 3158.704
cpu MHz         : 3158.704
cpu MHz         : 3158.704
cpu MHz         : 3158.704

But still the same problem occurs (for new and old versions of yade).  
So I googled that and it seems to be a problem with cpu affinity.

When I run yade -j4 --performance I see 4 PIDs (threads) running at 1 and the same core the whole time (e.g. PID = {11962,11963,11964,11965} in htop).

Then I tried this ...

me@debian ~/YADE/trunk >taskset -c -p 0 11962 pid 11962's current affinity list: 0 pid 11962's new affinity list: 0 me@debian ~/YADE/trunk >taskset -c -p 1 11963 pid 11963's current affinity list: 0 pid 11963's new affinity list: 1 me@debian ~/YADE/trunk >taskset -c -p 2 11964 pid 11964's current affinity list: 0 pid 11964's new affinity list: 2 me@debian ~/YADE/trunk >taskset -c -p 3 11965 pid 11965's current affinity list: 0 pid 11965's new affinity list: 3

and viola, it is working as expected (at least until one run with X balls is finished, after that PID is changing again and all new PIDs switched back on CPU 0).

So my question is:

How can I set cpu affinity? Do you know a fast-and-dirty way to get rid of this?

Thanks in advance,

cheesed off Christian


_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


References