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

template<class ArithT>
static ArithT Impala::Core::Array::Pattern::PxBcastValueOFT ( ArithT  val,
int  root 
) [inline, static]

Definition at line 271 of file PxDistribution.h.

References _myCPU, _nrCPUs, and BCAST_TAG.

Referenced by PxBcastValue(), and PxReduceValueToAllOFT().

00272 {
00273     /*** Broadcast value using One-level Flat Tree ***/
00274 
00275     MPI_Datatype elem;
00276     MPI_Status stat;
00277     MPI_Type_contiguous(sizeof(ArithT), MPI_BYTE, &elem);
00278     MPI_Type_commit(&elem);
00279 
00280     if (_myCPU == root) {               // send value to all other CPUs
00281         for (int partner=0; partner<_nrCPUs; partner++) {
00282             if (partner != _myCPU) {
00283                 MPI_Send(&val,
00284                          1, elem, partner, BCAST_TAG, MPI_COMM_WORLD);
00285             }
00286         }
00287     } else {                            // receive value from root
00288         MPI_Recv(&val, 1, elem, root, BCAST_TAG, MPI_COMM_WORLD, &stat);
00289     }
00290     MPI_Type_free(&elem);
00291     return val;
00292 }


Generated on Fri Mar 19 11:02:35 2010 for ImpalaSrc by  doxygen 1.5.1