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

Method GetMsg

library/cpp/netliba/v12/ib_collective.cpp:715–751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713 BP->FreeBuf(wc.wr_id);
714 }
715 bool GetMsg(ui64* resWorkId, int* resQPN, TIBMicroPeerTable* tbl) {
716 if (tbl->NeedParsePending()) {
717 for (TDeque<TPendingMessage>::iterator z = Pending.begin(); z != Pending.end(); ++z) {
718 if (!tbl->NeedQPN(z->QPN)) {
719 continue;
720 }
721 *resWorkId = z->WorkId;
722 *resQPN = z->QPN;
723 Pending.erase(z);
724 return true;
725 }
726 //printf("Stop parse pending\n");
727 tbl->StopParsePending();
728 }
729 for (;;) {
730 ibv_wc wc;
731 int rv = CQ->Poll(&wc, 1);
732 if (rv > 0) {
733 Y_ABORT_UNLESS(wc.status == IBV_WC_SUCCESS, "WaitForMsg() fail, status %d", (int)wc.status);
734 if (wc.opcode & IBV_WC_RECV) {
735 BP->RequestPostRecv();
736 if (tbl->NeedQPN(wc.qp_num)) {
737 *resWorkId = wc.wr_id;
738 *resQPN = wc.qp_num;
739 return true;
740 } else {
741 Pending.push_back(TPendingMessage(wc.qp_num, wc.wr_id));
742 BP->PostRecv();
743 }
744 } else {
745 WriteCompleted(wc);
746 }
747 } else {
748 return false;
749 }
750 }
751 }
752
753 bool ProcessSendCompletion(const ibv_wc& wc) {
754 Y_ABORT_UNLESS(wc.status == IBV_WC_SUCCESS, "WaitForMsg() fail, status %d", (int)wc.status);

Callers 1

TIBRecvMicroMethod · 0.45

Calls 11

TPendingMessageClass · 0.70
NeedParsePendingMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
NeedQPNMethod · 0.45
eraseMethod · 0.45
StopParsePendingMethod · 0.45
PollMethod · 0.45
RequestPostRecvMethod · 0.45
push_backMethod · 0.45
PostRecvMethod · 0.45

Tested by

no test coverage detected