34 #ifndef __vtkCommunicator_h
35 #define __vtkCommunicator_h
61 virtual void SetNumberOfProcesses(
int num);
62 vtkGetMacro(NumberOfProcesses,
int);
67 vtkGetMacro(LocalProcessId,
int);
118 virtual int Commutative() = 0;
139 int remoteHandle,
int tag) = 0;
145 return this->SendVoidArray(data, length,
VTK_INT, remoteHandle, tag);
148 return this->SendVoidArray(data, length,
VTK_INT, remoteHandle, tag);
151 int remoteHandle,
int tag) {
155 int remoteHandle,
int tag) {
159 return this->SendVoidArray(data, length,
VTK_CHAR, remoteHandle, tag);
162 return this->SendVoidArray(data, length,
VTK_FLOAT, remoteHandle, tag);
165 return this->SendVoidArray(data, length,
VTK_DOUBLE, remoteHandle, tag);
167 #ifdef VTK_USE_64BIT_IDS
169 return this->SendVoidArray(data, length,
VTK_ID_TYPE, remoteHandle, tag);
200 int remoteHandle,
int tag) = 0;
206 return this->ReceiveVoidArray(data, maxlength,
VTK_INT, remoteHandle, tag);
209 return this->ReceiveVoidArray(data, maxlength,
VTK_INT, remoteHandle, tag);
220 return this->ReceiveVoidArray(data, maxlength,
VTK_CHAR, remoteHandle, tag);
223 return this->ReceiveVoidArray(data, maxlength,
VTK_FLOAT, remoteHandle, tag);
226 return this->ReceiveVoidArray(data, maxlength,
VTK_DOUBLE, remoteHandle, tag);
228 #ifdef VTK_USE_64BIT_IDS
230 return this->ReceiveVoidArray(data, maxlength,
VTK_ID_TYPE, remoteHandle, tag);
253 virtual void Barrier();
260 return this->BroadcastVoidArray(data, length,
VTK_INT, srcProcessId);
263 return this->BroadcastVoidArray(data, length,
VTK_UNSIGNED_INT, srcProcessId);
272 return this->BroadcastVoidArray(data, length,
VTK_CHAR, srcProcessId);
275 return this->BroadcastVoidArray(data, length,
VTK_FLOAT, srcProcessId);
278 return this->BroadcastVoidArray(data, length,
VTK_DOUBLE, srcProcessId);
280 #ifdef VTK_USE_64BIT_IDS
282 return this->BroadcastVoidArray(data, length,
VTK_ID_TYPE, srcProcessId);
301 int Gather(
const int *sendBuffer,
int *recvBuffer,
303 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
306 int Gather(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
308 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
311 int Gather(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
313 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
316 int Gather(
const char *sendBuffer,
char *recvBuffer,
318 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
321 int Gather(
const float *sendBuffer,
float *recvBuffer,
323 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
326 int Gather(
const double *sendBuffer,
double *recvBuffer,
328 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
331 #ifdef VTK_USE_64BIT_IDS
334 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
353 int GatherV(
const int* sendBuffer,
int* recvBuffer,
356 return this->GatherVVoidArray(sendBuffer, recvBuffer,
357 sendLength, recvLengths,
358 offsets,
VTK_INT, destProcessId);
360 int GatherV(
const unsigned long* sendBuffer,
unsigned long* recvBuffer,
363 return this->GatherVVoidArray(sendBuffer, recvBuffer,
364 sendLength, recvLengths,
367 int GatherV(
const unsigned char* sendBuffer,
unsigned char* recvBuffer,
370 return this->GatherVVoidArray(sendBuffer, recvBuffer,
371 sendLength, recvLengths,
374 int GatherV(
const char* sendBuffer,
char* recvBuffer,
377 return this->GatherVVoidArray(sendBuffer, recvBuffer,
378 sendLength, recvLengths,
381 int GatherV(
const float* sendBuffer,
float* recvBuffer,
384 return this->GatherVVoidArray(sendBuffer, recvBuffer,
385 sendLength, recvLengths,
388 int GatherV(
const double* sendBuffer,
double* recvBuffer,
391 return this->GatherVVoidArray(sendBuffer, recvBuffer,
392 sendLength, recvLengths,
395 #ifdef VTK_USE_64BIT_IDS
399 return this->GatherVVoidArray(sendBuffer, recvBuffer,
400 sendLength, recvLengths,
416 int Scatter(
const int *sendBuffer,
int *recvBuffer,
418 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
421 int Scatter(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
423 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
426 int Scatter(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
428 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
431 int Scatter(
const char *sendBuffer,
char *recvBuffer,
433 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
436 int Scatter(
const float *sendBuffer,
float *recvBuffer,
438 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
441 int Scatter(
const double *sendBuffer,
double *recvBuffer,
443 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
446 #ifdef VTK_USE_64BIT_IDS
449 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
464 int ScatterV(
const int *sendBuffer,
int *recvBuffer,
466 vtkIdType recvLength,
int srcProcessId) {
467 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
468 sendLengths, offsets, recvLength,
471 int ScatterV(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
473 vtkIdType recvLength,
int srcProcessId) {
474 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
475 sendLengths, offsets, recvLength,
478 int ScatterV(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
480 vtkIdType recvLength,
int srcProcessId) {
481 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
482 sendLengths, offsets, recvLength,
485 int ScatterV(
const char *sendBuffer,
char *recvBuffer,
487 vtkIdType recvLength,
int srcProcessId) {
488 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
489 sendLengths, offsets, recvLength,
492 int ScatterV(
const float *sendBuffer,
float *recvBuffer,
494 vtkIdType recvLength,
int srcProcessId) {
495 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
496 sendLengths, offsets, recvLength,
499 int ScatterV(
const double *sendBuffer,
double *recvBuffer,
501 vtkIdType recvLength,
int srcProcessId) {
502 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
503 sendLengths, offsets, recvLength,
506 #ifdef VTK_USE_64BIT_IDS
509 vtkIdType recvLength,
int srcProcessId) {
510 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
511 sendLengths, offsets, recvLength,
520 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
VTK_INT);
522 int AllGather(
const unsigned long *sendBuffer,
524 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
527 int AllGather(
const unsigned char *sendBuffer,
529 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
533 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
VTK_CHAR);
536 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
VTK_FLOAT);
538 int AllGather(
const double *sendBuffer,
540 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
VTK_DOUBLE);
542 #ifdef VTK_USE_64BIT_IDS
545 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
554 int AllGatherV(
const int* sendBuffer,
int* recvBuffer,
557 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
558 sendLength, recvLengths,
561 int AllGatherV(
const unsigned long* sendBuffer,
unsigned long* recvBuffer,
564 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
565 sendLength, recvLengths,
568 int AllGatherV(
const unsigned char* sendBuffer,
unsigned char* recvBuffer,
571 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
572 sendLength, recvLengths,
575 int AllGatherV(
const char* sendBuffer,
char* recvBuffer,
578 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
579 sendLength, recvLengths,
582 int AllGatherV(
const float* sendBuffer,
float* recvBuffer,
585 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
586 sendLength, recvLengths,
589 int AllGatherV(
const double* sendBuffer,
double* recvBuffer,
592 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
593 sendLength, recvLengths,
596 #ifdef VTK_USE_64BIT_IDS
600 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
601 sendLength, recvLengths,
614 int Reduce(
const int *sendBuffer,
int *recvBuffer,
616 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
617 VTK_INT, operation, destProcessId);
619 int Reduce(
const unsigned int *sendBuffer,
unsigned int *recvBuffer,
621 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
624 int Reduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
626 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
629 int Reduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
631 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
634 int Reduce(
const char *sendBuffer,
char *recvBuffer,
636 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
637 VTK_CHAR, operation, destProcessId);
639 int Reduce(
const float *sendBuffer,
float *recvBuffer,
641 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
644 int Reduce(
const double *sendBuffer,
double *recvBuffer,
646 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
649 #ifdef VTK_USE_64BIT_IDS
652 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
657 int operation,
int destProcessId);
664 int Reduce(
const int *sendBuffer,
int *recvBuffer,
666 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
667 VTK_INT, operation, destProcessId);
669 int Reduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
671 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
674 int Reduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
676 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
679 int Reduce(
const char *sendBuffer,
char *recvBuffer,
681 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
682 VTK_CHAR, operation, destProcessId);
684 int Reduce(
const float *sendBuffer,
float *recvBuffer,
686 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
689 int Reduce(
const double *sendBuffer,
double *recvBuffer,
691 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
694 #ifdef VTK_USE_64BIT_IDS
697 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
702 Operation *operation,
int destProcessId);
708 int AllReduce(
const int *sendBuffer,
int *recvBuffer,
710 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
713 int AllReduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
715 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
718 int AllReduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
720 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
723 int AllReduce(
const char *sendBuffer,
char *recvBuffer,
725 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
728 int AllReduce(
const float *sendBuffer,
float *recvBuffer,
730 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
733 int AllReduce(
const double *sendBuffer,
double *recvBuffer,
735 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
738 #ifdef VTK_USE_64BIT_IDS
741 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
747 int AllReduce(
const int *sendBuffer,
int *recvBuffer,
749 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
752 int AllReduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
754 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
757 int AllReduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
759 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
762 int AllReduce(
const char *sendBuffer,
char *recvBuffer,
764 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
767 int AllReduce(
const float *sendBuffer,
float *recvBuffer,
769 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
772 int AllReduce(
const double *sendBuffer,
double *recvBuffer,
774 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
777 #ifdef VTK_USE_64BIT_IDS
780 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
785 Operation *operation);
793 virtual int GatherVoidArray(
const void *sendBuffer,
void *recvBuffer,
795 virtual int GatherVVoidArray(
const void *sendBuffer,
void *recvBuffer,
798 virtual int ScatterVoidArray(
const void *sendBuffer,
void *recvBuffer,
800 virtual int ScatterVVoidArray(
const void *sendBuffer,
void *recvBuffer,
804 virtual int AllGatherVoidArray(
const void *sendBuffer,
void *recvBuffer,
806 virtual int AllGatherVVoidArray(
const void *sendBuffer,
void *recvBuffer,
809 virtual int ReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
811 int operation,
int destProcessId);
812 virtual int ReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
814 Operation *operation,
int destProcessId);
815 virtual int AllReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
818 virtual int AllReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
820 Operation *operation);
823 static void SetUseCopy(
int useCopy);
835 virtual int ComputeGlobalBounds(
int processorId,
int numProcesses,
837 int *rightHasBounds = 0,
838 int *leftHasBounds = 0,
839 int hasBoundsTag = 288402,
840 int localBoundsTag = 288403,
841 int globalBoundsTag = 288404);
849 static int GetParentProcessor(
int pid);
850 static int GetLeftChildProcessor(
int pid);
874 int remoteHandle,
int tag,
int type=-1);
876 int remoteHandle,
int tag);
877 int ReceiveMultiBlockDataSet(
879 int ReceiveTemporalDataSet(
896 #endif // __vtkCommunicator_h