Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

void Impala::Util::Broadcast ( IOBuffer *  buffer,
int  root 
) [inline]

Todo:
investigate performance of MPI vs, Franks implementations

Definition at line 837 of file IOBuffer.h.

References Impala::Util::IOBuffer::GetBuffer(), ILOG_DEBUG, ILOG_VAR, Impala::Util::IOBuffer::SetBuffer(), and Impala::Util::IOBuffer::Size().

Referenced by Impala::Persistency::FeatureTableRepositoryInFile::Get(), and Impala::Persistency::DistributedAccessRepositoryInFile::LoadQuids().

00838 {
00839 #ifdef MPI_USED
00840     ILOG_VAR(Impala.Util.Broadcast);
00841     MPI_Barrier(MPI_COMM_WORLD);
00842     Int64 size = buffer->Size();
00843     MPI_Bcast(&size, 1, MPI_LONG_LONG, root, MPI_COMM_WORLD);
00844     unsigned char* sendBuffer;
00845     if (Link::Mpi::MyId() == root)
00846         sendBuffer = buffer->GetBuffer();
00847     else
00848         sendBuffer = new unsigned char[size];
00849     ILOG_DEBUG(Link::Mpi::MyId() << ": about to broadcast, buf = " <<
00850                (void*)sendBuffer << "size = " << size);
00851     unsigned char* curPos = sendBuffer;
00852     Int64 transmitted = 0;
00853     while (transmitted < size)
00854     {
00855         int maxBlock = 1024 * 1024 * 1024;
00856         int blockSize = (size - transmitted > maxBlock) ? maxBlock 
00857                                                         : size - transmitted;
00858         MPI_Bcast(curPos, blockSize, MPI_CHAR, root, MPI_COMM_WORLD);
00859         curPos += blockSize;
00860         transmitted += blockSize;
00861     }
00862     if (Link::Mpi::MyId() != root)
00863     {
00864         buffer->SetBuffer(sendBuffer, size);
00865     }
00866     ILOG_DEBUG("done");
00867 #endif // MPI_USED
00868 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:24:06 2011 for ImpalaSrc by  doxygen 1.5.1