![]() |
|
|
#1 |
|
Sep 2010
Portland, OR
5648 Posts |
I'm trying to get the most out of a multi-core system when factoring -- specifically when running aliqueit. Some pieces are simple; yafu and ggnfs are easily configured to run multiple threads. But ecm and polynomial selection run single-threaded, and when running with many cores these portions start to dominate the run time. Of course one approach is just to run fewer curves and jump to yafu's SIQS sooner, and to push the ggnfs cutoff higher, but a nicer solution would be to make more effective use of multiple threads.
Surely I'm not the first to ask this. Is there already a way to thread ecm and poly selection? Or is there something inherently serial about them that I'm missing? (I'm new to factoring and don't claim to understand much of the underlying math.) For ecm it seems like you could easily just divide the number of curves to run across any number of threads. I understand poly selection even less but it seems like that also consists of many independent tests. Any help or pointers appreciated. Thanks! |
|
|
|
|
|
#2 |
|
Mar 2010
3×137 Posts |
If you are on Windows, you can just create a batch file for ECM, and run it 4 times(if you have 4 cores).
Here's how I've done the batch file: Code:
ecm.exe -c 800 2500000 2500000000 <factorme.txt >> OUT\ECM[%random%]N[%random%] As for polynomial selection, better use a GPU for that. Msieve supports Nvidia GPUs currently. |
|
|
|
|
|
#3 | |
|
"Ben"
Feb 2007
66718 Posts |
Quote:
To my knowledge, GMP-ECM is not easily threadable. Its code makes use of a global structure of primes in a way that defeats threading by curves. However, it is fairly easy to run multiple instances of the executable to achieve the same effect; although I don't know of a good, ready-made script for automating this. |
|
|
|
|
|
|
#4 | |
|
A Sunny Moo
Aug 2007
USA (GMT-5)
3·2,083 Posts |
Quote:
|
|
|
|
|
|
|
#5 | |
|
Sep 2010
Portland, OR
22×3×31 Posts |
Quote:
Anyway I may take a crack at modifying aliqueit to launch N ecm instances in parallel, unless somebody says they've already done it. As for poly selection, my machines don't have GPUs (they're monitor-less servers) so that's not an option for me. I'll see if I can figure out MT ecm before I tackle that one. |
|
|
|
|
|
|
#6 | |
|
"Ben"
Feb 2007
1101101110012 Posts |
Quote:
To use the native multithreaded ecm (which is slower), you'd need to recompile. |
|
|
|
|
|
|
#7 | |
|
"Ben"
Feb 2007
3×1,171 Posts |
Quote:
I've kicked around the idea of modifying GMP-ECM to be thread friendly, but I've never got around to doing it... one of these days maybe. |
|
|
|
|
|
|
#8 |
|
Sep 2010
Portland, OR
22·3·31 Posts |
OK, thanks for the explanation, that all makes sense.
I have a version of aliqueit which runs multi-threaded ecm, and it seems to be working OK. I have no idea whether it's portable -- it uses signal() and killpg() to clean up child threads so it may not be -- but I'm happy to share it if anyone's interested. Msieve's polyfind is much more difficult since it uses a bunch of heuristics to set time limits, which may not work when searching subranges. A better approach might be to run polyfind and ecm in parallel. I'll think about that... |
|
|
|
|
|
#9 |
|
May 2009
Dedham Massachusetts USA
3×281 Posts |
For aliquot sequences there are enough of them that one can simply run one sequence per processor. With -p, I have found I can run at 100% (of all) cpu and still use the computer for other things.
OTOH, if the factor is big enough to need more than 1 processor then the overhead of manually doing things (or writing a script) is small compared to the running time. |
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| RSA multi factor | labba | FactorDB | 2 | 2016-01-30 23:25 |
| multi-core TF | dbaugh | Information & Answers | 3 | 2011-09-06 01:32 |
| Multi-Core / Multi-CPU Assignments (missing) | worknplay | Software | 3 | 2008-11-05 17:26 |
| NEW MERSENNES AND MULTI-THREADED SOFTWARE | lpmurray | Software | 13 | 2005-12-21 08:24 |
| Prime95 a multi-threaded application? | Unregistered | Software | 10 | 2004-06-11 05:31 |