In the remote GET pattern, there are two communications: 1) a PE requests a remote PE to send back its local data (REQUEST), and 2) the receiver actually sends back data to the requester (REPLY). Since this GET communication is asynchronous, when the requester creates an asynchronous message, it also specifies where to store received data so the receiver can know the destination location in the requester's memory.
The figure below illustrates the GET pattern. While the figure only shows one PE0 -> PE1 -> PE0 communication for presentation purposes, in reality, each PE does the sender's and receiver's role in an interleaved fashion.
// packetstructIgPkt{int64_tdst;int64_tsrc;};enumMailBoxType{REQUEST,REPLY};classIgSelector:publichclib::Selector<2,IgPkt>{//shared table array src, targetint64_t*ltable,*tgt;voidreq_process(IgPktpkt,intsender_rank){pkt.src=ltable[pkt.src];// Reply back to the requestersend(REPLY,pkt,sender_rank);}voidresp_process(IgPktpkt,intsender_rank){tgt[pkt.dst]=pkt.src;}public:IgSelector(int64_t*ltable,int64_t*tgt):ltable(ltable),tgt(tgt){mb[REQUEST].process=[this](IgPktpkt,intsender_rank){this->req_process(pkt,sender_rank);};mb[REPLY].process=[this](IgPktpkt,intsender_rank){this->resp_process(pkt,sender_rank);};}};