VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkCommunicator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCommunicator.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
34 #ifndef __vtkCommunicator_h
35 #define __vtkCommunicator_h
36 
37 #include "vtkParallelCoreModule.h" // For export macro
38 #include "vtkObject.h"
39 
40 class vtkBoundingBox;
41 class vtkCharArray;
42 class vtkDataArray;
43 class vtkDataObject;
44 class vtkDataSet;
45 class vtkImageData;
48 
50 {
51 
52 public:
53 
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
58 
61  virtual void SetNumberOfProcesses(int num);
62  vtkGetMacro(NumberOfProcesses, int);
64 
66 
67  vtkGetMacro(LocalProcessId, int);
69 
70 //BTX
71 
72  enum Tags
73  {
74  BROADCAST_TAG = 10,
75  GATHER_TAG = 11,
76  GATHERV_TAG = 12,
77  SCATTER_TAG = 13,
78  SCATTERV_TAG = 14,
79  REDUCE_TAG = 15,
80  BARRIER_TAG = 16
81  };
82 
84  {
94  BITWISE_XOR_OP
95  };
96 
98 
100  class Operation
101  {
102  public:
104 
105 
114  virtual void Function(const void *A, void *B, vtkIdType length,
115  int datatype) = 0;
117 
120  virtual int Commutative() = 0;
121 
122  virtual ~Operation() {}
123  };
124 
125 //ETX
126 
129  int Send(vtkDataObject* data, int remoteHandle, int tag);
130 
133  int Send(vtkDataArray* data, int remoteHandle, int tag);
134 
136 
140  virtual int SendVoidArray(const void *data, vtkIdType length, int type,
141  int remoteHandle, int tag) = 0;
143 
145 
146  int Send(const int* data, vtkIdType length, int remoteHandle, int tag) {
147  return this->SendVoidArray(data, length, VTK_INT, remoteHandle, tag);
148  }
149  int Send(const unsigned int* data, vtkIdType length, int remoteHandle, int tag) {
150  return this->SendVoidArray(data, length, VTK_INT, remoteHandle, tag);
151  }
152  int Send(const unsigned long* data, vtkIdType length,
153  int remoteHandle, int tag) {
154  return this->SendVoidArray(data, length,VTK_UNSIGNED_LONG,remoteHandle,tag);
155  }
156  int Send(const unsigned char* data, vtkIdType length,
157  int remoteHandle, int tag) {
158  return this->SendVoidArray(data, length,VTK_UNSIGNED_CHAR,remoteHandle,tag);
159  }
160  int Send(const char* data, vtkIdType length, int remoteHandle, int tag) {
161  return this->SendVoidArray(data, length, VTK_CHAR, remoteHandle, tag);
162  }
163  int Send(const float* data, vtkIdType length, int remoteHandle, int tag) {
164  return this->SendVoidArray(data, length, VTK_FLOAT, remoteHandle, tag);
165  }
166  int Send(const double* data, vtkIdType length, int remoteHandle, int tag) {
167  return this->SendVoidArray(data, length, VTK_DOUBLE, remoteHandle, tag);
168  }
169 #ifdef VTK_USE_64BIT_IDS
170  int Send(const vtkIdType* data, vtkIdType length, int remoteHandle, int tag) {
171  return this->SendVoidArray(data, length, VTK_ID_TYPE, remoteHandle, tag);
172  }
173 #endif
174 //BTX
175  int Send(const vtkMultiProcessStream& stream, int remoteId, int tag);
176 //ETX
178 
179 
182  int Receive(vtkDataObject* data, int remoteHandle, int tag);
183 
186  vtkDataObject *ReceiveDataObject(int remoteHandle, int tag);
187 
190  int Receive(vtkDataArray* data, int remoteHandle, int tag);
191 
193 
201  virtual int ReceiveVoidArray(void *data, vtkIdType maxlength, int type,
202  int remoteHandle, int tag) = 0;
204 
206 
207  int Receive(int* data, vtkIdType maxlength, int remoteHandle, int tag) {
208  return this->ReceiveVoidArray(data, maxlength, VTK_INT, remoteHandle, tag);
209  }
210  int Receive(unsigned int* data, vtkIdType maxlength, int remoteHandle, int tag) {
211  return this->ReceiveVoidArray(data, maxlength, VTK_INT, remoteHandle, tag);
212  }
213  int Receive(unsigned long* data, vtkIdType maxlength, int remoteHandle, int tag){
214  return this->ReceiveVoidArray(data, maxlength, VTK_UNSIGNED_LONG, remoteHandle,
215  tag);
216  }
217  int Receive(unsigned char* data, vtkIdType maxlength, int remoteHandle, int tag){
218  return this->ReceiveVoidArray(data, maxlength, VTK_UNSIGNED_CHAR, remoteHandle,
219  tag);
220  }
221  int Receive(char* data, vtkIdType maxlength, int remoteHandle, int tag) {
222  return this->ReceiveVoidArray(data, maxlength, VTK_CHAR, remoteHandle, tag);
223  }
224  int Receive(float* data, vtkIdType maxlength, int remoteHandle, int tag) {
225  return this->ReceiveVoidArray(data, maxlength, VTK_FLOAT, remoteHandle, tag);
226  }
227  int Receive(double* data, vtkIdType maxlength, int remoteHandle, int tag) {
228  return this->ReceiveVoidArray(data, maxlength, VTK_DOUBLE, remoteHandle, tag);
229  }
230 #ifdef VTK_USE_64BIT_IDS
231  int Receive(vtkIdType* data, vtkIdType maxlength, int remoteHandle, int tag) {
232  return this->ReceiveVoidArray(data, maxlength, VTK_ID_TYPE, remoteHandle, tag);
233  }
234 #endif
235 //BTX
236  int Receive(vtkMultiProcessStream& stream, int remoteId, int tag);
237 //ETX
239 
241 
248  vtkGetMacro(Count, vtkIdType);
250 
251  //---------------------- Collective Operations ----------------------
252 
255  virtual void Barrier();
256 
258 
261  int Broadcast(int *data, vtkIdType length, int srcProcessId) {
262  return this->BroadcastVoidArray(data, length, VTK_INT, srcProcessId);
263  }
264  int Broadcast(unsigned int *data, vtkIdType length, int srcProcessId) {
265  return this->BroadcastVoidArray(data, length, VTK_UNSIGNED_INT, srcProcessId);
266  }
267  int Broadcast(unsigned long *data, vtkIdType length, int srcProcessId) {
268  return this->BroadcastVoidArray(data,length,VTK_UNSIGNED_LONG,srcProcessId);
269  }
270  int Broadcast(unsigned char *data, vtkIdType length, int srcProcessId) {
271  return this->BroadcastVoidArray(data,length,VTK_UNSIGNED_CHAR,srcProcessId);
272  }
273  int Broadcast(char *data, vtkIdType length, int srcProcessId) {
274  return this->BroadcastVoidArray(data, length, VTK_CHAR, srcProcessId);
275  }
276  int Broadcast(float *data, vtkIdType length, int srcProcessId) {
277  return this->BroadcastVoidArray(data, length, VTK_FLOAT, srcProcessId);
278  }
279  int Broadcast(double *data, vtkIdType length, int srcProcessId) {
280  return this->BroadcastVoidArray(data, length, VTK_DOUBLE, srcProcessId);
281  }
282 #ifdef VTK_USE_64BIT_IDS
283  int Broadcast(vtkIdType *data, vtkIdType length, int srcProcessId) {
284  return this->BroadcastVoidArray(data, length, VTK_ID_TYPE, srcProcessId);
285  }
286 #endif
287  int Broadcast(vtkDataObject *data, int srcProcessId);
288  int Broadcast(vtkDataArray *data, int srcProcessId);
289 //BTX
290  int Broadcast(vtkMultiProcessStream& stream, int srcProcessId);
291 //ETX
293 
295 
303  int Gather(const int *sendBuffer, int *recvBuffer,
304  vtkIdType length, int destProcessId) {
305  return this->GatherVoidArray(sendBuffer, recvBuffer, length,
306  VTK_INT, destProcessId);
307  }
308  int Gather(const unsigned long *sendBuffer, unsigned long *recvBuffer,
309  vtkIdType length, int destProcessId) {
310  return this->GatherVoidArray(sendBuffer, recvBuffer, length,
311  VTK_UNSIGNED_LONG, destProcessId);
312  }
313  int Gather(const unsigned char *sendBuffer, unsigned char *recvBuffer,
314  vtkIdType length, int destProcessId) {
315  return this->GatherVoidArray(sendBuffer, recvBuffer, length,
316  VTK_UNSIGNED_CHAR, destProcessId);
317  }
318  int Gather(const char *sendBuffer, char *recvBuffer,
319  vtkIdType length, int destProcessId) {
320  return this->GatherVoidArray(sendBuffer, recvBuffer, length,
321  VTK_CHAR, destProcessId);
322  }
323  int Gather(const float *sendBuffer, float *recvBuffer,
324  vtkIdType length, int destProcessId) {
325  return this->GatherVoidArray(sendBuffer, recvBuffer, length,
326  VTK_FLOAT, destProcessId);
327  }
328  int Gather(const double *sendBuffer, double *recvBuffer,
329  vtkIdType length, int destProcessId) {
330  return this->GatherVoidArray(sendBuffer, recvBuffer, length,
331  VTK_DOUBLE, destProcessId);
332  }
333 #ifdef VTK_USE_64BIT_IDS
334  int Gather(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
335  vtkIdType length, int destProcessId) {
336  return this->GatherVoidArray(sendBuffer, recvBuffer, length,
337  VTK_ID_TYPE, destProcessId);
338  }
339 #endif
340  int Gather(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
341  int destProcessId);
343 
345 
355  int GatherV(const int* sendBuffer, int* recvBuffer,
356  vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
357  int destProcessId) {
358  return this->GatherVVoidArray(sendBuffer, recvBuffer,
359  sendLength, recvLengths,
360  offsets, VTK_INT, destProcessId);
361  }
362  int GatherV(const unsigned long* sendBuffer, unsigned long* recvBuffer,
363  vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
364  int destProcessId) {
365  return this->GatherVVoidArray(sendBuffer, recvBuffer,
366  sendLength, recvLengths,
367  offsets, VTK_UNSIGNED_LONG, destProcessId);
368  }
369  int GatherV(const unsigned char* sendBuffer, unsigned char* recvBuffer,
370  vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
371  int destProcessId) {
372  return this->GatherVVoidArray(sendBuffer, recvBuffer,
373  sendLength, recvLengths,
374  offsets, VTK_UNSIGNED_CHAR, destProcessId);
375  }
376  int GatherV(const char* sendBuffer, char* recvBuffer,
377  vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
378  int destProcessId) {
379  return this->GatherVVoidArray(sendBuffer, recvBuffer,
380  sendLength, recvLengths,
381  offsets, VTK_CHAR, destProcessId);
382  }
383  int GatherV(const float* sendBuffer, float* recvBuffer,
384  vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
385  int destProcessId) {
386  return this->GatherVVoidArray(sendBuffer, recvBuffer,
387  sendLength, recvLengths,
388  offsets, VTK_FLOAT, destProcessId);
389  }
390  int GatherV(const double* sendBuffer, double* recvBuffer,
391  vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
392  int destProcessId) {
393  return this->GatherVVoidArray(sendBuffer, recvBuffer,
394  sendLength, recvLengths,
395  offsets, VTK_DOUBLE, destProcessId);
396  }
397 #ifdef VTK_USE_64BIT_IDS
398  int GatherV(const vtkIdType* sendBuffer, vtkIdType* recvBuffer,
399  vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
400  int destProcessId) {
401  return this->GatherVVoidArray(sendBuffer, recvBuffer,
402  sendLength, recvLengths,
403  offsets, VTK_ID_TYPE, destProcessId);
404  }
405 #endif
406  int GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
407  vtkIdType *recvLengths, vtkIdType *offsets, int destProcessId);
408  int GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
409  int destProcessId);
411 
413 
418  int Scatter(const int *sendBuffer, int *recvBuffer,
419  vtkIdType length, int srcProcessId) {
420  return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
421  VTK_INT, srcProcessId);
422  }
423  int Scatter(const unsigned long *sendBuffer, unsigned long *recvBuffer,
424  vtkIdType length, int srcProcessId) {
425  return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
426  VTK_UNSIGNED_LONG, srcProcessId);
427  }
428  int Scatter(const unsigned char *sendBuffer, unsigned char *recvBuffer,
429  vtkIdType length, int srcProcessId) {
430  return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
431  VTK_UNSIGNED_CHAR, srcProcessId);
432  }
433  int Scatter(const char *sendBuffer, char *recvBuffer,
434  vtkIdType length, int srcProcessId) {
435  return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
436  VTK_CHAR, srcProcessId);
437  }
438  int Scatter(const float *sendBuffer, float *recvBuffer,
439  vtkIdType length, int srcProcessId) {
440  return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
441  VTK_FLOAT, srcProcessId);
442  }
443  int Scatter(const double *sendBuffer, double *recvBuffer,
444  vtkIdType length, int srcProcessId) {
445  return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
446  VTK_DOUBLE, srcProcessId);
447  }
448 #ifdef VTK_USE_64BIT_IDS
449  int Scatter(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
450  vtkIdType length, int srcProcessId) {
451  return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
452  VTK_ID_TYPE, srcProcessId);
453  }
454 #endif
455  int Scatter(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
456  int srcProcessId);
458 
460 
466  int ScatterV(const int *sendBuffer, int *recvBuffer,
467  vtkIdType *sendLengths, vtkIdType *offsets,
468  vtkIdType recvLength, int srcProcessId) {
469  return this->ScatterVVoidArray(sendBuffer, recvBuffer,
470  sendLengths, offsets, recvLength,
471  VTK_INT, srcProcessId);
472  }
473  int ScatterV(const unsigned long *sendBuffer, unsigned long *recvBuffer,
474  vtkIdType *sendLengths, vtkIdType *offsets,
475  vtkIdType recvLength, int srcProcessId) {
476  return this->ScatterVVoidArray(sendBuffer, recvBuffer,
477  sendLengths, offsets, recvLength,
478  VTK_UNSIGNED_LONG, srcProcessId);
479  }
480  int ScatterV(const unsigned char *sendBuffer, unsigned char *recvBuffer,
481  vtkIdType *sendLengths, vtkIdType *offsets,
482  vtkIdType recvLength, int srcProcessId) {
483  return this->ScatterVVoidArray(sendBuffer, recvBuffer,
484  sendLengths, offsets, recvLength,
485  VTK_UNSIGNED_CHAR, srcProcessId);
486  }
487  int ScatterV(const char *sendBuffer, char *recvBuffer,
488  vtkIdType *sendLengths, vtkIdType *offsets,
489  vtkIdType recvLength, int srcProcessId) {
490  return this->ScatterVVoidArray(sendBuffer, recvBuffer,
491  sendLengths, offsets, recvLength,
492  VTK_CHAR, srcProcessId);
493  }
494  int ScatterV(const float *sendBuffer, float *recvBuffer,
495  vtkIdType *sendLengths, vtkIdType *offsets,
496  vtkIdType recvLength, int srcProcessId) {
497  return this->ScatterVVoidArray(sendBuffer, recvBuffer,
498  sendLengths, offsets, recvLength,
499  VTK_FLOAT, srcProcessId);
500  }
501  int ScatterV(const double *sendBuffer, double *recvBuffer,
502  vtkIdType *sendLengths, vtkIdType *offsets,
503  vtkIdType recvLength, int srcProcessId) {
504  return this->ScatterVVoidArray(sendBuffer, recvBuffer,
505  sendLengths, offsets, recvLength,
506  VTK_DOUBLE, srcProcessId);
507  }
508 #ifdef VTK_USE_64BIT_IDS
509  int ScatterV(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
510  vtkIdType *sendLengths, vtkIdType *offsets,
511  vtkIdType recvLength, int srcProcessId) {
512  return this->ScatterVVoidArray(sendBuffer, recvBuffer,
513  sendLengths, offsets, recvLength,
514  VTK_ID_TYPE, srcProcessId);
515  }
516 #endif
517 
518 
520 
521  int AllGather(const int *sendBuffer, int *recvBuffer, vtkIdType length) {
522  return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_INT);
523  }
524  int AllGather(const unsigned long *sendBuffer,
525  unsigned long *recvBuffer, vtkIdType length) {
526  return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
528  }
529  int AllGather(const unsigned char *sendBuffer,
530  unsigned char *recvBuffer, vtkIdType length) {
531  return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
533  }
534  int AllGather(const char *sendBuffer, char *recvBuffer, vtkIdType length) {
535  return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_CHAR);
536  }
537  int AllGather(const float *sendBuffer, float *recvBuffer, vtkIdType length) {
538  return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_FLOAT);
539  }
540  int AllGather(const double *sendBuffer,
541  double *recvBuffer, vtkIdType length) {
542  return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_DOUBLE);
543  }
544 #ifdef VTK_USE_64BIT_IDS
545  int AllGather(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
546  vtkIdType length) {
547  return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
548  VTK_ID_TYPE);
549  }
550 #endif
551  int AllGather(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer);
553 
555 
556  int AllGatherV(const int* sendBuffer, int* recvBuffer,
557  vtkIdType sendLength, vtkIdType* recvLengths,
558  vtkIdType* offsets) {
559  return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
560  sendLength, recvLengths,
561  offsets, VTK_INT);
562  }
563  int AllGatherV(const unsigned long* sendBuffer, unsigned long* recvBuffer,
564  vtkIdType sendLength, vtkIdType* recvLengths,
565  vtkIdType* offsets) {
566  return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
567  sendLength, recvLengths,
568  offsets, VTK_UNSIGNED_LONG);
569  }
570  int AllGatherV(const unsigned char* sendBuffer, unsigned char* recvBuffer,
571  vtkIdType sendLength, vtkIdType* recvLengths,
572  vtkIdType* offsets) {
573  return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
574  sendLength, recvLengths,
575  offsets, VTK_UNSIGNED_CHAR);
576  }
577  int AllGatherV(const char* sendBuffer, char* recvBuffer,
578  vtkIdType sendLength, vtkIdType* recvLengths,
579  vtkIdType* offsets) {
580  return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
581  sendLength, recvLengths,
582  offsets, VTK_CHAR);
583  }
584  int AllGatherV(const float* sendBuffer, float* recvBuffer,
585  vtkIdType sendLength, vtkIdType* recvLengths,
586  vtkIdType* offsets) {
587  return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
588  sendLength, recvLengths,
589  offsets, VTK_FLOAT);
590  }
591  int AllGatherV(const double* sendBuffer, double* recvBuffer,
592  vtkIdType sendLength, vtkIdType* recvLengths,
593  vtkIdType* offsets) {
594  return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
595  sendLength, recvLengths,
596  offsets, VTK_DOUBLE);
597  }
598 #ifdef VTK_USE_64BIT_IDS
599  int AllGatherV(const vtkIdType* sendBuffer, vtkIdType* recvBuffer,
600  vtkIdType sendLength, vtkIdType* recvLengths,
601  vtkIdType* offsets) {
602  return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
603  sendLength, recvLengths,
604  offsets, VTK_ID_TYPE);
605  }
606 #endif
607  int AllGatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
608  vtkIdType *recvLengths, vtkIdType *offsets);
609  int AllGatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer);
611 
613 
616  int Reduce(const int *sendBuffer, int *recvBuffer,
617  vtkIdType length, int operation, int destProcessId) {
618  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
619  VTK_INT, operation, destProcessId);
620  }
621  int Reduce(const unsigned int *sendBuffer, unsigned int *recvBuffer,
622  vtkIdType length, int operation, int destProcessId) {
623  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
624  VTK_UNSIGNED_INT, operation, destProcessId);
625  }
626  int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
627  vtkIdType length, int operation, int destProcessId) {
628  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
629  VTK_UNSIGNED_LONG, operation, destProcessId);
630  }
631  int Reduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
632  vtkIdType length, int operation, int destProcessId) {
633  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
634  VTK_UNSIGNED_CHAR, operation, destProcessId);
635  }
636  int Reduce(const char *sendBuffer, char *recvBuffer,
637  vtkIdType length, int operation, int destProcessId) {
638  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
639  VTK_CHAR, operation, destProcessId);
640  }
641  int Reduce(const float *sendBuffer, float *recvBuffer,
642  vtkIdType length, int operation, int destProcessId) {
643  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
644  VTK_FLOAT, operation, destProcessId);
645  }
646  int Reduce(const double *sendBuffer, double *recvBuffer,
647  vtkIdType length, int operation, int destProcessId) {
648  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
649  VTK_DOUBLE, operation, destProcessId);
650  }
651 #ifdef VTK_USE_64BIT_IDS
652  int Reduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
653  vtkIdType length, int operation, int destProcessId) {
654  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
655  VTK_ID_TYPE, operation, destProcessId);
656  }
657 #endif
658  int Reduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
659  int operation, int destProcessId);
661 
663 
666  int Reduce(const int *sendBuffer, int *recvBuffer,
667  vtkIdType length, Operation *operation, int destProcessId) {
668  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
669  VTK_INT, operation, destProcessId);
670  }
671  int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
672  vtkIdType length, Operation *operation, int destProcessId) {
673  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
674  VTK_UNSIGNED_LONG, operation, destProcessId);
675  }
676  int Reduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
677  vtkIdType length, Operation *operation, int destProcessId) {
678  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
679  VTK_UNSIGNED_CHAR, operation, destProcessId);
680  }
681  int Reduce(const char *sendBuffer, char *recvBuffer,
682  vtkIdType length, Operation *operation, int destProcessId) {
683  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
684  VTK_CHAR, operation, destProcessId);
685  }
686  int Reduce(const float *sendBuffer, float *recvBuffer,
687  vtkIdType length, Operation *operation, int destProcessId) {
688  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
689  VTK_FLOAT, operation, destProcessId);
690  }
691  int Reduce(const double *sendBuffer, double *recvBuffer,
692  vtkIdType length, Operation *operation, int destProcessId) {
693  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
694  VTK_DOUBLE, operation, destProcessId);
695  }
696 #ifdef VTK_USE_64BIT_IDS
697  int Reduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
698  vtkIdType length, Operation *operation, int destProcessId) {
699  return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
700  VTK_ID_TYPE, operation, destProcessId);
701  }
702 #endif
703  int Reduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
704  Operation *operation, int destProcessId);
706 
708 
710  int AllReduce(const int *sendBuffer, int *recvBuffer,
711  vtkIdType length, int operation) {
712  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
713  VTK_INT, operation);
714  }
715  int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
716  vtkIdType length, int operation) {
717  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
718  VTK_UNSIGNED_LONG, operation);
719  }
720  int AllReduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
721  vtkIdType length, int operation) {
722  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
723  VTK_UNSIGNED_CHAR, operation);
724  }
725  int AllReduce(const char *sendBuffer, char *recvBuffer,
726  vtkIdType length, int operation) {
727  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
728  VTK_CHAR, operation);
729  }
730  int AllReduce(const float *sendBuffer, float *recvBuffer,
731  vtkIdType length, int operation) {
732  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
733  VTK_FLOAT, operation);
734  }
735  int AllReduce(const double *sendBuffer, double *recvBuffer,
736  vtkIdType length, int operation) {
737  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
738  VTK_DOUBLE, operation);
739  }
740 #ifdef VTK_USE_64BIT_IDS
741  int AllReduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
742  vtkIdType length, int operation) {
743  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
744  VTK_ID_TYPE, operation);
745  }
746 #endif
747  int AllReduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
748  int operation);
749  int AllReduce(const int *sendBuffer, int *recvBuffer,
750  vtkIdType length, Operation *operation) {
751  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
752  VTK_INT, operation);
753  }
754  int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
755  vtkIdType length, Operation *operation) {
756  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
757  VTK_UNSIGNED_LONG, operation);
758  }
759  int AllReduce(const unsigned char *sendBuffer, unsigned char *recvBuffer,
760  vtkIdType length, Operation *operation) {
761  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
762  VTK_UNSIGNED_CHAR, operation);
763  }
764  int AllReduce(const char *sendBuffer, char *recvBuffer,
765  vtkIdType length, Operation *operation) {
766  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
767  VTK_CHAR, operation);
768  }
769  int AllReduce(const float *sendBuffer, float *recvBuffer,
770  vtkIdType length, Operation *operation) {
771  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
772  VTK_FLOAT, operation);
773  }
774  int AllReduce(const double *sendBuffer, double *recvBuffer,
775  vtkIdType length, Operation *operation) {
776  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
777  VTK_DOUBLE, operation);
778  }
779 #ifdef VTK_USE_64BIT_IDS
780  int AllReduce(const vtkIdType *sendBuffer, vtkIdType *recvBuffer,
781  vtkIdType length, Operation *operation) {
782  return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
783  VTK_ID_TYPE, operation);
784  }
785 #endif
786  int AllReduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
787  Operation *operation);
789 
791 
793  virtual int BroadcastVoidArray(void *data, vtkIdType length, int type,
794  int srcProcessId);
795  virtual int GatherVoidArray(const void *sendBuffer, void *recvBuffer,
796  vtkIdType length, int type, int destProcessId);
797  virtual int GatherVVoidArray(const void *sendBuffer, void *recvBuffer,
798  vtkIdType sendLength, vtkIdType *recvLengths,
799  vtkIdType *offsets, int type, int destProcessId);
800  virtual int ScatterVoidArray(const void *sendBuffer, void *recvBuffer,
801  vtkIdType length, int type, int srcProcessId);
802  virtual int ScatterVVoidArray(const void *sendBuffer, void *recvBuffer,
803  vtkIdType *sendLengths, vtkIdType *offsets,
804  vtkIdType recvLength, int type,
805  int srcProcessId);
806  virtual int AllGatherVoidArray(const void *sendBuffer, void *recvBuffer,
807  vtkIdType length, int type);
808  virtual int AllGatherVVoidArray(const void *sendBuffer, void *recvBuffer,
809  vtkIdType sendLength, vtkIdType *recvLengths,
810  vtkIdType *offsets, int type);
811  virtual int ReduceVoidArray(const void *sendBuffer, void *recvBuffer,
812  vtkIdType length, int type,
813  int operation, int destProcessId);
814  virtual int ReduceVoidArray(const void *sendBuffer, void *recvBuffer,
815  vtkIdType length, int type,
816  Operation *operation, int destProcessId);
817  virtual int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer,
818  vtkIdType length, int type,
819  int operation);
820  virtual int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer,
821  vtkIdType length, int type,
822  Operation *operation);
824 
825  static void SetUseCopy(int useCopy);
826 
827 //BTX
829 
837  virtual int ComputeGlobalBounds(int processorId, int numProcesses,
838  vtkBoundingBox *bounds,
839  int *rightHasBounds = 0,
840  int *leftHasBounds = 0,
841  int hasBoundsTag = 288402,
842  int localBoundsTag = 288403,
843  int globalBoundsTag = 288404);
844 //ETX
846 
848 
851  static int GetParentProcessor(int pid);
852  static int GetLeftChildProcessor(int pid);
854 
856 
859  static int MarshalDataObject(vtkDataObject *object, vtkCharArray *buffer);
860  static int UnMarshalDataObject(vtkCharArray *buffer, vtkDataObject *object);
862 
863 protected:
864 
865  int WriteDataArray(vtkDataArray *object);
866  int ReadDataArray(vtkDataArray *object);
867 
868  vtkCommunicator();
869  ~vtkCommunicator();
870 
871  // Internal methods called by Send/Receive(vtkDataObject *... ) above.
872  int SendElementalDataObject(vtkDataObject* data, int remoteHandle, int tag);
873  int ReceiveDataObject(vtkDataObject* data,
874  int remoteHandle, int tag, int type=-1);
875  int ReceiveElementalDataObject(vtkDataObject* data,
876  int remoteHandle, int tag);
877  int ReceiveMultiBlockDataSet(
878  vtkMultiBlockDataSet* data, int remoteHandle, int tag);
879 
882 
884 
885  static int UseCopy;
886 
888 
889 private:
890  vtkCommunicator(const vtkCommunicator&); // Not implemented.
891  void operator=(const vtkCommunicator&); // Not implemented.
892 };
893 
894 #endif // __vtkCommunicator_h
895 
896 
int Receive(double *data, vtkIdType maxlength, int remoteHandle, int tag)
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
int Receive(unsigned int *data, vtkIdType maxlength, int remoteHandle, int tag)
int AllGather(const unsigned long *sendBuffer, unsigned long *recvBuffer, vtkIdType length)
int Broadcast(float *data, vtkIdType length, int srcProcessId)
int AllReduce(const char *sendBuffer, char *recvBuffer, vtkIdType length, Operation *operation)
int Gather(const int *sendBuffer, int *recvBuffer, vtkIdType length, int destProcessId)
int GatherV(const double *sendBuffer, double *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int destProcessId)
int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer, vtkIdType length, int operation)
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
int ScatterV(const double *sendBuffer, double *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int srcProcessId)
int AllReduce(const unsigned char *sendBuffer, unsigned char *recvBuffer, vtkIdType length, int operation)
#define VTK_UNSIGNED_INT
Definition: vtkType.h:32
int Send(const int *data, vtkIdType length, int remoteHandle, int tag)
abstract base class for most VTK objects
Definition: vtkObject.h:61
int Receive(unsigned char *data, vtkIdType maxlength, int remoteHandle, int tag)
int Scatter(const double *sendBuffer, double *recvBuffer, vtkIdType length, int srcProcessId)
stream used to pass data across processes using vtkMultiProcessController.
GLuint buffer
Definition: vtkgl.h:11839
int GatherV(const char *sendBuffer, char *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int destProcessId)
#define VTKPARALLELCORE_EXPORT
abstract class to specify dataset behavior
Definition: vtkDataSet.h:60
int Gather(const unsigned long *sendBuffer, unsigned long *recvBuffer, vtkIdType length, int destProcessId)
int AllReduce(const double *sendBuffer, double *recvBuffer, vtkIdType length, Operation *operation)
int AllReduce(const float *sendBuffer, float *recvBuffer, vtkIdType length, Operation *operation)
int Reduce(const float *sendBuffer, float *recvBuffer, vtkIdType length, int operation, int destProcessId)
int Reduce(const double *sendBuffer, double *recvBuffer, vtkIdType length, Operation *operation, int destProcessId)
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer, vtkIdType length, Operation *operation, int destProcessId)
int ScatterV(const unsigned long *sendBuffer, unsigned long *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int srcProcessId)
int Send(const float *data, vtkIdType length, int remoteHandle, int tag)
int Scatter(const char *sendBuffer, char *recvBuffer, vtkIdType length, int srcProcessId)
int Reduce(const int *sendBuffer, int *recvBuffer, vtkIdType length, Operation *operation, int destProcessId)
GLuint GLsizei GLsizei * length
Definition: vtkgl.h:11992
int vtkIdType
Definition: vtkType.h:268
int AllGatherV(const int *sendBuffer, int *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets)
int AllReduce(const unsigned char *sendBuffer, unsigned char *recvBuffer, vtkIdType length, Operation *operation)
int Broadcast(char *data, vtkIdType length, int srcProcessId)
int AllGather(const double *sendBuffer, double *recvBuffer, vtkIdType length)
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
int Send(const double *data, vtkIdType length, int remoteHandle, int tag)
GLuint GLuint num
Definition: vtkgl.h:16907
int ScatterV(const int *sendBuffer, int *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int srcProcessId)
int Reduce(const unsigned char *sendBuffer, unsigned char *recvBuffer, vtkIdType length, int operation, int destProcessId)
int Scatter(const float *sendBuffer, float *recvBuffer, vtkIdType length, int srcProcessId)
int AllReduce(const char *sendBuffer, char *recvBuffer, vtkIdType length, int operation)
#define VTK_DOUBLE
Definition: vtkType.h:36
int ScatterV(const unsigned char *sendBuffer, unsigned char *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int srcProcessId)
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:42
#define VTK_FLOAT
Definition: vtkType.h:35
static int UseCopy
int Gather(const double *sendBuffer, double *recvBuffer, vtkIdType length, int destProcessId)
int Receive(char *data, vtkIdType maxlength, int remoteHandle, int tag)
int Send(const unsigned int *data, vtkIdType length, int remoteHandle, int tag)
virtual void PrintSelf(ostream &os, vtkIndent indent)
int AllGatherV(const float *sendBuffer, float *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets)
int Reduce(const float *sendBuffer, float *recvBuffer, vtkIdType length, Operation *operation, int destProcessId)
a simple class to control print indentation
Definition: vtkIndent.h:38
int ScatterV(const char *sendBuffer, char *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int srcProcessId)
int AllGatherV(const char *sendBuffer, char *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets)
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
int AllGather(const unsigned char *sendBuffer, unsigned char *recvBuffer, vtkIdType length)
int Reduce(const int *sendBuffer, int *recvBuffer, vtkIdType length, int operation, int destProcessId)
int AllReduce(const double *sendBuffer, double *recvBuffer, vtkIdType length, int operation)
#define VTK_CHAR
Definition: vtkType.h:26
int AllGather(const float *sendBuffer, float *recvBuffer, vtkIdType length)
int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer, vtkIdType length, Operation *operation)
int Send(const unsigned long *data, vtkIdType length, int remoteHandle, int tag)
int Gather(const char *sendBuffer, char *recvBuffer, vtkIdType length, int destProcessId)
int AllGatherV(const double *sendBuffer, double *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets)
int Scatter(const unsigned char *sendBuffer, unsigned char *recvBuffer, vtkIdType length, int srcProcessId)
int Gather(const float *sendBuffer, float *recvBuffer, vtkIdType length, int destProcessId)
int AllGatherV(const unsigned long *sendBuffer, unsigned long *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets)
int Reduce(const unsigned int *sendBuffer, unsigned int *recvBuffer, vtkIdType length, int operation, int destProcessId)
int GatherV(const int *sendBuffer, int *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int destProcessId)
int Broadcast(unsigned long *data, vtkIdType length, int srcProcessId)
GLuint GLuint stream
Definition: vtkgl.h:14154
int Reduce(const char *sendBuffer, char *recvBuffer, vtkIdType length, Operation *operation, int destProcessId)
int Scatter(const unsigned long *sendBuffer, unsigned long *recvBuffer, vtkIdType length, int srcProcessId)
int AllGatherV(const unsigned char *sendBuffer, unsigned char *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets)
int AllGather(const int *sendBuffer, int *recvBuffer, vtkIdType length)
int Broadcast(double *data, vtkIdType length, int srcProcessId)
int AllReduce(const int *sendBuffer, int *recvBuffer, vtkIdType length, Operation *operation)
int Reduce(const unsigned char *sendBuffer, unsigned char *recvBuffer, vtkIdType length, Operation *operation, int destProcessId)
int Receive(float *data, vtkIdType maxlength, int remoteHandle, int tag)
int Send(const unsigned char *data, vtkIdType length, int remoteHandle, int tag)
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:28
int ScatterV(const float *sendBuffer, float *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int srcProcessId)
int Gather(const unsigned char *sendBuffer, unsigned char *recvBuffer, vtkIdType length, int destProcessId)
int Reduce(const char *sendBuffer, char *recvBuffer, vtkIdType length, int operation, int destProcessId)
Composite dataset that organizes datasets into blocks.
int AllReduce(const float *sendBuffer, float *recvBuffer, vtkIdType length, int operation)
int Receive(int *data, vtkIdType maxlength, int remoteHandle, int tag)
int GatherV(const float *sendBuffer, float *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int destProcessId)
#define VTK_ID_TYPE
Definition: vtkType.h:37
int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer, vtkIdType length, int operation, int destProcessId)
int Broadcast(unsigned char *data, vtkIdType length, int srcProcessId)
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:34
int Receive(unsigned long *data, vtkIdType maxlength, int remoteHandle, int tag)
int Broadcast(int *data, vtkIdType length, int srcProcessId)
int GatherV(const unsigned long *sendBuffer, unsigned long *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int destProcessId)
int AllGather(const char *sendBuffer, char *recvBuffer, vtkIdType length)
Used to send/receive messages in a multiprocess environment.
int Scatter(const int *sendBuffer, int *recvBuffer, vtkIdType length, int srcProcessId)
general representation of visualization data
Definition: vtkDataObject.h:64
int GatherV(const unsigned char *sendBuffer, unsigned char *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int destProcessId)
int Send(const char *data, vtkIdType length, int remoteHandle, int tag)
int AllReduce(const int *sendBuffer, int *recvBuffer, vtkIdType length, int operation)
#define VTK_INT
Definition: vtkType.h:31
int Broadcast(unsigned int *data, vtkIdType length, int srcProcessId)
Fast Simple Class for dealing with 3D bounds.
int Reduce(const double *sendBuffer, double *recvBuffer, vtkIdType length, int operation, int destProcessId)