mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > GMP-ECM

Reply
 
Thread Tools
Old 2010-08-20, 14:08   #1
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

2·7·461 Posts
Default Which bits of gmp-ecm are now parallel?

I recall some reports of enormously large second-stage B values for p +- 1 factorisations using multi-CPU machines.

Since the B2 values for sixty-digit ECM are large enough that I don't have enough memory to run one per CPU, I was wondering if the second stage of ECM can be made to use more than one CPU?
fivemack is offline   Reply With Quote
Old 2010-08-20, 16:49   #2
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

19×181 Posts
Default

I learned recently from Alex, that stage2 of ECM, P-1 and P+1 can all be done in stages and on different machines.

If you do stage1 with the -chkpnt or -save option to make a checkpoint file at the end of stage1, you can distribute that file to several machines. Then you can do stage2 like this, assuming B1=85e7:

ecm.exe -resume chkpnt.txt 85e7 85e7-1e14 < number.txt
ecm.exe -resume chkpnt.txt 85e7 1e14-2e14 < number.txt
ecm.exe -resume chkpnt.txt 85e7 2e14-3e14 < number.txt
.
.
.
and so on.

Last fiddled with by ATH on 2010-08-20 at 16:51
ATH is offline   Reply With Quote
Old 2010-08-20, 17:44   #3
xilman
Bamboozled!
 
xilman's Avatar
 
"๐’‰บ๐’ŒŒ๐’‡ท๐’†ท๐’€ญ"
May 2003
Down not across

1166810 Posts
Default

Quote:
Originally Posted by fivemack View Post
I recall some reports of enormously large second-stage B values for p +- 1 factorisations using multi-CPU machines.

Since the B2 values for sixty-digit ECM are large enough that I don't have enough memory to run one per CPU, I was wondering if the second stage of ECM can be made to use more than one CPU?
Further, the second stage need not all fit in memory at once. Use the -maxmem switch to set the limit.

Paul
xilman is online now   Reply With Quote
Old 2010-08-23, 12:40   #4
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

2·7·461 Posts
Default

Thanks. Now I can run sixteen copies at a time, each taking 6800+2800 seconds so 600s per curve, rather that six copies each taking 3550+675 = 704s/curve aggregated.
fivemack is offline   Reply With Quote
Old 2010-09-03, 20:13   #5
chris2be8
 
chris2be8's Avatar
 
Sep 2009

22·607 Posts
Default

I've found a way to overlap stage 1 and stage 2 ecm. From a shell script:

Code:
mkfifo ecm.fifo

ecm -resume ecm.fifo -nn 11e6 | tee -a $LOG.2 | grep [Ff]actor &
echo $N | ecm -c 4480 -savea ecm.fifo -nn 11e6 1 | tee -a $LOG | grep [Ff]actor
$N holds the number to factor, $LOG holds the name of the log file.

I've tested it on Linux. It should work for other UNIX variants. Porting to windows would be "an exercise for the reader".

On a single core with hiperthreading it's saving about 1/3 the time it took to do stage 2 when only running 1 thread (I don't have enough RAM on this box to run two stage 2s at once). It would work better if I set B2 to a value that took nearly as long as stage 1, but I havn't worked that out yet.How does run time for stage 2 vary with B2 for different numbers? And how does it vary when maxmem becomes significant?

It should also work for p-1 against a list of numbers and p+1. But I've not tested them.

Chris K
chris2be8 is offline   Reply With Quote
Old 2010-09-05, 06:49   #6
jrk
 
jrk's Avatar
 
May 2008

21078 Posts
Default

Quote:
Originally Posted by chris2be8 View Post
I've found a way to overlap stage 1 and stage 2 ecm. From a shell script:

Code:
mkfifo ecm.fifo

ecm -resume ecm.fifo -nn 11e6 | tee -a $LOG.2 | grep [Ff]actor &
echo $N | ecm -c 4480 -savea ecm.fifo -nn 11e6 1 | tee -a $LOG | grep [Ff]actor
Neat idea.
jrk is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel sieving with newpgen fivemack And now for something completely different 3 2017-05-16 17:55
What's the best way to use PFGW in parallel? CRGreathouse Information & Answers 4 2016-03-06 00:21
Parallel version of Prime for HPC? dtripp Software 3 2008-09-30 19:52
Parallel memory bandwidth fivemack Factoring 14 2008-06-11 20:43
Parallel Prime Search DonaldTripp Software 2 2007-02-17 19:35

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


Thu Feb 9 11:48:24 UTC 2023 up 175 days, 9:16, 1 user, load averages: 0.80, 0.79, 0.79

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

โ‰  ยฑ โˆ“ รท ร— ยท โˆ’ โˆš โ€ฐ โŠ— โŠ• โŠ– โŠ˜ โŠ™ โ‰ค โ‰ฅ โ‰ฆ โ‰ง โ‰จ โ‰ฉ โ‰บ โ‰ป โ‰ผ โ‰ฝ โŠ โŠ โŠ‘ โŠ’ ยฒ ยณ ยฐ
โˆ  โˆŸ ยฐ โ‰… ~ โ€– โŸ‚ โซ›
โ‰ก โ‰œ โ‰ˆ โˆ โˆž โ‰ช โ‰ซ โŒŠโŒ‹ โŒˆโŒ‰ โˆ˜ โˆ โˆ โˆ‘ โˆง โˆจ โˆฉ โˆช โจ€ โŠ• โŠ— ๐–• ๐–– ๐–— โŠฒ โŠณ
โˆ… โˆ– โˆ โ†ฆ โ†ฃ โˆฉ โˆช โŠ† โŠ‚ โŠ„ โŠŠ โŠ‡ โŠƒ โŠ… โŠ‹ โŠ– โˆˆ โˆ‰ โˆ‹ โˆŒ โ„• โ„ค โ„š โ„ โ„‚ โ„ต โ„ถ โ„ท โ„ธ ๐“Ÿ
ยฌ โˆจ โˆง โŠ• โ†’ โ† โ‡’ โ‡ โ‡” โˆ€ โˆƒ โˆ„ โˆด โˆต โŠค โŠฅ โŠข โŠจ โซค โŠฃ โ€ฆ โ‹ฏ โ‹ฎ โ‹ฐ โ‹ฑ
โˆซ โˆฌ โˆญ โˆฎ โˆฏ โˆฐ โˆ‡ โˆ† ฮด โˆ‚ โ„ฑ โ„’ โ„“
๐›ข๐›ผ ๐›ฃ๐›ฝ ๐›ค๐›พ ๐›ฅ๐›ฟ ๐›ฆ๐œ€๐œ– ๐›ง๐œ ๐›จ๐œ‚ ๐›ฉ๐œƒ๐œ— ๐›ช๐œ„ ๐›ซ๐œ… ๐›ฌ๐œ† ๐›ญ๐œ‡ ๐›ฎ๐œˆ ๐›ฏ๐œ‰ ๐›ฐ๐œŠ ๐›ฑ๐œ‹ ๐›ฒ๐œŒ ๐›ด๐œŽ๐œ ๐›ต๐œ ๐›ถ๐œ ๐›ท๐œ™๐œ‘ ๐›ธ๐œ’ ๐›น๐œ“ ๐›บ๐œ”