34 #ifndef __vtkCommunicator_h
35 #define __vtkCommunicator_h
61 virtual void SetNumberOfProcesses(
int num);
62 vtkGetMacro(NumberOfProcesses,
int);
67 vtkGetMacro(LocalProcessId,
int);
120 virtual int Commutative() = 0;
141 int remoteHandle,
int tag) = 0;
147 return this->SendVoidArray(data, length,
VTK_INT, remoteHandle, tag);
150 return this->SendVoidArray(data, length,
VTK_INT, remoteHandle, tag);
153 int remoteHandle,
int tag) {
157 int remoteHandle,
int tag) {
161 return this->SendVoidArray(data, length,
VTK_CHAR, remoteHandle, tag);
164 return this->SendVoidArray(data, length,
VTK_FLOAT, remoteHandle, tag);
167 return this->SendVoidArray(data, length,
VTK_DOUBLE, remoteHandle, tag);
169 #ifdef VTK_USE_64BIT_IDS
171 return this->SendVoidArray(data, length,
VTK_ID_TYPE, remoteHandle, tag);
202 int remoteHandle,
int tag) = 0;
208 return this->ReceiveVoidArray(data, maxlength,
VTK_INT, remoteHandle, tag);
211 return this->ReceiveVoidArray(data, maxlength,
VTK_INT, remoteHandle, tag);
222 return this->ReceiveVoidArray(data, maxlength,
VTK_CHAR, remoteHandle, tag);
225 return this->ReceiveVoidArray(data, maxlength,
VTK_FLOAT, remoteHandle, tag);
228 return this->ReceiveVoidArray(data, maxlength,
VTK_DOUBLE, remoteHandle, tag);
230 #ifdef VTK_USE_64BIT_IDS
232 return this->ReceiveVoidArray(data, maxlength,
VTK_ID_TYPE, remoteHandle, tag);
255 virtual void Barrier();
262 return this->BroadcastVoidArray(data, length,
VTK_INT, srcProcessId);
265 return this->BroadcastVoidArray(data, length,
VTK_UNSIGNED_INT, srcProcessId);
274 return this->BroadcastVoidArray(data, length,
VTK_CHAR, srcProcessId);
277 return this->BroadcastVoidArray(data, length,
VTK_FLOAT, srcProcessId);
280 return this->BroadcastVoidArray(data, length,
VTK_DOUBLE, srcProcessId);
282 #ifdef VTK_USE_64BIT_IDS
284 return this->BroadcastVoidArray(data, length,
VTK_ID_TYPE, srcProcessId);
303 int Gather(
const int *sendBuffer,
int *recvBuffer,
305 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
308 int Gather(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
310 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
313 int Gather(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
315 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
318 int Gather(
const char *sendBuffer,
char *recvBuffer,
320 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
323 int Gather(
const float *sendBuffer,
float *recvBuffer,
325 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
328 int Gather(
const double *sendBuffer,
double *recvBuffer,
330 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
333 #ifdef VTK_USE_64BIT_IDS
336 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
355 int GatherV(
const int* sendBuffer,
int* recvBuffer,
358 return this->GatherVVoidArray(sendBuffer, recvBuffer,
359 sendLength, recvLengths,
360 offsets,
VTK_INT, destProcessId);
362 int GatherV(
const unsigned long* sendBuffer,
unsigned long* recvBuffer,
365 return this->GatherVVoidArray(sendBuffer, recvBuffer,
366 sendLength, recvLengths,
369 int GatherV(
const unsigned char* sendBuffer,
unsigned char* recvBuffer,
372 return this->GatherVVoidArray(sendBuffer, recvBuffer,
373 sendLength, recvLengths,
376 int GatherV(
const char* sendBuffer,
char* recvBuffer,
379 return this->GatherVVoidArray(sendBuffer, recvBuffer,
380 sendLength, recvLengths,
383 int GatherV(
const float* sendBuffer,
float* recvBuffer,
386 return this->GatherVVoidArray(sendBuffer, recvBuffer,
387 sendLength, recvLengths,
390 int GatherV(
const double* sendBuffer,
double* recvBuffer,
393 return this->GatherVVoidArray(sendBuffer, recvBuffer,
394 sendLength, recvLengths,
397 #ifdef VTK_USE_64BIT_IDS
401 return this->GatherVVoidArray(sendBuffer, recvBuffer,
402 sendLength, recvLengths,
418 int Scatter(
const int *sendBuffer,
int *recvBuffer,
420 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
423 int Scatter(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
425 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
428 int Scatter(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
430 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
433 int Scatter(
const char *sendBuffer,
char *recvBuffer,
435 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
438 int Scatter(
const float *sendBuffer,
float *recvBuffer,
440 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
443 int Scatter(
const double *sendBuffer,
double *recvBuffer,
445 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
448 #ifdef VTK_USE_64BIT_IDS
451 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
466 int ScatterV(
const int *sendBuffer,
int *recvBuffer,
468 vtkIdType recvLength,
int srcProcessId) {
469 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
470 sendLengths, offsets, recvLength,
473 int ScatterV(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
475 vtkIdType recvLength,
int srcProcessId) {
476 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
477 sendLengths, offsets, recvLength,
480 int ScatterV(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
482 vtkIdType recvLength,
int srcProcessId) {
483 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
484 sendLengths, offsets, recvLength,
487 int ScatterV(
const char *sendBuffer,
char *recvBuffer,
489 vtkIdType recvLength,
int srcProcessId) {
490 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
491 sendLengths, offsets, recvLength,
494 int ScatterV(
const float *sendBuffer,
float *recvBuffer,
496 vtkIdType recvLength,
int srcProcessId) {
497 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
498 sendLengths, offsets, recvLength,
501 int ScatterV(
const double *sendBuffer,
double *recvBuffer,
503 vtkIdType recvLength,
int srcProcessId) {
504 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
505 sendLengths, offsets, recvLength,
508 #ifdef VTK_USE_64BIT_IDS
511 vtkIdType recvLength,
int srcProcessId) {
512 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
513 sendLengths, offsets, recvLength,
522 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
VTK_INT);
524 int AllGather(
const unsigned long *sendBuffer,
526 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
529 int AllGather(
const unsigned char *sendBuffer,
531 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
535 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
VTK_CHAR);
538 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
VTK_FLOAT);
540 int AllGather(
const double *sendBuffer,
542 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
VTK_DOUBLE);
544 #ifdef VTK_USE_64BIT_IDS
547 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
556 int AllGatherV(
const int* sendBuffer,
int* recvBuffer,
559 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
560 sendLength, recvLengths,
563 int AllGatherV(
const unsigned long* sendBuffer,
unsigned long* recvBuffer,
566 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
567 sendLength, recvLengths,
570 int AllGatherV(
const unsigned char* sendBuffer,
unsigned char* recvBuffer,
573 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
574 sendLength, recvLengths,
577 int AllGatherV(
const char* sendBuffer,
char* recvBuffer,
580 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
581 sendLength, recvLengths,
584 int AllGatherV(
const float* sendBuffer,
float* recvBuffer,
587 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
588 sendLength, recvLengths,
591 int AllGatherV(
const double* sendBuffer,
double* recvBuffer,
594 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
595 sendLength, recvLengths,
598 #ifdef VTK_USE_64BIT_IDS
602 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
603 sendLength, recvLengths,
616 int Reduce(
const int *sendBuffer,
int *recvBuffer,
618 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
619 VTK_INT, operation, destProcessId);
621 int Reduce(
const unsigned int *sendBuffer,
unsigned int *recvBuffer,
623 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
626 int Reduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
628 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
631 int Reduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
633 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
636 int Reduce(
const char *sendBuffer,
char *recvBuffer,
638 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
639 VTK_CHAR, operation, destProcessId);
641 int Reduce(
const float *sendBuffer,
float *recvBuffer,
643 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
646 int Reduce(
const double *sendBuffer,
double *recvBuffer,
648 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
651 #ifdef VTK_USE_64BIT_IDS
654 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
659 int operation,
int destProcessId);
666 int Reduce(
const int *sendBuffer,
int *recvBuffer,
668 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
669 VTK_INT, operation, destProcessId);
671 int Reduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
673 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
676 int Reduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
678 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
681 int Reduce(
const char *sendBuffer,
char *recvBuffer,
683 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
684 VTK_CHAR, operation, destProcessId);
686 int Reduce(
const float *sendBuffer,
float *recvBuffer,
688 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
691 int Reduce(
const double *sendBuffer,
double *recvBuffer,
693 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
696 #ifdef VTK_USE_64BIT_IDS
699 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
704 Operation *operation,
int destProcessId);
710 int AllReduce(
const int *sendBuffer,
int *recvBuffer,
712 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
715 int AllReduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
717 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
720 int AllReduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
722 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
725 int AllReduce(
const char *sendBuffer,
char *recvBuffer,
727 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
730 int AllReduce(
const float *sendBuffer,
float *recvBuffer,
732 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
735 int AllReduce(
const double *sendBuffer,
double *recvBuffer,
737 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
740 #ifdef VTK_USE_64BIT_IDS
743 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
749 int AllReduce(
const int *sendBuffer,
int *recvBuffer,
751 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
754 int AllReduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
756 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
759 int AllReduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
761 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
764 int AllReduce(
const char *sendBuffer,
char *recvBuffer,
766 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
769 int AllReduce(
const float *sendBuffer,
float *recvBuffer,
771 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
774 int AllReduce(
const double *sendBuffer,
double *recvBuffer,
776 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
779 #ifdef VTK_USE_64BIT_IDS
782 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
787 Operation *operation);
795 virtual int GatherVoidArray(
const void *sendBuffer,
void *recvBuffer,
797 virtual int GatherVVoidArray(
const void *sendBuffer,
void *recvBuffer,
800 virtual int ScatterVoidArray(
const void *sendBuffer,
void *recvBuffer,
802 virtual int ScatterVVoidArray(
const void *sendBuffer,
void *recvBuffer,
806 virtual int AllGatherVoidArray(
const void *sendBuffer,
void *recvBuffer,
808 virtual int AllGatherVVoidArray(
const void *sendBuffer,
void *recvBuffer,
811 virtual int ReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
813 int operation,
int destProcessId);
814 virtual int ReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
816 Operation *operation,
int destProcessId);
817 virtual int AllReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
820 virtual int AllReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
822 Operation *operation);
825 static void SetUseCopy(
int useCopy);
837 virtual int ComputeGlobalBounds(
int processorId,
int numProcesses,
839 int *rightHasBounds = 0,
840 int *leftHasBounds = 0,
841 int hasBoundsTag = 288402,
842 int localBoundsTag = 288403,
843 int globalBoundsTag = 288404);
851 static int GetParentProcessor(
int pid);
852 static int GetLeftChildProcessor(
int pid);
876 int remoteHandle,
int tag,
int type=-1);
878 int remoteHandle,
int tag);
879 int ReceiveMultiBlockDataSet(
881 int ReceiveTemporalDataSet(
898 #endif // __vtkCommunicator_h