Ejemplo n.º 1
0
size32_t ThorCompress(const void * src, size32_t srcSz, MemoryBuffer & dest, size32_t threshold)
{
    size32_t prev = dest.length();
    size32_t dSz = srcSz + sizeof(size32_t);
    void * d = dest.reserve(dSz);
    size32_t ret = ThorCompress(src, srcSz, d, dSz, threshold);
    dest.setLength(prev+ret);
    return ret;
}
Ejemplo n.º 2
0
 size32_t gatherData(MemoryBuffer &mb)
 {
     CriticalBlock b(crit);
     if (progressEnabled)
     {
         MemoryBuffer progressData;
         { CriticalBlock b(crit);
             ForEachItemIn(g, activeGraphs)
             {
                 CGraphBase &graph = activeGraphs.item(g);
                 graph.serializeStats(progressData);
             }
         }
         size32_t sz = progressData.length();
         if (sz)
         {
             ThorCompress(progressData, mb, 0x200);
             return sz;
         }
     }
Ejemplo n.º 3
0
 size32_t gatherData(MemoryBuffer &mb)
 {
     CriticalBlock b(crit);
     if (progressEnabled)
     {
         MemoryBuffer progressData;
         {
             CriticalBlock b(crit);
             ForEachItemIn(g, activeGraphs) // NB: 1 for each slavesPerProcess
             {
                 CGraphBase &graph = activeGraphs.item(g);
                 progressData.append((unsigned)graph.queryJobChannel().queryMyRank()-1);
                 if (!graph.serializeStats(progressData))
                     progressData.setLength(progressData.length()-sizeof(unsigned));
             }
         }
         size32_t sz = progressData.length();
         if (sz)
         {
             ThorCompress(progressData, mb, 0x200);
             return sz;
         }
     }
Ejemplo n.º 4
0
size32_t ThorCompress(MemoryBuffer & src, MemoryBuffer & dest, size32_t threshold)
{
    return ThorCompress((const void *)src.toByteArray(), src.length(), dest, threshold);
}