Parallel I/O
Contents
Parallel I/O
The following classes are all defined within namespace HIPP::MPI.
Class File: the Parallel I/O Handler
-
class File
-
enum [anonymous] : int
Memory management methods:
Method
Detail
default constructor
Not available.
copy constructor
andoperator=(&&)Available;
noexcept; shallow copy.move constructor
andoperator=(const &)Available;
noexcept.-
File(const Comm &comm, const string &name, const string &amode, const Info &info = Info::nullval())
Create a new file or open an existing file.
- Parameters
comm – The communicator, consisting of the processes involved in I/O.
name – File name.
amode – Visiting mode. Could be
"r","w","wr","c"("create"),"excl","delete_on_close","unique_open","sequential","a"("append"), or their comma-separated combination, e.g.,"wr,c".info – Hints to the implementation.
-
ostream &info(ostream &os = cout, int fmt_cntl = 1) const
-
friend ostream &operator<<(ostream &os, const File &file)
info()displays some basic information of the file instance toos.- Parameters
fmt_cntl – Control the display format. 0 for inline information and 1 for a verbose, multiple-line information.
- Returns
The argument
osis returned.
The overloaded
<<operator is equivalent toinfo()with defaultfmt_cntl.The returned reference of
osallows you to chain the outputs, such asfile.info(cout) << " continue printing " << endl.
-
void close() noexcept
Close the file. This can be called on any object (even a null value) or even multiple times.
-
bool is_null() const
-
static File nullval() noexcept
is_null()tests whether the instance is a null value.nullval()returns a null value (internallyMPI_FILE_NULL).
-
Group get_group() const
-
string get_amode() const
Querying file parameters.
get_group()returns a duplication of the group of the communicator used to open the file.get_amode()returns the access mode associated with the file.
-
File &set_info(const Info &info)
-
Info get_info() const
File info management methods.
set_info()sets new values for the hints. It is a collective call. The info object may be different on each process, except if the implementation requires. Implementation may ignore the hints in this call because some info items cannot be changed after the creation or opening of the file.get_info()returns the info containing all hints that is actually used by the system related to this file.
-
File &set_view(offset_t disp, const Datatype &etype, const Datatype &filetype, const string &datarep = "native", const Info &info = Info::nullval())
-
void get_view(offset_t &disp, Datatype &etype, Datatype &filetype, string &datarep) const
File views management methods.
set_view()changes that process’s view of the data in the file. The start of the view isdisp(in bytes), the data type isetypeand the distribution of data is sete byfiletype, and the representation is set todatarep.set_view()also set the indivisual and shared file pointers to zero. This call is collective;datarepand the extents ofetypemust be identical on all processes in the group;disp,filetype,infomay vary. Theetypeandfiletypemust be committed. User should ensure that all nonblocking calls and split collective calls have been complete - otherwise the call is erroneous.get_viewreturns the process’s view of the data in the file.
-
template<typename ...Args>
Status read_at(offset_t offset, Args&&... args) -
template<typename ...Args>
Status read_at_all(offset_t offset, Args&&... args) -
template<typename ...Args>
Status write_at(offset_t offset, Args&&... args) -
template<typename ...Args>
Status write_at_all(offset_t offset, Args&&... args) -
template<typename ...Args>
Requests iread_at(offset_t offset, Args&&... args) -
template<typename ...Args>
Requests iwrite_at(offset_t offset, Args&&... args) -
template<typename ...Args>
void read_at_all_begin(offset_t offset, Args&&... args) -
Status read_at_all_end(void *buf)
-
template<typename ...Args>
void write_at_all_begin(offset_t offset, Args&&... args) -
Status write_at_all_end(const void *buf)
-
void seek(offset_t offset, int whence)
-
void seek(offset_t offset, const string &whence)
-
offset_t get_position() const
-
offset_t get_byte_offset(offset_t offset) const
-
template<typename ...Args>
Status read(Args&&... args) -
template<typename ...Args>
Status read_all(Args&&... args) -
template<typename ...Args>
Status write(Args&&... args) -
template<typename ...Args>
Status write_all(Args&&... args) -
template<typename ...Args>
Requests iread(Args&&... args) -
template<typename ...Args>
Requests iwrite(Args&&... args) -
template<typename ...Args>
void read_all_begin(Args&&... args) -
Status read_all_end(void *buf)
-
template<typename ...Args>
void write_all_begin(Args&&... args) -
Status write_all_end(const void *buf);
-
template<typename ...Args>
Status read_ordered(Args&&... args) -
template<typename ...Args>
Status write_ordered(Args&&... args) -
template<typename ...Args>
void read_ordered_begin(Args&&... args) -
Status read_ordered_end(void *buf)
-
template<typename ...Args>
void write_ordered_begin(Args&&... args) -
Status write_ordered_end(const void *buf);
Data access calls. Please refer to MPI Standard for their usage.
-
enum [anonymous] : int