From: <Ba...@us...> - 2012-02-25 00:21:14
|
Revision: 427 http://ggnfs.svn.sourceforge.net/ggnfs/?rev=427&view=rev Author: Batalov Date: 2012-02-25 00:21:07 +0000 (Sat, 25 Feb 2012) Log Message: ----------- set GZIPDAT=1 if you want to use gzipped dat; DO NOT mix and match with runs in progress! Modified Paths: -------------- trunk/tests/factMsieve.pl Modified: trunk/tests/factMsieve.pl =================================================================== --- trunk/tests/factMsieve.pl 2012-02-19 21:12:28 UTC (rev 426) +++ trunk/tests/factMsieve.pl 2012-02-25 00:21:07 UTC (rev 427) @@ -51,6 +51,8 @@ # Bah, this causes a fatal error if GMP BigInt is not available. # use Math::BigInt lib => 'GMP'; +$GZIPDAT = 0; # keep the .dat file plain --OR-- +# $GZIPDAT = 1; # keep the .dat file gzipped $NUM_CPUS=1; $NUM_THREADS=$NUM_CPUS; @@ -322,9 +324,11 @@ ########################################################### # Count the number of lines in the DATFILE ########################################################### - my $count = 0; - open(FILE, "< $DATNAME") or die "can't open $DATNAME: $!"; + my $count = -1; + # open(FILE, "< $DATNAME") or die "can't open $DATNAME: $!"; + open(FILE, "\"$GZIP\" -dfcq $DATNAME |") or die "can't open $DATNAME: $!"; $count++ while <FILE>; + close FILE; return $count; } @@ -1379,7 +1383,9 @@ print OF "$N\n"; close(OF); - open(OF, ">$DATNAME"); + # die if -e $DATNAME; # if you don't want to overwrite! + + open(OF, $GZIPDAT?"|\"$GZIP\">$DATNAME":">$DATNAME"); print OF "N $N\n"; close(OF); @@ -1705,9 +1711,15 @@ $MINRELS=$1 if($1); close IN; } - $cmd="\"$CAT\" spairs.out >> $DATNAME"; - print "=>$cmd\n" if($ECHO_CMDLINE); - concat("spairs.out", ">>", "$DATNAME"); + if($GZIPDAT) { + $cmd="\"$GZIP\" -5 -c spairs.out >> $DATNAME"; + print "=>$cmd\n" if($ECHO_CMDLINE); + system($cmd); + } else { + $cmd="\"$CAT\" spairs.out >> $DATNAME"; + print "=>$cmd\n" if($ECHO_CMDLINE); + concat("spairs.out", ">>", "$DATNAME"); + } $CURR_RELS = linecount; print "Found $CURR_RELS relations, need at least $MINRELS to proceed.\n"; if ($CURR_RELS > $MINRELS) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |