cgma
CGMParallelComm.hpp
Go to the documentation of this file.
00001 
00010 #ifndef CGM_PARALLEL_COMM_HPP
00011 #define CGM_PARALLEL_COMM_HPP
00012 
00013 #include "CGMProcConfig.hpp"
00014 #include "CGMmpi.h"
00015 #include "DLIList.hpp"
00016 #include <vector>
00017 
00018 class GeometryQueryTool;
00019 class RefEntity;
00020 
00021 class CGMParallelComm 
00022 {
00023 public:
00024 
00026   CGMParallelComm(MPI_Comm comm = MPI_COMM_WORLD);
00027   
00029   CGMParallelComm(std::vector<unsigned char> &tmp_buff,
00030           MPI_Comm comm = MPI_COMM_WORLD);
00031 
00032 
00033   
00035   ~CGMParallelComm();
00036     
00038   DLIList<RefEntity*> &partition_surf_list() {return partitioningSurfList;}
00039   const DLIList<RefEntity*> &partition_surf_list() const {return partitioningSurfList;}
00040   DLIList<RefEntity*> &partition_body_list() {return partitioningBodyList;}
00041   const DLIList<RefEntity*> &partition_body_list() const {return partitioningBodyList;}
00042   
00044   const CGMProcConfig &proc_config() const {return procConfig;}
00045   
00047   CGMProcConfig &proc_config() {return procConfig;}
00048 
00049   CubitStatus broadcast_entities(const unsigned int from_proc,
00050                  DLIList<RefEntity*> &ref_entity_list);
00051 
00052   CubitStatus scatter_entities(const unsigned int from_proc,
00053                    DLIList<RefEntity*> &ref_entity_list);
00054 
00055   CubitStatus write_buffer(DLIList<RefEntity*> &ref_entity_list,
00056               char* pBuffer,
00057               int& n_buffer_size,
00058               bool b_export_buffer);
00059 
00060   CubitStatus read_buffer(DLIList<RefEntity*> &ref_entity_list,
00061                 const char* pBuffer,
00062                 const int n_buffer_size);
00063     
00064   CubitStatus bcast_buffer(const unsigned int from_proc);
00065 
00066   CubitStatus append_to_buffer(DLIList<RefEntity*> &ref_entity_list,
00067                    int add_size);
00068 
00069 private:  
00070 
00071 
00072   CubitStatus check_size(int& target_size, const CubitBoolean keep = CUBIT_FALSE);
00073   
00075   GeometryQueryTool *gqt;
00076 
00078   CGMProcConfig procConfig;
00079   
00081   std::vector<unsigned char> myBuffer;
00082 
00083   char* m_pBuffer;
00084   
00085   int m_nBufferSize;
00086   
00087   int m_currentPosition;
00088   
00089   DLIList<RefEntity*> partitioningSurfList; // ref entity list containing all parts
00090   DLIList<RefEntity*> partitioningBodyList; // ref entity list containing all parts
00091 
00092 };
00093 
00094 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines