40 #ifndef __vtkMultiProcessController_h
41 #define __vtkMultiProcessController_h
43 #include "vtkParallelCoreModule.h"
65 void *remoteArg,
int remoteArgLength,
79 virtual void Initialize(
int* vtkNotUsed(argc),
char*** vtkNotUsed(argv))=0;
85 virtual void Initialize(
int* vtkNotUsed(argc),
char*** vtkNotUsed(argv),
86 int initializedExternally)=0;
91 virtual void Finalize()=0;
96 virtual void Finalize(
int finalizedExternally)=0;
102 void SetNumberOfProcesses(
int num);
103 int GetNumberOfProcesses();
123 virtual void SingleMethodExecute() = 0;
138 virtual void MultipleMethodExecute() = 0;
141 int GetLocalProcessId();
151 virtual void CreateOutputWindow() = 0;
196 virtual int RemoveFirstRMI(
int tag);
200 virtual int RemoveRMI(
unsigned long id);
205 {(void)f; (void)arg; (void)tag; vtkErrorMacro(
"RemoveRMI Not Implemented Yet");};
217 virtual void RemoveAllRMICallbacks(
int tag);
220 virtual bool RemoveRMICallback(
unsigned long id);
225 void TriggerRMI(
int remoteProcessId,
void *arg,
int argLength,
int tag);
229 void TriggerBreakRMIs();
233 void TriggerRMI(
int remoteProcessId,
const char *arg,
int tag)
234 { this->
TriggerRMI(remoteProcessId, (
void*)arg,
235 static_cast<int>(strlen(arg))+1, tag); }
240 void TriggerRMI(
int remoteProcessId,
int tag)
241 { this->
TriggerRMI(remoteProcessId, NULL, 0, tag); }
251 void TriggerRMIOnAllChildren(
void *arg,
int argLength,
int tag);
252 void TriggerRMIOnAllChildren(
const char *arg,
int tag)
254 this->TriggerRMIOnAllChildren(
255 (
void*)arg, static_cast<int>(strlen(arg))+1, tag);
257 void TriggerRMIOnAllChildren(
int tag)
259 this->TriggerRMIOnAllChildren(NULL, 0, tag);
271 int ProcessRMIs(
int reportErrors,
int dont_loop = 0);
279 vtkSetMacro(BreakFlag,
int);
280 vtkGetMacro(BreakFlag,
int);
316 XML_WRITER_DATA_INFO = 4
342 #ifdef VTK_USE_64BIT_IDS
369 int Receive(
int*
data,
vtkIdType maxlength,
int remoteProcessId,
int tag);
370 int Receive(
unsigned int*
data,
vtkIdType maxlength,
int remoteProcessId,
int tag);
371 int Receive(
unsigned long*
data,
vtkIdType maxlength,
int remoteProcessId,
373 int Receive(
char*
data,
vtkIdType maxlength,
int remoteProcessId,
int tag);
374 int Receive(
unsigned char*
data,
vtkIdType maxlength,
int remoteProcessId,
int tag);
375 int Receive(
float*
data,
vtkIdType maxlength,
int remoteProcessId,
int tag);
376 int Receive(
double*
data,
vtkIdType maxlength,
int remoteProcessId,
int tag);
377 #ifdef VTK_USE_64BIT_IDS
408 return this->Communicator->Broadcast(data, length, srcProcessId);
411 return this->Communicator->Broadcast(data, length, srcProcessId);
414 return this->Communicator->Broadcast(data, length, srcProcessId);
417 return this->Communicator->Broadcast(data, length, srcProcessId);
420 return this->Communicator->Broadcast(data, length, srcProcessId);
423 return this->Communicator->Broadcast(data, length, srcProcessId);
426 return this->Communicator->Broadcast(data, length, srcProcessId);
428 #ifdef VTK_USE_64BIT_IDS
430 return this->Communicator->Broadcast(data, length, srcProcessId);
434 return this->Communicator->Broadcast(data, srcProcessId);
437 return this->Communicator->Broadcast(data, srcProcessId);
441 return this->Communicator->Broadcast(stream, srcProcessId);
455 int Gather(
const int *sendBuffer,
int *recvBuffer,
457 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
460 int Gather(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
462 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
465 int Gather(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
467 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
470 int Gather(
const char *sendBuffer,
char *recvBuffer,
472 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
475 int Gather(
const float *sendBuffer,
float *recvBuffer,
477 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
480 int Gather(
const double *sendBuffer,
double *recvBuffer,
482 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
485 #ifdef VTK_USE_64BIT_IDS
488 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
494 return this->Communicator->Gather(sendBuffer, recvBuffer, destProcessId);
509 int GatherV(
const int* sendBuffer,
int* recvBuffer,
512 return this->Communicator->GatherV(sendBuffer, recvBuffer,
513 sendLength, recvLengths,
514 offsets, destProcessId);
516 int GatherV(
const unsigned long* sendBuffer,
unsigned long* recvBuffer,
519 return this->Communicator->GatherV(sendBuffer, recvBuffer,
520 sendLength, recvLengths,
521 offsets, destProcessId);
523 int GatherV(
const unsigned char* sendBuffer,
unsigned char* recvBuffer,
526 return this->Communicator->GatherV(sendBuffer, recvBuffer,
527 sendLength, recvLengths,
528 offsets, destProcessId);
530 int GatherV(
const char* sendBuffer,
char* recvBuffer,
533 return this->Communicator->GatherV(sendBuffer, recvBuffer,
534 sendLength, recvLengths,
535 offsets, destProcessId);
537 int GatherV(
const float* sendBuffer,
float* recvBuffer,
540 return this->Communicator->GatherV(sendBuffer, recvBuffer,
541 sendLength, recvLengths,
542 offsets, destProcessId);
544 int GatherV(
const double* sendBuffer,
double* recvBuffer,
547 return this->Communicator->GatherV(sendBuffer, recvBuffer,
548 sendLength, recvLengths,
549 offsets, destProcessId);
551 #ifdef VTK_USE_64BIT_IDS
555 return this->Communicator->GatherV(sendBuffer, recvBuffer,
556 sendLength, recvLengths,
557 offsets, destProcessId);
562 return this->Communicator->GatherV(sendBuffer, recvBuffer,
563 recvLengths, offsets,
576 return this->Communicator->GatherV(sendBuffer, recvBuffer, destProcessId);
586 int Scatter(
const int *sendBuffer,
int *recvBuffer,
588 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
591 int Scatter(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
593 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
596 int Scatter(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
598 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
601 int Scatter(
const char *sendBuffer,
char *recvBuffer,
603 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
606 int Scatter(
const float *sendBuffer,
float *recvBuffer,
608 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
611 int Scatter(
const double *sendBuffer,
double *recvBuffer,
613 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
616 #ifdef VTK_USE_64BIT_IDS
619 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
625 return this->Communicator->Scatter(sendBuffer, recvBuffer, srcProcessId);
636 int ScatterV(
const int *sendBuffer,
int *recvBuffer,
638 vtkIdType recvLength,
int srcProcessId) {
639 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
640 sendLengths, offsets, recvLength,
643 int ScatterV(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
645 vtkIdType recvLength,
int srcProcessId) {
646 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
647 sendLengths, offsets, recvLength,
650 int ScatterV(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
652 vtkIdType recvLength,
int srcProcessId) {
653 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
654 sendLengths, offsets, recvLength,
657 int ScatterV(
const char *sendBuffer,
char *recvBuffer,
659 vtkIdType recvLength,
int srcProcessId) {
660 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
661 sendLengths, offsets, recvLength,
664 int ScatterV(
const float *sendBuffer,
float *recvBuffer,
666 vtkIdType recvLength,
int srcProcessId) {
667 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
668 sendLengths, offsets, recvLength,
671 int ScatterV(
const double *sendBuffer,
double *recvBuffer,
673 vtkIdType recvLength,
int srcProcessId) {
674 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
675 sendLengths, offsets, recvLength,
678 #ifdef VTK_USE_64BIT_IDS
681 vtkIdType recvLength,
int srcProcessId) {
682 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
683 sendLengths, offsets, recvLength,
692 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
694 int AllGather(
const unsigned long *sendBuffer,
695 unsigned long *recvBuffer,
vtkIdType length) {
696 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
698 int AllGather(
const unsigned char *sendBuffer,
699 unsigned char *recvBuffer,
vtkIdType length) {
700 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
703 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
706 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
708 int AllGather(
const double *sendBuffer,
710 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
712 #ifdef VTK_USE_64BIT_IDS
715 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
719 return this->Communicator->AllGather(sendBuffer, recvBuffer);
725 int AllGatherV(
const int* sendBuffer,
int* recvBuffer,
728 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
729 sendLength, recvLengths,
732 int AllGatherV(
const unsigned long* sendBuffer,
unsigned long* recvBuffer,
735 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
736 sendLength, recvLengths,
739 int AllGatherV(
const unsigned char* sendBuffer,
unsigned char* recvBuffer,
742 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
743 sendLength, recvLengths,
746 int AllGatherV(
const char* sendBuffer,
char* recvBuffer,
749 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
750 sendLength, recvLengths,
753 int AllGatherV(
const float* sendBuffer,
float* recvBuffer,
756 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
757 sendLength, recvLengths,
760 int AllGatherV(
const double* sendBuffer,
double* recvBuffer,
763 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
764 sendLength, recvLengths,
767 #ifdef VTK_USE_64BIT_IDS
771 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
772 sendLength, recvLengths,
778 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
779 recvLengths, offsets);
790 return this->Communicator->AllGatherV(sendBuffer, recvBuffer);
798 int Reduce(
const int *sendBuffer,
int *recvBuffer,
799 vtkIdType length,
int operation,
int destProcessId) {
800 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
801 operation, destProcessId);
803 int Reduce(
const unsigned int *sendBuffer,
unsigned int *recvBuffer,
804 vtkIdType length,
int operation,
int destProcessId) {
805 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
806 operation, destProcessId);
808 int Reduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
809 vtkIdType length,
int operation,
int destProcessId) {
810 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
811 operation, destProcessId);
813 int Reduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
814 vtkIdType length,
int operation,
int destProcessId) {
815 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
816 operation, destProcessId);
818 int Reduce(
const char *sendBuffer,
char *recvBuffer,
819 vtkIdType length,
int operation,
int destProcessId) {
820 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
821 operation, destProcessId);
823 int Reduce(
const float *sendBuffer,
float *recvBuffer,
824 vtkIdType length,
int operation,
int destProcessId) {
825 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
826 operation, destProcessId);
828 int Reduce(
const double *sendBuffer,
double *recvBuffer,
829 vtkIdType length,
int operation,
int destProcessId) {
830 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
831 operation, destProcessId);
833 #ifdef VTK_USE_64BIT_IDS
835 vtkIdType length,
int operation,
int destProcessId) {
836 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
837 operation, destProcessId);
841 int operation,
int destProcessId) {
842 return this->Communicator->Reduce(sendBuffer, recvBuffer,
843 operation, destProcessId);
852 int Reduce(
const int *sendBuffer,
int *recvBuffer,
855 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
856 operation, destProcessId);
858 int Reduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
861 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
862 operation, destProcessId);
864 int Reduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
867 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
868 operation, destProcessId);
870 int Reduce(
const char *sendBuffer,
char *recvBuffer,
873 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
874 operation, destProcessId);
876 int Reduce(
const float *sendBuffer,
float *recvBuffer,
879 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
880 operation, destProcessId);
882 int Reduce(
const double *sendBuffer,
double *recvBuffer,
885 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
886 operation, destProcessId);
888 #ifdef VTK_USE_64BIT_IDS
892 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
893 operation, destProcessId);
898 return this->Communicator->Reduce(sendBuffer, recvBuffer,
899 operation, destProcessId);
907 int AllReduce(
const int *sendBuffer,
int *recvBuffer,
909 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
912 int AllReduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
914 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
917 int AllReduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
919 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
922 int AllReduce(
const char *sendBuffer,
char *recvBuffer,
924 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
927 int AllReduce(
const float *sendBuffer,
float *recvBuffer,
929 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
932 int AllReduce(
const double *sendBuffer,
double *recvBuffer,
934 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
937 #ifdef VTK_USE_64BIT_IDS
940 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
946 return this->Communicator->AllReduce(sendBuffer, recvBuffer, operation);
949 int AllReduce(
const int *sendBuffer,
int *recvBuffer,
951 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
954 int AllReduce(
const unsigned long *sendBuffer,
unsigned long *recvBuffer,
956 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
959 int AllReduce(
const unsigned char *sendBuffer,
unsigned char *recvBuffer,
961 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
964 int AllReduce(
const char *sendBuffer,
char *recvBuffer,
966 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
969 int AllReduce(
const float *sendBuffer,
float *recvBuffer,
971 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
974 int AllReduce(
const double *sendBuffer,
double *recvBuffer,
976 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
979 #ifdef VTK_USE_64BIT_IDS
982 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
988 return this->Communicator->AllReduce(sendBuffer, recvBuffer, operation);
1003 virtual void TriggerRMIInternal(
int remoteProcessId,
1004 void* arg,
int argLength,
int rmiTag,
bool propagate);
1016 void ProcessRMI(
int remoteProcessId,
void *arg,
int argLength,
int rmiTag);
1046 unsigned long RMICount;
1050 vtkInternal *Internal;
1056 int remoteProcessId,
int tag)
1069 int remoteProcessId,
int tag)
1082 int remoteProcessId,
int tag)
1095 int remoteProcessId,
int tag)
1109 int remoteProcessId,
1123 int remoteProcessId,
int tag)
1137 int remoteProcessId,
int tag)
1150 int remoteProcessId,
int tag)
1163 int remoteProcessId,
int tag)
1175 #ifdef VTK_USE_64BIT_IDS
1178 int remoteProcessId,
int tag)
1192 int remoteId,
int tag)
1202 int remoteProcessId,
int tag)
1215 int remoteProcessId,
int tag)
1228 int remoteProcessId,
int tag)
1241 int remoteProcessId,
int tag)
1254 int remoteProcessId,
int tag)
1268 int remoteProcessId,
1282 int remoteProcessId,
int tag)
1296 int remoteProcessId,
int tag)
1309 int remoteProcessId,
int tag)
1322 int remoteProcessId,
int tag)
1334 #ifdef VTK_USE_64BIT_IDS
1337 int remoteProcessId,
int tag)
1352 int remoteId,
int tag)