00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00040 #ifndef __vtkMultiProcessController_h
00041 #define __vtkMultiProcessController_h
00042
00043 #include "vtkObject.h"
00044
00045 #include "vtkCommunicator.h"
00046
00047 class vtkDataSet;
00048 class vtkImageData;
00049 class vtkCollection;
00050 class vtkOutputWindow;
00051 class vtkDataObject;
00052 class vtkProcessGroup;
00053 class vtkMultiProcessController;
00054
00055
00056
00057 typedef void (*vtkProcessFunctionType)(vtkMultiProcessController *controller,
00058 void *userData);
00059
00060
00061 typedef void (*vtkRMIFunctionType)(void *localArg,
00062 void *remoteArg, int remoteArgLength,
00063 int remoteProcessId);
00064
00065
00066
00067 class VTK_PARALLEL_EXPORT vtkMultiProcessController : public vtkObject
00068 {
00069 public:
00070 vtkTypeRevisionMacro(vtkMultiProcessController,vtkObject);
00071 void PrintSelf(ostream& os, vtkIndent indent);
00072
00076 virtual void Initialize(int* vtkNotUsed(argc), char*** vtkNotUsed(argv))=0;
00077
00079
00082 virtual void Initialize(int* vtkNotUsed(argc), char*** vtkNotUsed(argv),
00083 int initializedExternally)=0;
00085
00088 virtual void Finalize()=0;
00089
00093 virtual void Finalize(int finalizedExternally)=0;
00094
00096
00099 void SetNumberOfProcesses(int num);
00100 int GetNumberOfProcesses();
00102
00103
00105
00108 void SetSingleMethod(vtkProcessFunctionType, void *data);
00109
00111
00115 virtual void SingleMethodExecute() = 0;
00116
00117
00119
00123 void SetMultipleMethod(int index, vtkProcessFunctionType, void *data);
00124
00126
00130 virtual void MultipleMethodExecute() = 0;
00131
00133 int GetLocalProcessId();
00134
00139 static vtkMultiProcessController *GetGlobalController();
00140
00143 virtual void CreateOutputWindow() = 0;
00144
00146
00156 virtual vtkMultiProcessController *CreateSubController(
00157 vtkProcessGroup *group);
00159
00160
00161
00172 unsigned long AddRMI(vtkRMIFunctionType, void *localArg, int tag);
00173
00175 int RemoveFirstRMI(int tag);
00176
00179 int RemoveRMI(unsigned long id);
00180
00182
00183 void RemoveRMI(vtkRMIFunctionType f, void *arg, int tag)
00184 {f = f; arg = arg; tag = tag; vtkErrorMacro("RemoveRMI Not Implemented Yet");};
00185
00187
00189 void TriggerRMI(int remoteProcessId, void *arg, int argLength, int tag);
00190
00193 void TriggerBreakRMIs();
00194
00196
00197 void TriggerRMI(int remoteProcessId, const char *arg, int tag)
00198 { this->TriggerRMI(remoteProcessId, (void*)arg,
00199 static_cast<int>(strlen(arg))+1, tag); }
00201
00203
00204 void TriggerRMI(int remoteProcessId, int tag)
00205 { this->TriggerRMI(remoteProcessId, NULL, 0, tag); }
00207
00209
00216 int ProcessRMIs(int reportErrors, int dont_loop = 0);
00217 int ProcessRMIs();
00219
00221
00224 vtkSetMacro(BreakFlag, int);
00225 vtkGetMacro(BreakFlag, int);
00227
00229
00231 vtkGetObjectMacro(Communicator, vtkCommunicator);
00233
00235
00236 static int GetBreakRMITag() { return BREAK_RMI_TAG; }
00237 static int GetRMITag() { return RMI_TAG; }
00238 static int GetRMIArgTag() { return RMI_ARG_TAG; }
00240
00241
00242
00243 enum Errors
00244 {
00245 RMI_NO_ERROR,
00246 RMI_TAG_ERROR,
00247 RMI_ARG_ERROR
00248 };
00249
00250 enum Consts
00251 {
00252 MAX_PROCESSES = 8192,
00253 ANY_SOURCE = -1,
00254 INVALID_SOURCE = -2
00255 };
00256
00257 enum Tags
00258 {
00259 RMI_TAG = 1,
00260 RMI_ARG_TAG = 2,
00261 BREAK_RMI_TAG = 3,
00262 XML_WRITER_DATA_INFO = 4
00263 };
00264
00265
00266
00268 void Barrier();
00269
00270 static void SetGlobalController(vtkMultiProcessController *controller);
00271
00272
00273
00275
00277 int Send(const int* data, vtkIdType length, int remoteProcessId, int tag);
00278 int Send(const unsigned long* data, vtkIdType length, int remoteProcessId,
00279 int tag);
00280 int Send(const char* data, vtkIdType length, int remoteProcessId, int tag);
00281 int Send(const unsigned char* data, vtkIdType length, int remoteProcessId, int tag);
00282 int Send(const float* data, vtkIdType length, int remoteProcessId, int tag);
00283 int Send(const double* data, vtkIdType length, int remoteProcessId, int tag);
00284 #ifdef VTK_USE_64BIT_IDS
00285 int Send(const vtkIdType* data, vtkIdType length, int remoteProcessId, int tag);
00287 #endif
00288 int Send(vtkDataObject *data, int remoteId, int tag);
00289 int Send(vtkDataArray *data, int remoteId, int tag);
00290
00292
00295 int Receive(int* data, vtkIdType length, int remoteProcessId, int tag);
00296 int Receive(unsigned long* data, vtkIdType length, int remoteProcessId,
00297 int tag);
00298 int Receive(char* data, vtkIdType length, int remoteProcessId, int tag);
00299 int Receive(unsigned char* data, vtkIdType length, int remoteProcessId, int tag);
00300 int Receive(float* data, vtkIdType length, int remoteProcessId, int tag);
00301 int Receive(double* data, vtkIdType length, int remoteProcessId, int tag);
00302 #ifdef VTK_USE_64BIT_IDS
00303 int Receive(vtkIdType* data, vtkIdType length, int remoteProcessId, int tag);
00305 #endif
00306 int Receive(vtkDataObject* data, int remoteId, int tag);
00307 int Receive(vtkDataArray* data, int remoteId, int tag);
00308
00309 vtkDataObject *ReceiveDataObject(int remoteId, int tag);
00310
00311
00312
00314
00317 int Broadcast(int *data, vtkIdType length, int srcProcessId) {
00318 return this->Communicator->Broadcast(data, length, srcProcessId);
00319 }
00320 int Broadcast(unsigned long *data, vtkIdType length, int srcProcessId) {
00321 return this->Communicator->Broadcast(data, length, srcProcessId);
00322 }
00323 int Broadcast(unsigned char *data, vtkIdType length, int srcProcessId) {
00324 return this->Communicator->Broadcast(data, length, srcProcessId);
00325 }
00326 int Broadcast(char *data, vtkIdType length, int srcProcessId) {
00327 return this->Communicator->Broadcast(data, length, srcProcessId);
00328 }
00329 int Broadcast(float *data, vtkIdType length, int srcProcessId) {
00330 return this->Communicator->Broadcast(data, length, srcProcessId);
00331 }
00332 int Broadcast(double *data, vtkIdType length, int srcProcessId) {
00333 return this->Communicator->Broadcast(data, length, srcProcessId);
00334 }
00335 #ifdef VTK_USE_64BIT_IDS
00336 int Broadcast(vtkIdType *data, vtkIdType length, int srcProcessId) {
00337 return this->Communicator->Broadcast(data, length, srcProcessId);
00338 }
00340 #endif
00341 int Broadcast(vtkDataObject *data, int srcProcessId) {
00342 return this->Communicator->Broadcast(data, srcProcessId);
00343 }
00344 int Broadcast(vtkDataArray *data, int srcProcessId) {
00345 return this->Communicator->Broadcast(data, srcProcessId);
00346 }
00347
00349
00357 int Gather(const int *sendBuffer, int *recvBuffer,
00358 vtkIdType length, int destProcessId) {
00359 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
00360 destProcessId);
00361 }
00362 int Gather(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00363 vtkIdType length, int destProcessId) {
00364 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
00365 destProcessId);
00366 }
00367 int Gather(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00368 vtkIdType length, int destProcessId) {
00369 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
00370 destProcessId);
00371 }
00372 int Gather(const char *sendBuffer, char *recvBuffer,
00373 vtkIdType length, int destProcessId) {
00374 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
00375 destProcessId);
00376 }
00377 int Gather(const float *sendBuffer, float *recvBuffer,
00378 vtkIdType length, int destProcessId) {
00379 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
00380 destProcessId);
00381 }
00382 int Gather(const double *sendBuffer, double *recvBuffer,
00383 vtkIdType length, int destProcessId) {
00384 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
00385 destProcessId);
00386 }
00387 #ifdef VTK_USE_64BIT_IDS
00388 int Gather(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00389 vtkIdType length, int destProcessId) {
00390 return this->Communicator->Gather(sendBuffer, recvBuffer, length,
00391 destProcessId);
00392 }
00394 #endif
00395 int Gather(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00396 int destProcessId) {
00397 return this->Communicator->Gather(sendBuffer, recvBuffer, destProcessId);
00398 }
00399
00401
00411 int GatherV(const int* sendBuffer, int* recvBuffer,
00412 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00413 int destProcessId) {
00414 return this->Communicator->GatherV(sendBuffer, recvBuffer,
00415 sendLength, recvLengths,
00416 offsets, destProcessId);
00417 }
00418 int GatherV(const unsigned long* sendBuffer, unsigned long* recvBuffer,
00419 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00420 int destProcessId) {
00421 return this->Communicator->GatherV(sendBuffer, recvBuffer,
00422 sendLength, recvLengths,
00423 offsets, destProcessId);
00424 }
00425 int GatherV(const unsigned char* sendBuffer, unsigned char* recvBuffer,
00426 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00427 int destProcessId) {
00428 return this->Communicator->GatherV(sendBuffer, recvBuffer,
00429 sendLength, recvLengths,
00430 offsets, destProcessId);
00431 }
00432 int GatherV(const char* sendBuffer, char* recvBuffer,
00433 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00434 int destProcessId) {
00435 return this->Communicator->GatherV(sendBuffer, recvBuffer,
00436 sendLength, recvLengths,
00437 offsets, destProcessId);
00438 }
00439 int GatherV(const float* sendBuffer, float* recvBuffer,
00440 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00441 int destProcessId) {
00442 return this->Communicator->GatherV(sendBuffer, recvBuffer,
00443 sendLength, recvLengths,
00444 offsets, destProcessId);
00445 }
00446 int GatherV(const double* sendBuffer, double* recvBuffer,
00447 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00448 int destProcessId) {
00449 return this->Communicator->GatherV(sendBuffer, recvBuffer,
00450 sendLength, recvLengths,
00451 offsets, destProcessId);
00452 }
00453 #ifdef VTK_USE_64BIT_IDS
00454 int GatherV(const vtkIdType* sendBuffer, vtkIdType* recvBuffer,
00455 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00456 int destProcessId) {
00457 return this->Communicator->GatherV(sendBuffer, recvBuffer,
00458 sendLength, recvLengths,
00459 offsets, destProcessId);
00460 }
00462 #endif
00463
00465
00470 int Scatter(const int *sendBuffer, int *recvBuffer,
00471 vtkIdType length, int srcProcessId) {
00472 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
00473 srcProcessId);
00474 }
00475 int Scatter(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00476 vtkIdType length, int srcProcessId) {
00477 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
00478 srcProcessId);
00479 }
00480 int Scatter(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00481 vtkIdType length, int srcProcessId) {
00482 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
00483 srcProcessId);
00484 }
00485 int Scatter(const char *sendBuffer, char *recvBuffer,
00486 vtkIdType length, int srcProcessId) {
00487 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
00488 srcProcessId);
00489 }
00490 int Scatter(const float *sendBuffer, float *recvBuffer,
00491 vtkIdType length, int srcProcessId) {
00492 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
00493 srcProcessId);
00494 }
00495 int Scatter(const double *sendBuffer, double *recvBuffer,
00496 vtkIdType length, int srcProcessId) {
00497 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
00498 srcProcessId);
00499 }
00500 #ifdef VTK_USE_64BIT_IDS
00501 int Scatter(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00502 vtkIdType length, int srcProcessId) {
00503 return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
00504 srcProcessId);
00505 }
00507 #endif
00508 int Scatter(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00509 int srcProcessId) {
00510 return this->Communicator->Scatter(sendBuffer, recvBuffer, srcProcessId);
00511 }
00512
00514
00520 int ScatterV(const int *sendBuffer, int *recvBuffer,
00521 vtkIdType *sendLengths, vtkIdType *offsets,
00522 vtkIdType recvLength, int srcProcessId) {
00523 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
00524 sendLengths, offsets, recvLength,
00525 srcProcessId);
00526 }
00527 int ScatterV(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00528 vtkIdType *sendLengths, vtkIdType *offsets,
00529 vtkIdType recvLength, int srcProcessId) {
00530 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
00531 sendLengths, offsets, recvLength,
00532 srcProcessId);
00533 }
00534 int ScatterV(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00535 vtkIdType *sendLengths, vtkIdType *offsets,
00536 vtkIdType recvLength, int srcProcessId) {
00537 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
00538 sendLengths, offsets, recvLength,
00539 srcProcessId);
00540 }
00541 int ScatterV(const char *sendBuffer, char *recvBuffer,
00542 vtkIdType *sendLengths, vtkIdType *offsets,
00543 vtkIdType recvLength, int srcProcessId) {
00544 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
00545 sendLengths, offsets, recvLength,
00546 srcProcessId);
00547 }
00548 int ScatterV(const float *sendBuffer, float *recvBuffer,
00549 vtkIdType *sendLengths, vtkIdType *offsets,
00550 vtkIdType recvLength, int srcProcessId) {
00551 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
00552 sendLengths, offsets, recvLength,
00553 srcProcessId);
00554 }
00555 int ScatterV(const double *sendBuffer, double *recvBuffer,
00556 vtkIdType *sendLengths, vtkIdType *offsets,
00557 vtkIdType recvLength, int srcProcessId) {
00558 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
00559 sendLengths, offsets, recvLength,
00560 srcProcessId);
00561 }
00562 #ifdef VTK_USE_64BIT_IDS
00563 int ScatterV(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00564 vtkIdType *sendLengths, vtkIdType *offsets,
00565 vtkIdType recvLength, int srcProcessId) {
00566 return this->Communicator->ScatterV(sendBuffer, recvBuffer,
00567 sendLengths, offsets, recvLength,
00568 srcProcessId);
00569 }
00571 #endif
00572
00574
00575 int AllGather(const int *sendBuffer, int *recvBuffer, vtkIdType length) {
00576 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
00577 }
00578 int AllGather(const unsigned long *sendBuffer,
00579 unsigned long *recvBuffer, vtkIdType length) {
00580 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
00581 }
00582 int AllGather(const unsigned char *sendBuffer,
00583 unsigned char *recvBuffer, vtkIdType length) {
00584 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
00585 }
00586 int AllGather(const char *sendBuffer, char *recvBuffer, vtkIdType length) {
00587 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
00588 }
00589 int AllGather(const float *sendBuffer, float *recvBuffer, vtkIdType length) {
00590 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
00591 }
00592 int AllGather(const double *sendBuffer,
00593 double *recvBuffer, vtkIdType length) {
00594 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
00595 }
00596 #ifdef VTK_USE_64BIT_IDS
00597 int AllGather(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00598 vtkIdType length) {
00599 return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
00600 }
00602 #endif
00603 int AllGather(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer) {
00604 return this->Communicator->AllGather(sendBuffer, recvBuffer);
00605 }
00606
00608
00609 int AllGatherV(const int* sendBuffer, int* recvBuffer,
00610 vtkIdType sendLength, vtkIdType* recvLengths,
00611 vtkIdType* offsets) {
00612 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
00613 sendLength, recvLengths,
00614 offsets);
00615 }
00616 int AllGatherV(const unsigned long* sendBuffer, unsigned long* recvBuffer,
00617 vtkIdType sendLength, vtkIdType* recvLengths,
00618 vtkIdType* offsets) {
00619 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
00620 sendLength, recvLengths,
00621 offsets);
00622 }
00623 int AllGatherV(const unsigned char* sendBuffer, unsigned char* recvBuffer,
00624 vtkIdType sendLength, vtkIdType* recvLengths,
00625 vtkIdType* offsets) {
00626 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
00627 sendLength, recvLengths,
00628 offsets);
00629 }
00630 int AllGatherV(const char* sendBuffer, char* recvBuffer,
00631 vtkIdType sendLength, vtkIdType* recvLengths,
00632 vtkIdType* offsets) {
00633 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
00634 sendLength, recvLengths,
00635 offsets);
00636 }
00637 int AllGatherV(const float* sendBuffer, float* recvBuffer,
00638 vtkIdType sendLength, vtkIdType* recvLengths,
00639 vtkIdType* offsets) {
00640 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
00641 sendLength, recvLengths,
00642 offsets);
00643 }
00644 int AllGatherV(const double* sendBuffer, double* recvBuffer,
00645 vtkIdType sendLength, vtkIdType* recvLengths,
00646 vtkIdType* offsets) {
00647 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
00648 sendLength, recvLengths,
00649 offsets);
00650 }
00651 #ifdef VTK_USE_64BIT_IDS
00652 int AllGatherV(const vtkIdType* sendBuffer, vtkIdType* recvBuffer,
00653 vtkIdType sendLength, vtkIdType* recvLengths,
00654 vtkIdType* offsets) {
00655 return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
00656 sendLength, recvLengths,
00657 offsets);
00658 }
00660 #endif
00661
00663
00666 int Reduce(const int *sendBuffer, int *recvBuffer,
00667 vtkIdType length, int operation, int destProcessId) {
00668 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00669 operation, destProcessId);
00670 }
00671 int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00672 vtkIdType length, int operation, int destProcessId) {
00673 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00674 operation, destProcessId);
00675 }
00676 int Reduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00677 vtkIdType length, int operation, int destProcessId) {
00678 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00679 operation, destProcessId);
00680 }
00681 int Reduce(const char *sendBuffer, char *recvBuffer,
00682 vtkIdType length, int operation, int destProcessId) {
00683 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00684 operation, destProcessId);
00685 }
00686 int Reduce(const float *sendBuffer, float *recvBuffer,
00687 vtkIdType length, int operation, int destProcessId) {
00688 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00689 operation, destProcessId);
00690 }
00691 int Reduce(const double *sendBuffer, double *recvBuffer,
00692 vtkIdType length, int operation, int destProcessId) {
00693 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00694 operation, destProcessId);
00695 }
00696 #ifdef VTK_USE_64BIT_IDS
00697 int Reduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00698 vtkIdType length, int operation, int destProcessId) {
00699 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00700 operation, destProcessId);
00701 }
00703 #endif
00704 int Reduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00705 int operation, int destProcessId) {
00706 return this->Communicator->Reduce(sendBuffer, recvBuffer,
00707 operation, destProcessId);
00708 }
00709
00710
00712
00715 int Reduce(const int *sendBuffer, int *recvBuffer,
00716 vtkIdType length, vtkCommunicator::Operation *operation,
00717 int destProcessId) {
00718 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00719 operation, destProcessId);
00720 }
00721 int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00722 vtkIdType length, vtkCommunicator::Operation *operation,
00723 int destProcessId) {
00724 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00725 operation, destProcessId);
00726 }
00727 int Reduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00728 vtkIdType length, vtkCommunicator::Operation *operation,
00729 int destProcessId) {
00730 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00731 operation, destProcessId);
00732 }
00733 int Reduce(const char *sendBuffer, char *recvBuffer,
00734 vtkIdType length, vtkCommunicator::Operation *operation,
00735 int destProcessId) {
00736 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00737 operation, destProcessId);
00738 }
00739 int Reduce(const float *sendBuffer, float *recvBuffer,
00740 vtkIdType length, vtkCommunicator::Operation *operation,
00741 int destProcessId) {
00742 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00743 operation, destProcessId);
00744 }
00745 int Reduce(const double *sendBuffer, double *recvBuffer,
00746 vtkIdType length, vtkCommunicator::Operation *operation,
00747 int destProcessId) {
00748 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00749 operation, destProcessId);
00750 }
00751 #ifdef VTK_USE_64BIT_IDS
00752 int Reduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00753 vtkIdType length, vtkCommunicator::Operation *operation,
00754 int destProcessId) {
00755 return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
00756 operation, destProcessId);
00757 }
00759 #endif
00760 int Reduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00761 vtkCommunicator::Operation *operation, int destProcessId) {
00762 return this->Communicator->Reduce(sendBuffer, recvBuffer,
00763 operation, destProcessId);
00764 }
00765
00766
00768
00770 int AllReduce(const int *sendBuffer, int *recvBuffer,
00771 vtkIdType length, int operation) {
00772 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00773 operation);
00774 }
00775 int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00776 vtkIdType length, int operation) {
00777 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00778 operation);
00779 }
00780 int AllReduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00781 vtkIdType length, int operation) {
00782 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00783 operation);
00784 }
00785 int AllReduce(const char *sendBuffer, char *recvBuffer,
00786 vtkIdType length, int operation) {
00787 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00788 operation);
00789 }
00790 int AllReduce(const float *sendBuffer, float *recvBuffer,
00791 vtkIdType length, int operation) {
00792 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00793 operation);
00794 }
00795 int AllReduce(const double *sendBuffer, double *recvBuffer,
00796 vtkIdType length, int operation) {
00797 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00798 operation);
00799 }
00800 #ifdef VTK_USE_64BIT_IDS
00801 int AllReduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00802 vtkIdType length, int operation) {
00803 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00804 operation);
00805 }
00807 #endif
00808 int AllReduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00809 int operation) {
00810 return this->Communicator->AllReduce(sendBuffer, recvBuffer, operation);
00811 }
00812
00813 int AllReduce(const int *sendBuffer, int *recvBuffer,
00814 vtkIdType length, vtkCommunicator::Operation *operation) {
00815 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00816 operation);
00817 }
00818 int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00819 vtkIdType length, vtkCommunicator::Operation *operation) {
00820 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00821 operation);
00822 }
00823 int AllReduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00824 vtkIdType length, vtkCommunicator::Operation *operation) {
00825 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00826 operation);
00827 }
00828 int AllReduce(const char *sendBuffer, char *recvBuffer,
00829 vtkIdType length, vtkCommunicator::Operation *operation) {
00830 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00831 operation);
00832 }
00833 int AllReduce(const float *sendBuffer, float *recvBuffer,
00834 vtkIdType length, vtkCommunicator::Operation *operation) {
00835 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00836 operation);
00837 }
00838 int AllReduce(const double *sendBuffer, double *recvBuffer,
00839 vtkIdType length, vtkCommunicator::Operation *operation) {
00840 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00841 operation);
00842 }
00843 #ifdef VTK_USE_64BIT_IDS
00844 int AllReduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00845 vtkIdType length, vtkCommunicator::Operation *operation) {
00846 return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
00847 operation);
00848 }
00849 #endif
00850 int AllReduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00851 vtkCommunicator::Operation *operation) {
00852 return this->Communicator->AllReduce(sendBuffer, recvBuffer, operation);
00853 }
00854
00855
00856
00857
00858 protected:
00859 vtkMultiProcessController();
00860 ~vtkMultiProcessController();
00861
00862 vtkProcessFunctionType SingleMethod;
00863 void *SingleData;
00864 vtkProcessFunctionType MultipleMethod[MAX_PROCESSES];
00865 void *MultipleData[MAX_PROCESSES];
00866
00867 vtkCollection *RMIs;
00868
00869
00870
00871 int BreakFlag;
00872
00873 void ProcessRMI(int remoteProcessId, void *arg, int argLength, int rmiTag);
00874
00875
00876
00877 virtual vtkMultiProcessController *GetLocalController();
00878
00879
00880
00881 int ForceDeepCopy;
00882
00883 vtkOutputWindow* OutputWindow;
00884
00885
00886
00887
00888 vtkCommunicator* Communicator;
00889
00890
00891
00892
00893
00894
00895
00896
00897 vtkCommunicator* RMICommunicator;
00898
00899 private:
00900 vtkMultiProcessController(const vtkMultiProcessController&);
00901 void operator=(const vtkMultiProcessController&);
00902
00903 unsigned long RMICount;
00904 };
00905
00906
00907 inline int vtkMultiProcessController::Send(vtkDataObject *data,
00908 int remoteProcessId, int tag)
00909 {
00910 if (this->Communicator)
00911 {
00912 return this->Communicator->Send(data, remoteProcessId, tag);
00913 }
00914 else
00915 {
00916 return 0;
00917 }
00918 }
00919
00920 inline int vtkMultiProcessController::Send(vtkDataArray *data,
00921 int remoteProcessId, int tag)
00922 {
00923 if (this->Communicator)
00924 {
00925 return this->Communicator->Send(data, remoteProcessId, tag);
00926 }
00927 else
00928 {
00929 return 0;
00930 }
00931 }
00932
00933 inline int vtkMultiProcessController::Send(const int* data, vtkIdType length,
00934 int remoteProcessId, int tag)
00935 {
00936 if (this->Communicator)
00937 {
00938 return this->Communicator->Send(data, length, remoteProcessId, tag);
00939 }
00940 else
00941 {
00942 return 0;
00943 }
00944 }
00945
00946 inline int vtkMultiProcessController::Send(const unsigned long* data,
00947 vtkIdType length,
00948 int remoteProcessId,
00949 int tag)
00950 {
00951 if (this->Communicator)
00952 {
00953 return this->Communicator->Send(data, length, remoteProcessId, tag);
00954 }
00955 else
00956 {
00957 return 0;
00958 }
00959 }
00960
00961 inline int vtkMultiProcessController::Send(const char* data, vtkIdType length,
00962 int remoteProcessId, int tag)
00963 {
00964 if (this->Communicator)
00965 {
00966 return this->Communicator->Send(data, length, remoteProcessId, tag);
00967 }
00968 else
00969 {
00970 return 0;
00971 }
00972 }
00973
00974 inline int vtkMultiProcessController::Send(const unsigned char* data,
00975 vtkIdType length,
00976 int remoteProcessId, int tag)
00977 {
00978 if (this->Communicator)
00979 {
00980 return this->Communicator->Send(data, length, remoteProcessId, tag);
00981 }
00982 else
00983 {
00984 return 0;
00985 }
00986 }
00987
00988 inline int vtkMultiProcessController::Send(const float* data, vtkIdType length,
00989 int remoteProcessId, int tag)
00990 {
00991 if (this->Communicator)
00992 {
00993 return this->Communicator->Send(data, length, remoteProcessId, tag);
00994 }
00995 else
00996 {
00997 return 0;
00998 }
00999 }
01000
01001 inline int vtkMultiProcessController::Send(const double* data, vtkIdType length,
01002 int remoteProcessId, int tag)
01003 {
01004 if (this->Communicator)
01005 {
01006 return this->Communicator->Send(data, length, remoteProcessId, tag);
01007 }
01008 else
01009 {
01010 return 0;
01011 }
01012 }
01013
01014 #ifdef VTK_USE_64BIT_IDS
01015 inline int vtkMultiProcessController::Send(const vtkIdType* data,
01016 vtkIdType length,
01017 int remoteProcessId, int tag)
01018 {
01019 if (this->Communicator)
01020 {
01021 return this->Communicator->Send(data, length, remoteProcessId, tag);
01022 }
01023 else
01024 {
01025 return 0;
01026 }
01027 }
01028 #endif
01029
01030 inline int vtkMultiProcessController::Receive(vtkDataObject* data,
01031 int remoteProcessId, int tag)
01032 {
01033 if (this->Communicator)
01034 {
01035 return this->Communicator->Receive(data, remoteProcessId, tag);
01036 }
01037 else
01038 {
01039 return 0;
01040 }
01041 }
01042
01043 inline vtkDataObject* vtkMultiProcessController::ReceiveDataObject(
01044 int remoteProcessId, int tag)
01045 {
01046 if (this->Communicator)
01047 {
01048 return this->Communicator->ReceiveDataObject(remoteProcessId, tag);
01049 }
01050 else
01051 {
01052 return 0;
01053 }
01054 }
01055
01056 inline int vtkMultiProcessController::Receive(vtkDataArray* data,
01057 int remoteProcessId, int tag)
01058 {
01059 if (this->Communicator)
01060 {
01061 return this->Communicator->Receive(data, remoteProcessId, tag);
01062 }
01063 else
01064 {
01065 return 0;
01066 }
01067 }
01068
01069 inline int vtkMultiProcessController::Receive(int* data, vtkIdType length,
01070 int remoteProcessId, int tag)
01071 {
01072 if (this->Communicator)
01073 {
01074 return this->Communicator->Receive(data, length, remoteProcessId, tag);
01075 }
01076 else
01077 {
01078 return 0;
01079 }
01080 }
01081
01082 inline int vtkMultiProcessController::Receive(unsigned long* data,
01083 vtkIdType length,
01084 int remoteProcessId,
01085 int tag)
01086 {
01087 if (this->Communicator)
01088 {
01089 return this->Communicator->Receive(data, length, remoteProcessId, tag);
01090 }
01091 else
01092 {
01093 return 0;
01094 }
01095 }
01096
01097 inline int vtkMultiProcessController::Receive(char* data, vtkIdType length,
01098 int remoteProcessId, int tag)
01099 {
01100 if (this->Communicator)
01101 {
01102 return this->Communicator->Receive(data, length, remoteProcessId, tag);
01103 }
01104 else
01105 {
01106 return 0;
01107 }
01108 }
01109
01110 inline int vtkMultiProcessController::Receive(unsigned char* data,
01111 vtkIdType length,
01112 int remoteProcessId, int tag)
01113 {
01114 if (this->Communicator)
01115 {
01116 return this->Communicator->Receive(data, length, remoteProcessId, tag);
01117 }
01118 else
01119 {
01120 return 0;
01121 }
01122 }
01123
01124 inline int vtkMultiProcessController::Receive(float* data, vtkIdType length,
01125 int remoteProcessId, int tag)
01126 {
01127 if (this->Communicator)
01128 {
01129 return this->Communicator->Receive(data, length, remoteProcessId, tag);
01130 }
01131 else
01132 {
01133 return 0;
01134 }
01135 }
01136
01137 inline int vtkMultiProcessController::Receive(double* data, vtkIdType length,
01138 int remoteProcessId, int tag)
01139 {
01140 if (this->Communicator)
01141 {
01142 return this->Communicator->Receive(data, length, remoteProcessId, tag);
01143 }
01144 else
01145 {
01146 return 0;
01147 }
01148 }
01149
01150 #ifdef VTK_USE_64BIT_IDS
01151 inline int vtkMultiProcessController::Receive(vtkIdType* data,
01152 vtkIdType length,
01153 int remoteProcessId, int tag)
01154 {
01155 if (this->Communicator)
01156 {
01157 return this->Communicator->Receive(data, length, remoteProcessId, tag);
01158 }
01159 else
01160 {
01161 return 0;
01162 }
01163 }
01164 #endif
01165
01166 inline void vtkMultiProcessController::Barrier()
01167 {
01168 if (this->Communicator)
01169 {
01170 this->Communicator->Barrier();
01171 }
01172 }
01173
01174 #endif