Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
ReadParallel.hpp
Go to the documentation of this file.
1 #ifndef READ_PARALLEL_HPP
2 #define READ_PARALLEL_HPP
3 
4 #include "moab/Forward.hpp"
5 #include "moab/ReaderIface.hpp"
6 #include "DebugOutput.hpp"
7 
8 #include <string>
9 
10 namespace moab
11 {
12 
13 class ReadUtilIface;
14 class ParallelComm;
15 class Error;
16 
18 {
19 
20  public:
22 
23  //! load a file
24  ErrorCode load_file( const char* file_name,
25  const EntityHandle* file_set,
26  const FileOptions& opts,
27  const ReaderIface::SubsetList* subset_list = 0,
28  const Tag* file_id_tag = 0 );
29 
30  //! load multiple files
31  ErrorCode load_file( const char** file_names,
32  const int num_files,
33  const EntityHandle* file_set,
34  const FileOptions& opts,
35  const ReaderIface::SubsetList* subset_list = 0,
36  const Tag* file_id_tag = 0 );
37 
38  ErrorCode load_file( const char** file_names,
39  const int num_files,
40  const EntityHandle* file_set,
41  int parallel_mode,
42  std::string& partition_tag_name,
43  std::vector< int >& partition_tag_vals,
44  bool distrib,
45  bool partition_by_rank,
46  std::vector< int >& pa_vec,
47  const FileOptions& opts,
48  const ReaderIface::SubsetList* subset_list,
49  const Tag* file_id_tag,
50  const int reader_rank,
51  const bool cputime,
52  const int resolve_dim,
53  const int shared_dim,
54  const int ghost_dim,
55  const int bridge_dim,
56  const int num_layers,
57  const int addl_ents );
58  //! Constructor
59  ReadParallel( Interface* impl = NULL, ParallelComm* pc = NULL );
60 
61  //! Destructor
62  virtual ~ReadParallel() {}
63 
64  static const char* parallelOptsNames[];
65 
67  {
68  PA_READ = 0,
81  };
82 
83  static const char* ParallelActionsNames[];
84 
86  {
87  POPT_NONE = 0,
93  };
94 
95  //! PUBLIC TO ALLOW TESTING
96  ErrorCode delete_nonlocal_entities( std::string& ptag_name,
97  std::vector< int >& ptag_vals,
98  bool distribute,
99  EntityHandle file_set );
100 
102 
103  protected:
104  ErrorCode create_partition_sets( std::string& ptag_name, EntityHandle file_set );
105 
106  private:
108 
109  // each reader can keep track of its own pcomm
111 
113 
115 };
116 
117 inline ErrorCode ReadParallel::load_file( const char* file_name,
118  const EntityHandle* file_set,
119  const FileOptions& opts,
120  const ReaderIface::SubsetList* subset_list,
121  const Tag* file_id_tag )
122 {
123  return load_file( &file_name, 1, file_set, opts, subset_list, file_id_tag );
124 }
125 
126 } // namespace moab
127 
128 #endif