Ignore:
Timestamp:
Jan 23, 2017, 5:20:18 PM (21 months ago)
Author:
cameron
Message:

For segment-pipeline-parallelism, threads must not overwrite buffer segments belonging to other threads

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5267 r5273  
    226226    }
    227227
     228    // segment size made availabe for each call to the mmap source kernel
    228229    const unsigned segmentSize = codegen::SegmentSize;
    229     if (segmentPipelineParallel && codegen::BufferSegments < 2) {
    230         codegen::BufferSegments = 2;
    231     }
    232     const unsigned bufferSegments = codegen::BufferSegments;
     230    unsigned bufferSegments = codegen::BufferSegments;
     231    if (segmentPipelineParallel)
     232        {
     233            bufferSegments = codegen::BufferSegments * codegen::ThreadNum;
     234        }
    233235    const unsigned encodingBits = UTF_16 ? 16 : 8;
    234236
     
    290292    ExternalFileBuffer ByteStream(iBuilder, iBuilder->getStreamSetTy(1, 8));
    291293   
    292     kernel::MMapSourceKernel mmapK(iBuilder, segmentSize * bufferSegments);
     294    kernel::MMapSourceKernel mmapK(iBuilder, segmentSize);
    293295    mmapK.generateKernel({}, {&ByteStream});
    294296    mmapK.setInitialArguments({fileSize});
Note: See TracChangeset for help on using the changeset viewer.