mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2010-12-25, 13:24   #1
lorgix
 
lorgix's Avatar
 
Sep 2010
Scandinavia

3×5×41 Posts
Default Running YAFU

Hi,

I can't get flags to work. I'm assuming that I've missed something fundamental. Probably something that's obvious to people who know at least one programming language.

I don't understand how to do batch work either.

Also, is there a way of changing the behavior of the factor() command? Limits etc..

I'm running yafu-64k-x64 1.21 in Windows 7.
lorgix is offline   Reply With Quote
Old 2010-12-25, 13:34   #2
Karl M Johnson
 
Karl M Johnson's Avatar
 
Mar 2010

3×137 Posts
Default

My example:
I have a batch file, factor.bat .
If you open it with NotePad, it has the following:
Code:
yafu-32k-x64.exe -threads 4 -v -rhomax 800000 -fmtmax 299396627 <factorme.txt
pause
also, I have a file called factorme.txt .
YAFU reads from that file the numbers I want to factor.
Example contents of factorme.txt:
Code:
factor(999999999999999999999999999999999999999999999999999999999999999999999999999999839999999999999999999999999999999999999999999999999999999999999999999999999999997751)
siqs(1057409760389727179215648843128435820215732534244928446740953737668146356315982185550002262405690920105297)
Everything about the keys(-threads , -rhomax) is documented in YAFU docfile.The commands( siqs(), factor() ) are also there.
Karl M Johnson is offline   Reply With Quote
Old 2010-12-25, 14:54   #3
lorgix
 
lorgix's Avatar
 
Sep 2010
Scandinavia

3·5·41 Posts
Default

Thanks.

I think I've created a correct work file and a correct .bat.

It appears the only problem left is that I still don't know how to tell YAFU to get to work.

I have 'ecm.txt' and 'factor.bat', what do I type in YAFU?
lorgix is offline   Reply With Quote
Old 2010-12-25, 15:32   #4
Karl M Johnson
 
Karl M Johnson's Avatar
 
Mar 2010

41110 Posts
Default

Well, you can type the same stuff as in your ecm.txt , but, better yet, launch the batch file.

For example, you launch yafu, a console window appears, and you type ecm(*some number*) and press Enter, and that will "tell" yafu to ECM that number.
If you have "ecm (*some number*) in ecm.txt, you can just edit your factor.bat, so it will have "yafu.exe <ecm.txt".
Each time you launch that batch file, it will do ECM factoring on the number in ecm.txt.

Last fiddled with by Karl M Johnson on 2010-12-25 at 15:34 Reason: Yes.
Karl M Johnson is offline   Reply With Quote
Old 2010-12-25, 15:43   #5
lorgix
 
lorgix's Avatar
 
Sep 2010
Scandinavia

11478 Posts
Default

Quote:
Originally Posted by Karl M Johnson View Post
Well, you can type the same stuff as in your ecm.txt , but, better yet, launch the batch file.

For example, you launch yafu, a console window appears, and you type ecm(*some number*) and press Enter, and that will "tell" yafu to ECM that number.
If you have "ecm (*some number*) in ecm.txt, you can just edit your factor.bat, so it will have "yafu.exe <ecm.txt".
Each time you launch that batch file, it will do ECM factoring on the number in ecm.txt.
Ok, I understand all of that. The only problem is that apparently I don't know how to "launch a file in YAFU".
lorgix is offline   Reply With Quote
Old 2010-12-25, 16:01   #6
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·32·191 Posts
Default

Quote:
Originally Posted by lorgix View Post
Ok, I understand all of that. The only problem is that apparently I don't know how to "launch a file in YAFU".
yafu supports many different modes of interaction.

Some examples:

from a command line type
Code:
yafu-64k-x64
and you'll get a command prompt from which you can enter commands like siqs(*number*) or ecm(*number*,*num_curves*)

from a command line type
Code:
yafu-64k-x64 "siqs(*number*)"
or
Code:
yafu-64k-x64 "ecm(*number*,*num_curves*)"
and the program will do the same thing, but without the command prompt.

expanding on this theme, from a command line type
Code:
 yafu-64k-x64 -batchfile filename
and the program will process every line in the batchfile one at a time (lines in the batchfile should be statements such as siqs(*number*), etc.).

Or you could use redirection, as Karl is doing.

There are many other flags you can optionally add after the command (siqs(), ecm(), etc), such as -v, -threads, or options to control the ecm,p +/- 1 bounds, and so forth. these are documented in docfile.txt.

Code:
yafu-64k-x64 "siqs(*number*)" -v -threads 4 -rhomax 1000000
or Karl's example with redirection.

Hope this helps.

Last fiddled with by bsquared on 2010-12-25 at 16:03 Reason: fix some syntax
bsquared is offline   Reply With Quote
Old 2012-03-28, 00:45   #7
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×29×83 Posts
Default

Code:
Issuing the command 'help funcname' will bring up more detailed help
on a particular function.
Code:
Type help at any time, or quit to quit

>> help primes

searching for help on 'primes'
>> help prime

searching for help on 'prime'
>> help factor

searching for help on 'factor'
>> help

searching for help on 'help'
>>
I don't understand where exactly to find the help. Downloaded a few hours ago, v1.30.

Last fiddled with by Dubslow on 2012-03-28 at 00:46
Dubslow is offline   Reply With Quote
Old 2012-03-28, 01:08   #8
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

65568 Posts
Default

Quote:
Originally Posted by Dubslow View Post
Code:
Issuing the command 'help funcname' will bring up more detailed help
on a particular function.
Code:
Type help at any time, or quit to quit

>> help primes

searching for help on 'primes'
>> help prime

searching for help on 'prime'
>> help factor

searching for help on 'factor'
>> help

searching for help on 'help'
>>
I don't understand where exactly to find the help. Downloaded a few hours ago, v1.30.
I noticed years ago this was the case in the linux version and I never fixed it (it works fine in Windows...). I've wondered how long it would take for someone to notice :)

All it does is print the relevant section in docfile.txt, which should have been packaged in the download file. Open it in your favorite text editor and search for the term you want.
bsquared is offline   Reply With Quote
Old 2012-03-28, 01:17   #9
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×29×83 Posts
Default

Quote:
Originally Posted by bsquared View Post
I noticed years ago this was the case in the linux version and I never fixed it (it works fine in Windows...). I've wondered how long it would take for someone to notice :)

All it does is print the relevant section in docfile.txt, which should have been packaged in the download file. Open it in your favorite text editor and search for the term you want.

Thanks.

Edit: Something else that I couldn't figure out what was wrong:
Code:
-pscreen			Adding this flag causes the primes() function to output primes 
				to the screen
Code:
bill@Gravemind:~/yafu∰∂ yafu -pscreen primes()
bash: syntax error near unexpected token `('
bill@Gravemind:~/yafu∰∂ yafu -pscreen primes(200)
bash: syntax error near unexpected token `('
bill@Gravemind:~/yafu∰∂ yafu -pscreen "primes(200)"
no switch detected
bill@Gravemind:~/yafu∰∂ yafu -pscreen "primes()"
no switch detected
bill@Gravemind:~/yafu∰∂ yafu "primes()"


invalid character in str2hexz
not enough arguments, please specify min and max of range

ans = 0

bill@Gravemind:~/yafu∰∂ yafu "primes(1,1000)"


elapsed time = 0.0030

ans = 168

bill@Gravemind:~/yafu∰∂ yafu -pscreen "primes(1,1000)"
no switch detected
bill@Gravemind:~/yafu∰∂ yafu "primes(1,1000) -pscreen"


unrecognized token: pscreen
bill@Gravemind:~/yafu∰∂ yafu "primes(1,1000)" -pscreen


elapsed time = 0.0030

ans = 168

bill@Gravemind:~/yafu∰∂ yafu


03/27/12 19:36:01 v1.30 @ Gravemind, System/Build Info: 
Using GMP-ECM 6.3, Powered by GMP 5.0.1
detected        Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
detected L1 = 32768 bytes, L2 = 8388608 bytes, CL = 64 bytes
measured cpu frequency ~= 3494.445730

===============================================================
======= Welcome to YAFU (Yet Another Factoring Utility) =======
=======             bbuhrow@gmail.com                   =======
=======     Type help at any time, or quit to quit      =======
===============================================================
cached 78498 primes. pmax = 999983


>> primes(1,1000) -pscreen

unrecognized token: pscreen
>> primes(1,1000)     

elapsed time = 0.0031

ans = 168

>> help primes

searching for help on 'primes'
>> primes help 

searching for help on 'es help'
>> help

searching for help on 'help'
>> quit

bill@Gravemind:~/yafu∰∂ yafu help primes
no switch detected
And after that it devolved to me trying to figure out how to get help working. How can I print primes to screen?

Last fiddled with by Dubslow on 2012-03-28 at 01:55
Dubslow is offline   Reply With Quote
Old 2012-03-28, 03:37   #10
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·32·191 Posts
Default

Quote:
Originally Posted by Dubslow View Post
How can I print primes to screen?
Code:
yafu "primes(0,1000,0)" -pscreen
Generally, the command needs to come first followed by options. And you need the second "0" to tell the primes function to actually compute the primes instead of just count them (the default). I know, I know, it should see -pscreen and know that it needs to compute the primes... just one of the quirks of the program :)

Last fiddled with by bsquared on 2012-03-28 at 03:39
bsquared is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running YAFU via Aliqueit doesn't find yafu.ini EdH YAFU 8 2018-03-14 17:22
Running other programs while running Prime95. Neimanator PrimeNet 14 2013-08-10 20:15
yafu-1.33 bsquared YAFU 12 2012-11-08 04:12
yafu-1.32.1 bsquared YAFU 21 2012-09-04 19:44
Yafu batch running ThomRuley YAFU 11 2011-06-13 13:35

All times are UTC. The time now is 08:41.

Wed May 12 08:41:51 UTC 2021 up 34 days, 3:22, 0 users, load averages: 1.83, 1.72, 1.76

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