mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > GMP-ECM

Reply
 
Thread Tools
Old 2007-06-20, 21:10   #1
jasong
 
jasong's Avatar
 
"Jason Goatcher"
Mar 2005

3×7×167 Posts
Default 4 cores w/2GB of RAM, 60-digit curves.

I'm going to buy a Core 2 Quad when the price goes down, with 2GB of RAM. If I'm not mistaken 60-digit numbers take about 1.5GB of RAM if you don't split everything up. Here's my problem.

1,280MB of RAM(1024+256) for a maximum of 4 cores, 60-digit curves, and the assumption that, since it's Windows XP, the computer will be reset about every 2-3 weeks.

Basically, I'm trying to max out the number of curves done, while allowing for all those parameters. I'm considering the possibility I should do Stage 1 and Stage 2 separately, in which case I'm hoping someone can help me figure out a way that no more than two cores are doing Stage 2 at once(with the max RAM at 1,280), and with as little babysitting as possible.

Is it possible to set up a script to facilitate this? Because, if someone could do this, the program would (1) deserve it's own web page, and (2) the person would get instant geek cred for the accomplishment.
jasong is offline   Reply With Quote
Old 2007-06-21, 11:26   #2
S00113
 
S00113's Avatar
 
Dec 2003

23·33 Posts
Post

Quote:
Originally Posted by jasong View Post
I'm hoping someone can help me figure out a way that no more than two cores are doing Stage 2 at once(with the max RAM at 1,280), and with as little babysitting as possible.

Is it possible to set up a script to facilitate this? Because, if someone could do this, the program would (1) deserve it's own web page, and (2) the person would get instant geek cred for the accomplishment.
I have a very simple setup for Unix systems. It consists of two scripts. The first script do step 1 continously and saves to a file. This script can be run on three of the CPUs. The other script picks up the save files from the first and do step 2. The second script will also do step 1 as long as the next save file isn't done.

I have found that a B1 of about 5e8 is the most efficient when searching for 60 bit factors on a AMD CPU using up to 3,7 GiB RAM. Test different B1 values on your CPU with -v to find she sweet spot where expected time to find a 60 digit factor is lowest. Beware of local minima.

For the scripts to work on Windows you'll need Cygwin. Put your input number in a file num.inp and run three copies of the first script with num as parameter and one copy of the second script with the same num as parameter. Usually step 1 will take more than three times longer than step 2. If you run a longer step 2, step 2 will lag behind and you'll accumulate save files.

Check ecm-<num>.*.out to see if you have found any factors. When step 2 is done, the save file will change name from .save to .done. Count the files to check how many curves you have completed. The .done files can be used to continue a curve to a higher B1 later.

I have rewritten the scrips to make them presentable and more robust, and may have introduced bugs.

step1.sh
Code:
#!/bin/bash
num=$1
if [ ! -s "$num.inp" ]; then 
  echo "Usage $0 num where num.inp is a file containing the number to factor"
  exit 1
fi
declare -i i=`ls ecm-$num.*.done 2>/dev/null | wc -w`
while ((i=i+1)); do
  while [ -f ecm-$num.$i.save ]; do
    ((i=i + 5))
  done;
  ecm -inp $num.inp -save ecm-$num.$i.save 5e8 5e8 > ecm-$num.$i.out 2>&1
done
step2.sh
Code:
#!/bin/bash
num=$1
if [ ! -s "$num.inp" ]; then 
  echo "Usage $0 num where num.inp is a file containing the number to factor"
  exit 1
fi
declare -i i=`ls ecm-$num.*.done 2>/dev/null | wc -w`
while ((i=i+1)); do 
  while [ -s ecm-$num.$i.done ]; do ((i=i+1)); done
  while [ ! -s ecm-$num.$i.save ]; do
# Perhaps ecm has crashed or run ot of disk space during step 1?
# We want to avoid letting an empty save file block progress.  
# If there are more than 15 save files we assume that the process 
# creating it has died becore completion, and make a new one.
# Otherwise just run step 1 on a higher $i.
    test `ls ecm-$num.*.save 2>/dev/null | wc -w` -gt 15 && rm ecm-$num.$i.save
    declare -i j=$i
    while [ -f ecm-$num.$j.save ]; do ((j=j+1)); done
    ecm -inp $num.inp -save ecm-$num.$j.save 5e8 5e8 > ecm-$num.$j.out 2>&1
  done
  ecm -resume ecm-$num.$i.save 5e8 >> ecm-$num.$i.out
  mv ecm-$num.$i.save ecm-$num.$i.done
done
S00113 is offline   Reply With Quote
Old 2007-06-22, 00:35   #3
jasong
 
jasong's Avatar
 
"Jason Goatcher"
Mar 2005

3·7·167 Posts
Default

If I may ask some ignorant questions. Please correct me anywhere I'm wrong.

I'm assuming these are run from within cygwin. Do I need to use a special editor, or will either Notepad or Wordpad suffice? Also, I noticed some stuff was indented, do I need to imitate this, or is that just to make it friendlier to curious eyes?
jasong is offline   Reply With Quote
Old 2007-06-22, 11:26   #4
S00113
 
S00113's Avatar
 
Dec 2003

23×33 Posts
Default

Quote:
Originally Posted by jasong View Post
I'm assuming these are run from within cygwin. Do I need to use a special editor, or will either Notepad or Wordpad suffice?
Any editor which saves pure text files with no fonts or anything fancy. I haven't used a Windows computer in years, and don't have one easily accessible, but I think cygwin comes with a bash shell. Run the scripts from there. You can start the scripts i the background by ending the command line with an ampersand (&).
Quote:
Originally Posted by jasong View Post
Also, I noticed some stuff was indented, do I need to imitate this, or is that just to make it friendlier to curious eyes?
It is just to make the scripts more readable.
S00113 is offline   Reply With Quote
Old 2007-06-22, 13:10   #5
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

984410 Posts
Default

Quote:
Originally Posted by S00113 View Post
Any editor which saves pure text files with no fonts or anything fancy.
Notepad is tool of choice for a base Windows install.
Uncwilly is online now   Reply With Quote
Old 2007-10-08, 15:11   #6
jasong
 
jasong's Avatar
 
"Jason Goatcher"
Mar 2005

66638 Posts
Default

The last time I tried those scripts I was a bit manic, so I edited like crazy. Has anyone ever run those scripts successfully, edited or unedited?

If a mod reads this, please change the title of the thread to "Running Stages 1 and 2 separately". Thanks.
jasong is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
ECM - why 3 curves? James Heinrich PrimeNet 3 2017-11-14 13:59
JKL-ECM: ECM using Hessian curves CRGreathouse Software 1 2017-09-06 15:39
B1 and # curves for ECM Walter Nissen Factoring 36 2014-02-16 00:20
Curves needed henryzz GMP-ECM 3 2007-12-21 16:13
160 digit factor found of 366 digit (PRP-1) AntonVrba Factoring 7 2005-12-06 22:02

All times are UTC. The time now is 23:29.


Fri Aug 6 23:29:30 UTC 2021 up 14 days, 17:58, 1 user, load averages: 3.93, 3.86, 3.95

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.