Search the web
Sign In
New User? Sign Up
xyyxf
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
The "makems" script   Message List  
Reply | Forward Message #1185 of 1942 |
Hi all,

Here is the "makems" Perl script I use to make the Msieve files and
then run the linear algebra using Msieve, starting with the "n.poly"
file in GGNFS.

No guarantees, but should work OK - just read the comments...

Rgds,
--Bob.


#!/usr/bin/perl
#
# Make Msieve NFS format files from GGNFS poly file
# -- Bob Backstrom Oct 2007 --
#
# Run GGNFS with "$SAVEPAIRS=1;" in factLat.pl to
# save rels in gzip format at each cycle.
#
# msieve.dat Write N ddddd to first line then
# append rels with cmd:
# gunzip -c spairs.save.gz >> msieve.dat
#
# or manually:
# cat spairs.dump.i >> msieve.dat
# for all dump files.
#
# msieve.fb N ddddd, R0, R1 (R1 = 1 if m present),
# Y0 -> R0 and Y1 -> R1
# coeffs ci -> Ai 0<= i <= {deg}
#
# worktodo.ini N
#
# ------------------------------------------------

$PREFIX = "n"; # Poly file prefix
$SAVE = "spairs.save.gz"; # Rels save file
$MSIEVE = "msieve -nc -v"; # Msieve NFS, verbose

# ------------------------------------------------

$FILE1 = "$PREFIX.poly"; # Input poly file
$FILE2 = "msieve.dat"; # Output dat file
$FILE3 = "msieve.fb"; # Factor base file
$FILE4 = "worktodo.ini"; # Work to do file

$r[0] = "0";
$r[1] = "0";

# c5: 9000
# c4: -76048988
# ...

$deg = 0;

open(IN, "$FILE1"); # Find poly degree

while($line = <IN>)
{
$line = lc($line);

if($line =~ /^\s*c(\d+)/)
{
if($deg < $1) { $deg = $1 }
}
}

if(!$deg)
{
close(IN);
print "Coeffs \"cn: [-]ddd\" not found in \"$FILE1\"\n";
exit 1;
}

for($i = 0; $i <= $deg; $i++){ $c[$i] = "0"; }

if( -e $FILE2 ) # Check for dat file
{
print "\nFile: \"$FILE2\" already present\n\n";
open(REP, "-");

while(print "Overwrite (y/n): ")
{
$reply = <REP>;
$reply = lc($reply);

if($reply =~ /^\s*n\s*$/)
{
print "\nExit\n\n";
close(IN);
close(REP);
exit 1;
}
elsif($reply =~ /^\s*y\s*$/)
{
print "\nCont...\n";
close(REP);
last;
}
}
}

print "\ndeg: $deg\n";

seek(IN, 0, 0); # rewind input file
open(OUT1, ">$FILE2"); # dat file
open(OUT2, ">$FILE3"); # fb file
open(OUT3, ">$FILE4"); # worktodo file

while($line = <IN>)
{
$line = lc($line); # lower case

if($line =~ /^\s*n\s*:\s*(\d+)/) # n: ddd
{
$n = $1;
}
elsif($line =~ /^\s*m\s*:\s*(\d+)/) # m: ddd
{
$r[0] = "-" . $1; # (no arith, just strings)
$r[1] = 1;
}
elsif($line =~ /^\s*y(\d+)\s*:\s*(-*)(\d+)/)
{
$r[$1] = $2 . $3; # yi: [-]ddd
}

# deg: 5
# c5: 200
# c0: -7

elsif($line =~ /^\s*c(\d+)\s*:\s*(-*)(\d+)/)
{
$c[$1] = $2 . $3; # ci: [-]ddd
}

# rlim: 3000000
# alim: 3000000

elsif($line =~ /^\s*rlim\s*:\s*(\d+)/) # rlim: ddd
{
$frmax = $1;
}
elsif($line =~ /^\s*alim\s*:\s*(\d+)/) # alim: ddd
{
$famax = $1;
}

# lpbr: 28
# lpba: 28

elsif($line =~ /^\s*lpbr\s*:\s*(\d+)/) # lpbr: ddd
{
$srtfbits = $1;
}
elsif($line =~ /^\s*lpba\s*:\s*(\d+)/) # lpba: ddd
{
$satfbits = $1;
}
}

print OUT1 "N $n\n"; # N ddd to dat
print OUT3 "$n\n"; # ddd to worktodo

print OUT2 "N $n\n"; # N ddd to fb
print "N $n\n";

$s = "R0 $r[0]\n" .
"R1 $r[1]\n";

print OUT2 $s; # R0, R1 to fb
print $s;

for($i = 0, $s = ""; $i <= $deg; $i++)
{
$s = $s . "A$i $c[$i]\n";
}

print OUT2 $s; # A0 - A{deg} to fb
print $s;

$s = "FRMAX $frmax\n" .
"FAMAX $famax\n" .
"SRTFBITS $srtfbits\n" .
"SATFBITS $satfbits\n";

print OUT2 $s; # FRMAX etc to fb
print $s;

close(IN);
close(OUT1);
close(OUT2);
close(OUT3);

$cmd = "gunzip -c $SAVE >> $FILE2";

print "==> $cmd\n";
system($cmd); # Append rels to dat

$cmd = "$MSIEVE";

print "==> $cmd\n";
system($cmd); # Run Msieve

# Send 5 BELLS at end of run
use IO::Handle;
STDOUT->autoflush(1);

for($i = 0; $i < 5; $i++){sleep 1;print "\a";}





Fri Oct 19, 2007 2:22 pm

bobb7772004
Offline Offline
Send Email Send Email

Forward
Message #1185 of 1942 |
Expand Messages Author Sort by Date

Hi all, Here is the "makems" Perl script I use to make the Msieve files and then run the linear algebra using Msieve, starting with the "n.poly" file in GGNFS....
Bob Backstrom
bobb7772004
Offline Send Email
Oct 19, 2007
2:22 pm

Thanks very much for this, Bob [saved away safely]. It looks very tempting to use on my current GGNFS job, even though I had kindof decided to let it run...
James Wanless
bearnol
Offline Send Email
Oct 19, 2007
6:01 pm

I've run ggnfs, sqrt failed (again). I want to use makems to finish the job, but I don't have a spairs.out file. I have the rels.xx files and a few others,...
Mark Rodenkirch
mgrogue
Offline Send Email
Dec 11, 2007
11:29 pm

I found my answer in this thread: http://tech.groups.yahoo.com/group/xyyxf/message/1239 I'll give it a try and see what happens... --Mark ... have a ... ...
Mark Rodenkirch
mgrogue
Offline Send Email
Dec 12, 2007
12:36 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help