mersenneforum.org  

Go Back   mersenneforum.org > New To GIMPS? Start Here! > Information & Answers

Reply
 
Thread Tools
Old 2008-11-01, 12:59   #1
Unregistered
 

32×997 Posts
Default Workers use same CPU

I just upgraded my laptop to v25.7, build 3 and now only one CPU is used, because the two workers use the same CPU. What's going wrong and how can I fix this?
My OS is Ubuntu Hardy (32bit) and I have 2 x 1GB RAM with an Intel Core2 Duo T9300 @ 2.50GHz.
Here is the output of starting mprime on the console with the -d option:

klaus@laptop-klaus:~/MPrime/mobil$ ./mprime -d
[Main thread Nov 1 13:49] Mersenne number primality test program version 25.7
[Main thread Nov 1 13:49] Starting workers.
[Worker #2 Nov 1 13:49] Worker starting
[Worker #2 Nov 1 13:49] Setting affinity to run worker on logical CPU #0
[Worker #1 Nov 1 13:49] Worker starting
[Worker #1 Nov 1 13:49] Setting affinity to run worker on logical CPU #0
[Worker #2 Nov 1 13:49] Resuming primality test of M407XXXXX using FFT length 2560K
[Worker #1 Nov 1 13:49] Resuming primality test of M395XXXXX using FFT length 2560K
[Worker #2 Nov 1 13:49] Iteration: 496XXXX / 407XXXXX [12.18%].
[Worker #1 Nov 1 13:49] Iteration: 865XXXX / 395XXXXX [21.86%].

-- I pressed Ctrl+C:
[Main thread Nov 1 13:49] Stopping all worker threads.
[Worker #1 Nov 1 13:49] Stopping primality test of M395XXXXX at iteration 865XXXX [21.86%]
[Worker #1 Nov 1 13:49] Worker stopped.
[Worker #2 Nov 1 13:49] Stopping primality test of M407XXXXX at iteration 496XXXX [12.18%]
[Worker #2 Nov 1 13:49] Worker stopped.
[Main thread Nov 1 13:49] Execution halted.
[Main thread Nov 1 13:49] Choose Test/Continue to restart.
  Reply With Quote
Old 2008-11-01, 13:33   #2
S485122
 
S485122's Avatar
 
"Jacob"
Sep 2006
Brussels, Belgium

22×439 Posts
Default

You can correct this by using the menus (I think there is a startup parameter for that.) Otherwise edit the local.txt file and add following lines :

[Worker #1]
Affinity=0

[Worker #2]
Affinity=1

[Worker #3]
Affinity=2

...

Jacob
S485122 is offline   Reply With Quote
Old 2008-11-01, 16:35   #3
Unregistered
 

2×5×7×13 Posts
Default

Thank you, Jacob, I added the lines and it works with 100% CPU now.
My problem was that I missed the "Affinity"-Menu, when starting ./mprime -m.

By the way, ./mprime -h shows all possible Parameters, but it seems to me there is no other way to change this setting as manually editing the "local.txt" file.
  Reply With Quote
Old 2008-11-02, 10:39   #4
Oleg V.Cat
 
Oct 2008
Riga, Latvia

B16 Posts
Default

Quote:
Originally Posted by S485122 View Post
[Worker #1]
Affinity=0

[Worker #2]
Affinity=1

[Worker #3]
Affinity=2

Jacob
And if I want to use more than one CPU thread per worker?
Oleg V.Cat is offline   Reply With Quote
Old 2008-11-02, 15:18   #5
S485122
 
S485122's Avatar
 
"Jacob"
Sep 2006
Brussels, Belgium

22×439 Posts
Default

I do not know mprime, but if the menu structure is the same as for Prime95, the affinity is set in "Test / Worker Windows."

To use more than one thread per worker, you have to specify a number of workers smaller than your number of CPUs (cores). I do not know if it is possible to set the affinity for a multithreaded worker.

(Btw I just fiddled with menus to know al of this.)

OK after testing some more :

[Worker #1]
Affinity=0
ThreadsPerTest=2

[Worker #2]
Affinity=2
ThreadsPerTest=1

[Worker #3]
Affinity=3
ThreadsPerTest=1

A multi threaded test will use consecutive CPUs after the one set by affinity.

In most situations multithreade tests give a slower overall throughput than mono threaded tests. ( to test 4 exponents it will be quicker overall to start the 4 tests on 4 workers than using 4 CPUs on one worker and testing the exponents sequentially.) See numerous posts on the forum.

Jacob
S485122 is offline   Reply With Quote
Old 2008-11-02, 15:49   #6
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

5·29·53 Posts
Default

I'm interested in any reproducible case where the program decided to run two workers on the same CPU. Email the CPU details, prime.txt, local.txt to me. You should not have to set Affinity for mprime to put each worker on a different CPU.
Prime95 is online now   Reply With Quote
Old 2008-11-02, 17:22   #7
Oleg V.Cat
 
Oct 2008
Riga, Latvia

B16 Posts
Default

Quote:
Originally Posted by Prime95 View Post
I'm interested in any reproducible case where the program decided to run two workers on the same CPU. Email the CPU details, prime.txt, local.txt to me. You should not have to set Affinity for mprime to put each worker on a different CPU.
I have picture (see attach) like this on 4X Intel Xeon MP. (I think, 2xhyperthreading, but not sure). In all cases, task manager show 8CPU, and in this configuration 8 threads from 4 workers try to sit on 4 logical CPU (0,1,4,5)

---------- local.txt
OldCpuSpeed=3003
Memory=256
SrvrPO2=1
SrvrPO3=5
SrvrPO4=256
SrvrPO5=256
SrvrPO6=450
SrvrPO7=1410
SrvrPO8=1
SrvrPO9=4
SrvrP00=6
LastEndDatesSent=1225629950
ThreadsPerTest=2
RollingHash=470590818
RollingCompleteTime=4280859
RollingStartTime=1225617118
RollingAverage=943
SrvrPO1=101
Affinity=100

----------- Prime.txt
V24OptionsConverted=1
SendAllFactorData=1
StressTester=0
UsePrimenet=1
Windows95Service=0
DialUp=0
Left=248
Top=137
Right=1448
Bottom=998
OutputIterations=100000
ResultsFileIterations=999999999
DiskWriteTime=30
NetworkRetryTime=2
NetworkRetryTime2=70
DaysOfWork=5
DaysBetweenCheckins=1
TwoBackupFiles=1
SilentVictory=0
Priority=1
RunOnBattery=1
MinTortureFFT=8
MaxTortureFFT=4096
TortureMem=8
TortureTime=15
WorkPreference=101
Attached Thumbnails
Click image for larger version

Name:	prime25on4CPU.PNG
Views:	162
Size:	53.1 KB
ID:	2892  
Oleg V.Cat is offline   Reply With Quote
Old 2008-11-03, 01:49   #8
Peter Nelson
 
Peter Nelson's Avatar
 
Oct 2004

10000100012 Posts
Default

Hi Oleg.

I also have a Four socket Xeon MP machine, with hyperthreading enabled. Thus I also have 8 "virtual" cores.

I'm running the linux 64 bit version, and I also found that the assignment of work to particular virtual cores seems a little random and may not be optimal. But at least its working hard.

Maybe the software could better differentiate between two Quadcore processors and four hyperthreading processors?
Peter Nelson is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Workers galgrnpa Software 5 2016-08-09 14:54
Getting 34M-35M DC assignments for GPU workers UBR47K PrimeNet 3 2015-09-06 06:09
How many workers? Unregistered Information & Answers 12 2013-01-22 12:09
Max # Workers sk8kidamh Software 5 2011-07-16 15:58
Went from 8 workers to 4 workers on v26.6 upgrade dmoran Software 13 2011-05-23 12:36

All times are UTC. The time now is 02:13.


Sat Dec 4 02:13:59 UTC 2021 up 133 days, 20:42, 0 users, load averages: 1.02, 1.33, 1.37

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.