mersenneforum.org  

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

Reply
 
Thread Tools
Old 2009-07-10, 13:24   #1
jippie
 

25·3·89 Posts
Default exclude single core from quad core cpu for gimps

Basically what I am trying to do is to use three out of four cores for mprime on linux64. I want the fourth core to be available for the system at all times to have better desktop performance. How can this be done?
I am running mprime259-linux64 on Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz and all threads have nice value 19.
  Reply With Quote
Old 2009-07-10, 14:18   #2
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17×251 Posts
Default

Under Test > Worker Windows you can choose how many worker windows to run. I believe that with mprime you need to run ./mprime -m to bring up the menu.

You generally shouldn't be noticing a slowdown when running mprime at the lowest priority (like you are). Are one or more of the workers currently running P-1 stage 2? If so, you might be noticing issues related to memory usage and paging. You can set the amount of memory that mprime can use in Options > CPU to prevent this.
It might be possible that memory/cache bandwidth could be causing the issue, in which case I'd suggest changing one or two of the cores to TFing, at least temporarily to see if that fixes it. (if you change two to TFing, don't make them cores 1 and 2 or 3 and 4, break it up a bit like 1 and 3 so that it will be in more separate areas physically)
Mini-Geek is offline   Reply With Quote
Old 2009-07-10, 16:42   #3
pegaso56
 
pegaso56's Avatar
 
Oct 2006
Rosario, Argentina

3710 Posts
Default

Hi, I am running one P-1 and three LMH in a Phenom II, using 2600 Mb of memory and did not find any problem for mprime 25.9, desktop runs smoothly and Xorg was reniced from 0 to 10 also without not aprecciable slowdown.
Regards, Carlos
pegaso56 is offline   Reply With Quote
Old 2009-07-13, 20:22   #4
joblack
 
joblack's Avatar
 
Oct 2008
n00bville

52·29 Posts
Default

Quote:
Originally Posted by pegaso56 View Post
Hi, I am running one P-1 and three LMH in a Phenom II, using 2600 Mb of memory and did not find any problem for mprime 25.9, desktop runs smoothly and Xorg was reniced from 0 to 10 also without not aprecciable slowdown.
Regards, Carlos
It depends - it can slow down a little bit, especially because the Qxxxx Quads are two - double cores - and competing for the memory access. Additionally there could be a problem with your memory (virtual memory swapping because you don't have enough memory -> to a slower harddisk, ...)

That might be different for the Phenom and Core i7 (because they are 'real quad cores' and have a better memory management).

Alternative you can use two worker threads with two cpu threads (1 + 2 for one and 3 + 4 for another) so you have an optimized memory allocation.

That works more fluently in my case and you still have a very well desktop performance. Btw. if you compile your kernel for fast desktop latency it should be no problem whatever configuration you use ...

Last fiddled with by joblack on 2009-07-13 at 20:27
joblack is offline   Reply With Quote
Old 2009-12-10, 20:34   #5
Unregistered
 

22·5·7·43 Posts
Default

Quote:
Originally Posted by joblack View Post
Alternative you can use two worker threads with two cpu threads (1 + 2 for one and 3 + 4 for another) so you have an optimized memory allocation.
How would I configure that?




For the moment I changed my start script to forcibly assign only three cores to mprime. For all of you wondering how I managed this, take a look at lines 12 ~ 18. The disadvantage is that still 4 threads are started, whereas I'd rather run only three, but now they run on only three cores, which means 2 threads are running at 50% cpu. At least my system (and especially disk i/o) is a *lot* better than before.
Using the setup below, it is rather easy to add or remove cores from mprime :)

