moab
WriteHDF5Parallel.hpp
Go to the documentation of this file.
00001 
00002 #ifndef WRITE_HDF5_PARALLEL_HPP
00003 #define WRITE_HDF5_PARALLEL_HPP
00004 
00005 #include "WriteHDF5.hpp"
00006 #include <H5Spublic.h>
00007 #include <map>
00008 
00009 namespace moab {
00010 
00011 struct RemoteSetData;
00012 class ParallelComm;
00013 class IODebugTrack;
00014 
00020 class WriteHDF5Parallel : public WriteHDF5
00021 {
00022   public:
00023 
00024     static WriterIface* factory( Interface* );
00025     
00028     WriteHDF5Parallel( Interface* iface );
00029 
00030     virtual ~WriteHDF5Parallel();
00031     
00032   
00033   protected:
00034     
00035     virtual void debug_barrier_line(int lineno);
00036 
00037   
00038     virtual void print_times( const double* times ) const;
00039   
00042     virtual ErrorCode parallel_create_file( const char* filename,
00043                                      bool overwrite,
00044                                      const std::vector<std::string>& qa_records,
00045                                      const FileOptions& opts,
00046                                      const Tag* user_tag_list = 0,
00047                                      int user_tag_count = 0,
00048                                      int dimension = 3,
00049                                      double* times = 0);
00050     
00058     ErrorCode gather_interface_meshes( Range& non_local_ents );
00059     
00069     ErrorCode exchange_file_ids( const Range& non_local_ents );
00070     
00072     ErrorCode communicate_shared_set_ids( const Range& owned, const Range& remote );
00073     
00080     ErrorCode pack_set( Range::const_iterator set,
00081                         unsigned long* set_data,
00082                         size_t set_data_length );
00083   
00085     ErrorCode unpack_set( EntityHandle set, 
00086                           const unsigned long* set_data, 
00087                           size_t set_data_length );
00088                           
00092     ErrorCode communicate_shared_set_data( const Range& owned, const Range& remote );
00093     
00095     ErrorCode create_node_table( int dimension );
00096     
00100     ErrorCode negotiate_type_list();
00101     
00103     ErrorCode create_element_tables();
00104     
00106     ErrorCode create_adjacency_tables();
00107     
00109     ErrorCode create_meshset_tables(double* times);
00110     
00112     ErrorCode create_tag_tables();
00113    
00115     void remove_remote_entities( EntityHandle relative, Range& range );
00116     void remove_remote_entities( EntityHandle relative, std::vector<EntityHandle>& vect );
00117     void remove_remote_sets( EntityHandle relative, Range& range );
00118     void remove_remote_sets( EntityHandle relative, std::vector<EntityHandle>& vect );
00119   
00121     ErrorCode get_sharedset_tags();
00122 
00123     ErrorCode append_serial_tag_data( std::vector<unsigned char>& buffer,
00124                                       const WriteHDF5::TagDesc& tag );
00125 
00127     ErrorCode check_serial_tag_data( 
00128                                const std::vector<unsigned char>& buffer,
00129                                std::vector<TagDesc*>* missing = 0,
00130                                std::vector<TagDesc*>* newlist = 0 );
00131   
00133     struct DataSetCreator {
00134       virtual ErrorCode operator()( WriteHDF5* writer,
00135                                     long data_set_size,
00136                                     const ExportSet* group, 
00137                                     long& start_id_out ) const = 0;
00138     };
00139     struct NoopDescCreator : public DataSetCreator {
00140       ErrorCode operator()( WriteHDF5*, long, const ExportSet*, long& start_id ) const
00141       { start_id = -1; return MB_SUCCESS; }
00142     };
00143     
00171     ErrorCode create_dataset( int num_datasets,
00172                               const long* num_owned_entities,
00173                               long* offsets_out,
00174                               long* max_proc_ents_out,
00175                               long* total_ents_out,
00176                               const DataSetCreator& creator = NoopDescCreator(),
00177                               ExportSet* groups[] = 0,
00178                               id_t* first_ids_out = NULL );
00179   
00180     void print_shared_sets();
00181     void print_set_sharing_data( const Range& range, const char* label, Tag idt );
00182   
00183   private:
00184 
00186     ParallelComm *myPcomm;
00187 
00189     bool pcommAllocated;
00190     
00192     H5S_seloper_t hslabOp;
00193 };
00194 
00195 } // namespace moab
00196 
00197 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines