mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2013-02-06, 17:31   #1
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

2·7·337 Posts
Default YAFUWin

Well, I've created a useless Windows program, if anyone is interested...

It's a GUI for YAFU, with all the functions and flags accessible via buttons. It creates a YAFU command line string and invokes a console window in which to run it. Unfortunately, I haven't been able to find a way to either keep the console window open or retrieve the data. Once the operation is complete, the console window closes and takes the information with it. I can't find the factors in any files.

I suppose I can redirect the console window i/o, but that would add a lot of overhead.

Anyway, I have placed a copy of the binary and the code on my AliWin page, in case there is any interest. I have not added in the help pages yet, but the program is rather simplistic - you enter your expression in the provided box and choose the function. Based on what function is chosen, flags become available. You can then review and/or execute the command line.

The source code is at: YAFUWin.cpp
The executable is at: YAFUWin.exe

If any of you programmers could shed some light on how to get the console window to stay open when YAFU finishes (or, maybe just how to retrieve the factors), it would be greatly appreciated. I'm using CreateProcess() to invoke YAFU:
Code:
     CreateProcess(NULL, cstr, NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo);
cstr holds the YAFU command line.

All comments welcome...
EdH is offline   Reply With Quote
Old 2013-02-07, 14:58   #2
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

5·727 Posts
Default

Looks like you've been having some fun .

I don't know anything about CreateProcess, but the way to retrieve the factors would be to parse the log file (factor.log) that is created for each factorization. (If I were me I'd delete the factor.log file after each run so that you only have to parse one job entry.)

But CreateProcess apparently doesn't run in the same location as the executable, because I see no factor.log file after running a job. I don't know where CreateProcess runs by default, but I bet if you figure out where you'll find a bunch of log files there. Probably in some windows system folder.
bsquared is offline   Reply With Quote
Old 2013-02-07, 16:46   #3
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

2·7·337 Posts
Default

Quote:
Originally Posted by bsquared View Post
Looks like you've been having some fun .

I don't know anything about CreateProcess, but the way to retrieve the factors would be to parse the log file (factor.log) that is created for each factorization. (If I were me I'd delete the factor.log file after each run so that you only have to parse one job entry.)

But CreateProcess apparently doesn't run in the same location as the executable, because I see no factor.log file after running a job. I don't know where CreateProcess runs by default, but I bet if you figure out where you'll find a bunch of log files there. Probably in some windows system folder.
Hi Ben,

Thanks for the reply. The problem was actually that I was using v1.30. I just d/l'd v1.33 and factor.log does indeed have all the factors. For me all the files (factor.log, session.log, etc.) do get written within the same directory, but my factor.log file created by v1.30 only contained the header info.

Thanks for all your help.
EdH is offline   Reply With Quote
Old 2013-02-07, 17:01   #4
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

5×727 Posts
Default

Quote:
Originally Posted by EdH View Post
For me all the files (factor.log, session.log, etc.) do get written within the same directory, but my factor.log file created by v1.30 only contained the header info.
That's strange, but since you got it working I'll ignore it .
bsquared is offline   Reply With Quote
Old 2013-02-07, 20:49   #5
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

2×7×337 Posts
Default

Quote:
Originally Posted by bsquared View Post
That's strange, but since you got it working I'll ignore it .
Sounds like a good idea. The only practicality I see for the GUI is that it might help a new user, with little "terminal" experience, find their way around YAFU. It certainly doesn't add any functionality.
EdH is offline   Reply With Quote
Old 2016-02-29, 00:50   #6
jux
 
jux's Avatar
 
Aug 2015

668 Posts
Default

I was actually considering making a GUI of YAFU myself, just for practice with Qt. I would like to see the original GUI, but the download for the .exe does not work for me.
jux is offline   Reply With Quote
Old 2016-02-29, 05:09   #7
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

2·7·337 Posts
Default

Quote:
Originally Posted by jux View Post
I was actually considering making a GUI of YAFU myself, just for practice with Qt. I would like to see the original GUI, but the download for the .exe does not work for me.
I'm not sure why it doesn't d/l. but I haven't kept up with Windows programming and it has no modern security code in it. I added a .zip file that includes both .cpp and .exe files:

YAFUWin.zip

