mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Aliquot Sequences (https://www.mersenneforum.org/forumdisplay.php?f=90)
-   -   Aliqueit.exe discussion (https://www.mersenneforum.org/showthread.php?t=11618)

Andi47 2011-06-24 15:03

[QUOTE=bsquared;264550]Is there still interest in this? Other advantages is that it does multi-threaded ECM (on linux) and better balancing of ecm vs. siqs/nfs (IMO).[/QUOTE]

Yes, and especially if that would also become available for windows.

bsquared 2011-06-24 16:28

[QUOTE=Andi47;264551]Yes, and especially if that would also become available for windows.[/QUOTE]

Yeah, that wouldn't be a problem.

Anyone have v1.10 of the source code they can post? I still can't get to mklasson's site.

bchaffin 2011-06-24 20:02

I think this is the latest version:
[URL]http://www.sendspace.com/file/y1vuur[/URL]

I've also made some customizations to aliqueit -- mostly they are multi-threading improvements (and badly implemented, I've learned a lot since then) which are now done better in yafu. The one useful feature is an option which will ignore the digit/composite limits if the sequence has the downdriver, is decreasing, or has a few other promising patterns.

I'll likely integrate those changes with bsquared's new version so if anyone else is interested I can post that when it's ready.

bsquared 2011-06-24 21:18

[QUOTE=bchaffin;264572]I think this is the latest version:
[URL]http://www.sendspace.com/file/y1vuur[/URL]

I've also made some customizations to aliqueit -- mostly they are multi-threading improvements (and badly implemented, I've learned a lot since then) which are now done better in yafu. The one useful feature is an option which will ignore the digit/composite limits if the sequence has the downdriver, is decreasing, or has a few other promising patterns.

I'll likely integrate those changes with bsquared's new version so if anyone else is interested I can post that when it's ready.[/QUOTE]

Thanks!

[URL="http://www.sendspace.com/file/lzaaor"]Here [/URL]is the updated source code, and updated win32 and win64 binaries. Use command line option -y to use yafu's factor() for everything. A yafu.ini file can control the number of threads (and other stuff), like normal.

I haven't updated the version number or "whatsnew.txt" file, as it sounds like you're going to make some additional modifications (at least, I hope you do - sounds neat). Also, I think mklasson should be made aware of these developements at some point. I can shoot him an email...

Andi47 2011-06-25 09:25

[QUOTE=bsquared;264581]Thanks!

[URL="http://www.sendspace.com/file/lzaaor"]Here [/URL]is the updated source code, and updated win32 and win64 binaries. Use command line option -y to use yafu's factor() for everything. A yafu.ini file can control the number of threads (and other stuff), like normal.
[/QUOTE]

thanks! :tu:

Andi47 2011-06-25 09:40

Is yafu supposed to do multithreaded ECM (and multithreaded GNFS) under windows?

I just tested (I just see that I am using yafu 1.26) with the command aliqueit -y.
My yafu.ini contains the line "threads=6", but CPU-useage during ECM-pretesting (c106) is constantly at 12-13 % (during several minutes and dozens of ECM curves), indicating that only 1 out of 8 threads are used (instead of 6 like it should).

bsquared 2011-06-25 14:33

[QUOTE=Andi47;264634]Is yafu supposed to do multithreaded ECM (and multithreaded GNFS) under windows?

I just tested (I just see that I am using yafu 1.26) with the command aliqueit -y.
My yafu.ini contains the line "threads=6", but CPU-useage during ECM-pretesting (c106) is constantly at 12-13 % (during several minutes and dozens of ECM curves), indicating that only 1 out of 8 threads are used (instead of 6 like it should).[/QUOTE]

On windows it won't do multi-threaded ECM - just linux. So unfortunately that is expected behavior.

Andi47 2011-06-25 14:54

[QUOTE=bsquared;264645]On windows it won't do multi-threaded ECM - just linux. So unfortunately that is expected behavior.[/QUOTE]

Thanks. Is it possible to implement multithreaded ECM on windows?

bsquared 2011-06-25 15:14

[QUOTE=Andi47;264646]Thanks. Is it possible to implement multithreaded ECM on windows?[/QUOTE]

To the best of my knowledge, no. There is no equivalent to "fork" in windows, and gmp-ecm is not natively thread-safe.

Andi47 2011-06-25 19:21

[QUOTE=bsquared;264647]To the best of my knowledge, no. There is no equivalent to "fork" in windows, and gmp-ecm is not natively thread-safe.[/QUOTE]

Would this .pl file help?

