Changeset 17685 for trunk/Mars/mcore


Ignore:
Timestamp:
04/24/14 11:16:22 (11 years ago)
Author:
tbretz
Message:
Fixed revision 17607. When starting with tile 0 the currentTile can be either -1 or 0 depending on fNumRowsPerTile; this can lead to wrong results for isNextTile or when checked if a new tikle should be read; therefore implemented a different solution which also ensures that the copy feature and the checksum calculation gets every tile if read sequentially.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mcore/zfits.h

    r17650 r17685  
    276276    {
    277277        if (row == fRow+1)
    278             fRawsum.add(fBufferRow, false);
     278            fRawsum.add(fBufferRow);
    279279    }
    280280
     
    300300        //const int64_t currentSubTile     = currentTile   % fShrinkFactor;
    301301
     302        // Is this the first tile we read at all?
     303        const bool isFirstTile = fCurrentRow<0;
     304
     305        // Is this just the next tile in the sequence?
     306        const bool isNextTile = requestedTile==currentTile+1 || isFirstTile;
     307
    302308        fCurrentRow = rowNum;
    303309
    304         // Is this just the next tile in the sequence?
    305         const bool isNextTile = requestedTile==currentTile+1;
    306 
    307310        // Do we have to read a new tile from disk?
    308         if (requestedTile!=currentTile)
     311        if (requestedTile!=currentTile || isFirstTile)
    309312        {
    310313            //skip to the beginning of the tile
     
    316319            // seek for the sub tile. If we were just reading the previous one
    317320            // we can skip that.
    318             if (!isNextTile || requestedTile==0)
     321            if (!isNextTile || isFirstTile)
    319322            {
    320323                // step to the beginnig of the super tile
     
    383386
    384387
    385             // If we are reading sequentially, calcuakte checksum
     388            // If we are reading sequentially, calcualte checksum
    386389            if (isNextTile)
    387390            {
    388 //                std::cout << "Updating checksum" << std::endl;
    389391                // Padding for checksum calculation
    390392                memset(fCompressedBuffer.data(),   0, offset);
Note: See TracChangeset for help on using the changeset viewer.