Skip to content
Snippets Groups Projects
Commit 3b4883e1 authored by Chichi Lalescu's avatar Chichi Lalescu Committed by Cristian Lalescu
Browse files

add preliminary field_binary_io code

parent eef34216
Branches
No related tags found
1 merge request!21Bugfix/nansampling
...@@ -91,6 +91,11 @@ class field ...@@ -91,6 +91,11 @@ class field
const std::string field_name, const std::string field_name,
const int iteration); const int iteration);
int io_binary(
const std::string fname,
const int iteration,
const bool read = true);
/* essential FFT stuff */ /* essential FFT stuff */
void dft(); void dft();
void ift(); void ift();
......
/**********************************************************************
* *
* Copyright 2015 Max Planck Institute *
* for Dynamics and Self-Organization *
* *
* This file is part of bfps. *
* *
* bfps is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, either version 3 of the License, *
* or (at your option) any later version. *
* *
* bfps 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with bfps. If not, see <http://www.gnu.org/licenses/> *
* *
* Contact: Cristian.Lalescu@ds.mpg.de *
* *
**********************************************************************/
#include <vector>
#include "base.hpp"
#include "field_layout.hpp"
#ifndef FIELD_BINARY_IO_HPP
#define FIELD_BINARY_IO_HPP
template <MPI_Datatype element_type, field_components fc>
field_binary_IO::field_binary_IO(
const hsize_t *SIZES,
const hsize_t *SUBSIZES,
const hsize_t *STARTS,
const MPI_Comm COMM_TO_USE):
field_layout<fc>(
SIZES,
SUBSIZES,
STARTS,
COMM_TO_USE)
{
TIMEZONE("field_binary_IO::field_binary_IO");
MPI_Type_create_subarray(
ndims,
tsizes,
tsubsizes,
tstarts,
MPI_ORDER_C,
MPI_UNSIGNED_CHAR,
&this->mpi_array_dtype);
MPI_Type_commit(&this->mpi_array_dtype);
}
template <MPI_Datatype element_type, field_components fc>
field_binary_IO::field_binary_IO~field_binary_IO()
{
TIMEZONE("field_binary_IO::~field_binary_IO");
MPI_Type_free(&this->mpi_array_dtype);
}
#endif//FIELD_BINARY_IO_HPP
/**********************************************************************
* *
* Copyright 2015 Max Planck Institute *
* for Dynamics and Self-Organization *
* *
* This file is part of bfps. *
* *
* bfps is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, either version 3 of the License, *
* or (at your option) any later version. *
* *
* bfps 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with bfps. If not, see <http://www.gnu.org/licenses/> *
* *
* Contact: Cristian.Lalescu@ds.mpg.de *
* *
**********************************************************************/
#include <vector>
#include "base.hpp"
#include "field_layout.hpp"
#ifndef FIELD_BINARY_IO_HPP
#define FIELD_BINARY_IO_HPP
template <MPI_Datatype element_type, field_components fc>
class field_binary_IO:public field_layout<fc>
{
public:
MPI_Datatype mpi_array_dtype;
/* methods */
field_binary_IO(
const hsize_t *SIZES,
const hsize_t *SUBSIZES,
const hsize_t *STARTS,
const MPI_Comm COMM_TO_USE):
field_layout<fc>(
SIZES,
SUBSIZES,
STARTS,
COMM_TO_USE);
~field_binary_IO(){}
};
#endif//FIELD_BINARY_IO_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment