MCPcopy Create free account
hub / github.com/Kitware/VTK / Exchange

Method Exchange

Filters/ParallelMPI/vtkStructuredImplicitConnectivity.cxx:778–821  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

776
777//------------------------------------------------------------------------------
778void CommunicationManager::Exchange(vtkMPIController* comm)
779{
780 std::map<int, unsigned char*>::iterator it;
781
782 // STEP 0: exchange & allocate buffer sizes
783 this->AllocateRcvBuffers(comm);
784
785 // STEP 1: Allocate vector to store request objects for non-blocking comm.
786 int rqstIdx = 0;
787 this->Requests.resize(this->NumMsgs());
788
789 // STEP 2: Post Rcvs
790 for (it = this->Rcv.begin(); it != this->Rcv.end(); ++it)
791 {
792 int fromRank = it->first;
793 unsigned char* buffer = it->second;
794 assert("pre: rcv buffer size not found!" &&
795 this->RcvByteSize.find(fromRank) != this->RcvByteSize.end());
796 int bytesize = this->RcvByteSize[fromRank];
797
798 comm->NoBlockReceive(buffer, bytesize, fromRank, 0, this->Requests[rqstIdx]);
799 ++rqstIdx;
800 }
801
802 // STEP 3: Post Sends
803 for (it = this->Send.begin(); it != this->Send.end(); ++it)
804 {
805 int toRank = it->first;
806 unsigned char* buffer = it->second;
807 assert("pre: rcv buffer size not found!" &&
808 this->SendByteSize.find(toRank) != this->SendByteSize.end());
809 int bytesize = this->SendByteSize[toRank];
810
811 comm->NoBlockSend(buffer, bytesize, toRank, 0, this->Requests[rqstIdx]);
812 ++rqstIdx;
813 }
814
815 // STEP 4: WaitAll
816 if (!this->Requests.empty())
817 {
818 comm->WaitAll(this->NumMsgs(), this->Requests.data());
819 }
820 this->Requests.clear();
821}
822
823VTK_ABI_NAMESPACE_END
824} // END namespace detail

Callers 1

GrowGridMethod · 0.45

Calls 13

AllocateRcvBuffersMethod · 0.95
NumMsgsMethod · 0.95
NoBlockReceiveMethod · 0.80
NoBlockSendMethod · 0.80
WaitAllMethod · 0.80
assertFunction · 0.50
resizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected