Ignore:
Timestamp:
Feb 29, 2012 2:53:03 AM (8 years ago)
Author:
kulshres
Message:

convert tape stats to size_t from uint

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/src/taping.c

    r275 r294  
    10491049
    10501050    /* Leave space for the stats */
    1051     space = STAT_SIZE * sizeof(uint) + sizeof(ADOLC_ID);
     1051    space = STAT_SIZE * sizeof(size_t) + sizeof(ADOLC_ID);
    10521052    if (space > statSpace * sizeof(locint))
    10531053        fail(ADOLC_MORE_STAT_SPACE_REQUIRED);
     
    11151115        free(ADOLC_CURRENT_TAPE_INFOS.opBuffer);
    11161116        ADOLC_CURRENT_TAPE_INFOS.opBuffer = NULL;
    1117     } else ADOLC_CURRENT_TAPE_INFOS.numOps_Tape =
    1118         ADOLC_CURRENT_TAPE_INFOS.currOp - ADOLC_CURRENT_TAPE_INFOS.opBuffer;
     1117    } else {
     1118        ADOLC_CURRENT_TAPE_INFOS.numOps_Tape =
     1119            ADOLC_CURRENT_TAPE_INFOS.currOp - ADOLC_CURRENT_TAPE_INFOS.opBuffer;
     1120    }
    11191121    ADOLC_CURRENT_TAPE_INFOS.stats[NUM_OPERATIONS] =
    11201122        ADOLC_CURRENT_TAPE_INFOS.numOps_Tape;
     
    11331135        free(ADOLC_CURRENT_TAPE_INFOS.valBuffer);
    11341136        ADOLC_CURRENT_TAPE_INFOS.valBuffer = NULL;
    1135     } else ADOLC_CURRENT_TAPE_INFOS.numVals_Tape =
    1136         ADOLC_CURRENT_TAPE_INFOS.currVal - ADOLC_CURRENT_TAPE_INFOS.valBuffer;
     1137    } else {
     1138        ADOLC_CURRENT_TAPE_INFOS.numVals_Tape =
     1139            ADOLC_CURRENT_TAPE_INFOS.currVal - ADOLC_CURRENT_TAPE_INFOS.valBuffer;
     1140    }
    11371141    ADOLC_CURRENT_TAPE_INFOS.stats[NUM_VALUES] =
    11381142        ADOLC_CURRENT_TAPE_INFOS.numVals_Tape;
     
    11521156        fwrite(&adolc_id, sizeof(ADOLC_ID), 1,
    11531157                ADOLC_CURRENT_TAPE_INFOS.loc_file);
    1154         fwrite(ADOLC_CURRENT_TAPE_INFOS.stats, STAT_SIZE * sizeof(uint), 1,
     1158        fwrite(ADOLC_CURRENT_TAPE_INFOS.stats, STAT_SIZE * sizeof(size_t), 1,
    11551159               ADOLC_CURRENT_TAPE_INFOS.loc_file);
    11561160        fclose(ADOLC_CURRENT_TAPE_INFOS.loc_file);
     
    11581162        free(ADOLC_CURRENT_TAPE_INFOS.locBuffer);
    11591163        ADOLC_CURRENT_TAPE_INFOS.locBuffer = NULL;
    1160     } else ADOLC_CURRENT_TAPE_INFOS.numLocs_Tape  =
    1161         ADOLC_CURRENT_TAPE_INFOS.currLoc - ADOLC_CURRENT_TAPE_INFOS.locBuffer;
    1162     ADOLC_CURRENT_TAPE_INFOS.stats[NUM_LOCATIONS] =
    1163         ADOLC_CURRENT_TAPE_INFOS.numLocs_Tape;
     1164    } else {
     1165        ADOLC_CURRENT_TAPE_INFOS.numLocs_Tape  =
     1166            ADOLC_CURRENT_TAPE_INFOS.currLoc - ADOLC_CURRENT_TAPE_INFOS.locBuffer;
     1167        ADOLC_CURRENT_TAPE_INFOS.stats[NUM_LOCATIONS] =
     1168            ADOLC_CURRENT_TAPE_INFOS.numLocs_Tape;
     1169    }
    11641170}
    11651171
     
    12121218/* tape_stat[10]= value file access flag (1 = file in use, 0 otherwise)     */
    12131219/****************************************************************************/
    1214 void tapestats(short tag, int *tape_stats) {
     1220void tapestats(short tag, size_t *tape_stats) {
    12151221    int i;
    12161222    TapeInfos *tapeInfos;
     
    12271233/****************************************************************************/
    12281234void printTapeStats(FILE *stream, short tag) {
    1229     int stats[STAT_SIZE];
    1230 
    1231     tapestats(tag, (int *)&stats);
     1235    size_t stats[STAT_SIZE];
     1236
     1237    tapestats(tag, (size_t *)&stats);
    12321238    fprintf(stream, "\n*** TAPE STATS (tape %d) **********\n", (int)tag);
    1233     fprintf(stream, "Number of independents: %10d\n", stats[NUM_INDEPENDENTS]);
    1234     fprintf(stream, "Number of dependents:   %10d\n", stats[NUM_DEPENDENTS]);
     1239    fprintf(stream, "Number of independents: %10zd\n", stats[NUM_INDEPENDENTS]);
     1240    fprintf(stream, "Number of dependents:   %10zd\n", stats[NUM_DEPENDENTS]);
    12351241    fprintf(stream, "\n");
    1236     fprintf(stream, "Max # of live adoubles: %10d\n", stats[NUM_MAX_LIVES]);
    1237     fprintf(stream, "Taylor stack size:      %10d\n", stats[TAY_STACK_SIZE]);
     1242    fprintf(stream, "Max # of live adoubles: %10zd\n", stats[NUM_MAX_LIVES]);
     1243    fprintf(stream, "Taylor stack size:      %10zd\n", stats[TAY_STACK_SIZE]);
    12381244    fprintf(stream, "\n");
    1239     fprintf(stream, "Number of operations:   %10d\n", stats[NUM_OPERATIONS]);
    1240     fprintf(stream, "Number of locations:    %10d\n", stats[NUM_LOCATIONS]);
    1241     fprintf(stream, "Number of values:       %10d\n", stats[NUM_VALUES]);
     1245    fprintf(stream, "Number of operations:   %10zd\n", stats[NUM_OPERATIONS]);
     1246    fprintf(stream, "Number of locations:    %10zd\n", stats[NUM_LOCATIONS]);
     1247    fprintf(stream, "Number of values:       %10zd\n", stats[NUM_VALUES]);
    12421248    fprintf(stream, "\n");
    1243     fprintf(stream, "Operation file written: %10d\n", stats[OP_FILE_ACCESS]);
    1244     fprintf(stream, "Location file written:  %10d\n", stats[LOC_FILE_ACCESS]);
    1245     fprintf(stream, "Value file written:     %10d\n", stats[VAL_FILE_ACCESS]);
     1249    fprintf(stream, "Operation file written: %10zd\n", stats[OP_FILE_ACCESS]);
     1250    fprintf(stream, "Location file written:  %10zd\n", stats[LOC_FILE_ACCESS]);
     1251    fprintf(stream, "Value file written:     %10zd\n", stats[VAL_FILE_ACCESS]);
    12461252    fprintf(stream, "\n");
    1247     fprintf(stream, "Operation buffer size:  %10d\n", stats[OP_BUFFER_SIZE]);
    1248     fprintf(stream, "Location buffer size:   %10d\n", stats[LOC_BUFFER_SIZE]);
    1249     fprintf(stream, "Value buffer size:      %10d\n", stats[VAL_BUFFER_SIZE]);
    1250     fprintf(stream, "Taylor buffer size:     %10d\n", stats[TAY_BUFFER_SIZE]);
     1253    fprintf(stream, "Operation buffer size:  %10zd\n", stats[OP_BUFFER_SIZE]);
     1254    fprintf(stream, "Location buffer size:   %10zd\n", stats[LOC_BUFFER_SIZE]);
     1255    fprintf(stream, "Value buffer size:      %10zd\n", stats[VAL_BUFFER_SIZE]);
     1256    fprintf(stream, "Taylor buffer size:     %10zd\n", stats[TAY_BUFFER_SIZE]);
    12511257    fprintf(stream, "\n");
    1252     fprintf(stream, "Operation type size:    %10d\n",
    1253             (int)sizeof(unsigned char));
    1254     fprintf(stream, "Location type size:     %10d\n", (int)sizeof(locint));
    1255     fprintf(stream, "Value type size:        %10d\n", (int)sizeof(double));
    1256     fprintf(stream, "Taylor type size:       %10d\n", (int)sizeof(revreal));
     1258    fprintf(stream, "Operation type size:    %10zd\n",
     1259            (size_t)sizeof(unsigned char));
     1260    fprintf(stream, "Location type size:     %10zd\n", (size_t)sizeof(locint));
     1261    fprintf(stream, "Value type size:        %10zd\n", (size_t)sizeof(double));
     1262    fprintf(stream, "Taylor type size:       %10zd\n", (size_t)sizeof(revreal));
    12571263    fprintf(stream, "**********************************\n\n");
    12581264}
     
    12761282    if (fread(&tape_ADOLC_ID, sizeof(ADOLC_ID), 1, loc_file) != 1)
    12771283        fail(ADOLC_INTEGER_TAPE_FREAD_FAILED);
    1278     if (fread(tapeInfos->stats, STAT_SIZE * sizeof(uint), 1, loc_file) != 1)
     1284    if (fread(tapeInfos->stats, STAT_SIZE * sizeof(size_t), 1, loc_file) != 1)
    12791285        fail(ADOLC_INTEGER_TAPE_FREAD_FAILED);
    12801286
     
    16021608/****************************************************************************/
    16031609void put_op_block(unsigned char *lastOpP1) {
    1604     int i, chunks;
     1610    size_t i, chunks;
    16051611    size_t number, remain, chunkSize;
    16061612    ADOLC_OPENMP_THREAD_NUMBER;
     
    16531659/****************************************************************************/
    16541660void get_op_block_f() {
    1655     int i, chunks;
     1661    size_t i, chunks;
    16561662    size_t number, remain, chunkSize;
    16571663    ADOLC_OPENMP_THREAD_NUMBER;
     
    16811687/****************************************************************************/
    16821688void get_op_block_r() {
    1683     int i, chunks;
     1689    size_t i, chunks;
    16841690    size_t number, remain, chunkSize;
    16851691    ADOLC_OPENMP_THREAD_NUMBER;
     
    17141720/****************************************************************************/
    17151721void put_loc_block(locint *lastLocP1) {
    1716     int i, chunks;
     1722    size_t i, chunks;
    17171723    size_t number, remain, chunkSize;
    17181724    ADOLC_OPENMP_THREAD_NUMBER;
     
    17631769/****************************************************************************/
    17641770void get_loc_block_f() {
    1765     int i, chunks;
     1771    size_t i, chunks;
    17661772    size_t number, remain, chunkSize;
    17671773    ADOLC_OPENMP_THREAD_NUMBER;
     
    17911797/****************************************************************************/
    17921798void get_loc_block_r() {
    1793     int i, chunks;
     1799    size_t i, chunks;
    17941800    size_t number, remain, chunkSize;
    17951801    ADOLC_OPENMP_THREAD_NUMBER;
     
    18651871/****************************************************************************/
    18661872void put_val_block(double *lastValP1) {
    1867     int i, chunks;
     1873    size_t i, chunks;
    18681874    size_t number, remain, chunkSize;
    18691875    ADOLC_OPENMP_THREAD_NUMBER;
     
    19141920/****************************************************************************/
    19151921void get_val_block_f() {
    1916     int i, chunks;
     1922    size_t i, chunks;
    19171923    size_t number, remain, chunkSize;
    19181924    ADOLC_OPENMP_THREAD_NUMBER;
     
    19441950/****************************************************************************/
    19451951void get_val_block_r() {
    1946     int i, chunks;
     1952    size_t i, chunks;
    19471953    size_t number, remain, chunkSize;
    19481954    locint temp;
Note: See TracChangeset for help on using the changeset viewer.