mersenneforum.org > YAFU Running YAFU
 Register FAQ Search Today's Posts Mark Forums Read

 2010-12-25, 13:24 #1 lorgix     Sep 2010 Scandinavia 3×5×41 Posts 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.
 2010-12-25, 13:34 #2 Karl M Johnson     Mar 2010 3×137 Posts 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
 2010-12-25, 14:54 #3 lorgix     Sep 2010 Scandinavia 3·5·41 Posts 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?
 2010-12-25, 15:32 #4 Karl M Johnson     Mar 2010 41110 Posts 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
2010-12-25, 15:43   #5
lorgix

Sep 2010
Scandinavia

11478 Posts

Quote:
 Originally Posted by Karl M Johnson 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
Ok, I understand all of that. The only problem is that apparently I don't know how to "launch a file in YAFU".

2010-12-25, 16:01   #6
bsquared

"Ben"
Feb 2007

2·32·191 Posts

Quote:
 Originally Posted by lorgix 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

 2012-03-28, 00:45 #7 Dubslow Basketry That Evening!     "Bunslow the Bold" Jun 2011 40> 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
2012-03-28, 01:08   #8
bsquared

"Ben"
Feb 2007

65568 Posts

Quote:
 Originally Posted by Dubslow 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.

2012-03-28, 01:17   #9
Dubslow

"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×29×83 Posts

Quote:
 Originally Posted by bsquared 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:
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

2012-03-28, 03:37   #10
bsquared

"Ben"
Feb 2007

2·32·191 Posts

Quote:
 Originally Posted by Dubslow 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

 Similar Threads Thread Thread Starter Forum Replies Last Post EdH YAFU 8 2018-03-14 17:22 Neimanator PrimeNet 14 2013-08-10 20:15 bsquared YAFU 12 2012-11-08 04:12 bsquared YAFU 21 2012-09-04 19:44 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