-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmulti_io_unit.cpp
40 lines (34 loc) · 1.79 KB
/
multi_io_unit.cpp
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
/** 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/>.
*/
#include <cstdlib>
#include <iostream>
#include "multi_io_unit.h"
using namespace std;
namespace vlsv {
/** Constructor for struct Multi_IO_Unit.
* NOTE: MPI datatypes passed to Multi_IO_Unit are not committed or freed,
* thus one should only use native MPI datatypes, e.g. as returned by
* getMPIDatatype function.
* @param array In vlsv::Writer this is a pointer to array whose contents are
* written to file. In vlsv::ParallelReader this is a pointer to array where data
* from file is to be read.
* @param mpiType MPI datatype defining the I/O operation.
* @param amount Amount of data to be written or read, in units of mpiType.*/
Multi_IO_Unit::Multi_IO_Unit(char* array,const MPI_Datatype& mpiType,const uint64_t& amount): array(array),mpiType(mpiType),amount(amount) { offset=0; }
Multi_IO_Unit::Multi_IO_Unit(char* array,const MPI_Datatype& mpiType,const uint64_t& amount, const uint64_t& offset): array(array),mpiType(mpiType),amount(amount),offset(offset) { }
} // namespace vlsv