Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkSubGroup.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   ParaView
00004   Module:    $RCSfile: vtkSubGroup.h,v $
00005 
00006   Copyright (c) Kitware, Inc.
00007   All rights reserved.
00008   See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 /*----------------------------------------------------------------------------
00016  Copyright (c) Sandia Corporation
00017  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00018 ----------------------------------------------------------------------------*/
00019 
00033 #ifndef __vtkSubGroup_h
00034 #define __vtkSubGroup_h
00035 
00036 #include "vtkObject.h"
00037 
00038 class vtkMultiProcessController;
00039 class vtkCommunicator;
00040 
00041 class VTK_PARALLEL_EXPORT vtkSubGroup : public vtkObject 
00042 {
00043 public:
00044   vtkTypeRevisionMacro(vtkSubGroup, vtkObject);
00045   virtual void PrintSelf(ostream &os, vtkIndent indent);
00046   static vtkSubGroup *New();
00047 
00048 //BTX
00049   // The wrapper gets confused here and falls down.
00050   enum {MINOP = 1, MAXOP = 2, SUMOP = 3};
00051 //ETX
00058   int Initialize(int p0, int p1, int me, int tag, vtkCommunicator *c);
00059   
00060   int Gather(int *data, int *to, int length, int root);
00061   int Gather(char *data, char *to, int length, int root);
00062   int Gather(float *data, float *to, int length, int root);
00063   int Broadcast(float *data, int length, int root);
00064   int Broadcast(double *data, int length, int root);
00065   int Broadcast(int *data, int length, int root);
00066   int Broadcast(char *data, int length, int root);
00067   int ReduceSum(int *data, int *to, int length, int root);
00068   int ReduceMax(float *data, float *to, int length, int root);
00069   int ReduceMax(double *data, double *to, int length, int root);
00070   int ReduceMax(int *data, int *to, int length, int root);
00071   int ReduceMin(float *data, float *to, int length, int root);
00072   int ReduceMin(double *data, double *to, int length, int root);
00073   int ReduceMin(int *data, int *to, int length, int root);
00074   
00075   int AllReduceUniqueList(int *list, int len, int **newList);
00076   int MergeSortedUnique(int *list1, int len1, int *list2, int len2, int **newList);
00077   
00078   void setGatherPattern(int root, int length);
00079   int getLocalRank(int processID);
00080   
00081   int Barrier();
00082   
00083   void PrintSubGroup() const;
00084 
00085   static int MakeSortedUnique(int *list, int len, int **newList);
00086   
00087   int tag;
00088 
00089 protected:
00090   vtkSubGroup();
00091   ~vtkSubGroup();
00092 
00093 private:
00094   int computeFanInTargets();
00095   void restoreRoot(int rootLoc);
00096   void moveRoot(int rootLoc);
00097   void setUpRoot(int root);
00098 
00099   int nFrom;
00100   int nTo; 
00101   
00102   int sendId;                // gather
00103   int sendOffset;
00104   int sendLength;
00105 
00106   int recvId[20];
00107   int recvOffset[20];
00108   int recvLength[20];
00109   int fanInFrom[20];         // reduce, broadcast
00110 
00111   int fanInTo;
00112   int nSend;
00113   int nRecv;
00114   int gatherRoot;
00115   int gatherLength;
00116   
00117   int *members;
00118   int nmembers;
00119   int myLocalRank;
00120   
00121   vtkCommunicator *comm;
00122 
00123   vtkSubGroup(const vtkSubGroup&); // Not implemented
00124   void operator=(const vtkSubGroup&); // Not implemented
00125 };
00126 #endif

Generated on Mon Jan 21 23:07:34 2008 for VTK by  doxygen 1.4.3-20050530