mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Operation Billion Digits

Reply
 
Thread Tools
Old 2007-12-15, 17:08   #1
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

11·433 Posts
Default Factor5 source code thread

Here is my Factor5 source code.

It's far from optimized, and I'm studying a couple cases where it segfaulted.

Apart from that it is reliable as for the results it gives, and is multi-thread ready.

I'd appreciate some tests on quad-core environments.

Luigi

P.S. Would it be possible to make this thread sticky?
Attached Files
File Type: gz factor5_A64_linux.tar.gz (22.5 KB, 167 views)

Last fiddled with by ET_ on 2007-12-15 at 17:11 Reason: Adding P.S.
ET_ is offline   Reply With Quote
Old 2007-12-15, 19:14   #2
em99010pepe
 
em99010pepe's Avatar
 
Sep 2004

2×5×283 Posts
Default

Luigi,

Got your email. You need to rename factor5.exe to factor5.pdf to cheat gmail control.

Carlos
em99010pepe is offline   Reply With Quote
Old 2007-12-15, 19:56   #3
em99010pepe
 
em99010pepe's Avatar
 
Sep 2004

2·5·283 Posts
Default

Tested on my quad-core and it doesn't work with 4 threads only with 2. In the latter case the processor is always below 48%.

Of course it works running 4 clients with one thread turned on with setting the affinity to each core.

Carlos

Last fiddled with by em99010pepe on 2007-12-15 at 19:59
em99010pepe is offline   Reply With Quote
Old 2007-12-16, 09:23   #4
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

11·433 Posts
Default

Quote:
Originally Posted by em99010pepe View Post
Tested on my quad-core and it doesn't work with 4 threads only with 2. In the latter case the processor is always below 48%.

Of course it works running 4 clients with one thread turned on with setting the affinity to each core.

Carlos
Thank you Carlos.

It seems that I have to find out a quad-core to make some testing work.
"Doesn't work" means that only two threads keep on working, or that the whole program burst into pieces?

Strange enough, it works fine on dual-core CPUs... I'll investigate.

Luigi.

Last fiddled with by ET_ on 2007-12-16 at 09:24
ET_ is offline   Reply With Quote
Old 2007-12-16, 11:07   #5
em99010pepe
 
em99010pepe's Avatar
 
Sep 2004

2×5×283 Posts
Default

Quote:
Originally Posted by ET_ View Post

"Doesn't work" means that only two threads keep on working, or that the whole program burst into pieces?
Two threads keep working but not pushing the cores has it should be.
When starting with 4 the CPU goes up to 99% and then reduces to 48%...
The quad-core isn't online so I can't give you remote access to it...maybe this week....

Carlos
em99010pepe is offline   Reply With Quote
Old 2008-09-15, 05:08   #6
lfm
 
lfm's Avatar
 
Jul 2006
Calgary

52·17 Posts
Default

Quote:
Originally Posted by em99010pepe View Post
Two threads keep working but not pushing the cores has it should be.
When starting with 4 the CPU goes up to 99% and then reduces to 48%...
The quad-core isn't online so I can't give you remote access to it...maybe this week....

Carlos
Look like it is working well on my Intel quad Q9450 2.66ghz (Linux 64 bit OS). Near 4 x 100% most of the time, occasionally it looks like the threads exit one at a time and may leave a core idle for a few seconds but then they start up new threads again just fine. Running:

time ./factor5 2147483647 1 68 4

Factor5 v. 5.01 - December 27th, 2007 - AMD64/Linux64 compile - GMP 4.2.2


finds the same 3 factors and takes ...

real 35m36.482s
user 126m16.486s
sys 0m0.480s

with some background processing also going on.

Last fiddled with by lfm on 2008-09-15 at 05:10
lfm is offline   Reply With Quote
Old 2008-09-15, 10:24   #7
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

112338 Posts
Default

Quote:
Originally Posted by lfm View Post
Look like it is working well on my Intel quad Q9450 2.66ghz (Linux 64 bit OS). Near 4 x 100% most of the time, occasionally it looks like the threads exit one at a time and may leave a core idle for a few seconds but then they start up new threads again just fine. Running:

time ./factor5 2147483647 1 68 4

Factor5 v. 5.01 - December 27th, 2007 - AMD64/Linux64 compile - GMP 4.2.2


finds the same 3 factors and takes ...

real 35m36.482s
user 126m16.486s
sys 0m0.480s

with some background processing also going on.
Nice to hear it

You are right, threads may stop with a few seconds of time difference because of the implementation. BTW, 88.9% of efficiency sounds acceptable

Luigi
ET_ is offline   Reply With Quote
Old 2008-09-17, 10:32   #8
em99010pepe
 
em99010pepe's Avatar
 
Sep 2004

1011000011102 Posts
Default

I tried once again (windows version, Q6600@2.9GHz) and I still don't get 100%, only 40%.

Edit:

Running factor5.exe 2147483647 1 68 1, I get 25% CPU usage
Running factor5.exe 2147483647 1 68 2, I get 47% CPU usage
Running factor5.exe 2147483647 1 68 3, doesn't work
Running factor5.exe 2147483647 1 68 4, I get (28-40)% CPU usage

Carlos

Last fiddled with by em99010pepe on 2008-09-17 at 10:38
em99010pepe is offline   Reply With Quote
Old 2008-09-17, 10:43   #9
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

112338 Posts
Default

Quote:
Originally Posted by em99010pepe View Post
I tried once again (windows version) and I still don't get 100%, only 40%.

Carlos
Very strange...
Maybe something on the Cygwin environment or the pthreads lib doesn't work correctly. Anyway, it does for 2 cores...

One possibility is to start your machine with some Linux CD distro and launch the Linux version to see if the problem goes away.

If it does, I will delve into the Cygwin environment, if not, it could be some BIOS settings that prevent use of full 4-core power and memory addressing.

Luigi
ET_ is offline   Reply With Quote
Old 2008-09-17, 11:59   #10
em99010pepe
 
em99010pepe's Avatar
 
Sep 2004

2·5·283 Posts
Default

Quote:
Originally Posted by ET_ View Post

If it does, I will delve into the Cygwin environment, if not, it could be some BIOS settings that prevent use of full 4-core power and memory addressing.

Luigi
dnet works well, it detects the 4 cores, it runs at 100 %.
em99010pepe is offline   Reply With Quote
Old 2008-09-17, 12:28   #11
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

11×433 Posts
Default

Quote:
Originally Posted by em99010pepe View Post
dnet works well, it detects the 4 cores, it runs at 100 %.
Thank you Carlos, it's "my" fault then I will see what I can do to give full power to Windows users, though it will be hard without a quad at home.

If I get Factor5 compile under VisualStudio, it will be easier to address the thread system issue... and to get a working GUI already on the to-do list!

Luigi

P.S. There have been thread issues with Cygwin DLL vers. 1.5.10. Did you try to get last DLL from Cygwin site? Meanwhile I will recheck my development environment.

Last fiddled with by ET_ on 2008-09-17 at 12:43
ET_ is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Source Code for msieve ? mohamed Msieve 8 2013-12-14 01:04
Source code for my program Sam Kennedy Factoring 7 2012-11-22 18:24
PrimeNet source code? ixfd64 PrimeNet 8 2009-12-11 14:26
llrnet - source code? reezer Prime Sierpinski Project 11 2009-09-11 10:47
Support for other OSs on x86/source code reezer Software 1 2007-02-08 12:57

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

Thu Aug 13 11:56:35 UTC 2020 up 8:32, 1 user, load averages: 1.90, 1.58, 1.42

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.