00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00034 #ifndef __vtkCommunicator_h
00035 #define __vtkCommunicator_h
00036
00037 #include "vtkObject.h"
00038
00039 class vtkBoundingBox;
00040 class vtkCharArray;
00041 class vtkDataArray;
00042 class vtkDataObject;
00043 class vtkDataSet;
00044 class vtkImageData;
00045 class vtkMultiBlockDataSet;
00046 class vtkTemporalDataSet;
00047
00048 class VTK_PARALLEL_EXPORT vtkCommunicator : public vtkObject
00049 {
00050
00051 public:
00052
00053 vtkTypeRevisionMacro(vtkCommunicator, vtkObject);
00054 void PrintSelf(ostream& os, vtkIndent indent);
00055
00057
00060 virtual void SetNumberOfProcesses(int num);
00061 vtkGetMacro(NumberOfProcesses, int);
00063
00065
00066 vtkGetMacro(LocalProcessId, int);
00068
00069
00070
00071 enum Tags
00072 {
00073 BROADCAST_TAG = 10,
00074 GATHER_TAG = 11,
00075 GATHERV_TAG = 12,
00076 SCATTER_TAG = 13,
00077 SCATTERV_TAG = 14,
00078 REDUCE_TAG = 15,
00079 BARRIER_TAG = 16
00080 };
00081
00082 enum StandardOperations
00083 {
00084 MAX_OP,
00085 MIN_OP,
00086 SUM_OP,
00087 PRODUCT_OP,
00088 LOGICAL_AND_OP,
00089 BITWISE_AND_OP,
00090 LOGICAL_OR_OP,
00091 BITWISE_OR_OP,
00092 LOGICAL_XOR_OP,
00093 BITWISE_XOR_OP
00094 };
00095
00097
00099 class Operation
00100 {
00101 public:
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 virtual void Function(const void *A, void *B, vtkIdType length,
00112 int datatype) = 0;
00114
00117 virtual int Commutative() = 0;
00118
00119 virtual ~Operation() {}
00120 };
00121
00122
00123
00126 int Send(vtkDataObject* data, int remoteHandle, int tag);
00127
00130 int Send(vtkDataArray* data, int remoteHandle, int tag);
00131
00133
00137 virtual int SendVoidArray(const void *data, vtkIdType length, int type,
00138 int remoteHandle, int tag) = 0;
00140
00142
00143 int Send(const int* data, vtkIdType length, int remoteHandle, int tag) {
00144 return this->SendVoidArray(data, length, VTK_INT, remoteHandle, tag);
00145 }
00146 int Send(const unsigned long* data, vtkIdType length,
00147 int remoteHandle, int tag) {
00148 return this->SendVoidArray(data, length,VTK_UNSIGNED_LONG,remoteHandle,tag);
00149 }
00150 int Send(const unsigned char* data, vtkIdType length,
00151 int remoteHandle, int tag) {
00152 return this->SendVoidArray(data, length,VTK_UNSIGNED_CHAR,remoteHandle,tag);
00153 }
00154 int Send(const char* data, vtkIdType length, int remoteHandle, int tag) {
00155 return this->SendVoidArray(data, length, VTK_CHAR, remoteHandle, tag);
00156 }
00157 int Send(const float* data, vtkIdType length, int remoteHandle, int tag) {
00158 return this->SendVoidArray(data, length, VTK_FLOAT, remoteHandle, tag);
00159 }
00160 int Send(const double* data, vtkIdType length, int remoteHandle, int tag) {
00161 return this->SendVoidArray(data, length, VTK_DOUBLE, remoteHandle, tag);
00162 }
00163 #ifdef VTK_USE_64BIT_IDS
00164 int Send(const vtkIdType* data, vtkIdType length, int remoteHandle, int tag) {
00165 return this->SendVoidArray(data, length, VTK_ID_TYPE, remoteHandle, tag);
00166 }
00168 #endif
00169
00170
00173 int Receive(vtkDataObject* data, int remoteHandle, int tag);
00174
00177 vtkDataObject *ReceiveDataObject(int remoteHandle, int tag);
00178
00181 int Receive(vtkDataArray* data, int remoteHandle, int tag);
00182
00184
00188 virtual int ReceiveVoidArray(void *data, vtkIdType length, int type,
00189 int remoteHandle, int tag) = 0;
00191
00193
00194 int Receive(int* data, vtkIdType length, int remoteHandle, int tag) {
00195 return this->ReceiveVoidArray(data, length, VTK_INT, remoteHandle, tag);
00196 }
00197 int Receive(unsigned long* data, vtkIdType length, int remoteHandle, int tag){
00198 return this->ReceiveVoidArray(data, length, VTK_UNSIGNED_LONG, remoteHandle,
00199 tag);
00200 }
00201 int Receive(unsigned char* data, vtkIdType length, int remoteHandle, int tag){
00202 return this->ReceiveVoidArray(data, length, VTK_UNSIGNED_CHAR, remoteHandle,
00203 tag);
00204 }
00205 int Receive(char* data, vtkIdType length, int remoteHandle, int tag) {
00206 return this->ReceiveVoidArray(data, length, VTK_CHAR, remoteHandle, tag);
00207 }
00208 int Receive(float* data, vtkIdType length, int remoteHandle, int tag) {
00209 return this->ReceiveVoidArray(data, length, VTK_FLOAT, remoteHandle, tag);
00210 }
00211 int Receive(double* data, vtkIdType length, int remoteHandle, int tag) {
00212 return this->ReceiveVoidArray(data, length, VTK_DOUBLE, remoteHandle, tag);
00213 }
00214 #ifdef VTK_USE_64BIT_IDS
00215 int Receive(vtkIdType* data, vtkIdType length, int remoteHandle, int tag) {
00216 return this->ReceiveVoidArray(data, length, VTK_ID_TYPE, remoteHandle, tag);
00217 }
00219 #endif
00220
00221
00222
00225 virtual void Barrier();
00226
00228
00231 int Broadcast(int *data, vtkIdType length, int srcProcessId) {
00232 return this->BroadcastVoidArray(data, length, VTK_INT, srcProcessId);
00233 }
00234 int Broadcast(unsigned long *data, vtkIdType length, int srcProcessId) {
00235 return this->BroadcastVoidArray(data,length,VTK_UNSIGNED_LONG,srcProcessId);
00236 }
00237 int Broadcast(unsigned char *data, vtkIdType length, int srcProcessId) {
00238 return this->BroadcastVoidArray(data,length,VTK_UNSIGNED_CHAR,srcProcessId);
00239 }
00240 int Broadcast(char *data, vtkIdType length, int srcProcessId) {
00241 return this->BroadcastVoidArray(data, length, VTK_CHAR, srcProcessId);
00242 }
00243 int Broadcast(float *data, vtkIdType length, int srcProcessId) {
00244 return this->BroadcastVoidArray(data, length, VTK_FLOAT, srcProcessId);
00245 }
00246 int Broadcast(double *data, vtkIdType length, int srcProcessId) {
00247 return this->BroadcastVoidArray(data, length, VTK_DOUBLE, srcProcessId);
00248 }
00249 #ifdef VTK_USE_64BIT_IDS
00250 int Broadcast(vtkIdType *data, vtkIdType length, int srcProcessId) {
00251 return this->BroadcastVoidArray(data, length, VTK_ID_TYPE, srcProcessId);
00252 }
00254 #endif
00255 int Broadcast(vtkDataObject *data, int srcProcessId);
00256 int Broadcast(vtkDataArray *data, int srcProcessId);
00257
00259
00267 int Gather(const int *sendBuffer, int *recvBuffer,
00268 vtkIdType length, int destProcessId) {
00269 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
00270 VTK_INT, destProcessId);
00271 }
00272 int Gather(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00273 vtkIdType length, int destProcessId) {
00274 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
00275 VTK_UNSIGNED_LONG, destProcessId);
00276 }
00277 int Gather(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00278 vtkIdType length, int destProcessId) {
00279 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
00280 VTK_UNSIGNED_CHAR, destProcessId);
00281 }
00282 int Gather(const char *sendBuffer, char *recvBuffer,
00283 vtkIdType length, int destProcessId) {
00284 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
00285 VTK_CHAR, destProcessId);
00286 }
00287 int Gather(const float *sendBuffer, float *recvBuffer,
00288 vtkIdType length, int destProcessId) {
00289 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
00290 VTK_FLOAT, destProcessId);
00291 }
00292 int Gather(const double *sendBuffer, double *recvBuffer,
00293 vtkIdType length, int destProcessId) {
00294 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
00295 VTK_DOUBLE, destProcessId);
00296 }
00297 #ifdef VTK_USE_64BIT_IDS
00298 int Gather(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00299 vtkIdType length, int destProcessId) {
00300 return this->GatherVoidArray(sendBuffer, recvBuffer, length,
00301 VTK_ID_TYPE, destProcessId);
00302 }
00304 #endif
00305 int Gather(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00306 int destProcessId);
00307
00309
00319 int GatherV(const int* sendBuffer, int* recvBuffer,
00320 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00321 int destProcessId) {
00322 return this->GatherVVoidArray(sendBuffer, recvBuffer,
00323 sendLength, recvLengths,
00324 offsets, VTK_INT, destProcessId);
00325 }
00326 int GatherV(const unsigned long* sendBuffer, unsigned long* recvBuffer,
00327 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00328 int destProcessId) {
00329 return this->GatherVVoidArray(sendBuffer, recvBuffer,
00330 sendLength, recvLengths,
00331 offsets, VTK_UNSIGNED_LONG, destProcessId);
00332 }
00333 int GatherV(const unsigned char* sendBuffer, unsigned char* recvBuffer,
00334 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00335 int destProcessId) {
00336 return this->GatherVVoidArray(sendBuffer, recvBuffer,
00337 sendLength, recvLengths,
00338 offsets, VTK_UNSIGNED_CHAR, destProcessId);
00339 }
00340 int GatherV(const char* sendBuffer, char* recvBuffer,
00341 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00342 int destProcessId) {
00343 return this->GatherVVoidArray(sendBuffer, recvBuffer,
00344 sendLength, recvLengths,
00345 offsets, VTK_CHAR, destProcessId);
00346 }
00347 int GatherV(const float* sendBuffer, float* recvBuffer,
00348 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00349 int destProcessId) {
00350 return this->GatherVVoidArray(sendBuffer, recvBuffer,
00351 sendLength, recvLengths,
00352 offsets, VTK_FLOAT, destProcessId);
00353 }
00354 int GatherV(const double* sendBuffer, double* recvBuffer,
00355 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00356 int destProcessId) {
00357 return this->GatherVVoidArray(sendBuffer, recvBuffer,
00358 sendLength, recvLengths,
00359 offsets, VTK_DOUBLE, destProcessId);
00360 }
00361 #ifdef VTK_USE_64BIT_IDS
00362 int GatherV(const vtkIdType* sendBuffer, vtkIdType* recvBuffer,
00363 vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
00364 int destProcessId) {
00365 return this->GatherVVoidArray(sendBuffer, recvBuffer,
00366 sendLength, recvLengths,
00367 offsets, VTK_ID_TYPE, destProcessId);
00368 }
00370 #endif
00371
00373
00378 int Scatter(const int *sendBuffer, int *recvBuffer,
00379 vtkIdType length, int srcProcessId) {
00380 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
00381 VTK_INT, srcProcessId);
00382 }
00383 int Scatter(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00384 vtkIdType length, int srcProcessId) {
00385 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
00386 VTK_UNSIGNED_LONG, srcProcessId);
00387 }
00388 int Scatter(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00389 vtkIdType length, int srcProcessId) {
00390 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
00391 VTK_UNSIGNED_CHAR, srcProcessId);
00392 }
00393 int Scatter(const char *sendBuffer, char *recvBuffer,
00394 vtkIdType length, int srcProcessId) {
00395 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
00396 VTK_CHAR, srcProcessId);
00397 }
00398 int Scatter(const float *sendBuffer, float *recvBuffer,
00399 vtkIdType length, int srcProcessId) {
00400 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
00401 VTK_FLOAT, srcProcessId);
00402 }
00403 int Scatter(const double *sendBuffer, double *recvBuffer,
00404 vtkIdType length, int srcProcessId) {
00405 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
00406 VTK_DOUBLE, srcProcessId);
00407 }
00408 #ifdef VTK_USE_64BIT_IDS
00409 int Scatter(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00410 vtkIdType length, int srcProcessId) {
00411 return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
00412 VTK_ID_TYPE, srcProcessId);
00413 }
00415 #endif
00416 int Scatter(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00417 int srcProcessId);
00418
00420
00426 int ScatterV(const int *sendBuffer, int *recvBuffer,
00427 vtkIdType *sendLengths, vtkIdType *offsets,
00428 vtkIdType recvLength, int srcProcessId) {
00429 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
00430 sendLengths, offsets, recvLength,
00431 VTK_INT, srcProcessId);
00432 }
00433 int ScatterV(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00434 vtkIdType *sendLengths, vtkIdType *offsets,
00435 vtkIdType recvLength, int srcProcessId) {
00436 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
00437 sendLengths, offsets, recvLength,
00438 VTK_UNSIGNED_LONG, srcProcessId);
00439 }
00440 int ScatterV(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00441 vtkIdType *sendLengths, vtkIdType *offsets,
00442 vtkIdType recvLength, int srcProcessId) {
00443 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
00444 sendLengths, offsets, recvLength,
00445 VTK_UNSIGNED_CHAR, srcProcessId);
00446 }
00447 int ScatterV(const char *sendBuffer, char *recvBuffer,
00448 vtkIdType *sendLengths, vtkIdType *offsets,
00449 vtkIdType recvLength, int srcProcessId) {
00450 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
00451 sendLengths, offsets, recvLength,
00452 VTK_CHAR, srcProcessId);
00453 }
00454 int ScatterV(const float *sendBuffer, float *recvBuffer,
00455 vtkIdType *sendLengths, vtkIdType *offsets,
00456 vtkIdType recvLength, int srcProcessId) {
00457 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
00458 sendLengths, offsets, recvLength,
00459 VTK_FLOAT, srcProcessId);
00460 }
00461 int ScatterV(const double *sendBuffer, double *recvBuffer,
00462 vtkIdType *sendLengths, vtkIdType *offsets,
00463 vtkIdType recvLength, int srcProcessId) {
00464 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
00465 sendLengths, offsets, recvLength,
00466 VTK_DOUBLE, srcProcessId);
00467 }
00468 #ifdef VTK_USE_64BIT_IDS
00469 int ScatterV(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00470 vtkIdType *sendLengths, vtkIdType *offsets,
00471 vtkIdType recvLength, int srcProcessId) {
00472 return this->ScatterVVoidArray(sendBuffer, recvBuffer,
00473 sendLengths, offsets, recvLength,
00474 VTK_ID_TYPE, srcProcessId);
00475 }
00477 #endif
00478
00480
00481 int AllGather(const int *sendBuffer, int *recvBuffer, vtkIdType length) {
00482 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_INT);
00483 }
00484 int AllGather(const unsigned long *sendBuffer,
00485 unsigned long *recvBuffer, vtkIdType length) {
00486 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
00487 VTK_UNSIGNED_LONG);
00488 }
00489 int AllGather(const unsigned char *sendBuffer,
00490 unsigned char *recvBuffer, vtkIdType length) {
00491 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
00492 VTK_UNSIGNED_CHAR);
00493 }
00494 int AllGather(const char *sendBuffer, char *recvBuffer, vtkIdType length) {
00495 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_CHAR);
00496 }
00497 int AllGather(const float *sendBuffer, float *recvBuffer, vtkIdType length) {
00498 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_FLOAT);
00499 }
00500 int AllGather(const double *sendBuffer,
00501 double *recvBuffer, vtkIdType length) {
00502 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_DOUBLE);
00503 }
00504 #ifdef VTK_USE_64BIT_IDS
00505 int AllGather(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00506 vtkIdType length) {
00507 return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
00508 VTK_ID_TYPE);
00509 }
00511 #endif
00512 int AllGather(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer);
00513
00515
00516 int AllGatherV(const int* sendBuffer, int* recvBuffer,
00517 vtkIdType sendLength, vtkIdType* recvLengths,
00518 vtkIdType* offsets) {
00519 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
00520 sendLength, recvLengths,
00521 offsets, VTK_INT);
00522 }
00523 int AllGatherV(const unsigned long* sendBuffer, unsigned long* recvBuffer,
00524 vtkIdType sendLength, vtkIdType* recvLengths,
00525 vtkIdType* offsets) {
00526 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
00527 sendLength, recvLengths,
00528 offsets, VTK_UNSIGNED_LONG);
00529 }
00530 int AllGatherV(const unsigned char* sendBuffer, unsigned char* recvBuffer,
00531 vtkIdType sendLength, vtkIdType* recvLengths,
00532 vtkIdType* offsets) {
00533 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
00534 sendLength, recvLengths,
00535 offsets, VTK_UNSIGNED_CHAR);
00536 }
00537 int AllGatherV(const char* sendBuffer, char* recvBuffer,
00538 vtkIdType sendLength, vtkIdType* recvLengths,
00539 vtkIdType* offsets) {
00540 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
00541 sendLength, recvLengths,
00542 offsets, VTK_CHAR);
00543 }
00544 int AllGatherV(const float* sendBuffer, float* recvBuffer,
00545 vtkIdType sendLength, vtkIdType* recvLengths,
00546 vtkIdType* offsets) {
00547 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
00548 sendLength, recvLengths,
00549 offsets, VTK_FLOAT);
00550 }
00551 int AllGatherV(const double* sendBuffer, double* recvBuffer,
00552 vtkIdType sendLength, vtkIdType* recvLengths,
00553 vtkIdType* offsets) {
00554 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
00555 sendLength, recvLengths,
00556 offsets, VTK_DOUBLE);
00557 }
00558 #ifdef VTK_USE_64BIT_IDS
00559 int AllGatherV(const vtkIdType* sendBuffer, vtkIdType* recvBuffer,
00560 vtkIdType sendLength, vtkIdType* recvLengths,
00561 vtkIdType* offsets) {
00562 return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
00563 sendLength, recvLengths,
00564 offsets, VTK_ID_TYPE);
00565 }
00567 #endif
00568
00570
00573 int Reduce(const int *sendBuffer, int *recvBuffer,
00574 vtkIdType length, int operation, int destProcessId) {
00575 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00576 VTK_INT, operation, destProcessId);
00577 }
00578 int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00579 vtkIdType length, int operation, int destProcessId) {
00580 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00581 VTK_UNSIGNED_LONG, operation, destProcessId);
00582 }
00583 int Reduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00584 vtkIdType length, int operation, int destProcessId) {
00585 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00586 VTK_UNSIGNED_CHAR, operation, destProcessId);
00587 }
00588 int Reduce(const char *sendBuffer, char *recvBuffer,
00589 vtkIdType length, int operation, int destProcessId) {
00590 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00591 VTK_CHAR, operation, destProcessId);
00592 }
00593 int Reduce(const float *sendBuffer, float *recvBuffer,
00594 vtkIdType length, int operation, int destProcessId) {
00595 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00596 VTK_FLOAT, operation, destProcessId);
00597 }
00598 int Reduce(const double *sendBuffer, double *recvBuffer,
00599 vtkIdType length, int operation, int destProcessId) {
00600 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00601 VTK_DOUBLE, operation, destProcessId);
00602 }
00603 #ifdef VTK_USE_64BIT_IDS
00604 int Reduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00605 vtkIdType length, int operation, int destProcessId) {
00606 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00607 VTK_ID_TYPE, operation, destProcessId);
00608 }
00610 #endif
00611 int Reduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00612 int operation, int destProcessId);
00613
00615
00618 int Reduce(const int *sendBuffer, int *recvBuffer,
00619 vtkIdType length, Operation *operation, int destProcessId) {
00620 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00621 VTK_INT, operation, destProcessId);
00622 }
00623 int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00624 vtkIdType length, Operation *operation, int destProcessId) {
00625 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00626 VTK_UNSIGNED_LONG, operation, destProcessId);
00627 }
00628 int Reduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00629 vtkIdType length, Operation *operation, int destProcessId) {
00630 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00631 VTK_UNSIGNED_CHAR, operation, destProcessId);
00632 }
00633 int Reduce(const char *sendBuffer, char *recvBuffer,
00634 vtkIdType length, Operation *operation, int destProcessId) {
00635 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00636 VTK_CHAR, operation, destProcessId);
00637 }
00638 int Reduce(const float *sendBuffer, float *recvBuffer,
00639 vtkIdType length, Operation *operation, int destProcessId) {
00640 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00641 VTK_FLOAT, operation, destProcessId);
00642 }
00643 int Reduce(const double *sendBuffer, double *recvBuffer,
00644 vtkIdType length, Operation *operation, int destProcessId) {
00645 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00646 VTK_DOUBLE, operation, destProcessId);
00647 }
00648 #ifdef VTK_USE_64BIT_IDS
00649 int Reduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00650 vtkIdType length, Operation *operation, int destProcessId) {
00651 return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
00652 VTK_ID_TYPE, operation, destProcessId);
00653 }
00655 #endif
00656 int Reduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00657 Operation *operation, int destProcessId);
00658
00660
00662 int AllReduce(const int *sendBuffer, int *recvBuffer,
00663 vtkIdType length, int operation) {
00664 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00665 VTK_INT, operation);
00666 }
00667 int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00668 vtkIdType length, int operation) {
00669 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00670 VTK_UNSIGNED_LONG, operation);
00671 }
00672 int AllReduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00673 vtkIdType length, int operation) {
00674 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00675 VTK_UNSIGNED_CHAR, operation);
00676 }
00677 int AllReduce(const char *sendBuffer, char *recvBuffer,
00678 vtkIdType length, int operation) {
00679 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00680 VTK_CHAR, operation);
00681 }
00682 int AllReduce(const float *sendBuffer, float *recvBuffer,
00683 vtkIdType length, int operation) {
00684 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00685 VTK_FLOAT, operation);
00686 }
00687 int AllReduce(const double *sendBuffer, double *recvBuffer,
00688 vtkIdType length, int operation) {
00689 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00690 VTK_DOUBLE, operation);
00691 }
00692 #ifdef VTK_USE_64BIT_IDS
00693 int AllReduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00694 vtkIdType length, int operation) {
00695 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00696 VTK_ID_TYPE, operation);
00697 }
00699 #endif
00700 int AllReduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00701 int operation);
00702 int AllReduce(const int *sendBuffer, int *recvBuffer,
00703 vtkIdType length, Operation *operation) {
00704 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00705 VTK_INT, operation);
00706 }
00707 int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
00708 vtkIdType length, Operation *operation) {
00709 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00710 VTK_UNSIGNED_LONG, operation);
00711 }
00712 int AllReduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
00713 vtkIdType length, Operation *operation) {
00714 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00715 VTK_UNSIGNED_CHAR, operation);
00716 }
00717 int AllReduce(const char *sendBuffer, char *recvBuffer,
00718 vtkIdType length, Operation *operation) {
00719 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00720 VTK_CHAR, operation);
00721 }
00722 int AllReduce(const float *sendBuffer, float *recvBuffer,
00723 vtkIdType length, Operation *operation) {
00724 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00725 VTK_FLOAT, operation);
00726 }
00727 int AllReduce(const double *sendBuffer, double *recvBuffer,
00728 vtkIdType length, Operation *operation) {
00729 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00730 VTK_DOUBLE, operation);
00731 }
00732 #ifdef VTK_USE_64BIT_IDS
00733 int AllReduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
00734 vtkIdType length, Operation *operation) {
00735 return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
00736 VTK_ID_TYPE, operation);
00737 }
00738 #endif
00739 int AllReduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
00740 Operation *operation);
00741
00743
00745 virtual int BroadcastVoidArray(void *data, vtkIdType length, int type,
00746 int srcProcessId);
00747 virtual int GatherVoidArray(const void *sendBuffer, void *recvBuffer,
00748 vtkIdType length, int type, int destProcessId);
00749 virtual int GatherVVoidArray(const void *sendBuffer, void *recvBuffer,
00750 vtkIdType sendLength, vtkIdType *recvLengths,
00751 vtkIdType *offsets, int type, int destProcessId);
00752 virtual int ScatterVoidArray(const void *sendBuffer, void *recvBuffer,
00753 vtkIdType length, int type, int srcProcessId);
00754 virtual int ScatterVVoidArray(const void *sendBuffer, void *recvBuffer,
00755 vtkIdType *sendLengths, vtkIdType *offsets,
00756 vtkIdType recvLength, int type,
00757 int srcProcessId);
00758 virtual int AllGatherVoidArray(const void *sendBuffer, void *recvBuffer,
00759 vtkIdType length, int type);
00760 virtual int AllGatherVVoidArray(const void *sendBuffer, void *recvBuffer,
00761 vtkIdType sendLength, vtkIdType *recvLengths,
00762 vtkIdType *offsets, int type);
00763 virtual int ReduceVoidArray(const void *sendBuffer, void *recvBuffer,
00764 vtkIdType length, int type,
00765 int operation, int destProcessId);
00766 virtual int ReduceVoidArray(const void *sendBuffer, void *recvBuffer,
00767 vtkIdType length, int type,
00768 Operation *operation, int destProcessId);
00769 virtual int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer,
00770 vtkIdType length, int type,
00771 int operation);
00772 virtual int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer,
00773 vtkIdType length, int type,
00774 Operation *operation);
00776
00777 static void SetUseCopy(int useCopy);
00778
00780
00788 virtual int ComputeGlobalBounds(int processorId, int numProcesses,
00789 vtkBoundingBox *bounds,
00790 int *rightHasBounds = 0,
00791 int *leftHasBounds = 0,
00792 int hasBoundsTag = 288402,
00793 int localBoundsTag = 288403,
00794 int globalBoundsTag = 288404);
00796
00798
00801 static int GetParentProcessor(int pid);
00802 static int GetLeftChildProcessor(int pid);
00804
00806
00809 static int MarshalDataObject(vtkDataObject *object, vtkCharArray *buffer);
00810 static int UnMarshalDataObject(vtkCharArray *buffer, vtkDataObject *object);
00812
00813 protected:
00814
00815 int WriteDataArray(vtkDataArray *object);
00816 int ReadDataArray(vtkDataArray *object);
00817
00818 vtkCommunicator();
00819 ~vtkCommunicator();
00820
00821
00822 int SendElementalDataObject(vtkDataObject* data, int remoteHandle, int tag);
00823 int SendMultiBlockDataSet(vtkMultiBlockDataSet* data, int remoteHandle, int tag);
00824 int SendTemporalDataSet(vtkTemporalDataSet* data, int remoteHandle, int tag);
00825 int ReceiveDataObject(vtkDataObject* data,
00826 int remoteHandle, int tag, int type=-1);
00827 int ReceiveElementalDataObject(vtkDataObject* data,
00828 int remoteHandle, int tag);
00829 int ReceiveMultiBlockDataSet(
00830 vtkMultiBlockDataSet* data, int remoteHandle, int tag);
00831 int ReceiveTemporalDataSet(
00832 vtkTemporalDataSet* data, int remoteHandle, int tag);
00833
00834 int MaximumNumberOfProcesses;
00835 int NumberOfProcesses;
00836
00837 int LocalProcessId;
00838
00839 static int UseCopy;
00840
00841 private:
00842 vtkCommunicator(const vtkCommunicator&);
00843 void operator=(const vtkCommunicator&);
00844 };
00845
00846 #endif // __vtkCommunicator_h
00847
00848