Changeset 3269
- Timestamp:
- 11/03/09 10:05:07 (4 months ago)
- Location:
- cgm/trunk
- Files:
-
- 5 modified
-
geom/parallel/CGMParallelComm.cpp (modified) (6 diffs)
-
geom/parallel/CGMParallelComm.hpp (modified) (6 diffs)
-
geom/parallel/ParallelGeomTool.cpp (modified) (2 diffs)
-
geom/parallel/ParallelGeomTool.hpp (modified) (3 diffs)
-
itaps/CATag.hpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cgm/trunk/geom/parallel/CGMParallelComm.cpp
r3267 r3269 1 1 #include "CGMParallelComm.hpp" 2 //#include "CubitAttrib.hpp"3 //#include "OCCQueryEngine.hpp"4 2 #include "TopologyEntity.hpp" 5 3 #include "GeometryQueryEngine.hpp" 6 4 #include "RefEntity.hpp" 7 8 //#include <iostream> 9 #include <sstream> 10 #include <algoritm> 11 12 #ifdef USE_MPI 13 #include "CGMmpi.h" 14 #endif 5 #include "GeometryQueryTool.hpp" 6 7 #include <algorithm> 15 8 16 9 #define INITIAL_BUFF_SIZE 1024 … … 21 14 return result;} 22 15 23 CGMParallelComm::CGMParallelComm(CGMTagManager *impl, 24 MPI_Comm comm, int* id ) 25 : cgmImpl(impl), procConfig(comm) 16 std::vector<CGMParallelComm*> CGMParallelComm::instanceList; 17 18 CGMParallelComm::CGMParallelComm(MPI_Comm comm, int* id ) 19 : procConfig(comm) 26 20 { 27 21 myBuffer.resize(INITIAL_BUFF_SIZE); … … 46 40 } 47 41 48 CGMParallelComm::CGMParallelComm(CGMTagManager *impl, 49 std::vector<unsigned char> &tmp_buff, 42 CGMParallelComm::CGMParallelComm(std::vector<unsigned char> &tmp_buff, 50 43 MPI_Comm comm, 51 44 int* id) 52 : cgmImpl(impl),procConfig(comm)45 : procConfig(comm) 53 46 { 54 47 myBuffer.swap(tmp_buff); … … 80 73 int CGMParallelComm::add_pcomm(CGMParallelComm *pc) 81 74 { 82 // add this pcomm to instance tag 83 std::vector<CGMParallelComm *> pc_array; 84 pc_array = cgmImpl->get_pc_array(); 85 pc_array.push_back(pc); 86 87 return pc_array.size() - 1; 75 instanceList.push_back(pc); 76 return instanceList.size() - 1; 88 77 } 89 78 90 79 void CGMParallelComm::remove_pcomm(CGMParallelComm *pc) 91 80 { 92 // remove this pcomm from instance tag93 std::vector<CGMParallelComm *> pc_array;94 pc_array = cgmImpl->get_pc_array();95 96 81 std::vector<CGMParallelComm*>::iterator pc_it = 97 std::find( pc_array.begin(), pc_array.end(), pc);98 assert(pc_it != pc_array.end());99 pc_array.erase(pc_it);82 std::find(instanceList.begin(), instanceList.end(), pc); 83 assert(pc_it != instanceList.end()); 84 instanceList.erase(pc_it); 100 85 } 101 86 102 87 //! get the indexed pcomm object from the interface 103 CGMParallelComm *CGMParallelComm::get_pcomm(CGMTagManager *impl, 104 const int index) 88 CGMParallelComm *CGMParallelComm::get_pcomm(const int index) 105 89 { 106 std::vector<CGMParallelComm *> pc_array; 107 pc_array = impl->get_pc_array(); 108 109 if (pc_array.size() < (unsigned int) (index + 1)) return NULL; 110 else return pc_array[index]; 111 } 112 113 CubitStatus CGMParallelComm::get_all_pcomm(CGMTagManager *impl, 114 std::vector<CGMParallelComm*>& list ) 115 { 116 list = impl->get_pc_array(); 90 if (instanceList.size() < (unsigned int) (index + 1)) return NULL; 91 else return instanceList[index]; 92 } 93 94 CubitStatus CGMParallelComm::get_all_pcomm(std::vector<CGMParallelComm*>& list ) 95 { 96 list = instanceList; 117 97 return CUBIT_SUCCESS; 118 98 } … … 120 100 121 101 //! get the indexed pcomm object from the interface 122 CGMParallelComm *CGMParallelComm::get_pcomm(CGMTagManager *impl, 123 //MBEntityHandle prtn, 102 CGMParallelComm *CGMParallelComm::get_pcomm(//MBEntityHandle prtn, 124 103 const MPI_Comm* comm ) 125 104 { … … 140 119 //rval = impl->tag_get_data( prtn_tag, &prtn, 1, &pcomm_id ); 141 120 //if (MB_SUCCESS == rval) { 142 result= get_pcomm(impl, 143 pcomm_id ); 121 result= get_pcomm( pcomm_id ); 144 122 //} 145 123 /* -
cgm/trunk/geom/parallel/CGMParallelComm.hpp
r3263 r3269 11 11 #define CGM_PARALLEL_COMM_HPP 12 12 13 //#include "CGMForward.hpp"14 #include "GeometryQueryTool.hpp"15 //#include "CGMRange.hpp"16 13 #include "CGMProcConfig.hpp" 17 #include "CATag.hpp" 18 #include <map> 19 #include <set> 14 #include "CGMmpi.h" 15 #include "DLIList.hpp" 20 16 #include <vector> 21 #include "math.h"22 #include "CGMmpi.h"23 17 24 25 extern "C" { 26 struct tuple_list; 27 } 28 29 //class TagServer; 30 //class SequenceManager; 31 //template <typename KeyType, typename ValType, ValType NullVal> class RangeMap; 32 //typedef RangeMap<CGMEntityHandle, CGMEntityHandle, 0> HandleMap; 33 34 #define MAX_SHARING_PROCS 64 18 class GeometryQueryTool; 19 class RefEntity; 35 20 36 21 class CGMParallelComm … … 39 24 40 25 //! constructor 41 CGMParallelComm(CGMTagManager *impl, 42 MPI_Comm comm = MPI_COMM_WORLD, 26 CGMParallelComm(MPI_Comm comm = MPI_COMM_WORLD, 43 27 int* pcomm_id_out = 0); 44 28 45 29 //! constructor taking buffer, for testing 46 CGMParallelComm(CGMTagManager *impl, 47 std::vector<unsigned char> &tmp_buff, 30 CGMParallelComm(std::vector<unsigned char> &tmp_buff, 48 31 MPI_Comm comm = MPI_COMM_WORLD, 49 32 int* pcomm_id_out = 0); … … 53 36 54 37 //! get the indexed pcomm object from the interface 55 static CGMParallelComm *get_pcomm(CGMTagManager *impl, 56 const int index); 38 static CGMParallelComm *get_pcomm(const int index); 57 39 58 40 //! Get CGMParallelComm instance associated with partition handle 59 41 //! Will create CGMParallelComm instance if a) one does not already 60 42 //! exist and b) a valid value for MPI_Comm is passed. 61 static CGMParallelComm *get_pcomm(CGMTagManager *impl, 62 //CGMEntityHandle partitioning, 43 static CGMParallelComm *get_pcomm(//CGMEntityHandle partitioning, 63 44 const MPI_Comm* comm = 0 ); 64 45 65 static CubitStatus get_all_pcomm(CGMTagManager *impl, 66 std::vector<CGMParallelComm*>& list ); 46 static CubitStatus get_all_pcomm(std::vector<CGMParallelComm*>& list ); 67 47 68 48 //! destructor … … 130 110 private: 131 111 112 static std::vector<CGMParallelComm*> instanceList; 113 132 114 //! add a pc to the iface instance tag PARALLEL_COMM 133 int add_pcomm(CGMParallelComm *pc);115 static int add_pcomm(CGMParallelComm *pc); 134 116 135 117 //! remove a pc from the iface instance tag PARALLEL_COMM 136 void remove_pcomm(CGMParallelComm *pc);118 static void remove_pcomm(CGMParallelComm *pc); 137 119 138 120 CubitStatus check_size(int& target_size, const CubitBoolean keep = CUBIT_FALSE); … … 141 123 GeometryQueryTool *gqt; 142 124 143 //! CGM tag manager interface associated with this writer144 CGMTagManager *cgmImpl;145 146 125 //! Proc config object, keeps info on parallel stuff 147 126 CGMProcConfig procConfig; 148 149 //! Tag server, so we can get more info about tags150 //TagServer *tagServer;151 152 //! Sequence manager, to get more efficient access to entities153 //SequenceManager *sequenceManager;154 155 127 156 128 //! data buffer used to communicate … … 162 134 163 135 int m_currentPosition; 164 165 //std::ofstream mOfstream;166 167 //! more data buffers, proc-specific168 //std::vector<unsigned char> ownerRBuffs[MAX_SHARING_PROCS],169 //ownerSBuffs[MAX_SHARING_PROCS], ghostRBuffs[MAX_SHARING_PROCS],170 // ghostSBuffs[MAX_SHARING_PROCS];171 172 //! request objects, may be used if store_remote_handles is used173 //MPI_Request sendReqs[2*MAX_SHARING_PROCS];174 175 //! processor rank for each buffer index176 //std::vector<int> buffProcs;177 178 //! the partition, interface sets for this comm'n instance179 //CGMRange partitionSets, interfaceSets;180 181 //! local entities ghosted to other procs182 //std::map<unsigned int, CGMRange> ghostedEnts;183 184 //! tags used to save sharing procs and handles185 //CGMTag sharedpTag, sharedpsTag, sharedhTag, sharedhsTag, pstatusTag,186 //ifaceSetsTag, partitionTag;187 188 //int globalPartCount; //!< Cache of global part count189 136 190 137 //CGMEntityHandle partitioningSet; //!< entity set containing all parts -
cgm/trunk/geom/parallel/ParallelGeomTool.cpp
r3108 r3269 13 13 #include "ParallelGeomTool.hpp" 14 14 #include "CGMParallelConventions.h" 15 #include "CATag.hpp"16 15 #include "CGMParallelComm.hpp" 17 16 … … 46 45 //ParallelGeomTool *ParallelGeomTool::instance_ = NULL; 47 46 48 ParallelGeomTool::ParallelGeomTool(CGM TagManager* impl, CGMParallelComm *pc)49 : cgmImpl(impl),myPcomm(pc)47 ParallelGeomTool::ParallelGeomTool(CGMParallelComm *pc) 48 : myPcomm(pc) 50 49 { 51 50 if (!myPcomm) { 52 myPcomm = CGMParallelComm::get_pcomm( impl,0);53 if (NULL == myPcomm) myPcomm = new CGMParallelComm( cgmImpl);51 myPcomm = CGMParallelComm::get_pcomm(0); 52 if (NULL == myPcomm) myPcomm = new CGMParallelComm(); 54 53 } 55 54 //gqt = GeometryQueryTool::instfance(); -
cgm/trunk/geom/parallel/ParallelGeomTool.hpp
r3108 r3269 5 5 #include "CubitDefines.h" 6 6 #include "CGMParallelComm.hpp" 7 //#include "ProcData.hpp"8 7 #include "FileOptions.hpp" 9 //#include "CATag.hpp"10 //#include "CGMParallelComm.hpp"11 12 //class CGMTagManager;13 //class CGMParallelComm;14 8 15 9 class ParallelGeomTool … … 17 11 public: 18 12 19 ParallelGeomTool(CGM TagManager* impl = NULL, CGMParallelComm *pc = NULL);13 ParallelGeomTool(CGMParallelComm *pc = NULL); 20 14 21 15 //static ParallelGeomTool *instance(); … … 71 65 //static ParallelGeomTool *instance_; 72 66 73 CGMTagManager *cgmImpl;74 75 67 // each reader can keep track of its own pcomm 76 68 CGMParallelComm *myPcomm; -
cgm/trunk/itaps/CATag.hpp
r3108 r3269 43 43 class RefGroup; 44 44 class CATag; 45 class CGMParallelComm;46 45 47 46 class CGMTagManager … … 118 117 } 119 118 120 inline std::vector<CGMParallelComm*>& get_pc_array() { return pc_array; }121 122 119 private: 123 120 CGMTagManager(); … … 132 129 static const char *CATag_NAME_INTERNAL; 133 130 RefGroup *interfaceGroup; 134 135 // list of parallel comm136 std::vector<CGMParallelComm*> pc_array;137 131 138 132 bool getPresetTagData(const RefEntity *entity, const long tag_num,
![(please configure the [header_logo] section in trac.ini)](/projects/ITAPS/chrome/common/trac_banner.png)