Bridge++  Ver. 1.3.x
fieldIO_Binary_Parallel.h
Go to the documentation of this file.
1 
14 #ifndef FIELDIO_BINARY_PARALLEL_INCLUDED
15 #define FIELDIO_BINARY_PARALLEL_INCLUDED
16 
17 #include <string>
18 using std::string;
19 
20 #ifdef USE_MPI
21 #include <mpi.h>
22 #ifdef USE_BGNET
23 #include "communicator_bgnet.h"
24 #else
25 #include "communicator_mpi.h"
26 #endif
27 #endif
28 
29 #include "fieldIO.h"
30 
31 #include "bridgeIO.h"
32 using Bridge::vout;
33 
35 
54 #ifdef USE_MPI
55 class FieldIO_Binary_Parallel : public FieldIO
56 {
57  public:
58  static const std::string class_name;
59 
60  public:
61  FieldIO_Binary_Parallel(const IO_Format::Format *format) : FieldIO(format), m_is_initialized(false) {}
62 
63  void read_file(Field *v, string filename);
64  void write_file(Field *v, string filename);
65 
66  private:
67 
68  bool m_is_initialized;
69 
70  int m_nvol;
71 
72  MPI_Datatype m_type_vector;
73  MPI_Datatype m_type_tiled;
74 
75  int initialize();
76  int finalize();
77 };
78 
79 #else
80 
81 // for Single version, just an alias of FieldIO_Binary.
82 
84 {
85  public:
87 };
88 #endif
89 #endif
BridgeIO vout
Definition: bridgeIO.cpp:278
Container of Field-type object.
Definition: field.h:39
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:53