Code:
     1  #! /bin/sh                                                                                                                                         
     2  ### BEGIN INIT INFO                                                                                                                                
     3  # Provides:                                                                                                                                        
     4  # Required-Start:                                                                                                                                  
     5  # Required-Stop:                                                                                                                                   
     6  # Default-Start:                                                                                                                                   
     7  # Default-Stop:                                                                                                                                    
     8  # Short-Description: Start or stop gimps mprime                                                                                                    
     9  # Description:                                                                                                                                     
    10  ### END INIT INFO                                                                                                                                  
    11                                                                                                                                                     
    12  test -d /dev/cgroup || mkdir /dev/cgroup                                                                                                           
    13  # mount -t cgroup cpuset -ocpuset /dev/cgroup                                                                                                      
    14  mount -t cgroup cgroup /dev/cgroup                                                                                                                 
    15  test -d /dev/cgroup/gimps || mkdir /dev/cgroup/gimps                                                                                               
    16  echo 1-3 > /dev/cgroup/gimps/cpuset.cpus                                                                                                           
    17  echo 0   > /dev/cgroup/gimps/cpuset.mems                                                                                                           
    18  echo 0   > /dev/cgroup/gimps/tasks                                                                                                                 
    19                                                                                                                                                     
    20                                                                                                                                                     
    21                                                                                                                                                     
    22  PATH=/sbin:/bin  # No remote fs at start                                                                                                           
    23  DAEMON=/opt/gimps/mprime                                                                                                                           
    24  [ -x "$DAEMON" ] || exit 0                                                                                                                         
    25  NAME=gimps                                                                                                                                         
    26  DESC="GIMPS mprime"                                                                                                                                
    27                                                                                                                                                     
    28  GIMPS_DIR=/opt/gimps                                                                                                                               
    29  USER=gimps                                                                                                                                         
    30  GROUP=gimps                                                                                                                                        
    31  GIMPS_OPTS=                                                                                                                                        
    32                                                                                                                                                     
    33  # BOOTLOGD_OPTS="-r -c"                                                                                                                            
    34  [ -r /etc/default/gimps ] && . /etc/default/gimps                                                                                                  
    35  . /lib/init/vars.sh                                                                                                                                
    36                                                                                                                                                     
    37  . /lib/lsb/init-functions                                                                                                                          
    38                                                                                                                                                     
    39  SCRIPTNAME=${0##*/}                                                                                                                                
    40  SCRIPTNAME=${SCRIPTNAME#[SK]??}                                                                                                                    
    41  ACTION="$1"                                                                                                                                        
    42                                                                                                                                                     
    43  case "$ACTION" in                                                                                                                                  
    44    start)                                                                                                                                           
    45          # PATH is set above                                                                                                                        
    46          log_daemon_msg "Starting $DESC" "$NAME"
    47                  umask 027
    48                  start-stop-daemon --start --quiet --background \
    49                  --chdir ${GIMPS_DIR} --chuid ${USER}:${GROUP} \
    50                  --nicelevel 19 --exec $DAEMON --
    51                  # -- $GIMPS_OPTS
    52                  ES=$?
    53          log_end_msg $ES
    54          ;;
    55    stop)
    56          PATH=/bin:/sbin:/usr/bin:/usr/sbin
    57          log_daemon_msg "Stopping $DESC" "$NAME"
    58          start-stop-daemon --oknodo --stop --quiet --exec $DAEMON
    59          ES=$?
    60          sleep 1
    61          log_end_msg $ES
    62          ;;
    63    restart|force-reload)
    64          /etc/init.d/bootlogd stop
    65          /etc/init.d/bootlogd start
    66          ;;
    67    status)
    68          status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
    69          ;;
    70    *)
    71          echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
    72          exit 3
    73          ;;
    74  esac
    75
    76  :
  Reply With Quote
Old 2009-12-10, 21:39   #6
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17×251 Posts
Default

Quote:
Originally Posted by Unregistered View Post
How would I configure that?
(hopefully there's no difference between the mprime and Prime95 menus, if there is just try to find the equivalent options or ask for someone experienced with mprime)
1. close mprime
2. run mprime -m to open the menu
3. go to Test > Worker Windows
4. set Number of worker windows to run to 2
5. choose to modify the settings for All workers (alternately, do it one worker at a time)
6. set CPUs to use to 2 (this is per-worker, so 2x2)
7. exit mprime
8. your worktodo.txt file will look something like this:
Code:
[Worker #1]
Test=0123456789ABCD...,50000003,69,1

[Worker #2]
Test=123956789ABCD...,50000009,69,1

[Worker #3]
Test=2687456789ABCD...,50000011,69,1

[Worker #4]
Test=3984256789ABCD...,50000017,69,1
You need to make it so there's just two sections, but you don't want to lose your assignments, so merge #3's and #4's lines into the #1 and #2 sections, then delete the #3 and #4 headers, like this, and save the file: (do not use these exact lines, these are just examples to show you what you'll be doing)
Code:
[Worker #1]
Test=0123456789ABCD...,50000003,69,1
Test=2687456789ABCD...,50000011,69,1

[Worker #2]
Test=123956789ABCD...,50000009,69,1
Test=3984256789ABCD...,50000017,69,1
9. start mprime. It will now have two workers each using two threads, and default to cores 1 and 2 for the 1st worker and cores 3 and 4 for the 2nd worker.

Last fiddled with by Mini-Geek on 2009-12-10 at 21:40
Mini-Geek is offline   Reply With Quote
Old 2009-12-10, 21:45   #7
jrk
 
jrk's Avatar
 
May 2008

1,093 Posts
Default

Quote:
Originally Posted by jippie View Post
I want the fourth core to be available for the system at all times to have better desktop performance.
If you don't mind rebuilding the kernel instead,

Try with Con Kolivas's BFS patch and then start mprime with schedtool to set it as SCHED_IDLEPRIO ("schedtool -D -e ./mprime").

Last fiddled with by jrk on 2009-12-10 at 21:46
jrk is offline   Reply With Quote
Old 2009-12-14, 22:04   #8
Unregistered
 

125516 Posts
Smile

Running Kubuntu 9.10, it appears that I do not have to rebuild the kernel, just had to install the schedtool. Running with:
Code:
$ schedtool 23633
PID 23633: PRIO   0, POLICY D: SCHED_IDLEPRIO, NICE  19, AFFINITY 0xf
I'll be trying this for a while instead of my taskset trickery. Thnx!

Quote:
Originally Posted by jrk View Post
If you don't mind rebuilding the kernel instead,

Try with Con Kolivas's BFS patch and then start mprime with schedtool to set it as SCHED_IDLEPRIO ("schedtool -D -e ./mprime").
  Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual Core to Quad Core Upgrade Rodrigo Hardware 6 2010-11-29 18:48
Why factoring is single-core designed? otutusaus Software 33 2010-11-20 21:05
Quad Core and P95 sgrupp Hardware 54 2008-01-25 22:01
Quad Core R.D. Silverman Hardware 76 2007-11-19 21:57
Optimising work for Intel Core 2 Duo or Quad Core S485122 Software 0 2007-05-13 09:15

All times are UTC. The time now is 07:56.

Sat Oct 31 07:56:51 UTC 2020 up 51 days, 5:07, 2 users, load averages: 1.44, 1.65, 1.73

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, 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.