forked from fmihpc/vlsv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multi_io_unit.h
47 lines (40 loc) · 1.69 KB
/
multi_io_unit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/** This file is part of VLSV file format.
*
* Copyright 2011-2013 Finnish Meteorological Institute
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MULTI_IO_UNIT_H
#define MULTI_IO_UNIT_H
#include <stdint.h>
#include <mpi.h>
namespace vlsv {
/** Definition of a parallel file I/O unit. Processes can
* define zero or more file action units for a collective file I/O
* operation in VLSVWriter and VLSVParReader. Those classes will then
* arrange all defined I/O operations to be performed with a single MPI call
* to optimize performance.
*/
struct Multi_IO_Unit {
public:
Multi_IO_Unit(char* array,const MPI_Datatype& mpiType,const uint64_t& amount);
char* array; /**< Pointer to data to be written.*/
MPI_Datatype mpiType; /**< MPI datatype of data that is written.*/
uint64_t amount; /**< How many elements of type mpiType are to be written.*/
private:
/** Private default constructor to prevent creation of empty multiwrite units.*/
Multi_IO_Unit();
};
}
#endif