Changeset 17285


Ignore:
Timestamp:
10/21/13 12:05:40 (11 years ago)
Author:
lyard
Message:
fixed bug related to thread-safe-ness
File:
1 edited

Legend:

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

    r17281 r17285  
    314314            fTable.num_rows++;
    315315
    316             DrsOffsetCalibrate(target_location);
    317 
    318316            if (fTable.num_rows % fNumRowsPerTile != 0)
    319317            {
     
    324322            // use the least occupied queue
    325323            const auto imin = std::min_element(fCompressionQueues.begin(), fCompressionQueues.end());
     324
    326325            if (!imin->emplace(InitNextCompression()))
    327326                throw std::runtime_error("The compression queues are not started. Did you close the file before writing this row?");
     
    631630            //Really do not understand what's wrong...
    632631            //calibrate data if required
    633             //const uint32_t thisRoundNumRows  = (target.num_rows%fNumRowsPerTile) ? target.num_rows%fNumRowsPerTile : fNumRowsPerTile;
    634 //            for (uint32_t i=0;i<thisRoundNumRows;i++)
    635 //            {
    636 //                char* target_location = target.src.get() + fRealRowWidth*i;
    637 //                cout << "Target Location there...." << hex << static_cast<void*>(target_location) << endl;
    638 //                DrsOffsetCalibrate(target_location);
    639 //            }
    640 
     632            const uint32_t thisRoundNumRows  = (target.num_rows%fNumRowsPerTile) ? target.num_rows%fNumRowsPerTile : fNumRowsPerTile;
     633            for (uint32_t i=0;i<thisRoundNumRows;i++)
     634            {
     635                char* target_location = target.src.get() + fRealRowWidth*i;
     636                DrsOffsetCalibrate(target_location);
     637            }
    641638#ifdef __EXCEPTIONS
    642639            try
     
    644641#endif
    645642                //transpose the original data
    646                 copyTransposeTile(target.src.get(), target.transposed_src.get());
     643                copyTransposeTile(target.src.get(), target.transposed_src.get(), target.num_rows);
    647644
    648645                //compress the buffer
     
    787784        /// @param src buffer hosting the regular, row-ordered data
    788785        /// @param dest the target buffer that will receive the transposed data
    789         void copyTransposeTile(const char* src, char* dest)
    790         {
    791             const uint32_t thisRoundNumRows = (fTable.num_rows%fNumRowsPerTile) ? fTable.num_rows%fNumRowsPerTile : fNumRowsPerTile;
     786        void copyTransposeTile(const char* src, char* dest, uint32_t num_rows)
     787        {
     788            const uint32_t thisRoundNumRows = (num_rows%fNumRowsPerTile) ? num_rows%fNumRowsPerTile : fNumRowsPerTile;
    792789
    793790            //copy the tile and transpose it
Note: See TracChangeset for help on using the changeset viewer.