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] |