Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

gpartitioner.hpp

Go to the documentation of this file.
00001 //************************************************************************************//
00002 // Module       : gpartitioner.hpp
00003 // Date         : 6/9/05 (DLR)
00004 // Copyright    : 2005-2006 Copyright University Corporation for Atmospheric
00005 //                Research
00006 // Description  : Encapsulates the access methods and data associated with
00007 //                partitioning of data/elements among processors.
00008 // Derived From : none.
00009 // Modifications:
00010 //************************************************************************************//
00011 #if !defined(GPARTITIONER_HPP)
00012 #define GPARTITIONER_HPP
00013 
00014 #include "gtypes.h"
00015 #include <iostream.h>
00016 #include <stdlib.h>
00017 #include "gelemlist.hpp"
00018 #include "gelemindex.hpp"
00019 #include "gfieldlist.hpp"
00020 #include "gcomm.hpp"
00021 #include "gtlist.hpp"
00022 #include "gobjlist.hpp"
00023 #include "gobjbuffer.hpp"
00024 #include "gpobjbuffer.hpp"
00025 #include "gpartmapper.hpp"
00026 
00027 
00028 class GPartitioner 
00029 {
00030 public:
00031                            GPartitioner(GElemList *gelemsv, GFieldList **gfieldsv, GINT nfieldsv);
00032                           ~GPartitioner();
00033 
00034          GBOOL             Init(stGPartitionMap pm[], GINT nmax);                    // Set partition map data
00035          GBOOL             SetBasisPools(pGLLBuffer *vbasis, GIBuffer *szvbasis,
00036                                          pGLBuffer  *pbasis, GIBuffer *szpbasis);
00037          GBOOL             SetFieldGroup(GElemList *gelems, GFieldList **gfields, GINT nfields);
00038                                                                                      // Set additional field groups
00039          GBOOL             DoPartition();                                            // Carry out data exchange/repartitioning
00040 
00041 private:
00042          // Methods: 
00043          GBOOL             PostReceives();                                           // Post receives of data from other procs
00044          GBOOL             WaitOnRecvs();                                            // Waits on recvs from all procs
00045          GBOOL             SendData    ();                                           // Send elements/fields to other procs, delete from here
00046          GBOOL             Pack(GDOUBLE *cdata, GINT ndata, GINT field_index[], GINT nflds); 
00047                                                                                      // Bundle field data into comm packet
00048          GBOOL             Unpack(GDOUBLE *cdata, GINT ndata);                       // Unbundle field data from comm packet
00049          GBOOL             Unpack();                                                 // Unbundle field data from all comm packets
00050          GBOOL             CleanFieldLists();                                        // Remove unnec. fields/elems from lists
00051          GBOOL             CreateSendRecvBuffs();                                    // Set up send/recv buffers
00052 
00053          // Member data
00054          GSHORT            nprocs_;            // number of procs
00055          GSHORT            this_rank_;         // this proc's rank
00056          GBOOL             bInitialized_;      // object initialized?
00057          GBOOL             bdelete_partmap_;   // delete partmap variable?
00058          GINT              nfieldsv_;          // number of v-fields
00059          GINT              nfieldsp_;          // number of v-fields
00060          GINT              npartmax_;          // max number of sends among all processors
00061          GINT              maxvnodes_;         // max number of v-nodes
00062          GINT              maxpnodes_;         // max number of p-nodes
00063          GINT              maxedges_;          // max number of edges
00064          GINT              maxfaces_;          // max number of faces
00065          GINT              maxverts_;          // max number of element vertices
00066          GINT              maxnto_;            // max number of elements to send among all procs
00067          GINT              maxlevels_;         // max no. time levels for each field
00068          GINT              nto_;               // number of procs to send data to
00069          GINT              nfrom_;             // number of procs to recv data from 
00070          GINT              lbuff_;             // send/recv buffer lens
00071          GDBuffer          sendbuff_;          // send buffer
00072          GDBuffer          *recvbuff_;         // receive buffers
00073          GIBuffer          index_to_;          // indices in gelems/gfields to send to procs
00074          GIBuffer          *szbasisv_;         // array of v-basis sizes
00075          GIBuffer          *szbasisp_;         // array of p-basis sizes
00076          GSBuffer          iproc_to_;          // procs where to send data, pointed to by indices in indices2send_
00077          GSBuffer          iproc_from_;        // procs from which to recv data
00078          CHBuffer          rhandle_;           // comm handle array for posted receives
00079          pGLLBuffer        *gbasisv_;          // pool of v-bases
00080          pGLBuffer         *gbasisp_;          // pool of p-bases
00081          GElemList         *gelemsv_;          // v-Element list
00082          GElemList         *gelemsp_;          // p-Element list
00083          GFieldList        **gfieldsv_;        // v-field list
00084          GFieldList        **gfieldsp_;        // p-field list
00085          stGPartitionMap   *partmap_;          // partition map
00086          GFGList           fieldgroups_;       // field group list
00087 
00088 };
00089 
00090 #endif

Generated on Wed Dec 21 16:00:48 2005 for Geophysics & Astrophysics Spectral Element Adaptive Refinement (GASpAR) 2D Code by  doxygen 1.4.4