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

Method WaitForMsg

library/cpp/netliba/v6/ib_collective.cpp:795–821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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