29 #ifndef vtkPPixelTransfer_h 30 #define vtkPPixelTransfer_h 33 #include "vtkRenderingParallelLICModule.h" 34 #include "vtkSetGet.h" 73 SrcWholeExt(srcWholeExt),
76 DestWholeExt(destWholeExt),
96 SrcWholeExt(srcWholeExt),
99 DestWholeExt(destWholeExt),
118 SrcWholeExt(wholeExt),
121 DestWholeExt(wholeExt),
161 SrcWholeExt(srcWholeExt),
164 DestWholeExt(destWholeExt),
165 DestExt(destWholeExt),
183 SrcWholeExt(srcWholeExt),
186 DestWholeExt(destWholeExt),
199 { this->SrcRank=rank; }
202 {
return this->SrcRank; }
205 { this->DestRank=rank; }
208 {
return this->DestRank; }
215 bool Sender(
int rank)
const {
return (this->SrcRank == rank); }
216 bool Receiver(
int rank)
const {
return (this->DestRank == rank); }
218 {
return (this->Sender(rank) && this->Receiver(rank)); }
225 { this->SrcWholeExt=srcExt; }
228 {
return this->SrcWholeExt; }
231 {
return this->SrcWholeExt; }
238 { this->SrcExt=srcExt; }
241 {
return this->SrcExt; }
244 {
return this->SrcExt; }
251 { this->DestWholeExt=destExt; }
254 {
return this->DestWholeExt; }
257 {
return this->DestWholeExt; }
264 { this->DestExt=destExt; }
267 {
return this->DestExt; }
270 {
return this->DestExt; }
285 { this->UseBlockingSend=val; }
288 {
return this->UseBlockingSend; }
291 { this->UseBlockingRecv=val; }
294 {
return this->UseBlockingRecv; }
299 template<
typename SOURCE_TYPE,
typename DEST_TYPE>
304 SOURCE_TYPE *srcData,
306 std::vector<MPI_Request> &reqs,
307 std::deque<MPI_Datatype> &types,
322 std::vector<MPI_Request> &reqs,
323 std::deque<MPI_Datatype> &types,
338 template<
typename SOURCE_TYPE>
343 SOURCE_TYPE *srcData,
346 std::vector<MPI_Request> &reqs,
347 std::deque<MPI_Datatype> &types,
363 template<
typename SOURCE_TYPE>
368 SOURCE_TYPE *srcData,
371 std::vector<MPI_Request> &reqs,
372 std::deque<MPI_Datatype> &types,
379 return this->Execute(
393 template<
typename SOURCE_TYPE,
typename DEST_TYPE>
398 SOURCE_TYPE *srcData,
400 std::vector<MPI_Request> &reqs,
401 std::deque<MPI_Datatype> &types,
405 if ((comm == MPI_COMM_NULL) || (this->Local(rank)))
419 if (rank == this->DestRank)
422 if (destData == NULL)
427 MPI_Datatype subarray;
428 iErr = vtkMPIPixelViewNew<DEST_TYPE>(
438 if (this->UseBlockingRecv)
452 reqs.push_back(MPI_REQUEST_NULL);
463 #define HOLD_RECV_TYPES 464 #ifdef HOLD_RECV_YPES 465 types.push_back(subarray);
467 MPI_Type_free(&subarray);
476 if (rank == this->SrcRank)
484 MPI_Datatype subarray;
485 iErr = vtkMPIPixelViewNew<SOURCE_TYPE>(
495 if (this->UseBlockingSend)
516 #define SAVE_SEND_REQS 517 #ifdef SAVE_SEND_REQS 520 MPI_Request_free(&req);
524 #define HOLD_SEND_TYPES 525 #ifdef HOLD_SEND_TYPES 526 types.push_back(subarray);
528 MPI_Type_free(&subarray);
540 VTKRENDERINGPARALLELLIC_EXPORT
vtkPixelExtent & GetSourceExtent()
void SetUseBlockingSend(int val)
Enable/diasable non-blocking communication.
vtkPPixelTransfer(int srcRank, int destRank, const vtkPixelExtent &ext, int id=0)
Initialize a transaction from sub extent of source to sub extent of dest, both the whole and the subs...
const vtkPixelExtent & GetDestinationExtent() const
void SetDestinationRank(int rank)
int GetSourceRank() const
void SetSourceWholeExtent(vtkPixelExtent &srcExt)
Set/Get the source extent.
vtkPixelExtent & GetDestinationWholeExtent()
vtkPPixelTransfer(int srcRank, const vtkPixelExtent &srcWholeExt, const vtkPixelExtent &srcExt, int destRank, const vtkPixelExtent &destWholeExt, const vtkPixelExtent &destExt, int id=0)
Initialize a transaction from sub extent of source to sub extent of dest, where the subsets are diffe...
int GetDestinationRank() const
int GetUseBlockingRecv() const
class to handle inter-process communication of pixel data from non-contiguous regions of a shared ind...
vtkPixelExtent & GetSourceWholeExtent()
void SetUseBlockingRecv(int val)
void SetSourceExtent(vtkPixelExtent &srcExt)
Set/Get the source extent.
vtkPPixelTransfer(int srcRank, int destRank, const vtkPixelExtent &wholeExt, const vtkPixelExtent &targetExt, int id=0)
Initialize a transaction from sub extent of source to sub extent of dest, both the whole and the subs...
int GetTransactionId() const
const vtkPixelExtent & GetSourceExtent() const
static int Blit(const vtkPixelExtent &ext, int nComps, int srcType, void *srcData, int destType, void *destData)
for memory to memory transfers.
const vtkPixelExtent & GetSourceWholeExtent() const
VTKRENDERINGPARALLELLIC_EXPORT ostream & operator<<(std::ostream &os, const vtkPPixelTransfer >)
vtkPPixelTransfer(int srcRank, const vtkPixelExtent &srcWholeExt, const vtkPixelExtent &targetExt, int destRank, const vtkPixelExtent &destWholeExt, int id)
Initialize a transaction from sub extent of source to sub extent of dest, where the subsets are the s...
vtkPPixelTransfer(int srcRank, const vtkPixelExtent &srcWholeExt, int destRank, const vtkPixelExtent &destWholeExt, int id=0)
Initialize a transaction from whole extent of source to whole extent of dest, where source and destin...
bool Sender(int rank) const
Tests to determine a given rank's role in this transaction.
int Execute(MPI_Comm comm, int rank, int nComps, SOURCE_TYPE *srcData, DEST_TYPE *destData, std::vector< MPI_Request > &reqs, std::deque< MPI_Datatype > &types, int tag)
Transfer data from source to destination.
void SetDestinationWholeExtent(vtkPixelExtent &destExt)
Set/get the destination extent.
vtkPPixelTransfer(const vtkPixelExtent &srcWholeExt, const vtkPixelExtent &srcExt, const vtkPixelExtent &destWholeExt, const vtkPixelExtent &destExt)
Initialize a transaction from sub extent of source to sub extent of dest, where the subsets are diffe...
Representation of a cartesian pixel plane and common operations on it.
void SetSourceRank(int rank)
Set/Get the MPI rank of source and destination processes.
bool Local(int rank) const
int GetUseBlockingSend() const
void SetTransactionId(int id)
Set/get the transaction id.
bool Receiver(int rank) const
void SetDestinationExtent(vtkPixelExtent &destExt)
Set/get the destination extent.
const vtkPixelExtent & GetDestinationWholeExtent() const
vtkPixelExtent & GetDestinationExtent()