28 #ifndef vtkPPixelTransfer_h
29 #define vtkPPixelTransfer_h
32 #include "vtkRenderingParallelLICModule.h"
33 #include "vtkSetGet.h"
71 SrcWholeExt(srcWholeExt),
74 DestWholeExt(destWholeExt),
94 SrcWholeExt(srcWholeExt),
97 DestWholeExt(destWholeExt),
116 SrcWholeExt(wholeExt),
119 DestWholeExt(wholeExt),
159 SrcWholeExt(srcWholeExt),
162 DestWholeExt(destWholeExt),
163 DestExt(destWholeExt),
181 SrcWholeExt(srcWholeExt),
184 DestWholeExt(destWholeExt),
196 { this->SrcRank=rank; }
200 {
return this->SrcRank; }
203 { this->DestRank=rank; }
206 {
return this->DestRank; }
212 bool Sender(
int rank)
const {
return (this->SrcRank == rank); }
213 bool Receiver(
int rank)
const {
return (this->DestRank == rank); }
215 {
return (this->Sender(rank) && this->Receiver(rank)); }
222 { this->SrcWholeExt=srcExt; }
226 {
return this->SrcWholeExt; }
229 {
return this->SrcWholeExt; }
235 { this->SrcExt=srcExt; }
239 {
return this->SrcExt; }
242 {
return this->SrcExt; }
248 { this->DestWholeExt=destExt; }
252 {
return this->DestWholeExt; }
255 {
return this->DestWholeExt; }
261 { this->DestExt=destExt; }
265 {
return this->DestExt; }
268 {
return this->DestExt; }
282 { this->UseBlockingSend=val; }
286 {
return this->UseBlockingSend; }
289 { this->UseBlockingRecv=val; }
292 {
return this->UseBlockingRecv; }
296 template<
typename SOURCE_TYPE,
typename DEST_TYPE>
301 SOURCE_TYPE *srcData,
303 std::vector<MPI_Request> &reqs,
304 std::deque<MPI_Datatype> &types,
319 std::vector<MPI_Request> &reqs,
320 std::deque<MPI_Datatype> &types,
337 template<
typename SOURCE_TYPE>
342 SOURCE_TYPE *srcData,
345 std::vector<MPI_Request> &reqs,
346 std::deque<MPI_Datatype> &types,
362 template<
typename SOURCE_TYPE>
367 SOURCE_TYPE *srcData,
370 std::vector<MPI_Request> &reqs,
371 std::deque<MPI_Datatype> &types,
392 template<
typename SOURCE_TYPE,
typename DEST_TYPE>
397 SOURCE_TYPE *srcData,
399 std::vector<MPI_Request> &reqs,
400 std::deque<MPI_Datatype> &types,
404 if ((comm == MPI_COMM_NULL) || (this->
Local(rank)))
418 if (rank == this->DestRank)
421 if (destData == NULL)
426 MPI_Datatype subarray;
427 iErr = vtkMPIPixelViewNew<DEST_TYPE>(
437 if (this->UseBlockingRecv)
451 reqs.push_back(MPI_REQUEST_NULL);
462 #define HOLD_RECV_TYPES
463 #ifdef HOLD_RECV_YPES
464 types.push_back(subarray);
466 MPI_Type_free(&subarray);
475 if (rank == this->SrcRank)
483 MPI_Datatype subarray;
484 iErr = vtkMPIPixelViewNew<SOURCE_TYPE>(
494 if (this->UseBlockingSend)
515 #define SAVE_SEND_REQS
516 #ifdef SAVE_SEND_REQS
519 MPI_Request_free(&req);
523 #define HOLD_SEND_TYPES
524 #ifdef HOLD_SEND_TYPES
525 types.push_back(subarray);
527 MPI_Type_free(&subarray);
539 VTKRENDERINGPARALLELLIC_EXPORT
vtkPixelExtent & GetSourceExtent()
void SetUseBlockingSend(int val)
vtkPPixelTransfer(int srcRank, int destRank, const vtkPixelExtent &ext, int id=0)
const vtkPixelExtent & GetDestinationExtent() const
void SetDestinationRank(int rank)
int GetSourceRank() const
void SetSourceWholeExtent(vtkPixelExtent &srcExt)
vtkPixelExtent & GetDestinationWholeExtent()
vtkPPixelTransfer(int srcRank, const vtkPixelExtent &srcWholeExt, const vtkPixelExtent &srcExt, int destRank, const vtkPixelExtent &destWholeExt, const vtkPixelExtent &destExt, int id=0)
int GetDestinationRank() const
int GetUseBlockingRecv() const
vtkPixelExtent & GetSourceWholeExtent()
void SetUseBlockingRecv(int val)
void SetSourceExtent(vtkPixelExtent &srcExt)
vtkPPixelTransfer(int srcRank, int destRank, const vtkPixelExtent &wholeExt, const vtkPixelExtent &targetExt, int id=0)
int GetTransactionId() const
const vtkPixelExtent & GetSourceExtent() const
static int Blit(const vtkPixelExtent &ext, int nComps, int srcType, void *srcData, int destType, void *destData)
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)
vtkPPixelTransfer(int srcRank, const vtkPixelExtent &srcWholeExt, int destRank, const vtkPixelExtent &destWholeExt, int id=0)
bool Sender(int rank) const
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)
void SetDestinationWholeExtent(vtkPixelExtent &destExt)
vtkPPixelTransfer(const vtkPixelExtent &srcWholeExt, const vtkPixelExtent &srcExt, const vtkPixelExtent &destWholeExt, const vtkPixelExtent &destExt)
void SetSourceRank(int rank)
bool Local(int rank) const
int GetUseBlockingSend() const
void SetTransactionId(int id)
bool Receiver(int rank) const
void SetDestinationExtent(vtkPixelExtent &destExt)
const vtkPixelExtent & GetDestinationWholeExtent() const
vtkPixelExtent & GetDestinationExtent()