MCPcopy Create free account
hub / github.com/catboost/catboost / Resize

Method Resize

library/cpp/netliba/v6/ib_collective.cpp:548–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546 }
547
548 bool Resize(size_t dataSize) override {
549 size_t repSize = (dataSize + 63) & (~63ull);
550 size_t bufSize = repSize * BufSizeMult;
551
552 if (bufSize > DataSync.BufSize) {
553 return false;
554 }
555
556 for (int z = 0; z < DataSync.Iterations.ysize(); ++z) {
557 TAllDataSync::TIteration& iter = DataSync.Iterations[z];
558 for (int i = 0; i < iter.OutList.ysize(); ++i) {
559 TAllDataSync::TSend& snd = iter.OutList[i];
560 snd.Length = dataSize;
561 snd.SrcOffset = snd.Reduce.SrcIndex * repSize;
562 snd.DstOffset = snd.Reduce.DstIndex * repSize;
563 }
564
565 for (int i = 0; i < iter.ReduceList.ysize(); ++i) {
566 TAllDataSync::TReduce& red = iter.ReduceList[i];
567 red.SrcOffset = red.SrcIndex * repSize;
568 red.DstOffset = red.DstIndex * repSize;
569 }
570 }
571 DataSync.ReadyOffset = ReadyOffsetMult * repSize;
572 DataSync.DataSize = dataSize;
573 return true;
574 }
575 friend class TIBCollective;
576 };
577

Callers 4

CreateAllGatherMethod · 0.45
CreateAllReduceMethod · 0.45
TPacketMethod · 0.45
RecvMethod · 0.45

Calls 1

ysizeMethod · 0.45

Tested by

no test coverage detected