[code]use Math::BigInt;
use Math::BigFloat;
# Bah, this causes a fatal error if GMP BigInt is not available.
# use Math::BigInt lib => 'GMP';

$NUM_CPUS=6;
$NUM_THREADS=$NUM_CPUS;

$ECHO_CMDLINE=1;

### ECM parameters ###

$B1=3e6;
$NUM_CURVES=3000; #total number of curves
$MAXMEM=920; #max. memory used per thread

$INPUTFILE="alq609960.400.txt";
$ECM_OUTPUTNAME="alq609960.400_3e6.out";

#$INPUTFILE="alq4788.2687.txt";
#$ECM_OUTPUTNAME="alq4788.2687_43e6.out";

#$INPUTFILE="alq84054.1003.txt";
#$ECM_OUTPUTNAME="alq84054.1003_11e7.out";

# just for info: optimal number of ecm curves:

# B1 # curves digits

# 11e3 86 t20
# 5e4: 214 t25
# 25e5: 430 t30
# 1e6: 910 t35
# 3e6: 2351 t40
# 11e6: 4482 t45
# 43e6: 7557 t50
# 11e7: 17884 t55
# 26e7: 42057 t60
# 85e7: 69471 t65
# 29e8: 102212 t70
# 76e8: 188056 t75
# 25e9: 265557 t80

############# nothing configurable below here! #######################

$CNUM=int($NUM_CURVES)/$NUM_THREADS; #note: this will cause rounding errors if $NUM_CURVES is not divisible by $NUM_THREADS

if ($NUM_THREADS != 1) {
use Config;
if (!($Config{usethreads})) {
printf "This version of Perl doesn't support multiple threads. Only using 1 thread.";
$NUM_THREADS=1;
}
else {
use Thread qw(async);
}
}


if ($NUM_THREADS==1) {
# It's very important to call like this, so that if the user CTRL-C's,
# or otherwise kills the process, we see it and terminate as well.
unlink($ECM_OUTPUTNAME);
$cmd="ecm -nn -maxmem $MAXMEM -c $CNUM <$INPUTFILE $B1 >>$ECM_OUTPUTNAME";
print "=>$cmd\n" if($ECHO_CMDLINE);
$res=system($cmd);
}
else {
@thd = (1 .. $NUM_THREADS);
for ($j=1;$j<=$NUM_THREADS;$j++) {
unlink("$ECM_OUTPUTNAME.T$j");
$cmd="ECM -nn -maxmem $MAXMEM -c $CNUM <$INPUTFILE $B1 >>$ECM_OUTPUTNAME.T$j";
print "=>$cmd\n" if($ECHO_CMDLINE);
$thd[$j]=async{system($cmd)};
}
$res=0;
for ($j=1;$j<=$NUM_THREADS;$j++) {
$res+=eval{$thd[$j]->join()};
}
}
[/code]

This pearl file calls one instance of ecm.exe for each thread, ECM curves are split to the threads. (e.g. if you want 100 curves with 4 threads, it does 25 curves per thread.). After running this, I collect the outputfiles and eventual factor(s) manually.

What is still needed (and I'm not sure whether I could implement this due to lack of pearl skill):
* ability to select input/output filenames as well as B1, B2, number of curves and number of threads from command line
* automated stop of the run if one of the thread finds a factor
* no stop if one thread finishes without finding a factor, and the other threads are still running

Edit2: Even if ECM.exe is not thread-safe: running several instances of ecm is still way faster than if e.g. aliqueit.exe gets only one ECM thread for an intended multithreaded run.

Edit1: BTW: Does yafu use external ECM and GGNFS binarys? If not: is there an ability to set a switch in the command line which makes it use an external binary? This would be useful if one has e.g. an ECM binary which is optimized for one's computer architecture / platform.
* automated collection of factor(s) and ability to pass factor(s) to other programs like yafu or aliqueit.exe.

mklasson 2011-06-25 20:06

Hi folks,

my server is currently down while I find some good hosting, preferably one that allows execution of .exe cgi scripts. 20th century tech ftw! If you have any suggestions, please drop me a line in pm/email/here.

In the meantime, [url]http://www.sendspace.com/file/v44klu[/url] holds the latest aliqueit version from my end. It's just v1.10 with a few changes I made on mini-geek's request to have it work with ecm.py, [url]http://www.mersenneforum.org/showthread.php?p=260148#post260148[/url]. I never got a response to that posting though so I figure the demand for that feature probably wasn't all that high. :) I seem to recall mini-geek saying something about ecm.py supporting multithreaded ecm though, presumably also on windows.

Anyway, if that sounds interesting, check it out and see if it's useful and/or works.


All times are UTC. The time now is 22:40.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.