You do have to have a fully functioning YAFU named yafu.exe and then place YAFUWin.exe in the same directory. It will create a YAFUWin.cfg file that really only exists so the initial screen won't appear on subsequent runs. There is no installation. Just run the .exe. It may also be lacking any switches/options that have been added to recent versions.

Let me know what happens on a modern machine and what I might do to move my programming into the current century.

If there is any real interest, I might resurrect it and provide some help pages.
EdH is offline   Reply With Quote
Old 2016-03-01, 05:17   #8
jux
 
jux's Avatar
 
Aug 2015

2×33 Posts
Default

The GUI works on my Windows 8.1 machine, so that's good. I think it would be a nice addition for beginners if the GUI were bundled with the regular YAFU release.

Two quick suggestions: I believe yafu-1.34 comes with two binaries, yafu-Win32 and yafu-x64, so "Run YAFU" should have an option creating a process for those binaries instead of yafu.exe. Also, -R, -threads x, and all the NFS flags should be included, since those are what I use.

I would want to contribute, but I can't help with the Windows API. There's not much I can add on anyway.
jux is offline   Reply With Quote
Old 2016-03-01, 17:09   #9
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

10010011011102 Posts
Default

Quote:
Originally Posted by jux View Post
The GUI works on my Windows 8.1 machine, so that's good. I think it would be a nice addition for beginners if the GUI were bundled with the regular YAFU release.

Two quick suggestions: I believe yafu-1.34 comes with two binaries, yafu-Win32 and yafu-x64, so "Run YAFU" should have an option creating a process for those binaries instead of yafu.exe. Also, -R, -threads x, and all the NFS flags should be included, since those are what I use.

I would want to contribute, but I can't help with the Windows API. There's not much I can add on anyway.
Thanks for the feedback. I really appreciate it. The next thing I'll need is a bit of time and a Windows machine that can run Dev-C++. My Vista VM doesn't appear to work with it and all my normal workings are via linux. Maybe I'll see if CodeBlocks can compile it. I have that running on the Vista VM. Or maybe my laptop with a Win7 partition can run something...

I'll have to do some research, though. Just including the YAFU binaries wouldn't be enough without the sievers and possibly a generic GMP-ECM binary.
EdH is offline   Reply With Quote
Old 2016-03-02, 22:19   #10
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

2·7·337 Posts
Default

I just tried to compile the code with CodeBlocks under Windows Vista, with success! I also changed the program a little.

It now uses the standard Windows names for the 32 and 64 bit versions of YAFU so no renaming is required, and it allows you to choose between the 32* and 64 bit versions.

I'll look into adding and options/switches that have been added to the more recent versions of YAFU later.

*I did run into a missing VCOMP100.DLL message when I ran the 32 bit YAFU on the 64 bit Vista machine, but it's not an error from YAFUWin and I'm not sure if anyone would want to run yafu-win32 on a 64 bit machine. So, I'm not sure if it is significant.
EdH is offline   Reply With Quote
Old 2016-06-09, 20:53   #11
rincewind2016
 
Jun 2016

3 Posts
Default YAFU :)

First of all big thanks for making this GUI... I am a newbie to YAFU and couldn't figure out how to use the console at first, so GUI was a big help. I encountered some strange things, though I don't know if they are due to GUI or Yafu itself. Any advice would be appreciated.

When I tried to factor a larger number (namely 123456789012345678901234567890123456789012345678901234567890123456789012345678901) from the GUI, it gave me different logs on consecutive runs (as recorded in the factor.log file - attached).

The last attempt is from console command line, and it found the largest factor (labelled c44 cofactor), but log of this run somehow misses the smallest factor (47) which was quickly found on previous runs.

It bugs me why a math program behaves like this... I was expecting to see the same reports in factor.log for each run.

Also, when I use console mode, the console closes automatically when it does its thing, and I have to check factor.log for results. I would prefer the factors to be displayed in the console window.

(nooby things to ask, I know...)

Is this what it should do? What am I doing wrong? Thanks a lot in advance for you help,
Attached Files
File Type: log factor.log (26.8 KB, 146 views)
rincewind2016 is offline   Reply With Quote
Reply

Thread Tools


All times are UTC. The time now is 00:39.


Tue Aug 16 00:39:48 UTC 2022 up 39 days, 19:27, 1 user, load averages: 1.18, 1.18, 1.19

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

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