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 != p)||(M->AFB[pLoc].r != r)) {
! fprintf(stderr, "Error: Couldn't find (%" PRId32 ", %" PRId32 ") in the primes list!\n", p, r);
exit(-1);
}
***************
*** 1697,1701 ****
r = M->AFB[index].r;
if (M->aExp[index]%2) {
! printf("chooseIdeal() sever error: odd exponent found: (%ld, %ld) e=%ld!\n",p,r,(s32)M->aExp[index]);
return -1;
}
--- 1697,1701 ----
r = M->AFB[index].r;
if (M->aExp[index]%2) {
! printf("chooseIdeal() sever error: odd exponent found: (%" PRId32 ", %" PRId32 ") e=%" PRId32 "!\n",p,r,(s32)M->aExp[index]);
return -1;
}
***************
*** 1727,1731 ****
else {
if (M->spExp[indexE]%2) {
! printf("chooseIdeal() sever error: odd exponent found! (Special ideal %ld, e=%ld)\n", indexE,M->spExp[indexE]);
return -1;
}
--- 1727,1731 ----
else {
if (M->spExp[indexE]%2) {
! printf("chooseIdeal() severe error: odd exponent found! (Special ideal %" PRId32 ", e=%" PRId32 ")\n", indexE,M->spExp[indexE]);
return -1;
}
***************
*** 1737,1741 ****
}
#ifdef _DEBUG
! sprintf(tmpStr, "EIdeal %ld : e=%ld/%ld\n",indexE,e,M->spExp[indexE]);
strncat(idealSelStr, tmpStr, MAX_IDEAL_STR-strlen(idealSelStr));
#endif
--- 1737,1741 ----
}
#ifdef _DEBUG
! sprintf(tmpStr, "EIdeal %" PRId32 " : e=%" PRId32 "/%" PRId32 "\n",indexE,e,M->spExp[indexE]);
strncat(idealSelStr, tmpStr, MAX_IDEAL_STR-strlen(idealSelStr));
#endif
***************
*** 1756,1760 ****
r = M->AFB[index].r;
if (M->aExp[index]%2) {
! printf("chooseIdeal() sever error: odd exponent found: (%ld, %ld) e=%ld!\n",p,r,(s32)M->aExp[index]);
return -1;
}
--- 1756,1760 ----
r = M->AFB[index].r;
if (M->aExp[index]%2) {
! printf("chooseIdeal() severe error: odd exponent found: (%" PRId32 ", %" PRId32 ") e=%" PRId32 "!\n",p,r,(s32)M->aExp[index]);
return -1;
}
***************
*** 1765,1769 ****
}
#ifdef _DEBUG
! sprintf(tmpStr, "Ideal %ld : (%ld, %ld) e=%ld/%ld\n",index,p,r,e,M->aExp[index]);
strncat(idealSelStr, tmpStr, MAX_IDEAL_STR-strlen(idealSelStr));
#endif
--- 1765,1769 ----
}
#ifdef _DEBUG
! sprintf(tmpStr, "Ideal %" PRId32 " : (%" PRId32 ", %" PRId32 ") e=%" PRId32 "/%" PRId32 "\n",index,p,r,e,M->aExp[index]);
strncat(idealSelStr, tmpStr, MAX_IDEAL_STR-strlen(idealSelStr));
#endif
***************
*** 1785,1789 ****
else {
if (M->spExp[indexE]%2) {
! printf("chooseIdeal() sever error: odd exponent found! (Special ideal %ld, e=%ld)\n", indexE,M->spExp[indexE]);
return -1;
}
--- 1785,1789 ----
else {
if (M->spExp[indexE]%2) {
! printf("chooseIdeal() severe error: odd exponent found! (Special ideal %" PRId32 ", e=%" PRId32 ")\n", indexE,M->spExp[indexE]);
return -1;
}
***************
*** 2146,2150 ****
if ((now > (lastReportTime + 5.0)) ||
((M.logNormGDen < 1000.0) && (M.logNormGNum < 1000.0))) {
! printf("step %ld, sl=%2d, logGam=%1.2lf/%1.2lf, ",
l, sl, M.logNormGNum, M.logNormGDen);
printf("emb: ");
--- 2146,2150 ----
if ((now > (lastReportTime + 5.0)) ||
((M.logNormGDen < 1000.0) && (M.logNormGNum < 1000.0))) {
! printf("step %" PRId32 ", sl=%2d, logGam=%1.2lf/%1.2lf, ",
l, sl, M.logNormGNum, M.logNormGDen);
printf("emb: ");
***************
*** 2259,2263 ****
printf("-------------------------------------------------\n");
printf("Iterative portion of square root computation done.\n");
! printf("step %ld, sl=%2d, logGam=%1.2lf/%1.2lf, ",
l, sl, M.logNormGNum, M.logNormGDen);
printf("emb: ");
--- 2259,2263 ----
printf("-------------------------------------------------\n");
printf("Iterative portion of square root computation done.\n");
! printf("step %" PRId32 ", sl=%2d, logGam=%1.2lf/%1.2lf, ",
l, sl, M.logNormGNum, M.logNormGDen);
printf("emb: ");
***************
*** 2281,2285 ****
for (i=M.aSize-1; i>=0; i--) {
if (M.aExp[i] != 0) {
! printf("(%ld, %ld)^%ld\n", M.AFB[i].p, M.AFB[i].r, M.aExp[i]);
empty=0;
}
--- 2281,2285 ----
for (i=M.aSize-1; i>=0; i--) {
if (M.aExp[i] != 0) {
! printf("(%" PRId32 ", %" PRId32 ")^%" PRId32 "\n", M.AFB[i].p, M.AFB[i].r, M.aExp[i]);
empty=0;
}
***************
*** 2287,2291 ****
for (i=M.spSize-1; i>=0; i--) {
if (M.spExp[i] != 0) {
! printf("(EIdeal %d)^%ld\n", i, M.spExp[i]);
empty=0;
}
--- 2287,2291 ----
for (i=M.spSize-1; i>=0; i--) {
if (M.spExp[i] != 0) {
! printf("(EIdeal %d)^%" PRId32 "\n", i, M.spExp[i]);
empty=0;
}
Index: sqrt.c
===================================================================
RCS file: /cvsroot/ggnfs/branch_0/src/sqrt.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** sqrt.c 8 Jun 2005 19:47:04 -0000 1.1.1.1
--- sqrt.c 17 Jul 2005 10:01:46 -0000 1.2
***************
*** 209,215 ****
readBinField(str, 512, fp);
sscanf(str, "%256s %256s", token, value);
! if (strncmp(token, "NUMCOLS:", 8)==0) sscanf(value, "%lx", &maxCols);
else if (strncmp(token, "COLNAME:", 8)==0) sscanf(value, "%s", colIndex);
! else if (strncmp(token, "MAXRELS:", 8)==0) sscanf(value, "%lx", &maxRels);
else if (strncmp(token, "RELPREFIX:", 10)==0) sscanf(value, "%s", prelF.prefix);
else if (strncmp(token, "RELFILES:", 9)==0) sscanf(value, "%x", &prelF.numFiles);
--- 209,215 ----
readBinField(str, 512, fp);
sscanf(str, "%256s %256s", token, value);
! if (strncmp(token, "NUMCOLS:", 8)==0) sscanf(value, "%" SCNx32, &maxCols);
else if (strncmp(token, "COLNAME:", 8)==0) sscanf(value, "%s", colIndex);
! else if (strncmp(token, "MAXRELS:", 8)==0) sscanf(value, "%" SCNx32, &maxRels);
else if (strncmp(token, "RELPREFIX:", 10)==0) sscanf(value, "%s", prelF.prefix);
else if (strncmp(token, "RELFILES:", 9)==0) sscanf(value, "%x", &prelF.numFiles);
***************
*** 222,226 ****
if (!(colsInDep = (s32 *)malloc(maxCols*sizeof(s32)))) {
fclose(fp);
! fprintf(stderr, "Error allocating %ld bytes for columns in dependency!\n",
maxCols*sizeof(s32));
res = -1; goto SS_DONE;
--- 222,226 ----
if (!(colsInDep = (s32 *)malloc(maxCols*sizeof(s32)))) {
fclose(fp);
! fprintf(stderr, "Error allocating %lu bytes for columns in dependency!\n",
maxCols*sizeof(s32));
res = -1; goto SS_DONE;
***************
*** 233,244 ****
fclose(fp);
! printf("NUMCOLS = %ld\n", maxCols);
printf("COLNAME = %s\n", colIndex);
! printf("MAXRELS = %ld\n", maxRels);
printf("RELPREFIX = %s\n", prelF.prefix);
printf("RELFILES = %d\n", prelF.numFiles);
printf("LPFPREFIX = %s\n", lpF.prefix);
printf("LPFFILES = %d\n", lpF.numFiles);
! printf("There are %ld columns in this dependency. Getting corresponding (a,b) pairs...\n", numCols);
if (stat(colIndex, &fileInfo)) {
--- 233,244 ----
fclose(fp);
! printf("NUMCOLS = %" PRId32 "\n", maxCols);
printf("COLNAME = %s\n", colIndex);
! printf("MAXRELS = %" PRId32 "\n", maxRels);
printf("RELPREFIX = %s\n", prelF.prefix);
printf("RELFILES = %d\n", prelF.numFiles);
printf("LPFPREFIX = %s\n", lpF.prefix);
printf("LPFFILES = %d\n", lpF.numFiles);
! printf("There are %" PRId32 " columns in this dependency. Getting corresponding (a,b) pairs...\n", numCols);
if (stat(colIndex, &fileInfo)) {
***************
*** 255,259 ****
/********************************************************************/
if (!(rid_hash = (char *)malloc(maxRels*sizeof(char)))) {
! fprintf(stderr, "Error allocating %ld bytes for rid_hash!\n", maxRels*sizeof(char));
res = -1; goto SS_DONE;
}
--- 255,259 ----
/********************************************************************/
if (!(rid_hash = (char *)malloc(maxRels*sizeof(char)))) {
! fprintf(stderr, "Error allocating %lu bytes for rid_hash!\n", maxRels*sizeof(char));
res = -1; goto SS_DONE;
}
***************
*** 275,279 ****
rid_hash[C.Rels[k]] ^= 0x01;
else {
! fprintf(stderr, "Error: Column claims use of relation %ld (maxRels = %ld)!\n",
C.Rels[k], maxRels);
--- 275,279 ----
rid_hash[C.Rels[k]] ^= 0x01;
else {
! fprintf(stderr, "Error: Column claims use of relation %" PRId32 " (maxRels = %" PRId32 ")!\n",
C.Rels[k], maxRels);
***************
*** 289,296 ****
numRels++;
}
! printf("This dependency consists of %ld (a,b) pairs.\n", numRels);
if (!(relsInDep = (s32 *)malloc(sizeof(s32)*(numRels+1)))) {
! fprintf(stderr, "Error allocating %ld bytes for relsInDep!\n", (numRels+1)*sizeof(s32));
res = -1; goto SS_DONE;
}
--- 289,296 ----
numRels++;
}
! printf("This dependency consists of %" PRId32 " (a,b) pairs.\n", numRels);
if (!(relsInDep = (s32 *)malloc(sizeof(s32)*(numRels+1)))) {
! fprintf(stderr, "Error allocating %lu bytes for relsInDep!\n", (numRels+1)*sizeof(s32));
res = -1; goto SS_DONE;
}
***************
*** 332,336 ****
}
}
! msgLog("", " r1=%s", str,strlen(str));
mpz_get_str(str, 10, q);
if ((mpz_cmp_ui(q, 1)>0) && (mpz_cmp(q, N.FB->n)<0)) {
--- 332,336 ----
}
}
! msgLog("", " r1=%s", str);
mpz_get_str(str, 10, q);
if ((mpz_cmp_ui(q, 1)>0) && (mpz_cmp(q, N.FB->n)<0)) {
Index: polyselect.c
===================================================================
RCS file: /cvsroot/ggnfs/branch_0/src/polyselect.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** polyselect.c 8 Jun 2005 19:47:04 -0000 1.1.1.1
--- polyselect.c 17 Jul 2005 10:01:46 -0000 1.2
***************
*** 1878,1882 ****
size = 512 + fileInfo.st_size;
if (!(input = (char *)malloc(size*sizeof(char)))) {
! fprintf(stderr, "Memory allocation error (%ld bytes for file %s).\n",
size, fName);
return "";
--- 1878,1882 ----
size = 512 + fileInfo.st_size;
if (!(input = (char *)malloc(size*sizeof(char)))) {
! fprintf(stderr, "Memory allocation error (%" PRId32 " bytes for file %s).\n",
size, fName);
return "";
***************
*** 2062,2066 ****
if (thisScore > bestScore) {
printTmp(" ");
! printf("Score: %e (adj. I=%1.4lf, iteration %ld, minStage1=%1.2lf)\n",
thisScore, bestParam.logSize, iteration, minStage1Size);
bestScore = thisScore;
--- 2062,2066 ----
if (thisScore > bestScore) {
printTmp(" ");
! printf("Score: %e (adj. I=%1.4lf, iteration %" PRId32 ", minStage1=%1.2lf)\n",
thisScore, bestParam.logSize, iteration, minStage1Size);
bestScore = thisScore;
***************
*** 2085,2089 ****
fprintf(fp, "# GGNFS version %s polyselect.\n", GGNFS_VERSION);
fprintf(fp, "# Options were: \n");
! fprintf(fp, "# lcd=%ld, enumLCD=%s, maxS1=%1.8lf, seed=%ld.\n",
lcd, mpz_get_str(str, 10, enumLCD), minStage1Size, seed);
fprintf(fp, "# maxskew=%1.1lf\n", maxSkew);
--- 2085,2089 ----
fprintf(fp, "# GGNFS version %s polyselect.\n", GGNFS_VERSION);
fprintf(fp, "# Options were: \n");
! fprintf(fp, "# lcd=%" PRId32 ", enumLCD=%s, maxS1=%1.8lf, seed=%" PRId32 ".\n",
lcd, mpz_get_str(str, 10, enumLCD), minStage1Size, seed);
fprintf(fp, "# maxskew=%1.1lf\n", maxSkew);
Index: fbmisc.c
===================================================================
RCS file: /cvsroot/ggnfs/branch_0/src/fbmisc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** fbmisc.c 8 Jun 2005 19:47:02 -0000 1.1.1.1
--- fbmisc.c 17 Jul 2005 10:01:37 -0000 1.2
***************
*** 352,358 ****
if (verbose) {
if (lim > 0)
! printf("Generating AFB with norms upto %ld...\n", lim);
else
! printf("Generating AFB of size %ld...\n", size);
}
mpz_init_set(cd, &(FB->f->coef[d]));
--- 352,358 ----
if (verbose) {
if (lim > 0)
! printf("Generating AFB with norms upto %" PRId32 "...\n", lim);
else
! printf("Generating AFB of size %" PRId32 "...\n", size);
}
mpz_init_set(cd, &(FB->f->coef[d]));
***************
*** 374,378 ****
while (cont) {
if (verbose && ((total%10000)==0)) {
! sprintf(str, "Checking p=%ld...(total=%ld)", thisP, total);
printf("%s",str); fflush(stdout);
for (i=0; i<strlen(str); i++)
--- 374,378 ----
while (cont) {
if (verbose && ((total%10000)==0)) {
! sprintf(str, "Checking p=%" PRId32 "...(total=%" PRId32 ")", thisP, total);
printf("%s",str); fflush(stdout);
for (i=0; i<strlen(str); i++)
***************
*** 624,629 ****
sprintf(str, "npa: %d", FB->maxLPA); writeBinField(fp, str);
sprintf(str, "mpa: %d", (int)(0.5+log((double)FB->maxP_a)/M_LN2)); writeBinField(fp, str);
! sprintf(str, "RFBsize: %ld", FB->rfb_size); writeBinField(fp, str);
! sprintf(str, "AFBsize: %ld", FB->afb_size); writeBinField(fp, str);
sprintf(str, "END_HEADER"); writeBinField(fp, str);
/*******************/
--- 624,629 ----
sprintf(str, "npa: %d", FB->maxLPA); writeBinField(fp, str);
sprintf(str, "mpa: %d", (int)(0.5+log((double)FB->maxP_a)/M_LN2)); writeBinField(fp, str);
! sprintf(str, "RFBsize: %" PRId32, FB->rfb_size); writeBinField(fp, str);
! sprintf(str, "AFBsize: %" PRId32, FB->afb_size); writeBinField(fp, str);
sprintf(str, "END_HEADER"); writeBinField(fp, str);
/*******************/
Index: rels.c
===================================================================
RCS file: /cvsroot/ggnfs/branch_0/src/rels.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rels.c 12 Jun 2005 19:37:42 -0000 1.2
--- rels.c 17 Jul 2005 10:01:46 -0000 1.3
***************
*** 232,236 ****
fprintf(stderr, "dataConvertToRel() Error: MAX_ALG_FACTORS too small to hold %d factors!\n",
R->aFSize);
! fprintf(stderr, "sF field was: %8.8lx\n", sF);
return -1;
}
--- 232,236 ----
fprintf(stderr, "dataConvertToRel() Error: MAX_ALG_FACTORS too small to hold %d factors!\n",
R->aFSize);
! fprintf(stderr, "sF field was: %8.8" PRIx32 "\n", sF);
return -1;
}
***************
*** 326,330 ****
dataSize = S32S_IN_ENTRY(sF) - 1; /* We already read the first one! */
if (dataSize > 1024) {
! fprintf(stderr, "readRel() Error: dataSize = %ld > 1024! Increase and recompile!\n",
dataSize);
return -1;
--- 326,330 ----
dataSize = S32S_IN_ENTRY(sF) - 1; /* We already read the first one! */
if (dataSize > 1024) {
! fprintf(stderr, "readRel() Error: dataSize = %" PRId32 " > 1024! Increase and recompile!\n",
dataSize);
return -1;
***************
*** 387,391 ****
printf("\n");
if (L->numRels > L->maxRels) {
! fprintf(stderr, "readRelList() Error: File contains %ld relations vs. maxRels=%ld\n",
L->numRels, L->maxRels);
fclose(fp);
--- 387,391 ----
printf("\n");
if (L->numRels > L->maxRels) {
! fprintf(stderr, "readRelList() Error: File contains %" PRId32 " relations vs. maxRels=%" PRId32 "\n",
L->numRels, L->maxRels);
fclose(fp);
***************
*** 425,429 ****
}
if (size >= L->maxDataSize) {
! fprintf(stderr, " (read %ld of %ld relations).\n", relsRead, L->numRels);
L->numRels = relsRead;
fprintf(stderr, "readRelList() Error: L->relData is not large enough to handle %s!\n", fname);
--- 425,429 ----
}
if (size >= L->maxDataSize) {
! fprintf(stderr, " (read %" PRId32 " of %" PRId32 " relations).\n", relsRead, L->numRels);
L->numRels = relsRead;
fprintf(stderr, "readRelList() Error: L->relData is not large enough to handle %s!\n", fname);
***************
*** 527,531 ****
R->p[numLarge++] = pFacts[i];
} else {
! fprintf(stderr, "%lu\n", p);
return -177;
}
--- 527,531 ----
R->p[numLarge++] = pFacts[i];
} else {
! fprintf(stderr, "%" PRId32 "\n", p);
return -177;
}
***************
*** 779,783 ****
R->p[numLarge++] = pFacts[i];
} else {
! fprintf(stderr, "%lu\n", pFacts[i]);
return -177;
}
--- 779,783 ----
R->p[numLarge++] = pFacts[i];
} else {
! fprintf(stderr, "%" PRId32 "\n", pFacts[i]);
return -177;
}
***************
*** 1152,1156 ****
a = R->a; b = R->b;
mpz_mul_si64(temp2,FB->y1,a);
! //printf("a = %I64d\n", a );
//gmp_printf("y1*a=%Zd\n", temp2 );
--- 1152,1156 ----
a = R->a; b = R->b;
mpz_mul_si64(temp2,FB->y1,a);
! //printf("a = %" PRId64 "\n", a );
//gmp_printf("y1*a=%Zd\n", temp2 );
***************
*** 1251,1255 ****
R->p[numLarge++] = pFacts[i];
} else {
! fprintf(stderr, "%lu (numLarge=%d)\n", pFacts[i], numLarge);
return -177;
}
--- 1251,1255 ----
R->p[numLarge++] = pFacts[i];
} else {
! fprintf(stderr, "%" PRId32 " (numLarge=%d)\n", pFacts[i], numLarge);
return -177;
}
***************
*** 1357,1367 ****
mpz_set_ui(norm, 1);
} else {
! printf("Algebraic failure: (%I64d, %ld)\n", R->a, R->b);
printf(" leftover norm is: "); mpz_out_str(stdout, 10, norm); printf("\n");
printf("The following were the siever-supplied primes (norms):\n");
for (i=0; i<R->aFSize; i++)
! printf("%lx (%ld) ", R->aFactors[i], FB->afb[2*R->aFactors[i]]);
for (i=0; i<MAX_LARGE_ALG_PRIMES; i++)
! printf("(%ld)", R->a_p[i]);
printf("\n");
return -293;
--- 1357,1367 ----
mpz_set_ui(norm, 1);
} else {
! printf("Algebraic failure: (%" PRId64 ", %" PRId32 ")\n", R->a, R->b);
printf(" leftover norm is: "); mpz_out_str(stdout, 10, norm); printf("\n");
printf("The following were the siever-supplied primes (norms):\n");
for (i=0; i<R->aFSize; i++)
! printf("%" PRIx32 " (%" PRId32 ") ", R->aFactors[i], FB->afb[2*R->aFactors[i]]);
for (i=0; i<MAX_LARGE_ALG_PRIMES; i++)
! printf("(%" PRId32 ")", R->a_p[i]);
printf("\n");
return -293;
***************
*** 1377,1381 ****
/* Find this factor in the AFB. */
p = pFacts[i];
! if ((u32)p> (u32)FB->maxP_a) { fprintf(stderr, "%lu\n", p); return -1923; }
/* Find the corresponding 'r': */
if (R->b%p==0) r=p; /* prime @ infty. */
--- 1377,1381 ----
/* Find this factor in the AFB. */
p = pFacts[i];
! if ((u32)p> (u32)FB->maxP_a) { fprintf(stderr, "%" PRId32 "\n", p); return -1923; }
/* Find the corresponding 'r': */
if (R->b%p==0) r=p; /* prime @ infty. */
***************
*** 1456,1465 ****
char s[128];
! sprintf(str, "%I64d,%ld:", R->a, R->b);
for (i=0; i<R->rFSize; i++) {
if (R->rFactors[i] >= CLIENT_SKIP_R_PRIMES) {
if (numR==0)
! sprintf(s, "%lx", FB->rfb[2*R->rFactors[i]]);
! else sprintf(s, ",%lx", FB->rfb[2*R->rFactors[i]]);
strcat(str, s);
numR++;
--- 1456,1465 ----
char s[128];
! sprintf(str, "%" PRId64 ",%" PRId32 ":", R->a, R->b);
for (i=0; i<R->rFSize; i++) {
if (R->rFactors[i] >= CLIENT_SKIP_R_PRIMES) {
if (numR==0)
! sprintf(s, "%" PRIx32, FB->rfb[2*R->rFactors[i]]);
! else sprintf(s, ",%" PRIx32, FB->rfb[2*R->rFactors[i]]);
strcat(str, s);
numR++;
***************
*** 1469,1475 ****
if (R->p[i] > 1) {
if (numR>0)
! sprintf(s, ",%lx", R->p[i]);
else
! sprintf(s, "%lx", R->p[i]);
strcat(str, s);
numR++;
--- 1469,1475 ----
if (R->p[i] > 1) {
if (numR>0)
! sprintf(s, ",%" PRIx32, R->p[i]);
else
! sprintf(s, "%" PRIx32, R->p[i]);
strcat(str, s);
numR++;
***************
*** 1480,1485 ****
if (R->aFactors[i] >= CLIENT_SKIP_A_PRIMES) {
if (numA==0)
! sprintf(s, "%lx", FB->afb[2*R->aFactors[i]]);
! else sprintf(s, ",%lx", FB->afb[2*R->aFactors[i]]);
strcat(str, s);
numA++;
--- 1480,1485 ----
if (R->aFactors[i] >= CLIENT_SKIP_A_PRIMES) {
if (numA==0)
! sprintf(s, "%" PRIx32, FB->afb[2*R->aFactors[i]]);
! else sprintf(s, ",%" PRIx32, FB->afb[2*R->aFactors[i]]);
strcat(str, s);
numA++;
***************
*** 1490,1496 ****
if (R->a_p[i] > 1) {
if (numA>0)
! sprintf(s, ",%lx", R->a_p[i]);
else
! sprintf(s, "%lx", R->a_p[i]);
strcat(str, s);
numA++;
--- 1490,1496 ----
if (R->a_p[i] > 1) {
if (numA>0)
! sprintf(s, ",%" PRIx32, R->a_p[i]);
else
! sprintf(s, "%" PRIx32, R->a_p[i]);
strcat(str, s);
numA++;
***************
*** 1539,1543 ****
afb[j]=0; i++;
! if (sscanf(ab, "%I64d,%ld", &R->a, &R->b) != 2) return -1;
/* Rational primes: */
--- 1539,1543 ----
afb[j]=0; i++;
! if (sscanf(ab, "%" SCNd64 ",%" SCNd32, &R->a, &R->b) != 2) return -1;
/* Rational primes: */
***************
*** 1546,1550 ****
R->rFSize=0; j=0;
size = strlen(rfb);
! while ((j<size)&&(sscanf(rfb+j,"%lx", &p)==1)) {
k = lookupRFB(p, FB);
if (k>=0) {
--- 1546,1550 ----
R->rFSize=0; j=0;
size = strlen(rfb);
! while ((j<size)&&(sscanf(rfb+j,"%" SCNd32, &p)==1)) {
k = lookupRFB(p, FB);
if (k>=0) {
***************
*** 1564,1568 ****
R->aFSize=0; j=0;
size = strlen(afb);
! while ((j<size) && (sscanf(afb+j,"%lx", &p)==1)) {
if (R->b % p) {
r = mulmod32(p+(R->a%p), inverseModP(R->b, p), p);
--- 1564,1568 ----
R->aFSize=0; j=0;
size = strlen(afb);
! while ((j<size) && (sscanf(afb+j,"%" SCNd32, &p)==1)) {
if (R->b % p) {
r = mulmod32(p+(R->a%p), inverseModP(R->b, p), p);
Index: procrels.c
===================================================================
RCS file: /cvsroot/ggnfs/branch_0/src/procrels.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** procrels.c 12 Jun 2005 19:37:42 -0000 1.2
--- procrels.c 17 Jul 2005 10:01:46 -0000 1.3
***************
*** 179,188 ****
/* Now allocate for the relations. */
if (!(RL->relData = (s32 *)malloc(RL->maxDataSize * sizeof(s32)))) {
! fprintf(stderr, "Error allocating %ldMB for reading relation list!\n",
RL->maxDataSize * sizeof(s32)/1048576);
free(RL); return NULL;
}
if (!(RL->relIndex = (s32 *)malloc(RL->maxRels * sizeof(s32)))) {
! fprintf(stderr, "Error allocating %ldMB for relation pointers!\n",
RL->maxRels * sizeof(s32)/1048576);
free(RL->relData); free(RL);
--- 179,188 ----
/* Now allocate for the relations. */
if (!(RL->relData = (s32 *)malloc(RL->maxDataSize * sizeof(s32)))) {
! fprintf(stderr, "Error allocating %luMB for reading relation list!\n",
RL->maxDataSize * sizeof(s32)/1048576);
free(RL); return NULL;
}
if (!(RL->relIndex = (s32 *)malloc(RL->maxRels * sizeof(s32)))) {
! fprintf(stderr, "Error allocating %luMB for relation pointers!\n",
RL->maxRels * sizeof(s32)/1048576);
free(RL->relData); free(RL);
***************
*** 219,223 ****
s32 size;
char outputStr[1024], str[128];
! long bufMax, bufIndex, *buf;
relation_t R;
FILE *afp, *rfp;
--- 219,223 ----
s32 size;
char outputStr[1024], str[128];
! s32 bufMax, bufIndex, *buf;
relation_t R;
FILE *afp, *rfp;
***************
*** 243,247 ****
}
numRemove = (long)((removeFrac*RL->numRels))-1;
! printf("from %ld to %ld relations...",RL->numRels, RL->numRels-numRemove);
/* We proceed by modifying numBySize so that it contains the
number of relations we will keep with the given size.
--- 243,247 ----
}
numRemove = (long)((removeFrac*RL->numRels))-1;
! printf("from %" PRId32 " to %ld relations...",RL->numRels, RL->numRels-numRemove);
/* We proceed by modifying numBySize so that it contains the
number of relations we will keep with the given size.
***************
*** 381,385 ****
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);
--- 381,385 ----
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);
***************
*** 432,441 ****
lASize = sortRMDups2(lA, lASize);
printf("Done.\n");
! printf("Found %ld distinct large rprimes and %ld large aprimes so far.\n",lRSize, lASize);
}
! printf("There are %ld large primes versus %ld relations.\n",
lRSize+lASize, initialRelations);
! msgLog(NULL, "largePrimes: %ld , relations: %ld", lRSize+lASize, initialRelations);
/* Now, check: should we do a cycle count? */
free(lA); free(lR);
--- 432,442 ----
lASize = sortRMDups2(lA, lASize);
printf("Done.\n");
! printf("Found %" PRId32 " distinct large rprimes and %" PRId32 " large aprimes so far.\n",lRSize, lASize);
}
! printf("There are %" PRId32 " large primes versus %" PRId32 " relations.\n",
lRSize+lASize, initialRelations);
! msgLog(NULL, "largePrimes: %" PRId32 " , relations: %" PRId32,
! lRSize+lASize, initialRelations);
/* Now, check: should we do a cycle count? */
free(lA); free(lR);
***************
*** 477,481 ****
/* CJM, 129/04 : Consider making this MAX(i, DEFAULT_NUM_FILES); */
prelF->numFiles = MAX(i, 1);
! printf("Largest prel file size is %ld versus max allowed of %ld.\n",
maxSize, maxFileSize);
if ((maxSize < maxFileSize)||(takeAction==0))
--- 478,482 ----
/* CJM, 129/04 : Consider making this MAX(i, DEFAULT_NUM_FILES); */
prelF->numFiles = MAX(i, 1);
! printf("Largest prel file size is %" PRId32 " versus max allowed of %" PRId32 ".\n",
maxSize, maxFileSize);
if ((maxSize < maxFileSize)||(takeAction==0))
***************
*** 504,508 ****
for (i=0; i<prelF->numFiles; i++) {
RL = getRelList(prelF, i);
! printf("Read %ld relations from %s.%d\n", RL->numRels, prelF->prefix, i);
for (k=0; k<RL->numRels; k++) {
--- 505,509 ----
for (i=0; i<prelF->numFiles; i++) {
RL = getRelList(prelF, i);
! printf("Read %" PRId32 " relations from %s.%d\n", RL->numRels, prelF->prefix, i);
for (k=0; k<RL->numRels; k++) {
***************
*** 612,616 ****
RL->maxDataSize = 1000 + maxSize/sizeof(s32);
if (!(RL->relData = (s32 *)malloc(RL->maxDataSize * sizeof(s32)))) {
! 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");
--- 613,617 ----
RL->maxDataSize = 1000 + maxSize/sizeof(s32);
if (!(RL->relData = (s32 *)malloc(RL->maxDataSize * sizeof(s32)))) {
! 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");
***************
*** 620,624 ****
RL->maxRels = (u32)RL->maxDataSize/20;
if (!(RL->relIndex = (s32 *)malloc(RL->maxRels * sizeof(s32)))) {
! fprintf(stderr, "Error allocating %ldMB for relation pointers!\n",
RL->maxRels * sizeof(s32)/1048756);
free(RL->relData);
--- 621,625 ----
RL->maxRels = (u32)RL->maxDataSize/20;
if (!(RL->relIndex = (s32 *)malloc(RL->maxRels * sizeof(s32)))) {
! fprintf(stderr, "Error allocating %luMB for relation pointers!\n",
RL->maxRels * sizeof(s32)/1048756);
free(RL->relData);
***************
*** 1035,1039 ****
total = makeABLookup(prelF);
! printf("Before processing new relations, there are %ld total.\n", total);
/* Set up to prepare for the new data: */
--- 1036,1040 ----
total = makeABLookup(prelF);
! printf("Before processing new relations, there are %" PRId32 " total.\n", total);
/* Set up to prepare for the new data: */
***************
*** 1181,1185 ****
numRead++;
! // printf("Read (%I64d, %ld) from file\n", R.a, R.b );
if (checkAB(R.a, R.b)==0) {
--- 1182,1186 ----
numRead++;
! // printf("Read (%" PRId64 ", %ld) from file\n", R.a, R.b );
if (checkAB(R.a, R.b)==0) {
***************
*** 1226,1230 ****
} else {
#ifdef _DEBUG
! printf("Relation (%I64d, %ld) bad : return value %d.\n", R.a, R.b, factRes);
#endif
;
--- 1227,1231 ----
} else {
#ifdef _DEBUG
! printf("Relation (%" PRId64 ", %ld) bad : return value %d.\n", R.a, R.b, factRes);
#endif
;
***************
*** 1280,1285 ****
free(newData[i]);
clearABLookup();
! printf(" abExtra was sorted %ld times.\n", sortOps);
! msgLog("", "There were %ld/%ld duplicates.", collisions, numRead);
total += numNew;
return total;
--- 1281,1287 ----
free(newData[i]);
clearABLookup();
! printf(" abExtra was sorted %" PRId32 " times.\n", sortOps);
! msgLog("", "There were %" PRId32 "/%" PRId32 " duplicates.",
! collisions, numRead);
total += numNew;
return total;
***************
*** 1312,1316 ****
RL = getRelList(prelF, i);
numRels = RL->numRels;
! printf("Dumping %ld relations from %s...\n", numRels, prelName);
for (j=0; j<numRels; j++) {
dataConvertToRel(&R, &RL->relData[RL->relIndex[j]]);
--- 1314,1318 ----
RL = getRelList(prelF, i);
numRels = RL->numRels;
! printf("Dumping %" PRId32 " relations from %s...\n", numRels, prelName);
for (j=0; j<numRels; j++) {
dataConvertToRel(&R, &RL->relData[RL->relIndex[j]]);
***************
*** 1331,1335 ****
}
fclose(ofp);
! printf("Dumped %ld relations to %s.\n", total, fName);
return total;
}
--- 1333,1337 ----
}
fclose(ofp);
! printf("Dumped %" PRId32 " relations to %s.\n", total, fName);
return total;
}
***************
*** 1341,1346 ****
int res, i, n;
! sscanf(line, "%I64d,%ld", &R.a, &R.b);
! printf("Attempting to factor relation (%I64d, %ld)\n", R.a, R.b);
if (R.b <= 0) {
printf("Error: 'b' should be positive!\n");
--- 1343,1348 ----
int res, i, n;
! sscanf(line, "%" SCNd64 ",%" SCNd32, &R.a, &R.b);
! printf("Attempting to factor relation (%" PRId64 ", %" PRId32 ")\n", R.a, R.b);
if (R.b <= 0) {
printf("Error: 'b' should be positive!\n");
***************
*** 1351,1355 ****
printf("RFB:\n");
for (i=0; i<R.rFSize; i++) {
! printf("(%ld)^%d ", N->FB->rfb[2*R.rFactors[i]], R.rExps[i]);
if (i%6==5) printf("\n");
}
--- 1353,1357 ----
printf("RFB:\n");
for (i=0; i<R.rFSize; i++) {
! printf("(%" PRId32 ")^%d ", N->FB->rfb[2*R.rFactors[i]], R.rExps[i]);
if (i%6==5) printf("\n");
}
***************
*** 1357,1366 ****
for (i=0; i<MAX_LARGE_RAT_PRIMES; i++) {
if (R.p[i]>1)
! printf("%ld ", R.p[i]);
}
printf("\nAFB:\n");
for (i=0; i<R.aFSize; i++) {
! printf("(%ld,%ld)^%d ", N->FB->afb[2*R.aFactors[i]],
N->FB->afb[2*R.aFactors[i]+1], R.aExps[i]);
if (i%6==5) printf("\n");
--- 1359,1368 ----
for (i=0; i<MAX_LARGE_RAT_PRIMES; i++) {
if (R.p[i]>1)
! printf("%" PRId32 " ", R.p[i]);
}
printf("\nAFB:\n");
for (i=0; i<R.aFSize; i++) {
! printf("(%" PRId32 ",%" PRId32 ")^%d ", N->FB->afb[2*R.aFactors[i]],
N->FB->afb[2*R.aFactors[i]+1], R.aExps[i]);
if (i%6==5) printf("\n");
***************
*** 1369,1373 ****
for (i=0; i<MAX_LARGE_ALG_PRIMES; i++) {
if (R.a_p[i]>1)
! printf("(%ld, %ld) ", R.a_p[i], R.a_r[i]);
}
printf("Special primes:\n");
--- 1371,1375 ----
for (i=0; i<MAX_LARGE_ALG_PRIMES; i++) {
if (R.a_p[i]>1)
! printf("(%" PRId32 ", %" PRId32 ") ", R.a_p[i], R.a_r[i]);
}
printf("Special primes:\n");
***************
*** 1380,1384 ****
printf("\n");
}
! printf("QCB entries: %8.8lx %8.8lx\n", R.qcbBits[0], R.qcbBits[1]);
return 0;
}
--- 1382,1386 ----
printf("\n");
}
! printf("QCB entries: %8.8" PRIx32 " %8.8" PRIx32 "\n", R.qcbBits[0], R.qcbBits[1]);
return 0;
}
***************
*** 1466,1470 ****
}
now=sTime();
! printf("b[a%%1024] = %8.8lx\n", b[a%1024]); /* So the compiler doesn't remove the loop above! */
printf("timeunit: %1.3lf\n",10.0/(now-start));
exit(0);
--- 1468,1472 ----
}
now=sTime();
! printf("b[a%%1024] = %8.8" PRIx32 "\n", b[a%1024]); /* So the compiler doesn't remove the loop above! */
printf("timeunit: %1.3lf\n",10.0/(now-start));
exit(0);
***************
*** 1564,1568 ****
fclose(fp);
}
! printf(" New file appears to have %ld relations.\n", numNewRels);
}
--- 1566,1570 ----
fclose(fp);
}
! printf(" New file appears to have %" PRId32 " relations.\n", numNewRels);
}
***************
*** 1575,1579 ****
printf("--------------------------------------\n");
! printf("There are now a total of %ld unique relations in %d files.\n",
totalRels, prelF.numFiles);
initialRelations = totalRels;
--- 1577,1581 ----
printf("--------------------------------------\n");
! printf("There are now a total of %" PRId32 " unique relations in %d files.\n",
totalRels, prelF.numFiles);
initialRelations = totalRels;
Index: clsieve.c
===================================================================
RCS file: /cvsroot/ggnfs/branch_0/src/clsieve.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** clsieve.c 9 Jul 2005 14:20:57 -0000 1.4
--- clsieve.c 17 Jul 2005 10:01:37 -0000 1.5
***************
*** 436,460 ****
msgLog("", "");
! msgLog("", "hashtable: %d bins of size %d", conf.block_window, BLOCK_SIZE);
! msgLog("", "hashtable cache: %d entries per bin", conf.cache_max);
msgLog("", "Rational factor base:");
msgLog("", "base of logs: %4.3f", FB->rfb_log_base);
! msgLog("", "factor base entries: %d (%3.1f MB)", conf.rfb_size,
(double)conf.rfb_size*sizeof(sieve_fb_t)/1e6);
! msgLog("", "maximum factor base prime: %d", FB->rLim);
! msgLog("", "primes at infinity: %d", conf.rfb_inf_size);
! msgLog("", "hashed RFB entries: %d (%3.1f%%, max=%d)",
conf.rfb_size-conf.med_rfb_size,
100.0*(conf.rfb_size-conf.med_rfb_size)/conf.rfb_size,
conf.rfb[conf.rfb_size-1].p);
! msgLog("", "sieved RFB entries: %d (%3.3f%%, max=%d)",
conf.med_rfb_size-conf.tiny_rfb_size,
100.0*(conf.med_rfb_size-conf.tiny_rfb_size)/conf.rfb_size,
conf.rfb[conf.med_rfb_size-1].p);
! msgLog("", "unsieved RFB entries: %d", conf.tiny_rfb_size);
! msgLog("", "large prime cutoff: %d bits", mpz_sizeinbase(conf.LP1_max_r,2)-1);
! msgLog("", "trial factoring cutoff: %d bits",
(s32)(conf.cutoff2_r*M_LOG2E*FB->log_rlb)-1);
! msgLog("", "2-large prime cutoff: %d-%d bits",
mpz_sizeinbase(conf.LP2_min_r,2)-1,
mpz_sizeinbase(conf.LP2_max_r,2)-1);
--- 436,460 ----
msgLog("", "");
! msgLog("", "hashtable: %" PRId32 " bins of size %d", conf.block_window, BLOCK_SIZE);
! msgLog("", "hashtable cache: %" PRId32 " entries per bin", conf.cache_max);
msgLog("", "Rational factor base:");
msgLog("", "base of logs: %4.3f", FB->rfb_log_base);
! msgLog("", "factor base entries: %" PRId32 " (%3.1f MB)", conf.rfb_size,
(double)conf.rfb_size*sizeof(sieve_fb_t)/1e6);
! msgLog("", "maximum factor base prime: %" PRId32, FB->rLim);
! msgLog("", "primes at infinity: %" PRId32, conf.rfb_inf_size);
! msgLog("", "hashed RFB entries: %" PRId32 " (%3.1f%%, max=%" PRId32 ")",
conf.rfb_size-conf.med_rfb_size,
100.0*(conf.rfb_size-conf.med_rfb_size)/conf.rfb_size,
conf.rfb[conf.rfb_size-1].p);
! msgLog("", "sieved RFB entries: %" PRId32 " (%3.3f%%, max=%" PRId32 ")",
conf.med_rfb_size-conf.tiny_rfb_size,
100.0*(conf.med_rfb_size-conf.tiny_rfb_size)/conf.rfb_size,
conf.rfb[conf.med_rfb_size-1].p);
! msgLog("", "unsieved RFB entries: %" PRId32, conf.tiny_rfb_size);
! msgLog("", "large prime cutoff: %lu bits", mpz_sizeinbase(conf.LP1_max_r,2)-1);
! msgLog("", "trial factoring cutoff: %" PRId32 " bits",
(s32)(conf.cutoff2_r*M_LOG2E*FB->log_rlb)-1);
! msgLog("", "2-large prime cutoff: %lu-%lu bits",
mpz_sizeinbase(conf.LP2_min_r,2)-1,
mpz_sizeinbase(conf.LP2_max_r,2)-1);
***************
*** 462,482 ****
msgLog("", "Algebraic factor base:");
msgLog("", "base of logs: %4.3f", FB->afb_log_base);
! msgLog("", "factor base entries: %d (%3.1f MB)", conf.afb_size,
(double)conf.afb_size*sizeof(sieve_fb_t)/1e6);
! msgLog("", "maximum factor base prime: %d", FB->aLim);
! msgLog("", "primes at infinity: %d", conf.afb_inf_size);
! msgLog("", "hashed AFB entries: %d (%3.1f%%, max=%d)",
conf.afb_size-conf.med_afb_size,
100.0*(conf.afb_size-conf.med_afb_size)/conf.afb_size,
conf.afb[conf.afb_size-1].p);
! msgLog("", "sieved AFB entries: %d (%3.3f%%, max=%d)",
conf.med_afb_size-conf.tiny_afb_size,
100.0*(conf.med_afb_size-conf.tiny_afb_size)/conf.afb_size,
conf.afb[conf.med_afb_size-1].p);
! msgLog("", "unsieved AFB entries: %d", conf.tiny_afb_size);
! msgLog("", "large prime cutoff: %d bits", mpz_sizeinbase(conf.LP1_max_a,2)-1);
! msgLog("", "trial factoring cutoff: %d bits",
(s32)(conf.cutoff2_a*M_LOG2E*FB->log_alb)-1);
! msgLog("", "2-large prime cutoff: %d-%d bits",
mpz_sizeinbase(conf.LP2_min_a,2)-1,
mpz_sizeinbase(conf.LP2_max_a,2)-1);
--- 462,482 ----
msgLog("", "Algebraic factor base:");
msgLog("", "base of logs: %4.3f", FB->afb_log_base);
! msgLog("", "factor base entries: %" PRId32 " (%3.1f MB)", conf.afb_size,
(double)conf.afb_size*sizeof(sieve_fb_t)/1e6);
! msgLog("", "maximum factor base prime: %" PRId32, FB->aLim);
! msgLog("", "primes at infinity: %" PRId32, conf.afb_inf_size);
! msgLog("", "hashed AFB entries: %" PRId32 " (%3.1f%%, max=%" PRId32 ")",
conf.afb_size-conf.med_afb_size,
100.0*(conf.afb_size-conf.med_afb_size)/conf.afb_size,
conf.afb[conf.afb_size-1].p);
! msgLog("", "sieved AFB entries: %" PRId32 " (%3.3f%%, max=%" PRId32 ")",
conf.med_afb_size-conf.tiny_afb_size,
100.0*(conf.med_afb_size-conf.tiny_afb_size)/conf.afb_size,
conf.afb[conf.med_afb_size-1].p);
! msgLog("", "unsieved AFB entries: %" PRId32, conf.tiny_afb_size);
! msgLog("", "large prime cutoff: %lu bits", mpz_sizeinbase(conf.LP1_max_a,2)-1);
! msgLog("", "trial factoring cutoff: %" PRId32 " bits",
(s32)(conf.cutoff2_a*M_LOG2E*FB->log_alb)-1);
! msgLog("", "2-large prime cutoff: %lu-%lu bits",
mpz_sizeinbase(conf.LP2_min_a,2)-1,
mpz_sizeinbase(conf.LP2_max_a,2)-1);
***************
*** 613,617 ****
}
}
! msgLog("", "Classical sieved [%ld, %ld]x[%ld, %ld]",
-conf->sieve_size, conf->sieve_size, b0, i-1);
flushSavefile(conf);
--- 613,617 ----
}
}
! msgLog("", "Classical sieved [%" PRId32 ", %" PRId32 "]x[%" PRId32 ", %" PRId32 "]",
-conf->sieve_size, conf->sieve_size, b0, i-1);
flushSavefile(conf);
***************
*** 1954,1962 ****
char s[128];
! sprintf(str, "%ld,%ld:", (int)R->a, (int)R->b);
for (i=0; i<R->rFSize; i++) {
if (numR==0)
! sprintf(s, "%lx", R->rFactors[i]);
! else sprintf(s, ",%lx", R->rFactors[i]);
strcat(str, s);
numR++;
--- 1954,1962 ----
char s[128];
! sprintf(str, "%" PRId64 ",%" PRId32 ":", R->a, R->b);
for (i=0; i<R->rFSize; i++) {
if (numR==0)
! sprintf(s, "%" PRIx32, R->rFactors[i]);
! else sprintf(s, ",%" PRIx32 "", R->rFactors[i]);
strcat(str, s);
numR++;
***************
*** 1965,1971 ****
if (R->p[i] > 1) {
if (numR>0)
! sprintf(s, ",%lx", R->p[i]);
else
! sprintf(s, "%lx", R->p[i]);
strcat(str, s);
numR++;
--- 1965,1971 ----
if (R->p[i] > 1) {
if (numR>0)
! sprintf(s, ",%" PRIx32 "", R->p[i]);
else
! sprintf(s, "%" PRIx32 "", R->p[i]);
strcat(str, s);
numR++;
***************
*** 1975,1980 ****
for (i=0; i<R->aFSize; i++) {
if (numA==0)
! sprintf(s, "%lx", R->aFactors[i]);
! else sprintf(s, ",%lx", R->aFactors[i]);
strcat(str, s);
numA++;
--- 1975,1980 ----
for (i=0; i<R->aFSize; i++) {
if (numA==0)
! sprintf(s, "%" PRIx32 "", R->aFactors[i]);
! else sprintf(s, ",%" PRIx32 "", R->aFactors[i]);
strcat(str, s);
numA++;
***************
*** 1983,1989 ****
if (R->a_p[i] > 1) {
if (numA>0)
! sprintf(s, ",%lx", R->a_p[i]);
else
! sprintf(s, "%lx", R->a_p[i]);
strcat(str, s);
numA++;
--- 1983,1989 ----
if (R->a_p[i] > 1) {
if (numA>0)
! sprintf(s, ",%" PRIx32 "", R->a_p[i]);
else
! sprintf(s, "%" PRIx32 "", R->a_p[i]);
strcat(str, s);
numA++;
Index: makefb.c
===================================================================
RCS file: /cvsroot/ggnfs/branch_0/src/makefb.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** makefb.c 8 Jun 2005 19:47:02 -0000 1.1.1.1
--- makefb.c 17 Jul 2005 10:01:45 -0000 1.2
***************
*** 290,306 ****
msgLog("", "name: %s", FB->name);
mpz_get_str(str, 10, FB->n);
! msgLog("", "n=%s (%d digits)", str, strlen(str));
for (i=0; i<=FB->f->degree; i++) {
mpz_get_str(str, 10, &FB->f->coef[i]);
msgLog("", "c%d: %s", i, str);
}
! msgLog("", "RFBsize: %ld (upto %ld)", FB->rfb_size,
FB->rfb[2*(FB->rfb_size-1)]);
! msgLog("", "AFBsize: %ld (upto %ld)", FB->afb_size,
FB->afb[2*(FB->afb_size-1)]);
msgLog("", "maxNumLargeRatPrimes: %d", FB->maxLP);
! msgLog("", "maxLargeRatPrime: %ld", FB->maxP_r);
msgLog("", "maxNumLargeAlgPrimes: %d", FB->maxLPA);
! msgLog("", "maxLargeAlgPrime: %ld", FB->maxP_a);
--- 290,306 ----
msgLog("", "name: %s", FB->name);
mpz_get_str(str, 10, FB->n);
! msgLog("", "n=%s (%ld digits)", str, strlen(str));
for (i=0; i<=FB->f->degree; i++) {
mpz_get_str(str, 10, &FB->f->coef[i]);
msgLog("", "c%d: %s", i, str);
}
! msgLog("", "RFBsize: %" PRId32 " (upto %" PRId32 ")", FB->rfb_size,
FB->rfb[2*(FB->rfb_size-1)]);
! msgLog("", "AFBsize: %" PRId32 " (upto %" PRId32 ")", FB->afb_size,
FB->afb[2*(FB->afb_size-1)]);
msgLog("", "maxNumLargeRatPrimes: %d", FB->maxLP);
! msgLog("", "maxLargeRatPrime: %" PRId32, FB->maxP_r);
msgLog("", "maxNumLargeAlgPrimes: %d", FB->maxLPA);
! msgLog("", "maxLargeAlgPrime: %" PRId32, FB->maxP_a);
|