You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(11) |
Jul
(43) |
Aug
(688) |
Sep
(96) |
Oct
(18) |
Nov
(17) |
Dec
(16) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
(18) |
Mar
(29) |
Apr
|
May
(23) |
Jun
(11) |
Jul
(46) |
Aug
(9) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2007 |
Jan
(2) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(19) |
2008 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
(2) |
Dec
(5) |
2009 |
Jan
(8) |
Feb
(3) |
Mar
(4) |
Apr
(17) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(12) |
Dec
(1) |
2010 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(6) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
2011 |
Jan
(6) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
(1) |
Dec
(1) |
2012 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: BRG <brg...@us...> - 2005-08-10 20:04:33
|
Update of /cvsroot/ggnfs/branch_0/ggnfs.vc/pol51opt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10870/ggnfs.vc/pol51opt Modified Files: pol51opt.vcproj Log Message: Index: pol51opt.vcproj =================================================================== RCS file: /cvsroot/ggnfs/branch_0/ggnfs.vc/pol51opt/pol51opt.vcproj,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** pol51opt.vcproj 8 Jun 2005 19:47:00 -0000 1.1.1.1 --- pol51opt.vcproj 10 Aug 2005 20:04:22 -0000 1.2 *************** *** 133,158 **** RelativePath="..\..\src\pol5\zeit.c"> </File> - <Filter - Name="assembler"> - <File - RelativePath="..\asm_rs.asm"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - </File> - </Filter> </Filter> <Filter --- 133,136 ---- *************** *** 164,167 **** --- 142,168 ---- </File> </Filter> + <Filter + Name="Assembler Files" + Filter=""> + <File + RelativePath="..\asm_rs.asm"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + </File> + </Filter> <File RelativePath="..\bin\ggnfslib.lib"> |
From: BRG <brg...@us...> - 2005-08-10 20:04:33
|
Update of /cvsroot/ggnfs/branch_0/ggnfs.vc/latsieve12 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10870/ggnfs.vc/latsieve12 Modified Files: latsieve12.vcproj Log Message: Index: latsieve12.vcproj =================================================================== RCS file: /cvsroot/ggnfs/branch_0/ggnfs.vc/latsieve12/latsieve12.vcproj,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** latsieve12.vcproj 8 Jun 2005 19:47:00 -0000 1.1.1.1 --- latsieve12.vcproj 10 Aug 2005 20:04:21 -0000 1.2 *************** *** 186,306 **** </File> </Filter> - <Filter - Name="assembler"> - <File - RelativePath="..\lat_asm\asm_mul128.asm"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - </File> - <File - RelativePath="..\lat_asm\asm_mul64.asm"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - </File> - <File - RelativePath="..\lat_asm\asm_mul96.asm"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - </File> - <File - RelativePath="..\lat_asm\modinv1002.asm"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - </File> - <File - RelativePath="..\lat_asm\ri-aux.asm"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - </File> - <File - RelativePath="..\lat_asm\sieve-from-sched.asm"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" - " - Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> - </FileConfiguration> - </File> - </Filter> </Filter> <Filter --- 186,189 ---- *************** *** 319,322 **** --- 202,323 ---- </File> </Filter> + <Filter + Name="Assembler Files" + Filter=""> + <File + RelativePath="..\lat_asm\asm_mul128.asm"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + </File> + <File + RelativePath="..\lat_asm\asm_mul64.asm"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + </File> + <File + RelativePath="..\lat_asm\asm_mul96.asm"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + </File> + <File + RelativePath="..\lat_asm\modinv1002.asm"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + </File> + <File + RelativePath="..\lat_asm\ri-aux.asm"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + </File> + <File + RelativePath="..\lat_asm\sieve-from-sched.asm"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="nasm -Xvc -O9 -f win32 -o "$(ProjectDir)\$(IntDir)\$(InputName).obj" "$(InputPath)" + " + Outputs=""$(ProjectDir)\$(IntDir)\$(InputName).obj""/> + </FileConfiguration> + </File> + </Filter> <File RelativePath="..\bin\ggnfslib.lib"> |
From: BRG <brg...@us...> - 2005-08-10 20:04:33
|
Update of /cvsroot/ggnfs/branch_0/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10870/src Modified Files: blanczos64.c Log Message: Index: blanczos64.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/blanczos64.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** blanczos64.c 17 Jul 2005 10:01:37 -0000 1.3 --- blanczos64.c 10 Aug 2005 20:04:22 -0000 1.4 *************** *** 38,44 **** #ifdef __GNUC__ ! #define ALIGNED16 __attribute__ ((aligned (16))) #else ! #define ALIGNED16 #endif --- 38,46 ---- #ifdef __GNUC__ [...2683 lines suppressed...] + jnz l2 + emms + } + #endif } *************** *** 1914,1918 **** /*********************************************/ void getW_S(u64 *Wi, int *Si, u64 *T, int *Si_1) ! { u64 M[128] ALIGNED16, mask, t0, t1; int c[64], i, j, k, sSize, s; --- 4378,4383 ---- /*********************************************/ void getW_S(u64 *Wi, int *Si, u64 *T, int *Si_1) ! { ALIGNED16(u64 M[128]); ! u64 mask, t0, t1; int c[64], i, j, k, sSize, s; |
From: BRG <brg...@us...> - 2005-08-10 19:51:02
|
Update of /cvsroot/ggnfs/branch_0/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8317/doc Modified Files: readme.vc Log Message: |
From: BRG <brg...@us...> - 2005-08-10 19:51:01
|
Update of /cvsroot/ggnfs/branch_0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8317 Modified Files: Changelog Log Message: |
From: BRG <brg...@us...> - 2005-08-10 19:51:01
|
Update of /cvsroot/ggnfs/branch_0/ggnfs.vc/ggnfslib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8317/ggnfs.vc/ggnfslib Modified Files: ggnfslib.vcproj Log Message: |
From: BRG <brg...@us...> - 2005-08-10 19:51:01
|
Update of /cvsroot/ggnfs/branch_0/ggnfs.vc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8317/ggnfs.vc Modified Files: asm_hash5.asm asm_hash5n.asm if.c Log Message: |
From: Anton K. <as...@us...> - 2005-07-19 23:20:10
|
Update of /cvsroot/ggnfs/branch_0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19702 Modified Files: Changelog Makefile Log Message: Fixed some stupid bug in combinedSize() ;) Index: Changelog =================================================================== RCS file: /cvsroot/ggnfs/branch_0/Changelog,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Changelog 17 Jul 2005 10:01:35 -0000 1.16 --- Changelog 19 Jul 2005 23:20:00 -0000 1.17 *************** *** 1,2 **** --- 1,5 ---- + 7/20/05 (asl) + * Fixed some stupid bug in combinedSize() ;) + 7/17/05 (trilliwig) * Converted sources to use standard C9x int types defined in inttypes.h. Index: Makefile =================================================================== RCS file: /cvsroot/ggnfs/branch_0/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile 17 Jul 2005 10:01:36 -0000 1.7 --- Makefile 19 Jul 2005 23:20:01 -0000 1.8 *************** *** 1,3 **** ! VERSION=0.77.1-050717 THISDIR=ggnfs HOME=. --- 1,3 ---- ! VERSION=0.77.1-050720 THISDIR=ggnfs HOME=. |
From: Anton K. <as...@us...> - 2005-07-19 23:20:09
|
Update of /cvsroot/ggnfs/branch_0/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19702/src Modified Files: combparts.c Log Message: Fixed some stupid bug in combinedSize() ;) Index: combparts.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/combparts.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** combparts.c 17 Jul 2005 10:01:37 -0000 1.3 --- combparts.c 19 Jul 2005 23:20:01 -0000 1.4 *************** *** 610,614 **** sizeDiff++; } ! if (B[j] == r) { sizeDiff--; j++; --- 610,614 ---- sizeDiff++; } ! if ((j<sb) && (B[j] == r)) { sizeDiff--; j++; |
From: Sam C. <tri...@us...> - 2005-07-17 13:01:11
|
Update of /cvsroot/ggnfs/branch_0/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31718 Modified Files: blanczos64-no-mmx.c Log Message: * Whoops, forgot about blanczos64-no-mmx.c. Converted the necessary printf format specifiers to inttypes.h macros. Index: blanczos64-no-mmx.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/blanczos64-no-mmx.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** blanczos64-no-mmx.c 8 Jun 2005 19:47:01 -0000 1.1.1.1 --- blanczos64-no-mmx.c 17 Jul 2005 13:01:02 -0000 1.2 *************** *** 418,422 **** if ((double)100.0*64.0*iterations/n > 250) { fprintf(stderr, "Some error has occurred: Lanczos is not converging!\n"); ! fprintf(stderr, "Number of iterations is %ld.\n", iterations); /* Add some debugging stuff here! */ fprintf(stderr, "Terminating...\n"); --- 418,422 ---- if ((double)100.0*64.0*iterations/n > 250) { fprintf(stderr, "Some error has occurred: Lanczos is not converging!\n"); ! fprintf(stderr, "Number of iterations is %" PRIu32 ".\n", iterations); /* Add some debugging stuff here! */ fprintf(stderr, "Terminating...\n"); *************** *** 424,428 **** } } while (cont); ! printf("\nBlock Lanczos used %ld iterations.\n", iterations); --- 424,428 ---- } } while (cont); ! printf("\nBlock Lanczos used %" PRIu32 " iterations.\n", iterations); *************** *** 537,541 **** isZero = 0; if (!(isZero)) ! printf("Some error occurred: Final product (B)(deps) is nonzero (i=%ld)!\n", (s32)i); else printf("Verified.\n"); --- 537,541 ---- isZero = 0; if (!(isZero)) ! printf("Some error occurred: Final product (B)(deps) is nonzero (i=%" PRIu64 ")!\n", i); else printf("Verified.\n"); |
From: Sam C. <tri...@us...> - 2005-07-17 10:02:15
|
Update of /cvsroot/ggnfs/branch_0/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28641/include Modified Files: ggnfs.h version.h Log Message: * Converted sources to use standard C9x int types defined in inttypes.h. Corrected a number of format specifiers for printf/scanf. Changed a couple variable types here and there to correct possible problems. This provides a good way to print 64-bit ints with either standard GNU C libraries or the MSVCRT printf under Windows. Any future code should print s32s as PRId32, u64s as PRIu64, and so on. The corresponding scanf format specifiers are SCNd32/SCNx32 and SCNu64. Variables declared without bitlengths should still use non-macro formats (%d for int, %ld for long). At the moment, size_t is printed as %lu, unless someone has a better suggestion as to what it should be. Index: ggnfs.h =================================================================== RCS file: /cvsroot/ggnfs/branch_0/include/ggnfs.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ggnfs.h 3 Jul 2005 05:09:34 -0000 1.3 --- ggnfs.h 17 Jul 2005 10:01:36 -0000 1.4 *************** *** 29,32 **** --- 29,34 ---- #include <gmp.h> #include <stdarg.h> + #define __STDC_FORMAT_MACROS + #include <inttypes.h> #define _USE_MATH_DEFINES #include <math.h> *************** *** 86,103 **** #define MIN(_a, _b) ((_a) < (_b) ? (_a) : (_b)) ! #ifndef LONG64 ! typedef long s32; ! typedef long long s64; ! typedef unsigned long u32; ! typedef unsigned long long u64; ! #else ! typedef int s32; ! typedef long s64; ! typedef unsigned int u32; ! typedef unsigned long u64; ! #endif ! ! typedef unsigned char u8; ! typedef unsigned short u16; --- 88,100 ---- #define MIN(_a, _b) ((_a) < (_b) ? (_a) : (_b)) ! /* should be defined in inttypes.h. If your system doesn't ! have this, you'll need to define these and the printf/scanf ! format specifiers (e.g. PRId32, SCNu64, etc) yourself */ ! #define s32 int32_t ! #define s64 int64_t ! #define u32 uint32_t ! #define u64 uint64_t ! #define u8 uint8_t ! #define u16 uint16_t Index: version.h =================================================================== RCS file: /cvsroot/ggnfs/branch_0/include/version.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** version.h 8 Jun 2005 19:47:01 -0000 1.1.1.1 --- version.h 17 Jul 2005 10:01:36 -0000 1.2 *************** *** 1 **** ! #define GGNFS_VERSION "0.77.1" --- 1 ---- ! #define GGNFS_VERSION "0.77.1-050714" |
From: Sam C. <tri...@us...> - 2005-07-17 10:02:14
|
Update of /cvsroot/ggnfs/branch_0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28641 Modified Files: Changelog Makefile Log Message: * Converted sources to use standard C9x int types defined in inttypes.h. Corrected a number of format specifiers for printf/scanf. Changed a couple variable types here and there to correct possible problems. This provides a good way to print 64-bit ints with either standard GNU C libraries or the MSVCRT printf under Windows. Any future code should print s32s as PRId32, u64s as PRIu64, and so on. The corresponding scanf format specifiers are SCNd32/SCNx32 and SCNu64. Variables declared without bitlengths should still use non-macro formats (%d for int, %ld for long). At the moment, size_t is printed as %lu, unless someone has a better suggestion as to what it should be. Index: Makefile =================================================================== RCS file: /cvsroot/ggnfs/branch_0/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile 15 Jul 2005 03:18:30 -0000 1.6 --- Makefile 17 Jul 2005 10:01:36 -0000 1.7 *************** *** 1,3 **** ! VERSION=0.77.1-050714 THISDIR=ggnfs HOME=. --- 1,3 ---- ! VERSION=0.77.1-050717 THISDIR=ggnfs HOME=. Index: Changelog =================================================================== RCS file: /cvsroot/ggnfs/branch_0/Changelog,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Changelog 15 Jul 2005 03:18:29 -0000 1.15 --- Changelog 17 Jul 2005 10:01:35 -0000 1.16 *************** *** 1,2 **** --- 1,9 ---- + 7/17/05 (trilliwig) + * Converted sources to use standard C9x int types defined in inttypes.h. + Corrected a number of format specifiers for printf/scanf. Changed + a couple types here and there to correct possible problems. + * Added check that the aligned memory functions actually return aligned + memory in the MMX Lanczos code. + 7/14/05 (trilliwig) * Patched factLat.pl so it automatically applies more generous parameters |
From: Sam C. <tri...@us...> - 2005-07-17 10:02:00
|
Update of /cvsroot/ggnfs/branch_0/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28641/src Modified Files: blanczos64.c clsieve.c combparts.c fbgen.c fbmisc.c llist.c makefb.c matbuild.c matsolve.c matstuff.c misc.c montgomery_sqrt.c polyselect.c procrels.c rels.c sqrt.c Log Message: * Converted sources to use standard C9x int types defined in inttypes.h. Corrected a number of format specifiers for printf/scanf. Changed a couple variable types here and there to correct possible problems. This provides a good way to print 64-bit ints with either standard GNU C libraries or the MSVCRT printf under Windows. Any future code should print s32s as PRId32, u64s as PRIu64, and so on. The corresponding scanf format specifiers are SCNd32/SCNx32 and SCNu64. Variables declared without bitlengths should still use non-macro formats (%d for int, %ld for long). At the moment, size_t is printed as %lu, unless someone has a better suggestion as to what it should be. Index: matsolve.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/matsolve.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** matsolve.c 17 Jul 2005 04:35:21 -0000 1.4 --- matsolve.c 17 Jul 2005 10:01:45 -0000 1.5 *************** *** 153,157 **** } if (nz==0) { ! printf("Warning: column %ld is all zero!\n", c); if (numDel < 2048) delCols[numDel++]=c; --- 153,157 ---- } if (nz==0) { ! printf("Warning: column %" PRId32 " is all zero!\n", c); if (numDel < 2048) delCols[numDel++]=c; *************** *** 174,178 **** if (colHash[2*i]==colHash[2*i+2]) { if (colsAreEqual(M, colHash[2*i+1], colHash[2*i+3])) { ! printf("Bad matrix: column %ld = column %ld!\n", colHash[2*i+1], colHash[2*i+3]); if (numDel < 2048) --- 174,178 ---- if (colHash[2*i]==colHash[2*i+2]) { if (colsAreEqual(M, colHash[2*i+1], colHash[2*i+3])) { ! printf("Bad matrix: column %" PRId32 " = column %" PRId32 "!\n", colHash[2*i+1], colHash[2*i+3]); if (numDel < 2048) *************** *** 189,193 **** printf("in the matrix construction (procrels).\n"); if (numDel < 2048) { ! printf("However, the number of bad columns is only %ld,\n", numDel); printf("so we will delete them and attempt to continue.\n"); } --- 189,193 ---- printf("in the matrix construction (procrels).\n"); if (numDel < 2048) { ! printf("However, the number of bad columns is only %" PRId32 ",\n", numDel); printf("so we will delete them and attempt to continue.\n"); } *************** *** 222,226 **** rwt = (s32 *)malloc(M->numCols*sizeof(s32)); if (rwt == NULL) { ! fprintf(stderr, "loadMat(): Memory allocation error for rwt! (%ld bytes)\n", M->numCols*sizeof(s32)); exit(-1); --- 222,226 ---- rwt = (s32 *)malloc(M->numCols*sizeof(s32)); if (rwt == NULL) { ! fprintf(stderr, "loadMat(): Memory allocation error for rwt! (%lu bytes)\n", M->numCols*sizeof(s32)); exit(-1); *************** *** 246,250 **** dW=2.0; ! printf("Matrix scanned: it should be %ld x %ld.\n", M->numRows, M->numCols); i=0; /* This could be made a bit slicker, but whatever. */ --- 246,250 ---- dW=2.0; ! printf("Matrix scanned: it should be %" PRId32 " x %" PRId32 ".\n", M->numRows, M->numCols); i=0; /* This could be made a bit slicker, but whatever. */ *************** *** 270,277 **** } } ! printf("Found %ld dense blocks. Re-reading matrix...\n", M->numDenseBlocks); printf("The dense blocks consist of the following sets of rows:\n"); for (k=0; k<M->numDenseBlocks; k++) ! printf("[%ld, %ld]\n", M->denseBlockIndex[k], M->denseBlockIndex[k]+bSize-1); rewind(fp); --- 270,277 ---- } } ! printf("Found %" PRId32 " dense blocks. Re-reading matrix...\n", M->numDenseBlocks); printf("The dense blocks consist of the following sets of rows:\n"); for (k=0; k<M->numDenseBlocks; k++) ! printf("[%" PRId32 ", %" PRId32 "]\n", M->denseBlockIndex[k], M->denseBlockIndex[k]+bSize-1); rewind(fp); *************** *** 281,290 **** M->maxDataSize = 256 + fileSize/sizeof(s32); if (!(M->cEntry = (s32 *)malloc(M->maxDataSize*sizeof(s32)))) { ! fprintf(stderr, "loadMat() Error allocating %ld bytes for the sparse matrix!\n", M->maxDataSize*sizeof(s32)); fclose(fp); return -1; } if (!(M->cIndex = (s32 *)malloc((M->numCols+1)*sizeof(s32)))) { ! fprintf(stderr, "loadMat() Error allocating %ld bytes for the sparse matrix indicies!\n", (M->numCols+1)*sizeof(s32)); free(M->cEntry); fclose(fp); return -1; --- 281,290 ---- M->maxDataSize = 256 + fileSize/sizeof(s32); if (!(M->cEntry = (s32 *)malloc(M->maxDataSize*sizeof(s32)))) { ! fprintf(stderr, "loadMat() Error allocating %lu bytes for the sparse matrix!\n", M->maxDataSize*sizeof(s32)); fclose(fp); return -1; } if (!(M->cIndex = (s32 *)malloc((M->numCols+1)*sizeof(s32)))) { ! fprintf(stderr, "loadMat() Error allocating %lu bytes for the sparse matrix indicies!\n", (M->numCols+1)*sizeof(s32)); free(M->cEntry); fclose(fp); return -1; *************** *** 292,296 **** for (i=0; i<M->numDenseBlocks; i++) { if (!(M->denseBlocks[i] = (u64 *)calloc((M->numCols+1),sizeof(u64)))) { ! fprintf(stderr, "loadMat() Error allocating %ld bytes for the QCB entries!\n", (M->numCols+1)*sizeof(u64)); free(M->cIndex); free(M->cEntry); fclose(fp); return -1; --- 292,296 ---- for (i=0; i<M->numDenseBlocks; i++) { if (!(M->denseBlocks[i] = (u64 *)calloc((M->numCols+1),sizeof(u64)))) { ! fprintf(stderr, "loadMat() Error allocating %lu bytes for the QCB entries!\n", (M->numCols+1)*sizeof(u64)); free(M->cIndex); free(M->cEntry); fclose(fp); return -1; *************** *** 369,374 **** seedBlockLanczos(seed); startTime = sTime(); ! msgLog("", "GGNFS-%s : matsolve (seed=%ld)", GGNFS_VERSION,seed); ! printf("Using PRNG seed=%ld.\n", seed); --- 369,374 ---- seedBlockLanczos(seed); startTime = sTime(); ! msgLog("", "GGNFS-%s : matsolve (seed=%" PRId32 ")", GGNFS_VERSION, seed); ! printf("Using PRNG seed=%" PRId32 ".\n", seed); *************** *** 380,386 **** ! printf("Matrix loaded: it is %ld x %ld.\n", M.numRows, M.numCols); if (M.numCols < (M.numRows + 64)) { ! printf("More columns needed (current = %ld, min = %ld)\n", M.numCols, M.numRows+64); free(M.cEntry); free(M.cIndex); --- 380,386 ---- ! printf("Matrix loaded: it is %" PRId32 " x %" PRId32 ".\n", M.numRows, M.numCols); if (M.numCols < (M.numRows + 64)) { ! printf("More columns needed (current = %" PRId32 ", min = %" PRId32 ")\n", M.numCols, M.numRows+64); free(M.cEntry); free(M.cIndex); *************** *** 402,414 **** while (!(feof(ifp)) && strncmp(str, "END_HEADER",10)) { if (strncmp(str, "NUMCOLS: ", 9)==0) { ! sscanf(&str[9], "%lx", &origC); } readBinField(str, 1024, ifp); } fclose(ifp); ! printf("Original matrix had %ld columns.\n", origC); if (!(deps = (s32 *)malloc(origC*sizeof(s32)))) { ! printf("Could not allocate %ld bytes for the dependencies.\n", origC*sizeof(s32)); free(M.cEntry); free(M.cIndex); return -1; } --- 402,414 ---- while (!(feof(ifp)) && strncmp(str, "END_HEADER",10)) { if (strncmp(str, "NUMCOLS: ", 9)==0) { ! sscanf(&str[9], "%" SCNx32, &origC); } readBinField(str, 1024, ifp); } fclose(ifp); ! printf("Original matrix had %" PRId32 " columns.\n", origC); if (!(deps = (s32 *)malloc(origC*sizeof(s32)))) { ! printf("Could not allocate %lu bytes for the dependencies.\n", origC*sizeof(s32)); free(M.cEntry); free(M.cIndex); return -1; } Index: combparts.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/combparts.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** combparts.c 12 Jun 2005 19:37:42 -0000 1.2 --- combparts.c 17 Jul 2005 10:01:37 -0000 1.3 *************** *** 76,80 **** while (i<P->numFields) { if (fieldsBySize[i] > P->numFields) ! printf("?!?WTF?!? fieldsBySize[%ld]=%ld vs. P->numFields=%ld.\n", i,fieldsBySize[i], P->numFields); size = P->index[fieldsBySize[i]+1] - P->index[fieldsBySize[i]]; --- 76,80 ---- while (i<P->numFields) { if (fieldsBySize[i] > P->numFields) ! printf("?!?WTF?!? fieldsBySize[%" PRId32 "]=%" PRId32 " vs. P->numFields=%" PRId32 ".\n", i,fieldsBySize[i], P->numFields); size = P->index[fieldsBySize[i]+1] - P->index[fieldsBySize[i]]; *************** *** 83,87 **** else if (size < 0) { printf("P has been corrupted!\n"); ! printf("P->numFields = %ld, P->index[%ld]=%ld, P->index[%ld]=%ld.\n", P->numFields, fieldsBySize[i], P->index[fieldsBySize[i]], fieldsBySize[i]+1, P->index[fieldsBySize[i]+1]); --- 83,87 ---- else if (size < 0) { printf("P has been corrupted!\n"); ! printf("P->numFields = %" PRId32 ", P->index[%" PRId32 "]=%" PRId32 ", P->index[%" PRId32 "]=%" PRId32 ".\n", P->numFields, fieldsBySize[i], P->index[fieldsBySize[i]], fieldsBySize[i]+1, P->index[fieldsBySize[i]+1]); *************** *** 92,96 **** } for (i=0; i<7; i++) ! printf("There are %ld relations with %ld large primes.\n", numBySize[i], i); } } --- 92,96 ---- } for (i=0; i<7; i++) ! printf("There are %" PRId32 " relations with %" PRId32 " large primes.\n", numBySize[i], i); } } *************** *** 272,281 **** /* 'removeList' should already be sorted and unique, but whatever. */ numRemove = mkUniqueS32s(removeList, numRemove); ! printf("Deleting %ld singleton large primes.\n", numRemove); ll_deleteFields(P, removeList, numRemove); ll_resize(P, P->index[P->numFields] + LARGE_BUFFER); ll_deleteFields(R, removeList, numRemove); ! // printf("There are %ld relations remaining.\n", R->numFields); free(removeList); return (int)numRemove; --- 272,281 ---- /* 'removeList' should already be sorted and unique, but whatever. */ numRemove = mkUniqueS32s(removeList, numRemove); ! printf("Deleting %" PRId32 " singleton large primes.\n", numRemove); ll_deleteFields(P, removeList, numRemove); ll_resize(P, P->index[P->numFields] + LARGE_BUFFER); ll_deleteFields(R, removeList, numRemove); ! // printf("There are %" PRId32 " relations remaining.\n", R->numFields); free(removeList); return (int)numRemove; *************** *** 412,416 **** numAdds = mkUniquePairs(pairs, numAdds); if (numAdds > 0) { ! printf("Doing %ld additions...\n", numAdds); ll_catFields(P, pairs, numAdds, 1); ll_catFields(R, pairs, numAdds, 1); --- 412,416 ---- numAdds = mkUniquePairs(pairs, numAdds); if (numAdds > 0) { ! printf("Doing %" PRId32 " additions...\n", numAdds); ll_catFields(P, pairs, numAdds, 1); ll_catFields(R, pairs, numAdds, 1); *************** *** 471,475 **** } while (P->numFields < lastSize); s1 = R->numFields; ! printf("Total: %ld singletons deleted.\n", s0-s1); /* Sort the relation-sets on the number of large primes --- 471,475 ---- } while (P->numFields < lastSize); s1 = R->numFields; ! printf("Total: %" PRId32 " singletons deleted.\n", s0-s1); /* Sort the relation-sets on the number of large primes *************** *** 508,512 **** ll_init(&revP, P1+100, P->maxDataSize); do { ! printf("Doing merge on chunk %ld/%ld (P0=%ld, P1=%ld)...\n", part+1, numParts, P0, P1); /* Make the reverse-lookup table. */ mkLT(&revP, P, P0, P1); --- 508,512 ---- ll_init(&revP, P1+100, P->maxDataSize); do { ! printf("Doing merge on chunk %" PRId32 "/%" PRId32 " (P0=%" PRId32 ", P1=%" PRId32 ")...\n", part+1, numParts, P0, P1); /* Make the reverse-lookup table. */ mkLT(&revP, P, P0, P1); *************** *** 535,539 **** for (i=0; i<R->numFields; i++) { if (R->index[i+1]-R->index[i] == 0) { ! printf("Error: R field %ld is empty!\n", i); exit(-1); } --- 535,539 ---- for (i=0; i<R->numFields; i++) { if (R->index[i+1]-R->index[i] == 0) { ! printf("Error: R field %" PRId32 " is empty!\n", i); exit(-1); } *************** *** 541,545 **** for (k=j+1; k<R->index[i+1]; k++) { if (R->data[j]==R->data[k]) { ! printf("Error: R field %ld has duplicate entries!\n", i); exit(-1); } --- 541,545 ---- for (k=j+1; k<R->index[i+1]; k++) { if (R->data[j]==R->data[k]) { ! printf("Error: R field %" PRId32 " has duplicate entries!\n", i); exit(-1); } *************** *** 655,659 **** printf("Attempting to reduce weight of relation sets.\n"); ! printf("Initial weight is: %ld\n", R->index[R->numFields]); printf("Sorting relation-sets..."); fflush(stdout); for (i=0; i<R->numFields; i++) { --- 655,659 ---- printf("Attempting to reduce weight of relation sets.\n"); ! printf("Initial weight is: %" PRId32 "\n", R->index[R->numFields]); printf("Sorting relation-sets..."); fflush(stdout); for (i=0; i<R->numFields; i++) { *************** *** 685,689 **** ll_init(&revR, r1-r0+100, R->maxDataSize); do { ! printf("Making lookup table for chunk %ld / %ld: [%ld, %ld)...", part+1, numParts, r0, r1); fflush(stdout); --- 685,689 ---- ll_init(&revR, r1-r0+100, R->maxDataSize); do { ! printf("Making lookup table for chunk %" PRId32 " / %" PRId32 ": [%" PRId32 ", %" PRId32 ")...", part+1, numParts, r0, r1); fflush(stdout); *************** *** 732,738 **** */ if (numAdds > 0) { ! printf("Doing %ld additions to reduce relation-set weight...\n", numAdds); ll_catFields(R, pairs, numAdds, 1); ! printf("Current weight is: %ld\n", R->index[R->numFields]); numAdds=0; } --- 732,738 ---- */ if (numAdds > 0) { ! printf("Doing %" PRId32 " additions to reduce relation-set weight...\n", numAdds); ll_catFields(R, pairs, numAdds, 1); ! printf("Current weight is: %" PRId32 "\n", R->index[R->numFields]); numAdds=0; } *************** *** 745,749 **** free(pairs); // free(bitcount); ! printf("\nfinal weight is: %ld.\n", R->index[R->numFields]); return R->index[R->numFields] - initW; } --- 745,749 ---- free(pairs); // free(bitcount); ! printf("\nfinal weight is: %" PRId32 ".\n", R->index[R->numFields]); return R->index[R->numFields] - initW; } *************** *** 784,788 **** cwt += i*byWt[i]; if (byWt[i]>0) { ! printf("%3ld |%10ld|%10ld|%ld\n", i, byWt[i],cum,cwt); } } --- 784,788 ---- cwt += i*byWt[i]; if (byWt[i]>0) { ! printf("%3" PRId32 " |%10" PRIu32 "|%10" PRIu32 "|%" PRIu32 "\n", i, byWt[i],cum,cwt); } } *************** *** 870,879 **** full = makePass(R, P); checkR(R); ! printf("* There are now %ld full relations.\n", full); } while (lastFull < full); /* Drop any relation-sets still containing a large prime: */ keepFulls(R, P); ! printf("After keepFulls(), R->numFields = %ld\n", R->numFields); /* Don't bother with the weight reduction unless we're close --- 870,879 ---- full = makePass(R, P); checkR(R); ! printf("* There are now %" PRId32 " full relations.\n", full); } while (lastFull < full); /* Drop any relation-sets still containing a large prime: */ keepFulls(R, P); ! printf("After keepFulls(), R->numFields = %" PRId32 "\n", R->numFields); /* Don't bother with the weight reduction unless we're close *************** *** 890,894 **** reduceRelSets(R, P); wt1 = R->index[R->numFields]; ! msgLog("", "reduceRelSets dropped relation-set weight from %ld to %ld.", wt0, wt1); shrink = (double)(wt0-wt1)/wt0; --- 890,894 ---- reduceRelSets(R, P); wt1 = R->index[R->numFields]; ! msgLog("", "reduceRelSets dropped relation-set weight from %" PRId32 " to %" PRId32 ".", wt0, wt1); shrink = (double)(wt0-wt1)/wt0; *************** *** 896,901 **** #endif full = removeHeavyRelSets(R, P, maxRelsInFF); ! msgLog("", "After removing heavy rel-sets, weight is %ld.", R->index[R->numFields]); ! printf("After removing heavy rel-sets, weight is %ld.\n", R->index[R->numFields]); if (ll_verify(R)) { printf("ll_verify() reported an error for R!\n"); --- 896,901 ---- #endif full = removeHeavyRelSets(R, P, maxRelsInFF); ! msgLog("", "After removing heavy rel-sets, weight is %" PRId32 ".", R->index[R->numFields]); ! printf("After removing heavy rel-sets, weight is %" PRId32 ".\n", R->index[R->numFields]); if (ll_verify(R)) { printf("ll_verify() reported an error for R!\n"); Index: misc.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/misc.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** misc.c 15 Jul 2005 03:18:30 -0000 1.5 --- misc.c 17 Jul 2005 10:01:46 -0000 1.6 *************** *** 85,89 **** /**************************************************/ { double res; ! s32 e; static mpz_t _absk; static int initialized=0; --- 85,89 ---- /**************************************************/ { double res; ! long e; static mpz_t _absk; static int initialized=0; *************** *** 597,601 **** i++; if ((i%10)== 0) { ! printf("Attempt %ld / %ld for: ", i, _numCurves[level]); mpz_out_str(stdout, 10, tmp2); printf("\n"); --- 597,601 ---- i++; if ((i%10)== 0) { ! printf("Attempt %" PRId32 " / %" PRId32 " for: ", i, _numCurves[level]); mpz_out_str(stdout, 10, tmp2); printf("\n"); *************** *** 1119,1124 **** if (p==NULL) { mi_errs++; ! msgLog("", "Memory allocation error (%ld bytes requested).", (long)n); ! printf("Memory allocation error (%ld bytes requested).", (long)n); if (!(fatal)) return NULL; printf("Fatal error. Terminating...\n"); --- 1119,1124 ---- if (p==NULL) { mi_errs++; ! msgLog("", "Memory allocation error (%lu bytes requested).", (unsigned long)n); ! printf("Memory allocation error (%lu bytes requested).", (unsigned long)n); if (!(fatal)) return NULL; printf("Fatal error. Terminating...\n"); *************** *** 1145,1150 **** if (p==NULL) { mi_errs++; ! msgLog("", "Memory allocation error (%ld bytes requested).", (long)n); ! printf("Memory allocation error (%ld bytes requested).", (long)n); if (!(fatal)) return NULL; printf("Fatal error. Terminating...\n"); --- 1145,1150 ---- if (p==NULL) { mi_errs++; ! msgLog("", "Memory allocation error (%lu bytes requested).", (unsigned long)n); ! printf("Memory allocation error (%lu bytes requested).", (unsigned long)n); if (!(fatal)) return NULL; printf("Fatal error. Terminating...\n"); *************** *** 1173,1178 **** if (p==NULL) { mi_errs++; ! msgLog("", "Memory allocation error (%ld bytes requested).", (long)n); ! printf("Memory allocation error (%ld bytes requested).", (long)n); if (!(fatal)) return NULL; printf("Fatal error. Terminating...\n"); --- 1173,1178 ---- if (p==NULL) { mi_errs++; ! msgLog("", "Memory allocation error (%lu bytes requested).", (unsigned long)n); ! printf("Memory allocation error (%lu bytes requested).", (unsigned long)n); if (!(fatal)) return NULL; printf("Fatal error. Terminating...\n"); Index: fbgen.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/fbgen.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** fbgen.c 8 Jun 2005 19:47:02 -0000 1.1.1.1 --- fbgen.c 17 Jul 2005 10:01:37 -0000 1.2 *************** *** 428,434 **** u32 i; ! printf("\n%s %lu\n", c, dP); for (i = 0; i <= dP; i++) ! printf("%lu ", P[i]); printf("\n"); } --- 428,434 ---- u32 i; ! printf("\n%s %" PRIu32 "\n", c, dP); for (i = 0; i <= dP; i++) ! printf("%" PRIu32 " ", P[i]); printf("\n"); } *************** *** 495,499 **** j = polrootrecmod32(Q, dQ, r + i, S + dS + 1); /*j=dQ */ if (j != dQ) ! fprintf(stderr, "Falsche Nullstellenanzahl Q, P %lu\n", modulo32); i += j; } --- 495,499 ---- j = polrootrecmod32(Q, dQ, r + i, S + dS + 1); /*j=dQ */ if (j != dQ) ! fprintf(stderr, "Falsche Nullstellenanzahl Q, P %" PRIu32 "\n", modulo32); i += j; } *************** *** 503,507 **** j = polrootrecmod32(S, dS, r + i, S + dS + 1); /*j=dS */ if (j != dS) ! fprintf(stderr, "Falsche Nullstellenanzahl S, P %lu\n", modulo32); i += j; } --- 503,507 ---- j = polrootrecmod32(S, dS, r + i, S + dS + 1); /*j=dS */ if (j != dS) ! fprintf(stderr, "Falsche Nullstellenanzahl S, P %" PRIu32 "\n", modulo32); i += j; } Index: matbuild.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/matbuild.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** matbuild.c 4 Jul 2005 01:27:36 -0000 1.4 --- matbuild.c 17 Jul 2005 10:01:45 -0000 1.5 *************** *** 183,187 **** } if (nz==0) { ! printf("Warning: column %ld is all zero!\n", c); if (numDel < 2048) delCols[numDel++]=c; --- 183,187 ---- } if (nz==0) { ! printf("Warning: column %" PRId32 " is all zero!\n", c); if (numDel < 2048) delCols[numDel++]=c; *************** *** 204,208 **** if (colHash[2*i]==colHash[2*i+2]) { if (colsAreEqual(M, colHash[2*i+1], colHash[2*i+3])) { ! printf("Bad matrix: column %ld = column %ld!\n", colHash[2*i+1], colHash[2*i+3]); if (numDel < 2048) --- 204,208 ---- if (colHash[2*i]==colHash[2*i+2]) { if (colsAreEqual(M, colHash[2*i+1], colHash[2*i+3])) { ! printf("Bad matrix: column %" PRId32 " = column %" PRId32 "!\n", colHash[2*i+1], colHash[2*i+3]); if (numDel < 2048) *************** *** 219,223 **** printf("in the matrix construction (procrels).\n"); if (numDel < 2048) { ! printf("However, the number of bad columns is only %ld,\n", numDel); printf("so we will delete them and attempt to continue.\n"); } --- 219,223 ---- printf("in the matrix construction (procrels).\n"); if (numDel < 2048) { ! printf("However, the number of bad columns is only %" PRId32 ",\n", numDel); printf("so we will delete them and attempt to continue.\n"); } *************** *** 271,275 **** dW=2.0; ! printf("Matrix scanned: it should be %ld x %ld.\n", M->numRows, M->numCols); i=0; /* This could be made a bit slicker, but whatever. */ --- 271,275 ---- dW=2.0; ! printf("Matrix scanned: it should be %" PRId32 " x %" PRId32 ".\n", M->numRows, M->numCols); i=0; /* This could be made a bit slicker, but whatever. */ *************** *** 295,302 **** } } ! printf("Found %ld dense blocks. Re-reading matrix...\n", M->numDenseBlocks); ! printf("The dense blocks consist of the following sets of rows:\n"); ! for (k=0; k<M->numDenseBlocks; k++) ! printf("[%ld, %ld]\n", M->denseBlockIndex[k], M->denseBlockIndex[k]+bSize-1); rewind(fp); --- 295,302 ---- } } ! printf("Found %" PRId32 " dense blocks. Re-reading matrix...\n", M->numDenseBlocks); ! printf("The dense blocks consist of the following sets of rows:\n"); ! for (k=0; k<M->numDenseBlocks; k++) ! printf("[%" PRId32 ", %" PRId32 "]\n", M->denseBlockIndex[k], M->denseBlockIndex[k]+bSize-1); rewind(fp); *************** *** 309,313 **** for (i=0; i<M->numDenseBlocks; i++) { if (!(M->denseBlocks[i] = (u64 *)lxcalloc((M->numCols+1)*sizeof(u64),0))) { ! fprintf(stderr, "loadMat() Error allocating %ld bytes for the QCB entries!\n", (M->numCols+1)*sizeof(u64)); free(M->cIndex); free(M->cEntry); fclose(fp); return -1; --- 309,313 ---- for (i=0; i<M->numDenseBlocks; i++) { if (!(M->denseBlocks[i] = (u64 *)lxcalloc((M->numCols+1)*sizeof(u64),0))) { ! fprintf(stderr, "loadMat() Error allocating %lu bytes for the QCB entries!\n", (M->numCols+1)*sizeof(u64)); free(M->cIndex); free(M->cEntry); fclose(fp); return -1; *************** *** 375,384 **** /* Now allocate for the relations. */ if (!(RL->relData = (s32 *)lxmalloc(RL->maxDataSize * sizeof(s32),0))) { ! fprintf(stderr, "Error allocating %ldMB for reading relation list!\n", RL->maxDataSize * sizeof(s32)/1048576); free(RL); return NULL; } if (!(RL->relIndex = (s32 *)lxmalloc(RL->maxRels * sizeof(s32),0))) { ! fprintf(stderr, "Error allocating %ldMB for relation pointers!\n", RL->maxRels * sizeof(s32)/1048576); free(RL->relData); free(RL); --- 375,384 ---- /* Now allocate for the relations. */ if (!(RL->relData = (s32 *)lxmalloc(RL->maxDataSize * sizeof(s32),0))) { ! fprintf(stderr, "Error allocating %luMB for reading relation list!\n", RL->maxDataSize * sizeof(s32)/1048576); free(RL); return NULL; } if (!(RL->relIndex = (s32 *)lxmalloc(RL->maxRels * sizeof(s32),0))) { ! fprintf(stderr, "Error allocating %luMB for relation pointers!\n", RL->maxRels * sizeof(s32)/1048576); free(RL->relData); free(RL); *************** *** 502,506 **** lASize = lAMax=0; for (i=0; i<prelF->numFiles; i++) { ! printf("Loading processed file %ld/%d...", i+1, prelF->numFiles); fflush(stdout); RL = getRelList(prelF, i); --- 502,506 ---- lASize = lAMax=0; for (i=0; i<prelF->numFiles; i++) { ! printf("Loading processed file %" PRId32 "/%d...", i+1, prelF->numFiles); fflush(stdout); RL = getRelList(prelF, i); *************** *** 553,557 **** lASize = sortRMDups2(lA, lASize); printf("Done.\n"); ! printf("Found %ld distinct large rprimes and %ld large aprimes so far.\n",lRSize, lASize); } --- 553,557 ---- lASize = sortRMDups2(lA, lASize); printf("Done.\n"); ! printf("Found %" PRId32 " distinct large rprimes and %" PRId32 " large aprimes so far.\n",lRSize, lASize); } *************** *** 564,568 **** ! printf("There are %ld large primes versus %ld relations.\n", lRSize+lASize, numRels); initialRelations = numRels; --- 564,568 ---- ! printf("There are %" PRId32 " large primes versus %" PRId32 " relations.\n", lRSize+lASize, numRels); initialRelations = numRels; *************** *** 639,643 **** for (i=0; i<prelF->numFiles; i++) { ! printf("Loading processed file %ld/%d...", i+1, prelF->numFiles); fflush(stdout); RL = getRelList(prelF, i); --- 639,643 ---- for (i=0; i<prelF->numFiles; i++) { ! printf("Loading processed file %" PRId32 "/%d...", i+1, prelF->numFiles); fflush(stdout); RL = getRelList(prelF, i); *************** *** 660,664 **** loc = bsearch(&p, lR, lRSize, sizeof(s32), cmpS32s); if (loc==NULL) { ! printf("Warning: Could not find large rational prime %ld in lR!\n", p); index = BAD_LP_INDEX; /* See the note at top of file. */ } else { --- 660,664 ---- loc = bsearch(&p, lR, lRSize, sizeof(s32), cmpS32s); if (loc==NULL) { ! printf("Warning: Could not find large rational prime %" PRId32 " in lR!\n", p); index = BAD_LP_INDEX; /* See the note at top of file. */ } else { *************** *** 674,678 **** loc = bsearch(key, lA, lASize, 2*sizeof(s32), cmp2S32s); if (loc==NULL) { ! printf("Warning: Could not find large alg prime (%ld,%ld) in lR!\n",p,r); index = BAD_LP_INDEX; } else { --- 674,678 ---- loc = bsearch(key, lA, lASize, 2*sizeof(s32), cmp2S32s); if (loc==NULL) { ! printf("Warning: Could not find large alg prime (%" PRId32 ",%" PRId32 ") in lR!\n",p,r); index = BAD_LP_INDEX; } else { *************** *** 730,736 **** numLargeP = totalLargePrimes; printf("----------------------------\n"); ! printf("There are %ld large primes versus %ld relations.\n", numLargeP, initialRelations); ! msgLog(NULL, "largePrimes: %ld , relations: %ld", numLargeP, initialRelations); printf("----------------------------\n"); --- 730,737 ---- numLargeP = totalLargePrimes; printf("----------------------------\n"); ! printf("There are %" PRId32 " large primes versus %" PRId32 " relations.\n", numLargeP, initialRelations); ! msgLog(NULL, "largePrimes: %" PRId32 " , relations: %" PRId32, ! numLargeP, initialRelations); printf("----------------------------\n"); *************** *** 744,748 **** j=0; do { ! printf(" %ld | %ld\n", j, numLP[j]); j++; } while ((j<10) && (numLP[j]>0)); --- 745,749 ---- j=0; do { ! printf(" %" PRId32 " | %" PRId32 "\n", j, numLP[j]); j++; } while ((j<10) && (numLP[j]>0)); *************** *** 776,780 **** tPP = approxPi_x(FB->maxP_r) + approxPi_x(FB->maxP_a); tPP = tPP - FB->rfb_size - FB->afb_size; ! printf("Max # of large primes is approximately %ld.\n", tPP); numFulls = doRowOps3(&P, &Rl, prelF, maxRelsInFF); --- 777,781 ---- tPP = approxPi_x(FB->maxP_r) + approxPi_x(FB->maxP_a); tPP = tPP - FB->rfb_size - FB->afb_size; ! printf("Max # of large primes is approximately %" PRId32 ".\n", tPP); numFulls = doRowOps3(&P, &Rl, prelF, maxRelsInFF); *************** *** 868,872 **** ! printf("After re-scanning files and building column indicies, numFF=%ld.\n", numFF); bufSize = bufIndex = 0; bufSize2 = bufIndex2 = 0; --- 869,873 ---- ! printf("After re-scanning files and building column indicies, numFF=%" PRId32 ".\n", numFF); bufSize = bufIndex = 0; bufSize2 = bufIndex2 = 0; *************** *** 880,891 **** spOffset = aOffset + FB->afb_size; ! printf("Creating %ld matrix columns...\n", numFF); strcpy(fName, TMP_FILE); R0=R1=0; for (i=0; i<prelF->numFiles; i++) { ! sprintf(prelName, "%s.%ld", prelF->prefix, i); RL = getRelList(prelF, i); R1 = R0 + RL->numRels; ! printf("Re-read %ld relations from %s : [%ld, %ld).\n", RL->numRels, prelName, R0, R1); /* Now, we have in RAM the relations numbered [R0, R1). */ if (!(fp = fopen(colName, "rb"))) { --- 881,892 ---- spOffset = aOffset + FB->afb_size; ! printf("Creating %" PRId32 " matrix columns...\n", numFF); strcpy(fName, TMP_FILE); R0=R1=0; for (i=0; i<prelF->numFiles; i++) { ! sprintf(prelName, "%s.%" PRId32, prelF->prefix, i); RL = getRelList(prelF, i); R1 = R0 + RL->numRels; ! printf("Re-read %" PRId32 " relations from %s : [%" PRId32 ", %" PRId32 ").\n", RL->numRels, prelName, R0, R1); /* Now, we have in RAM the relations numbered [R0, R1). */ if (!(fp = fopen(colName, "rb"))) { *************** *** 1037,1045 **** if (C.numRels > 0) { ! printf("Error: relation-set %ld still has %ld unconverted relations!\n", j,C.numRels); printf("They are: "); for (i=0; i<C.numRels; i++) ! printf("%ld ", C.Rels[i]); printf("\n"); exit(-1); --- 1038,1046 ---- if (C.numRels > 0) { ! printf("Error: relation-set %" PRId32 " still has %" PRId32 " unconverted relations!\n", j,C.numRels); printf("They are: "); for (i=0; i<C.numRels; i++) ! printf("%" PRId32 " ", C.Rels[i]); printf("\n"); exit(-1); *************** *** 1115,1119 **** RL->maxDataSize = 1000 + maxSize/sizeof(s32); if (!(RL->relData = (s32 *)lxmalloc(RL->maxDataSize * sizeof(s32),0))) { ! fprintf(stderr, "Error allocating %ldMB for processed relation files!\n", RL->maxDataSize * sizeof(s32)/1048576); fprintf(stderr, "Try decreasing DEFAULT_MAX_FILESIZE and re-running.\n"); --- 1116,1120 ---- RL->maxDataSize = 1000 + maxSize/sizeof(s32); if (!(RL->relData = (s32 *)lxmalloc(RL->maxDataSize * sizeof(s32),0))) { ! fprintf(stderr, "Error allocating %luMB for processed relation files!\n", RL->maxDataSize * sizeof(s32)/1048576); fprintf(stderr, "Try decreasing DEFAULT_MAX_FILESIZE and re-running.\n"); *************** *** 1123,1127 **** RL->maxRels = (u32)RL->maxDataSize/20; if (!(RL->relIndex = (s32 *)lxmalloc(RL->maxRels * sizeof(s32),0))) { ! fprintf(stderr, "Error allocating %ldMB for relation pointers!\n", RL->maxRels * sizeof(s32)/1048756); free(RL->relData); --- 1124,1128 ---- RL->maxRels = (u32)RL->maxDataSize/20; if (!(RL->relIndex = (s32 *)lxmalloc(RL->maxRels * sizeof(s32),0))) { ! fprintf(stderr, "Error allocating %luMB for relation pointers!\n", RL->maxRels * sizeof(s32)/1048756); free(RL->relData); *************** *** 1161,1167 **** printf("Loading matrix into RAM...\n"); loadMat(&M, colName); ! printf("Matrix loaded: it is %ld x %ld.\n", M.numRows, M.numCols); if (M.numCols < (M.numRows + 64)) { ! printf("More columns needed (current = %ld, min = %ld)\n", M.numCols, M.numRows+64); free(M.cEntry); free(M.cIndex); --- 1162,1168 ---- printf("Loading matrix into RAM...\n"); loadMat(&M, colName); ! printf("Matrix loaded: it is %" PRId32 " x %" PRId32 ".\n", M.numRows, M.numCols); if (M.numCols < (M.numRows + 64)) { ! printf("More columns needed (current = %" PRId32 ", min = %" PRId32 ")\n", M.numCols, M.numRows+64); free(M.cEntry); free(M.cIndex); *************** *** 1188,1196 **** /* Sanity check: */ if (M.numCols != C.numFields) { ! fprintf(stderr, "Error: M.numCols = %ld != %ld = C.numFields.\n", M.numCols, C.numFields); exit(-1); } else { ! printf("Sanity check: M.numCols = %ld = C.numFields. passed.\n", M.numCols); } --- 1189,1197 ---- /* Sanity check: */ if (M.numCols != C.numFields) { ! fprintf(stderr, "Error: M.numCols = %" PRId32 " != %" PRId32 " = C.numFields.\n", M.numCols, C.numFields); exit(-1); } else { ! printf("Sanity check: M.numCols = %" PRId32 " = C.numFields. passed.\n", M.numCols); } *************** *** 1294,1301 **** logHeapStats(); if (finalFF > 0) ! msgLog("", "rels:%ld, initialFF:%ld, finalFF:%ld", initialRelations, initialFF, finalFF); if (finalFF < minFF) { ! printf("More columns needed (current = %ld, min = %ld)\n", finalFF, minFF); exit(0); --- 1295,1302 ---- logHeapStats(); if (finalFF > 0) ! msgLog("", "rels:%" PRId32 ", initialFF:%" PRId32 ", finalFF:%" PRId32, initialRelations, initialFF, finalFF); if (finalFF < minFF) { ! printf("More columns needed (current = %" PRId32 ", min = %" PRId32 ")\n", finalFF, minFF); exit(0); *************** *** 1311,1317 **** fprintf(stderr, "Error opening %s for write!\n", "depinf"); } else { ! sprintf(str, "NUMCOLS: %8.8lx", finalFF); writeBinField(fp, str); sprintf(str, "COLNAME: %s.index", colName); writeBinField(fp, str); ! sprintf(str, "MAXRELS: %8.8lx", totalRels); writeBinField(fp, str); sprintf(str, "RELPREFIX: %s", prelF.prefix); writeBinField(fp, str); sprintf(str, "RELFILES: %x", prelF.numFiles); writeBinField(fp, str); --- 1312,1318 ---- fprintf(stderr, "Error opening %s for write!\n", "depinf"); } else { ! sprintf(str, "NUMCOLS: %8.8" PRIx32, finalFF); writeBinField(fp, str); sprintf(str, "COLNAME: %s.index", colName); writeBinField(fp, str); ! sprintf(str, "MAXRELS: %8.8" PRIx32, totalRels); writeBinField(fp, str); sprintf(str, "RELPREFIX: %s", prelF.prefix); writeBinField(fp, str); sprintf(str, "RELFILES: %x", prelF.numFiles); writeBinField(fp, str); Index: llist.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/llist.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** llist.c 8 Jun 2005 19:47:02 -0000 1.1.1.1 --- llist.c 17 Jul 2005 10:01:37 -0000 1.2 *************** *** 42,51 **** L->numFields = 0; if (!(L->data = (s32 *)lxmalloc(maxDataSize*sizeof(s32),0))) { ! fprintf(stderr, "ll_init() Memory allocation error (%ldMb).\n", maxDataSize*sizeof(s32)/(1024*1024)); return -1; } if (!(L->index = (s32 *)lxmalloc((maxFields+1)*sizeof(s32),0))) { ! fprintf(stderr, "ll_init() Memory allocation error (%ldMb).\n", maxFields*sizeof(s32)/(1024*1024)); free(L->data); --- 42,51 ---- L->numFields = 0; if (!(L->data = (s32 *)lxmalloc(maxDataSize*sizeof(s32),0))) { ! fprintf(stderr, "ll_init() Memory allocation error (%luMb).\n", maxDataSize*sizeof(s32)/(1024*1024)); return -1; } if (!(L->index = (s32 *)lxmalloc((maxFields+1)*sizeof(s32),0))) { ! fprintf(stderr, "ll_init() Memory allocation error (%luMb).\n", maxFields*sizeof(s32)/(1024*1024)); free(L->data); *************** *** 126,130 **** if ((L->numFields < 0) || (L->numFields > L->maxFields)) { ! printf("ll_verify() L->numFields=%ld vs. L->maxFields=%ld.\n", L->numFields, L->maxFields); return -1; --- 126,130 ---- if ((L->numFields < 0) || (L->numFields > L->maxFields)) { ! printf("ll_verify() L->numFields=%" PRId32 " vs. L->maxFields=%" PRId32 ".\n", L->numFields, L->maxFields); return -1; *************** *** 135,144 **** s1 = L->index[i+1]; if (s1 > L->maxDataSize) { ! printf("ll_verify() L->index[%ld]=%ld vs. L->maxDataSize=%ld.\n", i+1, s1, L->maxDataSize); return -1; } if (s1 < s0) { ! printf("ll_verify() L->index[%ld]=%ld vs. L->index[%ld+1]=%ld.\n", i, s0, i, s1); return -1; --- 135,144 ---- s1 = L->index[i+1]; if (s1 > L->maxDataSize) { ! printf("ll_verify() L->index[%" PRId32 "]=%" PRId32 " vs. L->maxDataSize=%" PRId32 ".\n", i+1, s1, L->maxDataSize); return -1; } if (s1 < s0) { ! printf("ll_verify() L->index[%" PRId32 "]=%" PRId32 " vs. L->index[%" PRId32 "+1]=%" PRId32 ".\n", i, s0, i, s1); return -1; *************** *** 241,245 **** newEntries[numNewEntries++] = L->data[j]; if (numNewEntries >= MAXFIELDENTRIES) { ! printf("MAXFIELDENTRIES exceeded (i=%ld, c0=%ld, c1=%ld.). Ignoring...\n",i,c0,c1); return -1; } --- 241,245 ---- newEntries[numNewEntries++] = L->data[j]; if (numNewEntries >= MAXFIELDENTRIES) { ! printf("MAXFIELDENTRIES exceeded (i=%" PRId32 ", c0=%" PRId32 ", c1=%" PRId32 ".). Ignoring...\n",i,c0,c1); return -1; } *************** *** 265,273 **** if (tmpPtr == NULL) { printf("ll_catFields(): memory reallocation error!\n"); ! printf("%ld s32's requested.\n", (L->index[L->numFields] + maxShift + 10)); ! printf("Old size was L->maxDataSize=%ld\n", L->maxDataSize); ! printf("L->numFields = %ld, maxShift = %ld\n", L->numFields, maxShift); ! printf("L->index[%ld] = %ld\n", L->numFields, L->index[L->numFields]); ! printf("numPairs=%ld, numNewEntries=%ld\n", numPairs, numNewEntries); #ifdef MALLOC_REPORTING printf("malloc useage is about %d MB.", mallocReport()); --- 265,273 ---- if (tmpPtr == NULL) { printf("ll_catFields(): memory reallocation error!\n"); ! printf("%" PRId32 " s32's requested.\n", (L->index[L->numFields] + maxShift + 10)); ! printf("Old size was L->maxDataSize=%" PRId32 "\n", L->maxDataSize); ! printf("L->numFields = %" PRId32 ", maxShift = %" PRId32 "\n", L->numFields, maxShift); ! printf("L->index[%" PRId32 "] = %" PRId32 "\n", L->numFields, L->index[L->numFields]); ! printf("numPairs=%" PRId32 ", numNewEntries=%" PRId32 "\n", numPairs, numNewEntries); #ifdef MALLOC_REPORTING printf("malloc useage is about %d MB.", mallocReport()); Index: matstuff.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/matstuff.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** matstuff.c 17 Jul 2005 04:35:21 -0000 1.2 --- matstuff.c 17 Jul 2005 10:01:46 -0000 1.3 *************** *** 68,72 **** if (M->numCols <= 0) { ! printf("mat_verify() M->numCols=%ld.\n", M->numCols); return -1; } --- 68,72 ---- if (M->numCols <= 0) { ! printf("mat_verify() M->numCols=%" PRId32 ".\n", M->numCols); return -1; } *************** *** 76,85 **** s1 = M->cIndex[i+1]; if (s1 > M->maxDataSize) { ! printf("mat_verify() M->cIndex[%ld]=%ld vs. M->maxDataSize=%ld.\n", i+1, s1, M->maxDataSize); return -1; } if (s1 < s0) { ! printf("mat_verify() M->cIndex[%ld]=%ld vs. M->cIndex[%ld+1]=%ld.\n", i, s0, i, s1); return -1; --- 76,85 ---- s1 = M->cIndex[i+1]; if (s1 > M->maxDataSize) { ! printf("mat_verify() M->cIndex[%" PRId32 "]=%" PRId32 " vs. M->maxDataSize=%" PRId32 ".\n", i+1, s1, M->maxDataSize); return -1; } if (s1 < s0) { ! printf("mat_verify() M->cIndex[%" PRId32 "]=%" PRId32 " vs. M->cIndex[%" PRId32 "+1]=%" PRId32 ".\n", i, s0, i, s1); return -1; *************** *** 319,325 **** newEntries[numNewEntries++] = M->cEntry[j]; if (numNewEntries >= MAXCOLWT) { ! printf("MAXCOLWT exceeded (i=%ld, c0=%ld, c1=%ld.). Ignoring...\n",i,c0,c1); ! printf(" cIndex[c0]=%ld, cIndex[c0+1] = %ld.\n", M->cIndex[c0], M->cIndex[c0+1]); ! printf(" cIndex[c1]=%ld, cIndex[c1+1] = %ld.\n", M->cIndex[c1], M->cIndex[c1+1]); return -1; } --- 319,325 ---- newEntries[numNewEntries++] = M->cEntry[j]; if (numNewEntries >= MAXCOLWT) { ! printf("MAXCOLWT exceeded (i=%" PRId32 ", c0=%" PRId32 ", c1=%" PRId32 ".). Ignoring...\n",i,c0,c1); ! printf(" cIndex[c0]=%" PRId32 ", cIndex[c0+1] = %" PRId32 ".\n", M->cIndex[c0], M->cIndex[c0+1]); ! printf(" cIndex[c1]=%" PRId32 ", cIndex[c1+1] = %" PRId32 ".\n", M->cIndex[c1], M->cIndex[c1+1]); return -1; } *************** *** 603,607 **** if (!(cwt = (s32 *)malloc(2*M->numCols*sizeof(s32)))) { printf("removeHeavyColumnsByRows() memory allocation error!\n"); ! printf("( %ld bytes requested).\n", 2*sizeof(s32)*M->numCols); return -1; } --- 603,607 ---- if (!(cwt = (s32 *)malloc(2*M->numCols*sizeof(s32)))) { printf("removeHeavyColumnsByRows() memory allocation error!\n"); ! printf("( %lu bytes requested).\n", 2*sizeof(s32)*M->numCols); return -1; } *************** *** 615,619 **** free(cwt); printf("removeHeavyColumnsByRows() memory allocation error!\n"); ! printf("( %ld bytes requested).\n", sizeof(s32)*M->numRows); return -1; } --- 615,619 ---- free(cwt); printf("removeHeavyColumnsByRows() memory allocation error!\n"); ! printf("( %lu bytes requested).\n", sizeof(s32)*M->numRows); return -1; } *************** *** 1020,1029 **** wt = MIN(0.95, MAX(0.05, wtFactor)); ! sprintf(str, "Initial matrix is %ld x %ld with sparse part having weight %ld.", M->numRows, M->numCols, M->cIndex[M->numCols]); msgLog(NULL, "Pruning matrix with wt=%1.3lf", wt); origWt = M->cIndex[M->numCols]; printf("%s\n",str); msgLog("", str); ! sprintf(str, "(total weight is %ld)", matrixWeight(M)); printf("%s\n",str); msgLog("", str); --- 1020,1029 ---- wt = MIN(0.95, MAX(0.05, wtFactor)); ! sprintf(str, "Initial matrix is %" PRId32 " x %" PRId32 " with sparse part having weight %" PRId32 ".", M->numRows, M->numCols, M->cIndex[M->numCols]); msgLog(NULL, "Pruning matrix with wt=%1.3lf", wt); origWt = M->cIndex[M->numCols]; printf("%s\n",str); msgLog("", str); ! sprintf(str, "(total weight is %" PRId32 ")", matrixWeight(M)); printf("%s\n",str); msgLog("", str); *************** *** 1065,1069 **** mat_verify(M); ! sprintf(str, "Matrix pruned to %ld x %ld with weight %ld.", M->numRows, M->numCols, M->cIndex[M->numCols]); printf("%s\n", str); msgLog("", str); --- 1065,1069 ---- mat_verify(M); ! sprintf(str, "Matrix pruned to %" PRId32 " x %" PRId32 " with weight %" PRId32 ".", M->numRows, M->numCols, M->cIndex[M->numCols]); printf("%s\n", str); msgLog("", str); Index: blanczos64.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/blanczos64.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** blanczos64.c 17 Jul 2005 04:35:20 -0000 1.2 --- blanczos64.c 17 Jul 2005 10:01:37 -0000 1.3 *************** *** 683,687 **** if ((double)100.0*64.0*iterations/n > 250) { fprintf(stderr, "Some error has occurred: Lanczos is not converging!\n"); ! fprintf(stderr, "Number of iterations is %ld.\n", iterations); /* Add some debugging stuff here! */ fprintf(stderr, "Terminating...\n"); --- 683,687 ---- if ((double)100.0*64.0*iterations/n > 250) { fprintf(stderr, "Some error has occurred: Lanczos is not converging!\n"); ! fprintf(stderr, "Number of iterations is %" PRIu32 ".\n", iterations); /* Add some debugging stuff here! */ fprintf(stderr, "Terminating...\n"); *************** *** 689,693 **** } } while (cont); ! printf("\nBlock Lanczos used %ld iterations.\n", iterations); --- 689,693 ---- } } while (cont); ! printf("\nBlock Lanczos used %" PRIu32 " iterations.\n", iterations); *************** *** 807,811 **** isZero = 0; if (!(isZero)) ! printf("Some error occurred: Final product (B)(deps) is nonzero (i=%ld)!\n", (s32)i); else printf("Verified.\n"); --- 807,811 ---- isZero = 0; if (!(isZero)) ! printf("Some error occurred: Final product (B)(deps) is nonzero (i=%" PRIu64 ")!\n", i); else printf("Verified.\n"); Index: montgomery_sqrt.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/montgomery_sqrt.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** montgomery_sqrt.c 4 Jul 2005 01:27:36 -0000 1.3 --- montgomery_sqrt.c 17 Jul 2005 10:01:46 -0000 1.4 *************** *** 210,216 **** } if (M->Cd.aI[i] > 0) ! printf("in AFB at index %ld...", M->Cd.aI[i]); if (M->Cd.eI[i] > 0) ! printf("is exceptional with index %ld...", M->Cd.eI[i]); printf("\n"); --- 210,216 ---- } if (M->Cd.aI[i] > 0) ! printf("in AFB at index %" PRId32 "...", M->Cd.aI[i]); if (M->Cd.eI[i] > 0) ! printf("is exceptional with index %" PRId32 "...", M->Cd.eI[i]); printf("\n"); *************** *** 427,433 **** } M->spSize = k; ! printf("There are %ld special prime ideals:\n", k); for (i=0; i<k; i++) { ! printf("Sp. %ld: ", i); mpz_out_str(stdout, 10, M->sPrimes[i].p); printf(", "); mpz_poly_print(stdout, "",M->sPrimes[i].alpha); --- 427,433 ---- } M->spSize = k; ! printf("There are %" PRId32 " special prime ideals:\n", k); for (i=0; i<k; i++) { ! printf("Sp. %" PRId32 ": ", i); mpz_out_str(stdout, 10, M->sPrimes[i].p); printf(", "); mpz_poly_print(stdout, "",M->sPrimes[i].alpha); *************** *** 439,443 **** for (i=0; i<=lpF->numFiles; i++) { if (i < lpF->numFiles) ! sprintf(fName, "%s.%ld", lpF->prefix, i); else sprintf(fName, "%s.L", lpF->prefix); --- 439,443 ---- for (i=0; i<=lpF->numFiles; i++) { if (i < lpF->numFiles) ! sprintf(fName, "%s.%" PRId32, lpF->prefix, i); else sprintf(fName, "%s.L", lpF->prefix); *************** *** 453,457 **** maxSize += 1000; /* For safety. */ if (!(T1 = (afb_elt_t *)malloc(maxSize*sizeof(afb_elt_t)))) { ! fprintf(stderr, "setupPrimes() Error allocating %ld bytes for T1!\n", maxSize*sizeof(afb_elt_t)); exit(-1); --- 453,457 ---- maxSize += 1000; /* For safety. */ if (!(T1 = (afb_elt_t *)malloc(maxSize*sizeof(afb_elt_t)))) { ! fprintf(stderr, "setupPrimes() Error allocating %lu bytes for T1!\n", maxSize*sizeof(afb_elt_t)); exit(-1); *************** *** 462,466 **** for (i=0; i<=lpF->numFiles; i++) { if (i < lpF->numFiles) ! sprintf(fName, "%s.%ld", lpF->prefix, i); else sprintf(fName, "%s.L", lpF->prefix); --- 462,466 ---- for (i=0; i<=lpF->numFiles; i++) { if (i < lpF->numFiles) ! sprintf(fName, "%s.%" PRId32, lpF->prefix, i); else sprintf(fName, "%s.L", lpF->prefix); *************** *** 491,495 **** } if (t1Size >= maxSize) { ! fprintf(stderr, "setupPrimes() severe error! maxSize=%ld exceeded!\n", maxSize); exit(-1); --- 491,495 ---- } if (t1Size >= maxSize) { ! fprintf(stderr, "setupPrimes() severe error! maxSize=%" PRId32 " exceeded!\n", maxSize); exit(-1); *************** *** 498,502 **** qsort(T1, t1Size, sizeof(afb_elt_t), afb_elt_cmp); ! printf("Found %ld large primes total.\n", t1Size); /* Finally, the large primes we needed are in T1 and */ /* there are t1Size of them. */ --- 498,502 ---- qsort(T1, t1Size, sizeof(afb_elt_t), afb_elt_cmp); ! printf("Found %" PRId32 " large primes total.\n", t1Size); /* Finally, the large primes we needed are in T1 and */ /* there are t1Size of them. */ *************** *** 624,638 **** nr = NR_MULTIPLIER*depSize*M->N->FB->maxLP; if (!(ratHashList = (rat_p_t *)malloc(2*nr*sizeof(rat_p_t)))) { ! fprintf(stderr, "ratSqrt() Error allocating %ld bytes for ratHashList!\n", ! nr*sizeof(rat_p_t)); exit(-1); } if (!(ratLeftoverList = (rat_p_t *)malloc((nr/2)*sizeof(rat_p_t)))) { ! fprintf(stderr, "ratSqrt() Error allocating %ld bytes for ratLeftoverList!\n", ! nr*sizeof(rat_p_t)); free(ratHashList); exit(-1); } if (!(RFB_exps = (s32 *)malloc(M->N->FB->rfb_size*sizeof(s32)))) { ! fprintf(stderr, "ratSqrt() Error allocating %ld bytes for RFB_exps!\n", M->N->FB->rfb_size*sizeof(s32)); free(ratHashList); free(ratLeftoverList); exit(-1); --- 624,638 ---- nr = NR_MULTIPLIER*depSize*M->N->FB->maxLP; if (!(ratHashList = (rat_p_t *)malloc(2*nr*sizeof(rat_p_t)))) { ! fprintf(stderr, "ratSqrt() Error allocating %lu bytes for ratHashList!\n", ! 2*nr*sizeof(rat_p_t)); exit(-1); } if (!(ratLeftoverList = (rat_p_t *)malloc((nr/2)*sizeof(rat_p_t)))) { ! fprintf(stderr, "ratSqrt() Error allocating %lu bytes for ratLeftoverList!\n", ! (nr/2)*sizeof(rat_p_t)); free(ratHashList); exit(-1); } if (!(RFB_exps = (s32 *)malloc(M->N->FB->rfb_size*sizeof(s32)))) { ! fprintf(stderr, "ratSqrt() Error allocating %lu bytes for RFB_exps!\n", M->N->FB->rfb_size*sizeof(s32)); free(ratHashList); free(ratLeftoverList); exit(-1); *************** *** 701,705 **** for (i=0; i<M->FB->rfb_size; i++) { if (RFB_exps[i]%2) { ! fprintf(stderr, "Error: RFB[%ld] has odd exponent %ld!\n", i, RFB_exps[i]); exit(-1); --- 701,705 ---- for (i=0; i<M->FB->rfb_size; i++) { if (RFB_exps[i]%2) { ! fprintf(stderr, "Error: RFB[%" PRId32 "] has odd exponent %" PRId32 "!\n", i, RFB_exps[i]); exit(-1); *************** *** 715,719 **** mpz_powm_ui(tmp, tmp, -e, M->FB->n); else { ! printf("Error: Inverse of %ld does not exist mod n!", M->FB->rfb[2*i]); printf("If this is an intentionally placed factor, re-run with -knowndiv.\n"); exit(-1); --- 715,719 ---- mpz_powm_ui(tmp, tmp, -e, M->FB->n); else { ! printf("Error: Inverse of %" PRId32 " does not exist mod n!", M->FB->rfb[2*i]); printf("If this is an intentionally placed factor, re-run with -knowndiv.\n"); exit(-1); *************** *** 729,736 **** e = ratHashList[i].e/2; if (ratHashList[i].e%2) { ! fprintf(stderr, "Error: Rational prime %ld has odd exponent %ld!\n", ! ratHashList[i].p, ratHashList[i].e); ! msgLog(NULL, "Error: Rational prime %ld has odd exponent %ld!\n", ! ratHashList[i].p, ratHashList[i].e); res=-1; goto RSQRT_CLEANUP; } --- 729,736 ---- e = ratHashList[i].e/2; if (ratHashList[i].e%2) { ! fprintf(stderr, "Error: Rational prime %" PRId32 " has odd exponent %" PRId32 "!\n", ! ratHashList[i].p, ratHashList[i].e); ! msgLog(NULL, "Error: Rational prime %" PRId32 " has odd exponent %" PRId32 "!\n", ! ratHashList[i].p, ratHashList[i].e); res=-1; goto RSQRT_CLEANUP; } *************** *** 750,756 **** e = ratLeftoverList[i].e/2; if (ratLeftoverList[i].e%2) { ! fprintf(stderr, "Error: Rational prime %ld (leftover) has odd exponent %ld!\n", ratLeftoverList[i].p, ratLeftoverList[i].e); ! msgLog(NULL, "Error: Rational prime %ld (leftover) has odd exponent %ld!\n", ratLeftoverList[i].p, ratLeftoverList[i].e); res=-1; goto RSQRT_CLEANUP; --- 750,756 ---- e = ratLeftoverList[i].e/2; if (ratLeftoverList[i].e%2) { ! fprintf(stderr, "Error: Rational prime %" PRId32 " (leftover) has odd exponent %" PRId32 "!\n", ratLeftoverList[i].p, ratLeftoverList[i].e); ! msgLog(NULL, "Error: Rational prime %" PRId32 " (leftover) has odd exponent %" PRId32 "!\n", ratLeftoverList[i].p, ratLeftoverList[i].e); res=-1; goto RSQRT_CLEANUP; *************** *** 881,885 **** printf("The zeros of f have been computed as:\n"); for (i=0; i<d; i++) ! printf("z%ld = %1.15lf + I*%1.15lf\n",i,M->N->fZeros[i].r, M->N->fZeros[i].i); /* Some precomputation to save work later. */ --- 881,885 ---- printf("The zeros of f have been computed as:\n"); for (i=0; i<d; i++) ! printf("z%" PRId32 " = %1.15lf + I*%1.15lf\n",i,M->N->fZeros[i].r, M->N->fZeros[i].i); /* Some precomputation to save work later. */ *************** *** 928,932 **** printf("Reading relations and computing initial <gamma> factorization...\n"); ! printf("depSize = %ld.\n", depSize); /* Prime the loop by opening the first relation file. */ sprintf(fName, "%s.0", prelF->prefix); --- 928,932 ---- printf("Reading relations and computing initial <gamma> factorization...\n"); ! printf("depSize = %" PRId32 ".\n", depSize); /* Prime the loop by opening the first relation file. */ sprintf(fName, "%s.0", prelF->prefix); *************** *** 985,992 **** s32 pFacts[128]; int numpFacts; ! printf("Factorization of relation %ld is wrong:\n", i); ! printf("a=%ld, b=%ld\n", (s32)a, (s32)-b); printf("a-bm = "); mpz_out_str(stdout, 10, tmp); printf("\n"); ! printf("Stored large primes are: %ld %ld.\n", (u32)R.p[0], (u32)R.p[1]); printf("Product of factors gives:\n "); mpz_out_str(stdout, 10, tmp2); printf("\n"); --- 985,992 ---- s32 pFacts[128]; int numpFacts; ! printf("Factorization of relation %" PRId32 " is wrong:\n", i); ! printf("a=%" PRId64 ", b=%" PRId64 "\n", a, -b); printf("a-bm = "); mpz_out_str(stdout, 10, tmp); printf("\n"); ! printf("Stored large primes are: %" PRIu32 " %" PRIu32 ".\n", (u32)R.p[0], (u32)R.p[1]); printf("Product of factors gives:\n "); mpz_out_str(stdout, 10, tmp2); printf("\n"); *************** *** 994,998 **** printf("factor() returned %d and :\n", numpFacts); for (j=0; j<numpFacts; j++) ! printf("%ld ", pFacts[j]); printf("\n"); exit(-1); --- 994,998 ---- printf("factor() returned %d and :\n", numpFacts); for (j=0; j<numpFacts; j++) ! printf("%" PRId32 " ", pFacts[j]); printf("\n"); exit(-1); *************** *** 1050,1054 **** printf("The final square should be: "); mpz_out_str(stdout, 10, Zsquare); ! printf("\nWe used %ld (a,b) pairs.\n", numPairs); if (Rindex < R1) fclose(fp); i=M->aSize-1; --- 1050,1054 ---- printf("The final square should be: "); mpz_out_str(stdout, 10, Zsquare); ! printf("\nWe used %" PRId32 " (a,b) pairs.\n", numPairs); if (Rindex < R1) fclose(fp); i=M->aSize-1; *************** *** 1059,1063 **** for (i=0; i<=M->aExpLast; i++) { if (M->aExp[i]%2) { ! fprintf(stderr, "Error: Odd exponent found: AFB[%ld] has exponent %ld!\n", i, M->aExp[i]); exit(-1); --- 1059,1063 ---- for (i=0; i<=M->aExpLast; i++) { if (M->aExp[i]%2) { ! fprintf(stderr, "Error: Odd exponent found: AFB[%" PRId32 "] has exponent %" PRId32 "!\n", i, M->aExp[i]); exit(-1); *************** *** 1066,1070 **** for (i=0; i<M->spSize; i++) { if (M->spExp[i]%2) { ! fprintf(stderr, "Error: Odd exponent found: Sp[%ld] has exponent %ld!\n", i, M->spExp[i]); exit(-1); --- 1066,1070 ---- for (i=0; i<M->spSize; i++) { if (M->spExp[i]%2) { ! fprintf(stderr, "Error: Odd exponent found: Sp[%" PRId32 "] has exponent %" PRId32 "!\n", i, M->spExp[i]); exit(-1); *************** *** 1119,1126 **** i=0; j=0; ! printf("There are %ld exceptional prime ideals:\n", M->spSize); for (i=0; i<M->spSize; i++) { if (M->spExp[i] ) ! printf("[Sp. %ld]^%ld * ", i, M->spExp[i]); } printf("\n"); --- 1119,1126 ---- i=0; j=0; ! printf("There are %" PRId32 " exceptional prime ideals:\n", M->spSize); for (i=0; i<M->spSize; i++) { if (M->spExp[i] ) ! printf("[Sp. %" PRId32 "]^%" PRId32 " * ", i, M->spExp[i]); } printf("\n"); *************** *** 1473,1477 **** pLoc = findLP(p, r, M); if ((M->AFB[pLoc].p != p)||(M->AFB[pLoc].r != r)) { ! fprintf(stderr, "Error: Couldn't find (%ld, %ld) in the primes list!\n", p, r); exit(-1); } --- 1473,1477 ---- pLoc = findLP(p, r, M); if ((M->AFB[pLoc].p != p)||(M->AFB[pLoc].r != r)) { ! fprintf(stderr, "Error: Couldn't find (%" PRId32 ", %" PRId32 ") in the primes list!\n", p, r); exit(-1); } *************** *** 1516,1520 **** pLoc = findLP(p, r, M); if ((M->AFB[pLoc].p != p)||(M->AFB[pLoc].r != r)) { ! fprintf(stderr, "Error: Couldn't find (%ld, %ld) in the primes list!\n", p, r); exit(-1); } --- 1516,1520 ---- pLoc = findLP(p, r, M); if ((M->AFB[pLoc].p... [truncated message content] |
From: Sam C. <tri...@us...> - 2005-07-17 10:02:00
|
Update of /cvsroot/ggnfs/branch_0/src/pol5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28641/src/pol5 Modified Files: defs.h pol51m0b.c pol51m0n.c zeit.c Log Message: * Converted sources to use standard C9x int types defined in inttypes.h. Corrected a number of format specifiers for printf/scanf. Changed a couple variable types here and there to correct possible problems. This provides a good way to print 64-bit ints with either standard GNU C libraries or the MSVCRT printf under Windows. Any future code should print s32s as PRId32, u64s as PRIu64, and so on. The corresponding scanf format specifiers are SCNd32/SCNx32 and SCNu64. Variables declared without bitlengths should still use non-macro formats (%d for int, %ld for long). At the moment, size_t is printed as %lu, unless someone has a better suggestion as to what it should be. Index: defs.h =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/pol5/defs.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** defs.h 8 Jun 2005 19:47:08 -0000 1.1.1.1 --- defs.h 17 Jul 2005 10:01:46 -0000 1.2 *************** *** 6,8 **** --- 6,11 ---- #define ushort unsigned short #define ull unsigned long long + + #define __STDC_FORMAT_MACROS + #include <inttypes.h> #endif Index: pol51m0n.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/pol5/pol51m0n.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pol51m0n.c 6 Jul 2005 01:39:58 -0000 1.2 --- pol51m0n.c 17 Jul 2005 10:01:47 -0000 1.3 *************** *** 1133,1137 **** if (hh-h>3) complain("hash4.0\n"); } else { ! if (h-hh>3) complain("%u %u %u %u %llu hash4.1\n",h,hh,h1,raw_bound,raw_ull_bound); } hh=(uint)(sum2>>32); --- 1133,1137 ---- if (hh-h>3) complain("hash4.0\n"); } else { ! if (h-hh>3) complain("%u %u %u %u %" PRIu64 " hash4.1\n",h,hh,h1,raw_bound,raw_ull_bound); } hh=(uint)(sum2>>32); *************** *** 1323,1327 **** if (hh-h>3) complain("hash4.0\n"); } else { ! if (h-hh>3) complain("%u %u %u %u %llu hash4.1\n",h,hh,h1,raw_bound,raw_ull_bound); } hh=(uint)(sum2>>32); --- 1323,1327 ---- if (hh-h>3) complain("hash4.0\n"); } else { ! if (h-hh>3) complain("%u %u %u %u %" PRIu64 " hash4.1\n",h,hh,h1,raw_bound,raw_ull_bound); } hh=(uint)(sum2>>32); *************** *** 1746,1750 **** raw_ull_bound=(ull)db; raw_ull_bound+=(ull)((npr_in_p+2)*npr_in_p*p_pr[p_ind[npr_in_p-1]]); ! if (verbose>3) printf("raw_ull_bound: %llu\n",raw_ull_bound); raw_bound=(uint)(raw_ull_bound>>31)+1+4; #ifdef ZEIT --- 1746,1750 ---- raw_ull_bound=(ull)db; raw_ull_bound+=(ull)((npr_in_p+2)*npr_in_p*p_pr[p_ind[npr_in_p-1]]); ! if (verbose>3) printf("raw_ull_bound: %" PRIu64 "\n",raw_ull_bound); raw_bound=(uint)(raw_ull_bound>>31)+1+4; #ifdef ZEIT *************** *** 2054,2058 **** raw_ull_bound=(ull)db; raw_ull_bound+=(ull)((npr_in_p+2)*npr_in_p*p_pr[p_ind[npr_in_p-1]]); ! if (verbose>3) printf("raw_ull_bound: %llu\n",raw_ull_bound); raw_bound=(uint)(raw_ull_bound>>31)+1+4; #ifdef ZEIT --- 2054,2058 ---- raw_ull_bound=(ull)db; raw_ull_bound+=(ull)((npr_in_p+2)*npr_in_p*p_pr[p_ind[npr_in_p-1]]); ! if (verbose>3) printf("raw_ull_bound: %" PRIu64 "\n",raw_ull_bound); raw_bound=(uint)(raw_ull_bound>>31)+1+4; #ifdef ZEIT *************** *** 2394,2398 **** db*=18446744073709551616.; ull_bound=(ull)db; ! if (verbose>3) printf("ull_bound: %llu\n",ull_bound); /* bound=ull_bound+1;*/ --- 2394,2398 ---- db*=18446744073709551616.; ull_bound=(ull)db; ! if (verbose>3) printf("ull_bound: %" PRIu64 "\n",ull_bound); /* bound=ull_bound+1;*/ *************** *** 2611,2615 **** db*=18446744073709551616.; ull_bound=(ull)db; ! if (verbose>3) printf("ull_bound: %llu\n",ull_bound); /* bound=ull_bound+1;*/ --- 2611,2615 ---- db*=18446744073709551616.; ull_bound=(ull)db; ! if (verbose>3) printf("ull_bound: %" PRIu64 "\n",ull_bound); /* bound=ull_bound+1;*/ *************** *** 2656,2662 **** #if 1 if (sum1>sum2) ! printf("%llu %llu! ",sum1-sum2,ull_bound); else ! printf("%llu %llu! ",sum2-sum1,ull_bound); #else printf("!"); --- 2656,2662 ---- #if 1 if (sum1>sum2) ! printf("%" PRIu64 " %" PRIu64 "! ",sum1-sum2,ull_bound); else ! printf("%" PRIu64 " %" PRIu64 "! ",sum2-sum1,ull_bound); #else printf("!"); *************** *** 3475,3482 **** if (verbose) { printf("Statistics:\n"); ! printf("a5-values: %llu, suitable for %d primes: %llu\n",stat_n_a5,npr_in_p,stat_n_pr); ! printf("raw checks of (a5,p): %llu (%llu), fine checks of (a5,p): %llu\n",stat_n_p,stat_n_p_p0,stat_n_raw); ! printf("polynomials computed: %llu, survivors: %llu\n",stat_n_polexpand,stat_n_survivors); ! printf("Total number of checked polynomials: %llu\n",(ull)(five_pow(npr_in_p))*stat_n_p); } if (success) printf("success\n"); --- 3475,3482 ---- if (verbose) { printf("Statistics:\n"); ! printf("a5-values: %" PRIu64 ", suitable for %d primes: %" PRIu64 "\n",stat_n_a5,npr_in_p,stat_n_pr); ! printf("raw checks of (a5,p): %" PRIu64 " (%" PRIu64 "), fine checks of (a5,p): %" PRIu64 "\n",stat_n_p,stat_n_p_p0,stat_n_raw); ! printf("polynomials computed: %" PRIu64 ", survivors: %" PRIu64 "\n",stat_n_polexpand,stat_n_survivors); ! printf("Total number of checked polynomials: %" PRIu64 "\n",(ull)(five_pow(npr_in_p))*stat_n_p); } if (success) printf("success\n"); Index: zeit.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/pol5/zeit.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** zeit.c 8 Jun 2005 19:47:09 -0000 1.1.1.1 --- zeit.c 17 Jul 2005 10:01:47 -0000 1.2 *************** *** 148,157 **** void printzeit(int i) { ! printf("%.2fs (%llu) ",zeitsum[i]/CLOCKS_PER_SEC,asmzeitcounter[i]); } void printzeit2(int i1, int i2) { ! printf("%.2fs (%llu) ",(zeitsum[i1]+zeitsum[i2])/CLOCKS_PER_SEC,asmzeitcounter[i1]+asmzeitcounter[i2]); } --- 148,157 ---- void printzeit(int i) { ! printf("%.2fs (%" PRIu64 ") ",zeitsum[i]/CLOCKS_PER_SEC,asmzeitcounter[i]); } void printzeit2(int i1, int i2) { ! printf("%.2fs (%" PRIu64 ") ",(zeitsum[i1]+zeitsum[i2])/CLOCKS_PER_SEC,asmzeitcounter[i1]+asmzeitcounter[i2]); } *************** *** 166,170 **** printf("\nCycles: "); for (i=0; i<zeitcounteranz; i++) ! printf("%d: %llu ",i,asmzeitcounter[i]); printf("\n"); } --- 166,170 ---- printf("\nCycles: "); for (i=0; i<zeitcounteranz; i++) ! printf("%d: %" PRIu64 " ",i,asmzeitcounter[i]); printf("\n"); } Index: pol51m0b.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/pol5/pol51m0b.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pol51m0b.c 4 Jul 2005 01:27:37 -0000 1.2 --- pol51m0b.c 17 Jul 2005 10:01:46 -0000 1.3 *************** *** 912,916 **** if (hh-h>3) complain("hash4.0\n"); } else { ! if (h-hh>3) complain("%u %u %u %u %llu hash4.1\n",h,hh,h1,raw_bound,raw_ull_bound); } hh=(uint)(sum2>>32); --- 912,916 ---- if (hh-h>3) complain("hash4.0\n"); } else { ! if (h-hh>3) complain("%u %u %u %u %" PRIu64 " hash4.1\n",h,hh,h1,raw_bound,raw_ull_bound); } hh=(uint)(sum2>>32); *************** *** 1334,1338 **** raw_ull_bound=(ull)db; raw_ull_bound+=(ull)((npr_in_p+2)*npr_in_p*p_pr[p_ind[npr_in_p-1]]); ! if (verbose>3) printf("raw_ull_bound: %llu\n",raw_ull_bound); raw_bound=(uint)(raw_ull_bound>>31)+1+4; #ifdef ZEIT --- 1334,1338 ---- raw_ull_bound=(ull)db; raw_ull_bound+=(ull)((npr_in_p+2)*npr_in_p*p_pr[p_ind[npr_in_p-1]]); ! if (verbose>3) printf("raw_ull_bound: %" PRIu64 "\n",raw_ull_bound); raw_bound=(uint)(raw_ull_bound>>31)+1+4; #ifdef ZEIT *************** *** 1642,1646 **** raw_ull_bound=(ull)db; raw_ull_bound+=(ull)((npr_in_p+2)*npr_in_p*p_pr[p_ind[npr_in_p-1]]); ! if (verbose>3) printf("raw_ull_bound: %llu\n",raw_ull_bound); raw_bound=(uint)(raw_ull_bound>>31)+1+4; #ifdef ZEIT --- 1642,1646 ---- raw_ull_bound=(ull)db; raw_ull_bound+=(ull)((npr_in_p+2)*npr_in_p*p_pr[p_ind[npr_in_p-1]]); ! if (verbose>3) printf("raw_ull_bound: %" PRIu64 "\n",raw_ull_bound); raw_bound=(uint)(raw_ull_bound>>31)+1+4; #ifdef ZEIT *************** *** 1961,1965 **** db*=18446744073709551616.; ull_bound=(ull)db; ! if (verbose>3) printf("ull_bound: %llu\n",ull_bound); /* bound=ull_bound+1;*/ --- 1961,1965 ---- db*=18446744073709551616.; ull_bound=(ull)db; ! if (verbose>3) printf("ull_bound: %" PRIu64 "\n",ull_bound); /* bound=ull_bound+1;*/ *************** *** 2178,2182 **** db*=18446744073709551616.; ull_bound=(ull)db; ! if (verbose>3) printf("ull_bound: %llu\n",ull_bound); /* bound=ull_bound+1;*/ --- 2178,2182 ---- db*=18446744073709551616.; ull_bound=(ull)db; ! if (verbose>3) printf("ull_bound: %" PRIu64 "\n",ull_bound); /* bound=ull_bound+1;*/ *************** *** 2223,2229 **** #if 1 if (sum1>sum2) ! printf("%llu %llu! ",sum1-sum2,ull_bound); else ! printf("%llu %llu! ",sum2-sum1,ull_bound); #else printf("!"); --- 2223,2229 ---- #if 1 if (sum1>sum2) ! printf("%" PRIu64 " %" PRIu64 "! ",sum1-sum2,ull_bound); else ! printf("%" PRIu64 " %" PRIu64 "! ",sum2-sum1,ull_bound); #else printf("!"); *************** *** 3020,3027 **** if (verbose) { printf("Statistics:\n"); ! printf("a5-values: %llu, suitable for %d primes: %llu\n",stat_n_a5,npr_in_p,stat_n_pr); ! printf("raw checks of (a5,p): %llu (%llu), fine checks of (a5,p): %Lu\n",stat_n_p,stat_n_p_p0,stat_n_raw); ! printf("polynomials computed: %llu, survivors: %llu\n",stat_n_polexpand,stat_n_survivors); ! printf("Total number of checked polynomials: %llu\n",(ull)(five_pow(npr_in_p))*stat_n_p); } if (success) printf("success\n"); --- 3020,3027 ---- if (verbose) { printf("Statistics:\n"); ! printf("a5-values: %" PRIu64 ", suitable for %d primes: %" PRIu64 "\n",stat_n_a5,npr_in_p,stat_n_pr); ! printf("raw checks of (a5,p): %" PRIu64 " (%" PRIu64 "), fine checks of (a5,p): %" PRIu64 "\n",stat_n_p,stat_n_p_p0,stat_n_raw); ! printf("polynomials computed: %" PRIu64 ", survivors: %" PRIu64 "\n",stat_n_polexpand,stat_n_survivors); ! printf("Total number of checked polynomials: %" PRIu64 "\n",(ull)(five_pow(npr_in_p))*stat_n_p); } if (success) printf("success\n"); |
From: Sam C. <tri...@us...> - 2005-07-17 04:35:32
|
Update of /cvsroot/ggnfs/branch_0/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15109 Modified Files: blanczos64.c matstuff.c matsolve.c Log Message: * Added check that the aligned memory macros really return aligned memory. Ensure higher level matsolve routines actually check for error codes from lower routines. Index: matsolve.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/matsolve.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** matsolve.c 6 Jul 2005 06:24:29 -0000 1.3 --- matsolve.c 17 Jul 2005 04:35:21 -0000 1.4 *************** *** 1,4 **** /**************************************************************/ ! /* matolve.c */ /* Copyright 2004, Chris Monico. */ /**************************************************************/ --- 1,4 ---- /**************************************************************/ ! /* matsolve.c */ /* Copyright 2004, Chris Monico. */ /**************************************************************/ *************** *** 413,441 **** free(M.cEntry); free(M.cIndex); return -1; } - getDependencies(&M, &C, deps); ! ! if (!(ifp = fopen("depinf", "rb"))) { ! fprintf(stderr, "Error opening depinf for read!\n"); ! exit(-1); ! } ! printf("Writing dependencies to file %s.\n", depName); ! if (!(fp = fopen(depName, "wb"))) { ! fprintf(stderr, "Error opening %s for write!\n", depName); ! } else { ! /* Get the header information from depinf. */ ! readBinField(str, 1024, ifp); ! while (!(feof(ifp)) && strncmp(str, "END_HEADER",10)) { ! writeBinField(fp, str); ! readBinField(str,1024,ifp); } ! if (strncmp(str, "END_HEADER",10)) { ! fprintf(stderr, "Error: depinf is corrupt!\n"); ! fclose(ifp); fclose(fp); exit(-1); } - writeBinField(fp, str); - fclose(ifp); - fwrite(deps, sizeof(s32), origC, fp); - fclose(fp); } --- 413,442 ---- free(M.cEntry); free(M.cIndex); return -1; } ! if (getDependencies(&M, &C, deps) == 0) { ! if (!(ifp = fopen("depinf", "rb"))) { ! fprintf(stderr, "Error opening depinf for read!\n"); ! exit(-1); } ! printf("Writing dependencies to file %s.\n", depName); ! if (!(fp = fopen(depName, "wb"))) { ! fprintf(stderr, "Error opening %s for write!\n", depName); ! fclose(ifp); ! } else { ! /* Get the header information from depinf. */ ! readBinField(str, 1024, ifp); ! while (!(feof(ifp)) && strncmp(str, "END_HEADER",10)) { ! writeBinField(fp, str); ! readBinField(str,1024,ifp); ! } ! if (strncmp(str, "END_HEADER",10)) { ! fprintf(stderr, "Error: depinf is corrupt!\n"); ! fclose(ifp); fclose(fp); exit(-1); ! } ! writeBinField(fp, str); ! fclose(ifp); ! fwrite(deps, sizeof(s32), origC, fp); ! fclose(fp); } } Index: blanczos64.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/blanczos64.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** blanczos64.c 8 Jun 2005 19:47:01 -0000 1.1.1.1 --- blanczos64.c 17 Jul 2005 04:35:20 -0000 1.2 *************** *** 57,64 **** #if defined( USE_MMX_GCC ) #if defined(__MINGW32__) || defined(MINGW32) ! #define malloc_aligned64(p,a,n) (!((p) = (u64*)__mingw_aligned_malloc((n)*sizeof(u64),(a)))) #define free_aligned64(x) __mingw_aligned_free(x) #else ! #define malloc_aligned64(p,a,n) (!((p) = (u64*)memalign((a),(n)*sizeof(u64)))) #define free_aligned64(x) free(x) #endif --- 57,64 ---- #if defined( USE_MMX_GCC ) #if defined(__MINGW32__) || defined(MINGW32) ! #define malloc_aligned64(p,a,n) (!((p) = (u64*)__mingw_aligned_malloc((n)*sizeof(u64),(a))) || ((uintptr_t)(p)%(a))) #define free_aligned64(x) __mingw_aligned_free(x) #else ! #define malloc_aligned64(p,a,n) (!((p) = (u64*)memalign((a),(n)*sizeof(u64))) || ((uintptr_t)(p)%(a))) #define free_aligned64(x) free(x) #endif *************** *** 71,75 **** : : "r"(_a), "r"(_b) : "memory" ); } #elif defined( USE_MMX_MSC ) ! #define malloc_aligned64(p,a,n) (!(p = (u64*)_aligned_malloc((n) * sizeof(u64), (a)))) #define free_aligned64(x) _aligned_free(x) #define XEMMS __asm emms --- 71,75 ---- : : "r"(_a), "r"(_b) : "memory" ); } #elif defined( USE_MMX_MSC ) ! #define malloc_aligned64(p,a,n) (!((p) = (u64*)_aligned_malloc((n) * sizeof(u64), (a))) || ((uintptr_t)(p)%(a))) #define free_aligned64(x) _aligned_free(x) #define XEMMS __asm emms *************** *** 81,85 **** __asm movq [eax],mm0 } #else ! #define malloc_aligned64(p,a,n) (!(p = (u64*)malloc((n) * sizeof(u64)))) #define free_aligned64(x) free(x) #define XEMMS --- 81,85 ---- __asm movq [eax],mm0 } #else ! #define malloc_aligned64(p,a,n) (!((p) = (u64*)malloc((n) * sizeof(u64))) || ((uintptr_t)(p)%(a))) #define free_aligned64(x) free(x) #define XEMMS *************** *** 551,556 **** if (malloc_aligned64(tmp2_n, 16, n)) errs++; if (malloc_aligned64(tmp3_n, 16, n)) errs++; ! if (errs) goto SHORT_CIRC_STOP; /******************************************************************/ --- 551,558 ---- if (malloc_aligned64(tmp2_n, 16, n)) errs++; if (malloc_aligned64(tmp3_n, 16, n)) errs++; ! if (errs) { ! fprintf(stderr, "blanczos(): Memory allocation error!\n"); goto SHORT_CIRC_STOP; + } /******************************************************************/ Index: matstuff.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/matstuff.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** matstuff.c 8 Jun 2005 19:47:03 -0000 1.1.1.1 --- matstuff.c 17 Jul 2005 04:35:21 -0000 1.2 *************** *** 1091,1094 **** --- 1091,1095 ---- printf("Returned %d. Block Lanczos took %1.2lf seconds.\n", res, blstop-blstart); msgLog("", "BLanczosTime: %1.1lf", blstop-blstart); + if (res < 0) return res; /******************************************************/ |
From: Sam C. <tri...@us...> - 2005-07-15 03:19:09
|
Update of /cvsroot/ggnfs/branch_0/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19042/tests Modified Files: factLat.pl Log Message: * Patched factLat.pl so it automatically applies more generous parameters for SNFS factorizations where the polynomial degree is not optimal. The knob to twirl to adjust the functional difference in digit levels is $nonPrefDegAdjust. I'm not sure if it can be tweaked arbitrarily; the logic around getting degree crossovers right was a bit tricky. * The factLat.pl script will now start with a little classical sieving by default. Maybe we'll get more people using it now. :) * Reorganized mpz_fact_factorEasy() so the control flow makes more sense and doesn't repeat operations like trial division unnecessarily. The repeated stuff like power checks and ECM are now in a separate function mpz_fact_factorRealWork_rec(), which is recursive. Index: factLat.pl =================================================================== RCS file: /cvsroot/ggnfs/branch_0/tests/factLat.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** factLat.pl 6 Jul 2005 01:39:59 -0000 1.5 --- factLat.pl 15 Jul 2005 03:18:30 -0000 1.6 *************** *** 38,42 **** $CLEANUP=0; $PROMPTS=0; ! $DOCLASSICAL=0; $CHECK_BINARIES=1; $ECHO_CMDLINE=1; --- 38,42 ---- $CLEANUP=0; $PROMPTS=0; ! $DOCLASSICAL=1; $CHECK_BINARIES=1; $ECHO_CMDLINE=1; *************** *** 347,350 **** --- 347,351 ---- } + my $nonPrefDegAdjust = 12; ###################################################### sub loadDefaultParams { *************** *** 359,370 **** # arg0 = number of digits in N. # arg1 = type die("loadDefaultParams(): Insufficient arguments!\n") ! unless ($#_ >=1); ! my $DIGS=$_[0]; ! my $type=$_[1]; die("Could not find default parameter file $DEFAULT_PAR_FILE!\n") unless (-e $DEFAULT_PAR_FILE); open(IF, $DEFAULT_PAR_FILE); my $howClose=1000; while (<IF>) { --- 360,378 ---- # arg0 = number of digits in N. # arg1 = type + # + # The parameter actual_degree, if nonzero, will let this function adjust + # parameters for SNFS factorizations with a predetermined polynomial + # of degree that is not the optimal degree. die("loadDefaultParams(): Insufficient arguments!\n") ! unless ($#_ >= 2); ! my $realDIGS=$_[0]; ! my $realDEG=$_[1]; ! my $type=$_[2]; die("Could not find default parameter file $DEFAULT_PAR_FILE!\n") unless (-e $DEFAULT_PAR_FILE); open(IF, $DEFAULT_PAR_FILE); + my $paramDIGS=0; + my $paramDEG=0; my $howClose=1000; while (<IF>) { *************** *** 375,387 **** my $t=$_[0]; if ($t eq $type) { ! my $d=$_[1]; ! if (abs($d-$DIGS)<$howClose) { ! $o=2; ! $howClose=abs($d-$DIGS); ! $digLevel=$d; ! $DEG=$_[$o+0]; $MAXS1=$_[$o+1]; ! $MAXSKEW=$_[$o+2]; ! $GOODSCORE=$_[$o+3]; $EFRAC=$_[$o+4]; $J0=$_[$o+5]; $J1=$_[$o+6]; --- 383,402 ---- my $t=$_[0]; if ($t eq $type) { ! my $o=2; ! my $candDIGS=$_[1]; ! my $candDEG=$_[$o+0]; ! # try to properly handle crossover from degree 4 to degree 5 ! if ( ($type eq "gnfs" or ! $realDEG or $realDEG == $candDEG or $paramDEG == $candDEG-1) ! ? abs($candDIGS-$realDIGS)<$howClose ! : (abs($candDIGS-$nonPrefDegAdjust-$realDIGS)+$nonPrefDegAdjust)<$howClose ) ! { ! $howClose=($type ne "gnfs" and $realDEG and $candDEG != $realDEG) ! ? abs($candDIGS-$nonPrefDegAdjust-$realDIGS)+$nonPrefDegAdjust ! : abs($candDIGS-$realDIGS); ! $paramDIGS=$candDIGS; ! $paramDEG=$_[$o+0]; $MAXS1=$_[$o+1]; ! $MAXSKEW=$_[$o+2]; ! $GOODSCORE=$_[$o+3]; $EFRAC=$_[$o+4]; $J0=$_[$o+5]; $J1=$_[$o+6]; *************** *** 401,412 **** } close(IF); ! printf "-> Selected default factorization parameters for $digLevel digit level.\n"; if ($type eq "gnfs") { ! if ($DIGS < 110) { $LATSIEVER=$LATSIEVER_L1; } ! elsif ($DIGS < 135) { $LATSIEVER=$LATSIEVER_L2; } else { $LATSIEVER=$LATSIEVER_L3; } } else { ! if ($DIGS < 150) { $LATSIEVER=$LATSIEVER_L1; } ! elsif ($DIGS < 180) { $LATSIEVER=$LATSIEVER_L2; } else { $LATSIEVER=$LATSIEVER_L3; } } --- 416,429 ---- } close(IF); ! $DEG = $paramDEG; ! printf "-> Selected default factorization parameters for $paramDIGS digit level.\n"; if ($type eq "gnfs") { ! if ($realDIGS < 110) { $LATSIEVER=$LATSIEVER_L1; } ! elsif ($realDIGS < 135) { $LATSIEVER=$LATSIEVER_L2; } else { $LATSIEVER=$LATSIEVER_L3; } } else { ! $realDIGS += $nonPrefDegAdjust if ($realDEG and ($paramDEG != $realDEG)); ! if ($realDIGS < 150) { $LATSIEVER=$LATSIEVER_L1; } ! elsif ($realDIGS < 180) { $LATSIEVER=$LATSIEVER_L2; } else { $LATSIEVER=$LATSIEVER_L3; } } *************** *** 414,417 **** --- 431,435 ---- } + ###################################################### sub loadPolselParamsPol5 { *************** *** 422,428 **** # arg0 = number of digits in N. ! die("loadDefaultParams(): Insufficient arguments!\n") unless ($#_ >=0); ! my $DIGS=$_[0]; die("Could not find default parameter file $DEFAULT_POLSEL_PAR_FILE!\n") unless (-e $DEFAULT_POLSEL_PAR_FILE); --- 440,447 ---- # arg0 = number of digits in N. ! die("loadPolselParamsPol5(): Insufficient arguments!\n") unless ($#_ >=0); ! my $realDIGS=$_[0]; ! my $paramDIGS=0; die("Could not find default parameter file $DEFAULT_POLSEL_PAR_FILE!\n") unless (-e $DEFAULT_POLSEL_PAR_FILE); *************** *** 435,442 **** @_ = split /,/; my $d=$_[0]; ! if (abs($d-$DIGS)<$howClose) { $o=1; ! $howClose=abs($d-$DIGS); ! $digLevel=$d; $maxPSTime=60*$_[$o+0]; $search_a5step=$_[$o+1]; --- 454,461 ---- @_ = split /,/; my $d=$_[0]; ! if (abs($d-$realDIGS)<$howClose) { $o=1; ! $howClose=abs($d-$realDIGS); ! $paramDIGS=$d; $maxPSTime=60*$_[$o+0]; $search_a5step=$_[$o+1]; *************** *** 450,454 **** } close(IF); ! printf "-> Selected default polsel parameters for $digLevel digit level.\n"; } --- 469,473 ---- } close(IF); ! printf "-> Selected default polsel parameters for $paramDIGS digit level.\n"; } *************** *** 475,479 **** $maxPSTime *= $polySelTimeMultiplier; my $hmult=1e3; ! loadDefaultParams(length($N), "gnfs"); my %bestpolyinf = (); $bestpolyinf{Murphy_E} = 0; --- 494,498 ---- $maxPSTime *= $polySelTimeMultiplier; my $hmult=1e3; ! loadDefaultParams(length($N), 5, "gnfs"); my %bestpolyinf = (); $bestpolyinf{Murphy_E} = 0; *************** *** 601,605 **** printf "-> Starting search with leading coefficient divisor $lcdChoices[$lcdLevel].\n"; ! loadDefaultParams(length($N), "gnfs"); $MAXTIME *= $polySelTimeMultiplier; my $E1=$E0+$ESTEPSIZE; --- 620,624 ---- printf "-> Starting search with leading coefficient divisor $lcdChoices[$lcdLevel].\n"; ! loadDefaultParams(length($N), 0, "gnfs"); $MAXTIME *= $polySelTimeMultiplier; my $E1=$E0+$ESTEPSIZE; *************** *** 1104,1113 **** printf "-> SNFS_DIFFICULTY is about $SNFS_DIFFICULTY.\n"; ! loadDefaultParams($SNFS_DIFFICULTY->bstr(), "snfs"); } elsif ($TYPE =~ /gnfs/) { my $logN = (new Math::BigFloat $N)->babs->blog(10); # print "-> Log N is about $logN.\n"; ! loadDefaultParams(length($N), $TYPE); } else { printf "-> Error: poly file should contain one of the following lines:\n"; --- 1123,1132 ---- printf "-> SNFS_DIFFICULTY is about $SNFS_DIFFICULTY.\n"; ! loadDefaultParams($SNFS_DIFFICULTY->bstr(), $DEGREE, $TYPE); } elsif ($TYPE =~ /gnfs/) { my $logN = (new Math::BigFloat $N)->babs->blog(10); # print "-> Log N is about $logN.\n"; ! loadDefaultParams(length($N), $DEGREE, $TYPE); } else { printf "-> Error: poly file should contain one of the following lines:\n"; *************** *** 1388,1391 **** --- 1407,1411 ---- # Do some classical sieving, if needed/applicable. # This is broken - it is still a work in progress! + $DOCLASSICAL = 0 if ($CLIENT_ID > 1); if ($DOCLASSICAL) { classicalSieve($classicalA, 1, $classicalB); |
From: Sam C. <tri...@us...> - 2005-07-15 03:18:39
|
Update of /cvsroot/ggnfs/branch_0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19042 Modified Files: Changelog Makefile Log Message: * Patched factLat.pl so it automatically applies more generous parameters for SNFS factorizations where the polynomial degree is not optimal. The knob to twirl to adjust the functional difference in digit levels is $nonPrefDegAdjust. I'm not sure if it can be tweaked arbitrarily; the logic around getting degree crossovers right was a bit tricky. * The factLat.pl script will now start with a little classical sieving by default. Maybe we'll get more people using it now. :) * Reorganized mpz_fact_factorEasy() so the control flow makes more sense and doesn't repeat operations like trial division unnecessarily. The repeated stuff like power checks and ECM are now in a separate function mpz_fact_factorRealWork_rec(), which is recursive. Index: Makefile =================================================================== RCS file: /cvsroot/ggnfs/branch_0/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile 7 Jul 2005 05:23:24 -0000 1.5 --- Makefile 15 Jul 2005 03:18:30 -0000 1.6 *************** *** 1,3 **** ! VERSION=0.77.1-050706 THISDIR=ggnfs HOME=. --- 1,3 ---- ! VERSION=0.77.1-050714 THISDIR=ggnfs HOME=. Index: Changelog =================================================================== RCS file: /cvsroot/ggnfs/branch_0/Changelog,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Changelog 12 Jul 2005 09:50:06 -0000 1.14 --- Changelog 15 Jul 2005 03:18:29 -0000 1.15 *************** *** 1,2 **** --- 1,8 ---- + 7/14/05 (trilliwig) + * Patched factLat.pl so it automatically applies more generous parameters + for SNFS factorizations where the polynomial degree is not optimal. + * Reorganized mpz_fact_factorEasy() so the control flow makes more sense + and doesn't repeat operations like trial division unnecessarily. + 7/12/05 (trilliwig) * Updated mpz_fact_factorEasy() to check for higher multiplicity of prime |
From: Sam C. <tri...@us...> - 2005-07-15 03:18:39
|
Update of /cvsroot/ggnfs/branch_0/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19042/src Modified Files: misc.c Log Message: * Patched factLat.pl so it automatically applies more generous parameters for SNFS factorizations where the polynomial degree is not optimal. The knob to twirl to adjust the functional difference in digit levels is $nonPrefDegAdjust. I'm not sure if it can be tweaked arbitrarily; the logic around getting degree crossovers right was a bit tricky. * The factLat.pl script will now start with a little classical sieving by default. Maybe we'll get more people using it now. :) * Reorganized mpz_fact_factorEasy() so the control flow makes more sense and doesn't repeat operations like trial division unnecessarily. The repeated stuff like power checks and ECM are now in a separate function mpz_fact_factorRealWork_rec(), which is recursive. Index: misc.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/misc.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** misc.c 12 Jul 2005 09:50:07 -0000 1.4 --- misc.c 15 Jul 2005 03:18:30 -0000 1.5 *************** *** 530,533 **** --- 530,656 ---- const s32 _B1Sizes[]={2000, 5000, 10000, 50000, 250000, 1000000, 3000000}; const s32 _numCurves[]={50, 150, 200, 400, 600, 1000, 1000}; + + static int mpz_fact_factorRealWork_rec(mpz_fact_t *F, int doRealWork, + u32 numSmallP, u32 *smallP, + mpz_t tmp1, mpz_t tmp2, char str[256]) + /****************************************************/ + /* Recursive routine meant to be called from */ + /* mpz_fact_factorEasy(). Does a power check and, */ + /* if doRealWork is positive, ECM. Assumes that */ + /* trial division and DISC_P_DIV factors have */ + /* already been divided out (so no need to repeat) */ + /****************************************************/ + { + int top_e, e, giveUp, retVal, iter, level; + mpz_t s; + s32 i, B1; + double B2; + + if (doRealWork < 0) return -1; + + mpz_init(s); + + giveUp = 0; + iter=10; + level=0; + B1 = _B1Sizes[0]; + B2 = 0; + mpz_set_ui(s, 0); + top_e = 1; + while ((!giveUp) && mpz_cmp_ui(F->unfactored, 1)) { + if (mpz_probab_prime_p(F->unfactored, 20)) { + msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", + mpz_get_str(str, 10, F->unfactored)); + mpz_fact_add_factor(F, F->unfactored, 1); + mpz_set_ui(F->unfactored, 1); + } else { + /** Do a power check; avoid mpz_perfect_power_p() because **/ + /** it redoes trial division (as of GMP 4.1.4) **/ + e = 1; + while (mpz_perfect_square_p(F->unfactored)) { + e *= 2; + mpz_sqrt(F->unfactored, F->unfactored); + } + for (i=1; i<numSmallP; i++) { + while (mpz_root(tmp1, F->unfactored, smallP[i])) { + e *= smallP[i]; + mpz_set (F->unfactored, tmp1); + } + if (mpz_cmp_ui(tmp1, smallP[numSmallP-1]) < 0) break; + } + if (e > 1) { + top_e *= e; + if (mpz_probab_prime_p(F->unfactored, 20)) { + // printf("found factor with multiplicity %ld\n", e); + msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", + mpz_get_str(str, 10, F->unfactored)); + mpz_fact_add_factor(F, F->unfactored, top_e); + mpz_set_ui(F->unfactored, 1); + } + } + /** Now do ECM on the remaining part **/ + if (mpz_cmp_ui(F->unfactored, 1) && (doRealWork > 0)) { + mpz_set(tmp2, F->unfactored); + i=0; + do { + retVal = ecmFactor(tmp1, tmp2, B1, B2, iter, s); + i++; + if ((i%10)== 0) { + printf("Attempt %ld / %ld for: ", i, _numCurves[level]); + mpz_out_str(stdout, 10, tmp2); + printf("\n"); + } + /* if ECM found input number, try again */ + if ((retVal > 0) && (mpz_cmp(tmp1, F->unfactored) == 0)) retVal = 0; + } while ((retVal==0) && (i<_numCurves[level])); + if (retVal <= 0) { + if (++level < _numLevels) + B1 = _B1Sizes[level]; + else + giveUp = 1; + } else { + mpz_divexact(F->unfactored, F->unfactored, tmp1); + if (mpz_probab_prime_p(tmp1, 20)) { + e = 1; + mpz_mod(tmp2, F->unfactored, tmp1); + while (mpz_sgn(tmp2)==0) { + e++; + mpz_divexact(F->unfactored, F->unfactored, tmp1); + mpz_mod(tmp2, F->unfactored, tmp1); + } + msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", mpz_get_str(str, 10, tmp1)); + mpz_fact_add_factor(F, tmp1, top_e*e); + } else { + mpz_fact_t TmpF; + + mpz_fact_init(&TmpF); + mpz_set(TmpF.N, tmp1); + mpz_set(TmpF.unfactored, tmp1); + TmpF.sign = 1; + retVal = mpz_fact_factorRealWork_rec(&TmpF, doRealWork, numSmallP, + smallP, tmp1, tmp2, str); + if (retVal==0) { + for (i=0; i<TmpF.size; i++) + mpz_fact_add_factor(F, &TmpF.factors[i], + top_e*TmpF.exponents[i]); + } + else + doRealWork = 0; /* give up on ECM, but do one more power check */ + mpz_fact_clear(&TmpF); + } + } + } /* end ECM block */ + else + giveUp = 1; /* no more power checks, no more ECM */ + } + } + + mpz_clear(s); + if (mpz_cmp_ui(F->unfactored, 1)==0) + return 0; + return -1; + + } + int mpz_fact_factorEasy(mpz_fact_t *F, mpz_t N, int doRealWork) /************************************************************/ *************** *** 538,549 **** /* If doRealWork=0, we will not try too hard. If it is -1 */ /* we will do only trial division and divisors in ggnfs.log */ - /* ... and a power check */ /************************************************************/ ! { int e, giveUp, retVal, iter, level; u32 numSmallP, *smallP; ! mpz_t tmp1, tmp2, s; ! mpz_fact_t TmpF; ! s32 i, B1; ! double B2; FILE *fp; char str[256], *loc; --- 661,669 ---- /* If doRealWork=0, we will not try too hard. If it is -1 */ /* we will do only trial division and divisors in ggnfs.log */ /************************************************************/ ! { int e; u32 numSmallP, *smallP; ! mpz_t tmp1, tmp2; ! s32 i; FILE *fp; char str[256], *loc; *************** *** 551,555 **** mpz_init(tmp1); mpz_init(tmp2); - mpz_init(s); mpz_set(F->N, N); --- 671,674 ---- *************** *** 627,762 **** } ! ! /** Do a power check; avoid mpz_perfect_power_p() because it redoes trial **/ ! /** division (as of GMP 4.1.4) */ ! if (mpz_cmp_ui(F->unfactored, 1)) { ! if (mpz_probab_prime_p(F->unfactored, 20)) { ! msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", ! mpz_get_str(str, 10, F->unfactored)); ! mpz_fact_add_factor(F, F->unfactored, 1); ! mpz_set_ui(F->unfactored, 1); ! } else { ! e = 1; ! while (mpz_perfect_square_p(F->unfactored)) { ! e *= 2; ! mpz_sqrt(F->unfactored, F->unfactored); ! } ! for (i=1; i<numSmallP; i++) { ! while (mpz_root(tmp1, F->unfactored, smallP[i])) { ! e *= smallP[i]; ! mpz_set (F->unfactored, tmp1); ! } ! if (mpz_cmp_ui(tmp1, smallP[numSmallP-1]) < 0) break; ! } ! if (e > 1) { ! if (mpz_probab_prime_p(F->unfactored, 20)) { ! // printf("found factor with multiplicity %ld\n", e); ! msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", ! mpz_get_str(str, 10, F->unfactored)); ! mpz_fact_add_factor(F, F->unfactored, e); ! mpz_set_ui(F->unfactored, 1); ! } else { ! mpz_fact_init(&TmpF); ! retVal = mpz_fact_factorEasy(&TmpF, F->unfactored, doRealWork); ! if (retVal==0) { ! for (i=0; i<TmpF.size; i++) ! mpz_fact_add_factor(F, &TmpF.factors[i], e*TmpF.exponents[i]); ! } else doRealWork = 0; ! mpz_fact_clear(&TmpF); ! } ! } ! } } - free(smallP); - if (mpz_cmp_ui(F->unfactored, 1)==0) { - mpz_clear(tmp1); - mpz_clear(tmp2); - mpz_clear(s); - return 0; - } - if (doRealWork <= 0) { - mpz_clear(tmp1); - mpz_clear(tmp2); - mpz_clear(s); - return -1; - } - - - /** Do ECM on the remaining part **/ - mpz_fact_init(&TmpF); - giveUp = 0; - iter=10; - level=0; - B1 = _B1Sizes[0]; - B2 = 0; - mpz_set_ui(s, 0); - while ((!giveUp) && mpz_cmp_ui(F->unfactored, 1)) { - if (mpz_probab_prime_p(F->unfactored, 20)) { - msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", - mpz_get_str(str, 10, F->unfactored)); - mpz_fact_add_factor(F, F->unfactored, 1); - mpz_set_ui(F->unfactored, 1); - } else if (mpz_perfect_power_p(F->unfactored)) { /* inefficient? oh well */ - retVal = mpz_fact_factorEasy(&TmpF, F->unfactored, doRealWork); - if (retVal==0) { - for (i=0; i<TmpF.size; i++) - mpz_fact_add_factor(F, &TmpF.factors[i], TmpF.exponents[i]); - mpz_set_ui(F->unfactored, 1); - mpz_fact_clear(&TmpF); - mpz_fact_init(&TmpF); - } - else - giveUp = 1; - } else { - mpz_set(tmp2, F->unfactored); - i=0; - do { - retVal = ecmFactor(tmp1, tmp2, B1, B2, iter, s); - i++; - if ((i%10)== 0) { - printf("Attempt %ld / %ld for: ", i, _numCurves[level]); - mpz_out_str(stdout, 10, tmp2); - printf("\n"); - } - } while ((retVal==0) && (i<_numCurves[level])); - if (retVal <= 0) { - if (++level < _numLevels) - B1 = _B1Sizes[level]; - else - giveUp = 1; - } else { - mpz_divexact(F->unfactored, F->unfactored, tmp1); - if (mpz_probab_prime_p(tmp1, 20)) { - e = 1; - mpz_mod(tmp2, F->unfactored, tmp1); - while (mpz_sgn(tmp2)==0) { - e++; - mpz_divexact(F->unfactored, F->unfactored, tmp1); - mpz_mod(tmp2, F->unfactored, tmp1); - } - msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", mpz_get_str(str, 10, tmp1)); - mpz_fact_add_factor(F, tmp1, e); - } else { - retVal = mpz_fact_factorEasy(&TmpF, tmp1, doRealWork); - if (retVal==0) { - for (i=0; i<TmpF.size; i++) - mpz_fact_add_factor(F, &TmpF.factors[i], TmpF.exponents[i]); - mpz_fact_clear(&TmpF); - mpz_fact_init(&TmpF); - } - else - giveUp = 1; - } - } - } - } - mpz_fact_clear(&TmpF); mpz_clear(tmp1); mpz_clear(tmp2); - mpz_clear(s); if (mpz_cmp_ui(F->unfactored, 1)==0) return 0; return -1; } --- 746,760 ---- } ! if (mpz_cmp_ui(F->unfactored, 1) && (doRealWork >= 0)) { ! mpz_fact_factorRealWork_rec(F, doRealWork, numSmallP, smallP, tmp1, tmp2, str); } free(smallP); mpz_clear(tmp1); mpz_clear(tmp2); if (mpz_cmp_ui(F->unfactored, 1)==0) return 0; + return -1; + } |
From: Sam C. <tri...@us...> - 2005-07-13 23:35:06
|
Update of /cvsroot/ggnfs/branch_0/doc/ggnfs-doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23070 Modified Files: ggnfs-doc.tex Log Message: Addressed bug 1237224 submitted by GW Reynolds. Typo in doc file where the polynomial coefficient was c+0 instead of c_0. Index: ggnfs-doc.tex =================================================================== RCS file: /cvsroot/ggnfs/branch_0/doc/ggnfs-doc/ggnfs-doc.tex,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ggnfs-doc.tex 8 Jun 2005 19:46:58 -0000 1.1.1.1 --- ggnfs-doc.tex 13 Jul 2005 23:34:55 -0000 1.2 *************** *** 505,509 **** As usual, suppose $N$ is the composite number to be factored. ! Let $c+0+c_1x+\cdots c_dx^d = f(x)\in\Z[x]$ be a (not necessarily monic) polynomial of degree $d$ so that $f(m)=cN$ for some small nonzero integer $c$ and some --- 505,509 ---- As usual, suppose $N$ is the composite number to be factored. ! Let $c_0+c_1x+\cdots c_dx^d = f(x)\in\Z[x]$ be a (not necessarily monic) polynomial of degree $d$ so that $f(m)=cN$ for some small nonzero integer $c$ and some |
From: Sam C. <tri...@us...> - 2005-07-12 09:50:16
|
Update of /cvsroot/ggnfs/branch_0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26624 Modified Files: Changelog Log Message: * Updated mpz_fact_factorEasy() to check for higher multiplicity of prime factors above the trial division limit. The DISC_P_DIV lines in ggnfs.log will also be written/interpreted accordingly. This should fix some instances where procrels did not factor the discriminant of the polynomial as well as it could. Marvel in amazement when the following .poly file no longer gives procrels conniptions! name: C105_109_19 n: 105225398036176295267677603133796845078486405445258822110966842453117464990195186863233272721477143859073 m: 15636796351108567493 c5: 112559376 c4: 130569432434 c3: -202497712113004 c2: -48611302267291270 c1: 45932334357416631933 c0: 10379884647055473855360 skew: 912.461 type: gnfs rlim: 2500000 alim: 1500000 lpbr: 26 lpba: 26 mfbr: 50 mfba: 50 rlambda: 2.3 alambda: 2.3 qintsize: 100 * Added .params to the list of files cleaned in the gnfs-template Makefile. Index: Changelog =================================================================== RCS file: /cvsroot/ggnfs/branch_0/Changelog,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Changelog 9 Jul 2005 14:33:07 -0000 1.13 --- Changelog 12 Jul 2005 09:50:06 -0000 1.14 *************** *** 1,2 **** --- 1,10 ---- + 7/12/05 (trilliwig) + * Updated mpz_fact_factorEasy() to check for higher multiplicity of prime + factors above the trial division limit. The DISC_P_DIV lines in + ggnfs.log will also be written/interpreted accordingly. This should + fix some instances where procrels did not factor the discriminant of the + polynomial as well as it could. + * Added .params to the list of files cleaned in the gnfs-template Makefile. + 7/9/05 (jasonp_sf) * Free unneeded arrays before the classical siever starts; reduces |
From: Sam C. <tri...@us...> - 2005-07-12 09:50:16
|
Update of /cvsroot/ggnfs/branch_0/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26624/src Modified Files: misc.c Log Message: * Updated mpz_fact_factorEasy() to check for higher multiplicity of prime factors above the trial division limit. The DISC_P_DIV lines in ggnfs.log will also be written/interpreted accordingly. This should fix some instances where procrels did not factor the discriminant of the polynomial as well as it could. Marvel in amazement when the following .poly file no longer gives procrels conniptions! name: C105_109_19 n: 105225398036176295267677603133796845078486405445258822110966842453117464990195186863233272721477143859073 m: 15636796351108567493 c5: 112559376 c4: 130569432434 c3: -202497712113004 c2: -48611302267291270 c1: 45932334357416631933 c0: 10379884647055473855360 skew: 912.461 type: gnfs rlim: 2500000 alim: 1500000 lpbr: 26 lpba: 26 mfbr: 50 mfba: 50 rlambda: 2.3 alambda: 2.3 qintsize: 100 * Added .params to the list of files cleaned in the gnfs-template Makefile. Index: misc.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/misc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** misc.c 3 Jul 2005 05:09:34 -0000 1.3 --- misc.c 12 Jul 2005 09:50:07 -0000 1.4 *************** *** 537,541 **** /* Return value: 0 <==> factored completely. */ /* If doRealWork=0, we will not try too hard. If it is -1 */ ! /* we will do only trial division and divisors in ggnfs.log.*/ /************************************************************/ { int e, giveUp, retVal, iter, level; --- 537,542 ---- /* Return value: 0 <==> factored completely. */ /* If doRealWork=0, we will not try too hard. If it is -1 */ ! /* we will do only trial division and divisors in ggnfs.log */ ! /* ... and a power check */ /************************************************************/ { int e, giveUp, retVal, iter, level; *************** *** 595,598 **** --- 596,600 ---- } + /***************************************************/ /* First, scan the log file to see if we'd already */ *************** *** 607,617 **** if (loc != NULL) { mpz_set_str(tmp1, &loc[11], 10); ! mpz_mod(tmp2, F->unfactored, tmp1); ! if (mpz_sgn(tmp2)==0) { ! mpz_fact_add_factor(F, tmp1, 1); ! mpz_div(F->unfactored, F->unfactored, tmp1); ! } ! if (mpz_cmp_ui(F->unfactored, 1)==0) { ! msgLog(GGNFS_LOG_NAME, "Discriminant factorization re-read from log file."); } } --- 609,624 ---- if (loc != NULL) { mpz_set_str(tmp1, &loc[11], 10); ! if (mpz_probab_prime_p(tmp1, 20)) { ! e = 0; ! mpz_mod(tmp2, F->unfactored, tmp1); ! while (mpz_sgn(tmp2)==0) { ! e++; ! mpz_divexact(F->unfactored, F->unfactored, tmp1); ! mpz_mod(tmp2, F->unfactored, tmp1); ! } ! if (e) mpz_fact_add_factor(F, tmp1, e); ! if (mpz_cmp_ui(F->unfactored, 1)==0) { ! msgLog(GGNFS_LOG_NAME, "Discriminant factorization re-read from log file."); ! } } } *************** *** 621,624 **** --- 628,671 ---- + /** Do a power check; avoid mpz_perfect_power_p() because it redoes trial **/ + /** division (as of GMP 4.1.4) */ + if (mpz_cmp_ui(F->unfactored, 1)) { + if (mpz_probab_prime_p(F->unfactored, 20)) { + msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", + mpz_get_str(str, 10, F->unfactored)); + mpz_fact_add_factor(F, F->unfactored, 1); + mpz_set_ui(F->unfactored, 1); + } else { + e = 1; + while (mpz_perfect_square_p(F->unfactored)) { + e *= 2; + mpz_sqrt(F->unfactored, F->unfactored); + } + for (i=1; i<numSmallP; i++) { + while (mpz_root(tmp1, F->unfactored, smallP[i])) { + e *= smallP[i]; + mpz_set (F->unfactored, tmp1); + } + if (mpz_cmp_ui(tmp1, smallP[numSmallP-1]) < 0) break; + } + if (e > 1) { + if (mpz_probab_prime_p(F->unfactored, 20)) { + // printf("found factor with multiplicity %ld\n", e); + msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", + mpz_get_str(str, 10, F->unfactored)); + mpz_fact_add_factor(F, F->unfactored, e); + mpz_set_ui(F->unfactored, 1); + } else { + mpz_fact_init(&TmpF); + retVal = mpz_fact_factorEasy(&TmpF, F->unfactored, doRealWork); + if (retVal==0) { + for (i=0; i<TmpF.size; i++) + mpz_fact_add_factor(F, &TmpF.factors[i], e*TmpF.exponents[i]); + } else doRealWork = 0; + mpz_fact_clear(&TmpF); + } + } + } + } free(smallP); *************** *** 637,641 **** - /** Do ECM on the remaining part **/ mpz_fact_init(&TmpF); --- 684,687 ---- *************** *** 648,653 **** --- 694,712 ---- while ((!giveUp) && mpz_cmp_ui(F->unfactored, 1)) { if (mpz_probab_prime_p(F->unfactored, 20)) { + msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", + mpz_get_str(str, 10, F->unfactored)); mpz_fact_add_factor(F, F->unfactored, 1); mpz_set_ui(F->unfactored, 1); + } else if (mpz_perfect_power_p(F->unfactored)) { /* inefficient? oh well */ + retVal = mpz_fact_factorEasy(&TmpF, F->unfactored, doRealWork); + if (retVal==0) { + for (i=0; i<TmpF.size; i++) + mpz_fact_add_factor(F, &TmpF.factors[i], TmpF.exponents[i]); + mpz_set_ui(F->unfactored, 1); + mpz_fact_clear(&TmpF); + mpz_fact_init(&TmpF); + } + else + giveUp = 1; } else { mpz_set(tmp2, F->unfactored); *************** *** 668,675 **** giveUp = 1; } else { ! mpz_div(F->unfactored, F->unfactored, tmp1); if (mpz_probab_prime_p(tmp1, 20)) { msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", mpz_get_str(str, 10, tmp1)); ! mpz_fact_add_factor(F, tmp1, 1); } else { retVal = mpz_fact_factorEasy(&TmpF, tmp1, doRealWork); --- 727,741 ---- giveUp = 1; } else { ! mpz_divexact(F->unfactored, F->unfactored, tmp1); if (mpz_probab_prime_p(tmp1, 20)) { + e = 1; + mpz_mod(tmp2, F->unfactored, tmp1); + while (mpz_sgn(tmp2)==0) { + e++; + mpz_divexact(F->unfactored, F->unfactored, tmp1); + mpz_mod(tmp2, F->unfactored, tmp1); + } msgLog(GGNFS_LOG_NAME, "DISC_P_DIV=%s", mpz_get_str(str, 10, tmp1)); ! mpz_fact_add_factor(F, tmp1, e); } else { retVal = mpz_fact_factorEasy(&TmpF, tmp1, doRealWork); *************** *** 679,685 **** mpz_fact_clear(&TmpF); mpz_fact_init(&TmpF); ! } else { giveUp = 1; - } } } --- 745,751 ---- mpz_fact_clear(&TmpF); mpz_fact_init(&TmpF); ! } ! else giveUp = 1; } } |
From: Sam C. <tri...@us...> - 2005-07-12 09:50:16
|
Update of /cvsroot/ggnfs/branch_0/tests/gnfs-template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26624/tests/gnfs-template Modified Files: Makefile Log Message: * Updated mpz_fact_factorEasy() to check for higher multiplicity of prime factors above the trial division limit. The DISC_P_DIV lines in ggnfs.log will also be written/interpreted accordingly. This should fix some instances where procrels did not factor the discriminant of the polynomial as well as it could. Marvel in amazement when the following .poly file no longer gives procrels conniptions! name: C105_109_19 n: 105225398036176295267677603133796845078486405445258822110966842453117464990195186863233272721477143859073 m: 15636796351108567493 c5: 112559376 c4: 130569432434 c3: -202497712113004 c2: -48611302267291270 c1: 45932334357416631933 c0: 10379884647055473855360 skew: 912.461 type: gnfs rlim: 2500000 alim: 1500000 lpbr: 26 lpba: 26 mfbr: 50 mfba: 50 rlambda: 2.3 alambda: 2.3 qintsize: 100 * Added .params to the list of files cleaned in the gnfs-template Makefile. Index: Makefile =================================================================== RCS file: /cvsroot/ggnfs/branch_0/tests/gnfs-template/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 4 Jul 2005 01:27:37 -0000 1.2 --- Makefile 12 Jul 2005 09:50:07 -0000 1.3 *************** *** 4,8 **** rm -f cols* deps* factor.easy lpindex* rels* numFF.txt numrels.txt tmp.job *.afb.0 rm -f $(NAME).job $(NAME).polsel* $(NAME).fb spairs.* ! rm -f spmat sp-index .last_spq* depinf tmpdata.000 squeaky : clean ; --- 4,8 ---- rm -f cols* deps* factor.easy lpindex* rels* numFF.txt numrels.txt tmp.job *.afb.0 rm -f $(NAME).job $(NAME).polsel* $(NAME).fb spairs.* ! rm -f spmat sp-index .params .last_spq* depinf tmpdata.000 squeaky : clean ; |
From: jasonp_sf <jas...@us...> - 2005-07-09 14:33:17
|
Update of /cvsroot/ggnfs/branch_0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21909 Modified Files: Changelog Log Message: classical siever updates Index: Changelog =================================================================== RCS file: /cvsroot/ggnfs/branch_0/Changelog,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Changelog 7 Jul 2005 05:23:24 -0000 1.12 --- Changelog 9 Jul 2005 14:33:07 -0000 1.13 *************** *** 1,2 **** --- 1,10 ---- + 7/9/05 (jasonp_sf) + * Free unneeded arrays before the classical siever starts; reduces + memory use by more than half for large factorizations + * For the classical siever, set up each large factor base prime for + the next sieve line immediately after the prime is used. Also + collapse some operations scanning the sieve array. These two combine + for a small speedup (~5%). + 7/6/05 (frmky) * Applied a patch by Jason Papadopoulos to the classical sieve to fix an |
From: jasonp_sf <jas...@us...> - 2005-07-09 14:21:06
|
Update of /cvsroot/ggnfs/branch_0/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15399 Modified Files: clsieve.c Log Message: remove unneeded memory before sieving starts; also rearrange some operations for a slight speedup Index: clsieve.c =================================================================== RCS file: /cvsroot/ggnfs/branch_0/src/clsieve.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** clsieve.c 7 Jul 2005 05:23:24 -0000 1.3 --- clsieve.c 9 Jul 2005 14:20:57 -0000 1.4 *************** *** 483,486 **** --- 483,495 ---- msgLog("", ""); + /************************ + * free unneeded arrays * + ************************/ + + free(FB->rfb); FB->rfb = NULL; + free(FB->afb); FB->afb = NULL; + free(FB->rfb_log); FB->rfb_log = NULL; + free(FB->afb_log); FB->afb_log = NULL; + /********************** * do all the work :) * *************** *** 516,524 **** ***********************************************************/ { s32 i, j, k; ! s32 rfb_size = conf->rfb_size; ! s32 afb_size = conf->afb_size; sieve_fb_t *rfb = conf->rfb; sieve_fb_t *afb = conf->afb; ! int old_rels = 0, rels = 0; double startTime = sTime(); double currTime; --- 525,533 ---- ***********************************************************/ { s32 i, j, k; ! s32 med_rfb_size = conf->med_rfb_size; ! s32 med_afb_size = conf->med_afb_size; sieve_fb_t *rfb = conf->rfb; sieve_fb_t *afb = conf->afb; ! s32 old_rels = 0, rels = 0; double startTime = sTime(); double currTime; *************** *** 540,547 **** rels += do1SieveEven(FB, conf, i); ! /************************************** ! * update the roots for each FB prime * ! **************************************/ ! for (j=0; j<rfb_size; j++) { s32 p = rfb[j].p; s32 root = rfb[j].root + rfb[j].r; --- 549,558 ---- rels += do1SieveEven(FB, conf, i); ! /********************************************* ! * update the roots for the next sieve line; * ! * note that this has already happened for * ! * the large FB primes * ! *********************************************/ ! for (j=0; j<med_rfb_size; j++) { s32 p = rfb[j].p; s32 root = rfb[j].root + rfb[j].r; *************** *** 551,555 **** rfb[j].next = root; } ! for (j=0; j<afb_size; j++) { s32 p = afb[j].p; s32 root = afb[j].root + afb[j].r; --- 562,566 ---- rfb[j].next = root; } ! for (j=0; j<med_afb_size; j++) { s32 p = afb[j].p; s32 root = afb[j].root + afb[j].r; *************** *** 724,744 **** sieve_fb_t *fb = rfb + i; s32 p = fb->p; ! s32 off = fb->next; u8 logp = fb->logp; ! if (off<sieve_size) add2Hashtable(conf->rcache, conf->cache_max, rhash+BLOCK_HASH(off), p, off, logp, &conf->mempool); } for (i=med_afb_size; i<afb_size; i++) { sieve_fb_t *fb = afb + i; s32 p = fb->p; ! s32 off = fb->next; u8 logp = fb->logp; ! if (off<sieve_size) add2Hashtable(conf->acache, conf->cache_max, ahash+BLOCK_HASH(off), p, off, logp, &conf->mempool); } } --- 735,757 ---- sieve_fb_t *fb = rfb + i; s32 p = fb->p; ! s32 off = fb->root; u8 logp = fb->logp; ! if (off<sieve_size) { add2Hashtable(conf->rcache, conf->cache_max, rhash+BLOCK_HASH(off), p, off, logp, &conf->mempool); + } } for (i=med_afb_size; i<afb_size; i++) { sieve_fb_t *fb = afb + i; s32 p = fb->p; ! s32 off = fb->root; u8 logp = fb->logp; ! if (off<sieve_size) { add2Hashtable(conf->acache, conf->cache_max, ahash+BLOCK_HASH(off), p, off, logp, &conf->mempool); + } } } *************** *** 747,766 **** sieve_fb_t *fb = rfb + i; s32 p = fb->p; ! s32 off = p - fb->next; u8 logp = fb->logp; ! if (off<sieve_size) add2Hashtable(conf->rcache, conf->cache_max, rhash+BLOCK_HASH(off), p, off, logp, &conf->mempool); } for (i=med_afb_size; i<afb_size; i++) { sieve_fb_t *fb = afb + i; s32 p = fb->p; ! s32 off = p - fb->next; u8 logp = fb->logp; ! if (off<sieve_size) add2Hashtable(conf->acache, conf->cache_max, ahash+BLOCK_HASH(off), p, off, logp, &conf->mempool); } } --- 760,792 ---- sieve_fb_t *fb = rfb + i; s32 p = fb->p; ! s32 off = p - fb->root; u8 logp = fb->logp; ! if (off<sieve_size) { add2Hashtable(conf->rcache, conf->cache_max, rhash+BLOCK_HASH(off), p, off, logp, &conf->mempool); + } + + /* set up the next sieve line while the FB + structure is in cache */ + off = fb->root + fb->r; + if (off>=p) + off -= p; + fb->root = off; } for (i=med_afb_size; i<afb_size; i++) { sieve_fb_t *fb = afb + i; s32 p = fb->p; ! s32 off = p - fb->root; u8 logp = fb->logp; ! if (off<sieve_size) { add2Hashtable(conf->acache, conf->cache_max, ahash+BLOCK_HASH(off), p, off, logp, &conf->mempool); + } + off = fb->root + fb->r; + if (off>=p) + off -= p; + fb->root = off; } } *************** *** 789,814 **** sieve_fb_t *fb = rfb + i; s32 p = fb->p; ! s32 off = fb->next; u8 logp = fb->logp; if (off%2==0) off += p; off = off/2; ! if (off<sieve_size) add2Hashtable(conf->rcache, conf->cache_max, rhash+BLOCK_HASH(off), p, off, logp, &conf->mempool); } for (i=med_afb_size; i<afb_size; i++) { sieve_fb_t *fb = afb + i; s32 p = fb->p; ! s32 off = fb->next; u8 logp = fb->logp; if (off%2==0) off += p; off = off/2; ! if (off<sieve_size) add2Hashtable(conf->acache, conf->cache_max, ahash+BLOCK_HASH(off), p, off, logp, &conf->mempool); } } --- 815,842 ---- sieve_fb_t *fb = rfb + i; s32 p = fb->p; ! s32 off = fb->root; u8 logp = fb->logp; if (off%2==0) off += p; off = off/2; ! if (off<sieve_size) { add2Hashtable(conf->rcache, conf->cache_max, rhash+BLOCK_HASH(off), p, off, logp, &conf->mempool); + } } for (i=med_afb_size; i<afb_size; i++) { sieve_fb_t *fb = afb + i; s32 p = fb->p; ! s32 off = fb->root; u8 logp = fb->logp; if (off%2==0) off += p; off = off/2; ! if (off<sieve_size) { add2Hashtable(conf->acache, conf->cache_max, ahash+BLOCK_HASH(off), p, off, logp, &conf->mempool); + } } } *************** *** 817,842 **** sieve_fb_t *fb = rfb + i; s32 p = fb->p; ! s32 off = p - fb->next; u8 logp = fb->logp; if (off%2==0) off += p; off = off/2; ! if (off<sieve_size) add2Hashtable(conf->rcache, conf->cache_max, rhash+BLOCK_HASH(off), p, off, logp, &conf->mempool); } for (i=med_afb_size; i<afb_size; i++) { sieve_fb_t *fb = afb + i; s32 p = fb->p; ! s32 off = p - fb->next; u8 logp = fb->logp; if (off%2==0) off += p; off = off/2; ! if (off<sieve_size) add2Hashtable(conf->acache, conf->cache_max, ahash+BLOCK_HASH(off), p, off, logp, &conf->mempool); } } --- 845,880 ---- sieve_fb_t *fb = rfb + i; s32 p = fb->p; ! s32 off = p - fb->root; u8 logp = fb->logp; if (off%2==0) off += p; off = off/2; ! if (off<sieve_size) { add2Hashtable(conf->rcache, conf->cache_max, rhash+BLOCK_HASH(off), p, off, logp, &conf->mempool); + } + off = fb->root + fb->r; + if (off>=p) + off -= p; + fb->root = off; } for (i=med_afb_size; i<afb_size; i++) { sieve_fb_t *fb = afb + i; s32 p = fb->p; ! s32 off = p - fb->root; u8 logp = fb->logp; if (off%2==0) off += p; off = off/2; ! if (off<sieve_size) { add2Hashtable(conf->acache, conf->cache_max, ahash+BLOCK_HASH(off), p, off, logp, &conf->mempool); + } + off = fb->root + fb->r; + if (off>=p) + off -= p; + fb->root = off; } } *************** *** 1201,1214 **** for (j=0; j<blocksize; j++) { ! s32 off = i+j; ! s32 rbits = rblock[off]; ! s32 abits = ablock[off]; ! ! if (abits>logTarget_a && ! rbits>logTarget_r && ! gcd(block_start+off, b)==1) { ! rels += do1Factoring(FB, conf, off, b, ! rbits, abits, block, ! first_block, sign); } } --- 1239,1248 ---- for (j=0; j<blocksize; j++) { ! if (ablock[i+j]>logTarget_a && ! rblock[i+j]>logTarget_r && ! gcd(block_start+i+j, b)==1) { ! rels += do1Factoring(FB, conf, i+j, b, ! rblock[i+j], ablock[i+j], ! block, first_block, sign); } } *************** *** 1301,1313 **** for (j=0; j<blocksize; j++) { ! s32 off = i+j; ! s32 rbits = rblock[off]; ! s32 abits = ablock[off]; ! ! if (abits>logTarget_a && ! rbits>logTarget_r && ! gcd(2*(block_start+off)+1, b)==1) { ! rels += do1Factoring(FB, conf, off, b, ! rbits, abits, block, first_block, sign); } --- 1335,1343 ---- for (j=0; j<blocksize; j++) { ! if (ablock[i+j]>logTarget_a && ! rblock[i+j]>logTarget_r && ! gcd(2*(block_start+i+j)+1, b)==1) { ! rels += do1Factoring(FB, conf, i+j, b, ! rblock[i+j], ablock[i+j], block, first_block, sign); } |
From: Greg <fr...@us...> - 2005-07-07 05:23:34
|
Update of /cvsroot/ggnfs/branch_0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18820 Modified Files: Changelog Makefile Log Message: Applied a patch by Jason Papadopoulos to the classical sieve to fix an incorrect initialization when the factor base is very small (under 65536). Index: Makefile =================================================================== RCS file: /cvsroot/ggnfs/branch_0/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 6 Jul 2005 01:39:58 -0000 1.4 --- Makefile 7 Jul 2005 05:23:24 -0000 1.5 *************** *** 1,3 **** ! VERSION=0.77.1-050703 THISDIR=ggnfs HOME=. --- 1,3 ---- ! VERSION=0.77.1-050706 THISDIR=ggnfs HOME=. Index: Changelog =================================================================== RCS file: /cvsroot/ggnfs/branch_0/Changelog,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Changelog 6 Jul 2005 01:41:51 -0000 1.11 --- Changelog 7 Jul 2005 05:23:24 -0000 1.12 *************** *** 1,2 **** --- 1,7 ---- + 7/6/05 (frmky) + * Applied a patch by Jason Papadopoulos to the classical sieve to fix an + incorrect initialization when the factor base is very small (under + 65536). + 7/5/05 (trilliwig) * Moved crossover for the Kleinjung/Franke poly tool a little lower, so |