Thread: YAFU 2.0
View Single Post
Old 2021-09-17, 15:50   #249
chris2be8
 
chris2be8's Avatar
 
Sep 2009

22·32·61 Posts
Default

Quote:
Originally Posted by EdH View Post
On a different subject, I'm trying to figure out how to send options in the following script line:
Code:
echo "factor(${composite})" | ./yafu
I've tried adding -one and -silent before and after the pipe (at the ends of each command) and inside and outside the quotes, with and without another set of enclosing quotes. Can these be added to the script line, or can I place them in yafu.ini in some manner? I'm using separate copies of yafu and yafu.ini within the working directory where the script is located, so I'm free to modify yafu.ini to be specific. Alternately for -silent, is there a less verbose mode?
My perl scripts use:
Code:
$cmd="\"$YAFU\" 'factor($_[0])' -p -ecm_path /usr/bin/ecm -logfile $LOGFILE -threads $NUM_CPUS";
...
$res=system($cmd);
perl substitutes suitable values for $YAFU, $_[0], $LOGFILE and $NUM_CPUS, then passes the resulting string to the shell.

Or a trivial example from the command line:
Code:
chris@rigel:~/bin$ yafu 'factor(2^128+1)' -threads 2


fac: factoring 340282366920938463463374607431768211457
fac: using pretesting plan: normal
fac: using tune info for qs/gnfs crossover
div: primes less than 10000
rho: x^2 + 3, starting 1000 iterations on C39 
rho: x^2 + 2, starting 1000 iterations on C39 
rho: x^2 + 1, starting 1000 iterations on C39 
pm1: starting B1 = 150K, B2 = gmp-ecm default on C39
ecm: 30/30 curves on C39, B1=2K, B2=gmp-ecm default

starting SIQS on c39: 340282366920938463463374607431768211457

==== sieving in progress ( 2 threads):     656 relations needed ====
====            Press ctrl-c to abort and save state            ====
539 rels found: 297 full + 242 from 2231 partial, (34049.89 rels/sec)

SIQS elapsed time = 0.1017 seconds.
Total factoring time = 0.4423 seconds


***factors found***

P22 = 5704689200685129054721
P17 = 59649589127497217

ans = 1
Note it used 2 threads for sieving, so it saw the parameter -threads 2
chris2be8 is offline   Reply With Quote