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

Method WaitForMsg

library/cpp/netliba/v12/ib_collective.cpp:794–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

792 WaitCompletion(&wc);
793 }
794 ui64 WaitForMsg(int qpn) {
795 for (TDeque<TPendingMessage>::iterator z = Pending.begin(); z != Pending.end(); ++z) {
796 if (z->QPN == qpn) {
797 ui64 workId = z->WorkId;
798 Pending.erase(z);
799 return workId;
800 }
801 }
802 ibv_wc wc;
803 for (;;) {
804 int rv = CQ->Poll(&wc, 1);
805 if (rv > 0) {
806 Y_ABORT_UNLESS(wc.status == IBV_WC_SUCCESS, "WaitForMsg() fail, status %d", (int)wc.status);
807 if (wc.opcode & IBV_WC_RECV) {
808 BP->RequestPostRecv();
809 if ((int)wc.qp_num == qpn) {
810 return wc.wr_id;
811 } else {
812 Pending.push_back(TPendingMessage(wc.qp_num, wc.wr_id));
813 BP->PostRecv();
814 }
815 } else {
816 WriteCompleted(wc);
817 }
818 }
819 }
820 }
821
822 bool AllocOperationSlot(TPtrArg<TRCQueuePair> qp) {
823 int way = qp->GetQPN() & (SEND_COUNT_TABLE_SIZE - 1);

Callers

nothing calls this directly

Calls 8

TPendingMessageClass · 0.70
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
PollMethod · 0.45
RequestPostRecvMethod · 0.45
push_backMethod · 0.45
PostRecvMethod · 0.45

Tested by

no test coverage detected