mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   GMP-ECM (https://www.mersenneforum.org/forumdisplay.php?f=55)
-   -   Need help to run stage 1 and stage 2 separately (https://www.mersenneforum.org/showthread.php?t=8026)

jasong 2007-05-01 21:53

Need help to run stage 1 and stage 2 separately
 
Could someone advise me on how to run Stage 1 and Stage 2 separately, possibly on more than one machine? A couple things to go along with that:

I need to apply the treefile command with k=4 when I run Stage 2. Also, if I run Stage 1 on a Windows PC, is it possible to use the resulting file on a Linux box to run Stage 2? Lastly, I hate an idle processor. Do I have to finish all Stage 1s in a file with Stage 2s, or can I jump back and forth, doing some Stage 2s, leaving some Stage 1s and then adding to the Stage 1s that are left, even after doing some Stage 2s on that same file?

Xyzzy 2007-08-12 03:58

[quote]Also, if I run Stage 1 on a Windows PC, is it possible to use the resulting file on a Linux box to run Stage 2?[/quote]Yes.

[quote]Do I have to finish all Stage 1s in a file with Stage 2s, or can I jump back and forth, doing some Stage 2s, leaving some Stage 1s and then adding to the Stage 1s that are left, even after doing some Stage 2s on that same file?[/quote]As soon as the stage one lines are written to results.txt, you can remove them to work on them elsewhere. You can split the file up into chunks. You can put different chunks on different computers. Each line is independent.

We think this is what you are asking but we are not sure.

What we sometimes do is run stage one using Prime95 on a laptop. We pull lines from results.txt to move to various Linux boxes to run stage two. To be safe we sometimes restart Prime95 to make sure it knows stuff is gone, but we think it doesn't care. We have a feeling results.txt is a one-way street.

:blahblah:

jasong 2007-10-16 18:52

Okay, new problem. Though, hopefully, other people can make use of this in the future. In my case, it specifically involves running ecm on Linux, but I intend to learn how to do scripting commands, so I'm hoping I can make stuff for Windows people at some point in the future.

Edit: After actually writing this post, I realized how much work it would be, so no need for flames or polite rebuke. I have plenty of time on my hands, so I'll attempt to accomplish this with the next 2-3 months.

Here are the problems, in list format. I'm not feeling my best, so I'd rather not try to explain them in paragraph form.

(1) I have 4 cores. I want exactly one core to look for completed Step 1 files and run them if found. If no Step 1 file is found, then the core runs a Step 1, after which the script starts over. The other three cores JUST run Step 1.

(2) (a) At the moment, the scripts I'm using, made by someone else, only seem to allow running one number and one set of curve parameters. Plus, I can't control how many curves are done, it's simply a matter of stopping the scripts and resetting the parameters when I want to change things. (Although the person who created the scripts is very much appreciated. :) )

(b) It would be nice to have a function(script? not good with the lingo) that could take a number and assign the computer a certain number of curves for that number, at a certain level. I'm thinking it could work a bit like sr2sieve and sr2work.txt operate.

(3) Lastly, with the scripts I'm using, I've had to learn some bash commands to figure out how much progress has been made and to look for factors. You can come up with any way you want to track this, but I'm hoping it can be simplified.

What I'm thinking for as a solution to number 3 would be to have an assignment file with a specific name. People would be discouraged from changing the file, except to correct errors or remove assignments(although this could cause error correction headaches for the programmer). Basically each assignment would get a number, starting with either zero or 1, then incrementing by 1 for each new assignment. Then there would be a space and the number to be worked on in expanded format, the next line would give number of curves needed and either just the B1, which would mean use B2=B1*100, or would have a special letter to indicate use of the "special" method(can't remember it's name)

jasong 2007-10-24 08:09

Okay, people probably got bored after reading that long post when it was first written.

Before I post a recap, does anybody think I'd be better off in another forum? I'm thinking I might get a better response in the Programming or Linux forum.

Anyway, what I'm generally needing is a program(s) or script(s) that will

(1) run Stage 1 ecm on three cores. This would basically involve sending command-line arguments to an invisible(virtual?) bash session.

(2) Run Stage 2 on any completed Stage 1s, if there are no Stage 1s available run a Stage 1

(3) It would be nice if I could run curves on more than one number at a time, with different B1 values. The ecm program would decide the B2 value based on the B1 value, this is something that the ecm program does automatically. The script writer doesn't need to learn the special math involved.

(4) A way to track everything. The alias command seems to expire after a while, not sure why, but something as simple as a file I could print out that would give instructions on commands to track various things(found factors, how many curves on the various numbers, whether or that the Stage 1s are building up to an unusual level, which they are at the moment)

I need a saviour, and the miracles I'm asking for don't even have to break the laws of physics. ;)

Xyzzy 2007-10-24 10:45

[quote]The alias command seems to expire after a while...[/quote]It goes in your ~/.bashrc file, so it is parsed with each session.

As for all your other stuff, we cannot figure out why you want to make things so complicated.

wblipp 2007-10-24 19:22

[QUOTE=Xyzzy;116925]we cannot figure out why you want to make things so complicated.[/QUOTE]

My guess is that he wants to keep all four cores busy on ECM but ensure that at most one memory-intensive stage 2 is ever running, all without hand shuffling the work.

jasong 2007-10-24 20:07

[QUOTE=wblipp;116974]My guess is that he wants to keep all four cores busy on ECM but ensure that at most one memory-intensive stage 2 is ever running, all without hand shuffling the work.[/QUOTE]
Exactly.

Xyzzy 2007-10-25 01:31

In our (limited) experience, stage two takes longer than stage one, and if you are only running one stage two against three stage ones, you'll fall further and further behind.

Fortunately, the numbers we are working on fit within 512MB easily, so our dual core box can get by on just 1GB of memory.

jasong 2007-10-25 20:50

[QUOTE=Xyzzy;117007]In our (limited) experience, stage two takes longer than stage one, and if you are only running one stage two against three stage ones, you'll fall further and further behind.

Fortunately, the numbers we are working on fit within 512MB easily, so our dual core box can get by on just 1GB of memory.[/QUOTE]
I could be totally or partially wrong about this, but I'm guessing your experience is with p-1 rather than ecm. If you have 4 equal cores, 3 are only running Stage 1, and the last core is either running Stage 2 on available Stage 1s or running a Stage 1, then it can easily keep up.

In my case, though, the 4th core is deciding to run another Stage 1 when there are already Stage 1s available, which is bugging me.

Xyzzy 2007-10-25 22:32

We stand corrected. Looking back at our logs, stage 2 takes less time than stage 1.

:blush:


All times are UTC. The time now is 09:47.

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