Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fieldIO_Binary_Parallel.h
Go to the documentation of this file.
1 
9 #ifndef FIELDIO_BINARY_PARALLEL_INCLUDED
10 #define FIELDIO_BINARY_PARALLEL_INCLUDED
11 
12 #include <string>
13 using std::string;
14 
15 #ifdef USE_MPI
16 #include <mpi.h>
17 #ifdef USE_BGNET
18 #include "communicator_bgnet.h"
19 #else
20 #include "communicator_mpi.h"
21 #endif
22 #endif
23 
24 #include "fieldIO.h"
25 
26 #include "bridgeIO.h"
27 using Bridge::vout;
28 
30 
49 #ifdef USE_MPI
50 class FieldIO_Binary_Parallel : public FieldIO
51 {
52  public:
53  static const std::string class_name;
54 
55  public:
56  FieldIO_Binary_Parallel(const IO_Format::Format *format) : FieldIO(format), m_is_initialized(false) {}
57 
58  void read_file(Field *v, string filename);
59  void write_file(Field *v, string filename);
60 
61  private:
62 
63  bool m_is_initialized;
64 
65  int m_nvol;
66 
67  MPI_Datatype m_type_vector;
68  MPI_Datatype m_type_tiled;
69 
70  int initialize();
71  int finalize();
72 };
73 
74 #else
75 
76 // for Single version, just an alias of FieldIO_Binary.
77 
79 {
80  public:
82 };
83 #endif
84 #endif
BridgeIO vout
Definition: bridgeIO.cpp:207
Container of Field-type object.
Definition: field.h:37
FieldIO_Binary_Parallel(const IO_Format::Format *format)
void write_file(Field *v, string filename)
FieldIO_Binary_Parallel class for file I/O of Field data in binary format using MPI parallel I/O...
FieldIO_Binary class for file I/O of Field data in binary format.
void read_file(Field *v, string filename)
static const std::string class_name
FieldIO class for file I/O of space-time distributed data.
Definition: fieldIO.h:48