mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2007-03-16, 00:54   #1
remaker
 
Oct 2002

816 Posts
Default Automatic multi-core detect and use?

I know I can run multiple instances of Prime95, but are there plans to automagically detect multi-core processors and automatically take advantage of them?

With the quad-cores reaching mass market, this could be useful. Not everyone (including me) will take the time to set the system up manually to run as multi-core.

-Phil
(Using half of a Core Duo)
remaker is offline   Reply With Quote
Old 2007-03-16, 01:44   #2
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

2×3×52×72 Posts
Default

Quote:
Originally Posted by remaker View Post
are there plans to automagically detect multi-core processors and automatically take advantage of them?
Yes
Prime95 is online now   Reply With Quote
Old 2007-03-16, 11:00   #3
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

113008 Posts
Default

Quote:
Originally Posted by Prime95 View Post
Yes
That's nice. Does your algorithm also detect multi-processor environments? I could be interested...

Luigi
ET_ is offline   Reply With Quote
Old 2007-03-16, 12:37   #4
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

2·3·52·72 Posts
Default

Quote:
Originally Posted by ET_ View Post
That's nice. Does your algorithm also detect multi-processor environments?
I use the Windows GetSystemInfo call which return the numbers of cores/processors. The default prime95 behavior will be to give each core/processor its own LL test.
Prime95 is online now   Reply With Quote
Old 2007-03-16, 12:57   #5
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

26·3·52 Posts
Default

Quote:
Originally Posted by Prime95 View Post
I use the Windows GetSystemInfo call which return the numbers of cores/processors. The default prime95 behavior will be to give each core/processor its own LL test.
I wonder if there is a similar system call on Linux/Unix/Cygwin environments...

I'll look into that, thank you George.

Luigi
ET_ is offline   Reply With Quote
Old 2007-03-16, 13:38   #6
Cruelty
 
Cruelty's Avatar
 
May 2005

23×7×29 Posts
Default

If you plan on running Prime95/mprime on current C2Q CPUs using current GIMPS assignments (FFT size > 1024k), then think again: there is a large performance hit per core on Intel Quad-core platforms... depending on memory/chipset configuration performance hit will also be noticable on Dual-core platforms (e.g. using E6600 @ 3.067 GHz / FSB @ 340MHz / RAM @ 520MHz, penalty is ~20% in single channel mode, and ~10% in dual channel mode).
Cruelty is offline   Reply With Quote
Old 2007-03-16, 17:47   #7
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

26×3×52 Posts
Default

Quote:
Originally Posted by Cruelty View Post
If you plan on running Prime95/mprime on current C2Q CPUs using current GIMPS assignments (FFT size > 1024k), then think again: there is a large performance hit per core on Intel Quad-core platforms... depending on memory/chipset configuration performance hit will also be noticable on Dual-core platforms (e.g. using E6600 @ 3.067 GHz / FSB @ 340MHz / RAM @ 520MHz, penalty is ~20% in single channel mode, and ~10% in dual channel mode).
I just wanted to test my multithreaded mersenne factoring application...

Luigi
ET_ is offline   Reply With Quote
Old 2007-03-18, 16:33   #8
Mystwalker
 
Mystwalker's Avatar
 
Jul 2004
Potsdam, Germany

3×277 Posts
Default

Quote:
Originally Posted by ET_ View Post
I wonder if there is a similar system call on Linux/Unix/Cygwin environments...

I'll look into that, thank you George.

Luigi
What about /proc/cpuinfo ?
Does this source provide enough information?
Mystwalker is offline   Reply With Quote
Old 2007-03-18, 17:30   #9
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

26·3·52 Posts
Default

Quote:
Originally Posted by Mystwalker View Post
What about /proc/cpuinfo ?
Does this source provide enough information?
no /proc/cpuinfo under Cygwin

Luigi
ET_ is offline   Reply With Quote
Old 2007-03-21, 06:11   #10
TehPenguin
 
TehPenguin's Avatar
 
Jun 2006
Perth, Western Australia

2×5 Posts
Default

Quote:
Originally Posted by Prime95 View Post
I use the Windows GetSystemInfo call which return the numbers of cores/processors. The default prime95 behavior will be to give each core/processor its own LL test.
What about Hyper-Threading CPU's? Or is there code to preclude this from occurring?
TehPenguin is offline   Reply With Quote
Old 2007-04-02, 20:08   #11
Jeff Gilchrist
 
Jeff Gilchrist's Avatar
 
Jun 2003
Ottawa, Canada

100100100012 Posts
Default

Quote:
Originally Posted by ET_ View Post
I wonder if there is a similar system call on Linux/Unix/Cygwin environments...
Hi Luigi,

On UNIX/OSX systems I use these calls:

Code:
#include <unistd.h>
#ifdef __APPLE__
#include <sys/sysctl.h>
#endif

int numCPU = 1;

// Autodetect the number of CPUs on a box, if available
#if defined(__APPLE__)
	size_t len = sizeof(numCPU);
	int mib[2];
	mib[0] = CTL_HW;
	mib[1] = HW_NCPU;
	if (sysctl(mib, 2, &numCPU, &len, 0, 0) < 0 || len != sizeof(numCPU))
		numCPU = 1;
#elif defined(_SC_NPROCESSORS_ONLN)
	numCPU = sysconf(_SC_NPROCESSORS_ONLN);
#endif
I believe it also works under cygwin.

Last fiddled with by Jeff Gilchrist on 2007-04-02 at 20:10
Jeff Gilchrist is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about multi-core prime searching. Trilo Riesel Prime Search 33 2013-09-19 21:21
multi-core TF dbaugh Information & Answers 3 2011-09-06 01:32
GMP-Fermat and multi-core processors ixfd64 Factoring 1 2011-03-16 16:07
Multi-Core / Multi-CPU Assignments (missing) worknplay Software 3 2008-11-05 17:26
My prediction about multi-core chips jasong Hardware 6 2006-02-14 16:07

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

Fri Feb 26 07:04:00 UTC 2021 up 85 days, 3:15, 0 users, load averages: 1.93, 2.11, 1.92

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.