ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
core/io/mpiio/mpiio.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2010-2022 The ESPResSo project
3
* Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
4
* Max-Planck-Institute for Polymer Research, Theory Group
5
*
6
* This file is part of ESPResSo.
7
*
8
* ESPResSo is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
12
*
13
* ESPResSo is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
#pragma once
23
24
/** @file
25
* Implements binary output using MPI-IO.
26
*/
27
28
#include "
ParticleRange.hpp
"
29
#include "
bonded_interactions/bonded_interaction_data.hpp
"
30
#include "
cell_system/CellStructure.hpp
"
31
32
#include <string>
33
34
namespace
Mpiio
{
35
36
/**
37
* @brief Constants which indicate what to output.
38
* To indicate the output of multiple fields, OR the
39
* corresponding values.
40
*/
41
enum
MPIIOOutputFields
:
unsigned
int
{
42
MPIIO_OUT_NON
= 0u,
43
MPIIO_OUT_POS
= 1u,
44
MPIIO_OUT_VEL
= 2u,
45
MPIIO_OUT_TYP
= 4u,
46
MPIIO_OUT_BND
= 8u,
47
};
48
49
struct
write_buffers
{
50
std::vector<double>
pos
;
51
std::vector<double>
vel
;
52
std::vector<int>
id
;
53
std::vector<int>
type
;
54
};
55
56
/**
57
* @brief Parallel binary output using MPI-IO.
58
* To be called by all MPI processes. Aborts ESPResSo if an error occurs.
59
* On 1 MPI rank, the error is converted to a runtime error and can be
60
* recovered by removing any file that may have already been written.
61
*
62
* @param prefix Filepath prefix.
63
* @param fields Specifier for which fields to dump.
64
* @param bonded_ias Bonds to serialize.
65
* @param particles Range of particles to serialize.
66
* @param buffers Write buffers.
67
*/
68
void
mpi_mpiio_common_write
(std::string
const
&prefix,
unsigned
fields,
69
BondedInteractionsMap
const
&bonded_ias,
70
ParticleRange
const
&particles,
71
write_buffers
&buffers);
72
73
/**
74
* @brief Parallel binary input using MPI-IO.
75
* To be called by all MPI processes. Aborts ESPResSo if an error occurs.
76
* On 1 MPI rank, the error is converted to a runtime error and can be
77
* recovered.
78
*
79
* @param prefix Filepath prefix.
80
* @param fields Specifier for which fields to read.
81
* @param cell_structure Bonds to serialize.
82
*/
83
void
mpi_mpiio_common_read
(std::string
const
&prefix,
unsigned
fields,
84
CellStructure
&cell_structure);
85
86
}
// namespace Mpiio
CellStructure.hpp
ParticleRange.hpp
bonded_interaction_data.hpp
Data structures for bonded interactions.
BondedInteractionsMap
container for bonded interactions.
Definition
bonded_interaction_data.hpp:99
ParticleRange
A range of particles.
Definition
ParticleRange.hpp:38
Mpiio
Definition
mpiio.cpp:82
Mpiio::mpi_mpiio_common_write
void mpi_mpiio_common_write(std::string const &prefix, unsigned fields, BondedInteractionsMap const &bonded_ias, ParticleRange const &particles, write_buffers &buffers)
Parallel binary output using MPI-IO.
Definition
mpiio.cpp:214
Mpiio::MPIIOOutputFields
MPIIOOutputFields
Constants which indicate what to output.
Definition
core/io/mpiio/mpiio.hpp:41
Mpiio::MPIIO_OUT_BND
@ MPIIO_OUT_BND
Definition
core/io/mpiio/mpiio.hpp:46
Mpiio::MPIIO_OUT_VEL
@ MPIIO_OUT_VEL
Definition
core/io/mpiio/mpiio.hpp:44
Mpiio::MPIIO_OUT_POS
@ MPIIO_OUT_POS
Definition
core/io/mpiio/mpiio.hpp:43
Mpiio::MPIIO_OUT_TYP
@ MPIIO_OUT_TYP
Definition
core/io/mpiio/mpiio.hpp:45
Mpiio::MPIIO_OUT_NON
@ MPIIO_OUT_NON
Definition
core/io/mpiio/mpiio.hpp:42
Mpiio::mpi_mpiio_common_read
void mpi_mpiio_common_read(const std::string &prefix, unsigned fields, CellStructure &cell_structure)
Parallel binary input using MPI-IO.
Definition
mpiio.cpp:406
CellStructure
Describes a cell structure / cell system.
Definition
CellStructure.hpp:134
Mpiio::write_buffers
Definition
core/io/mpiio/mpiio.hpp:49
Mpiio::write_buffers::type
std::vector< int > type
Definition
core/io/mpiio/mpiio.hpp:53
Mpiio::write_buffers::pos
std::vector< double > pos
Definition
core/io/mpiio/mpiio.hpp:50
Mpiio::write_buffers::id
std::vector< int > id
Definition
core/io/mpiio/mpiio.hpp:52
Mpiio::write_buffers::vel
std::vector< double > vel
Definition
core/io/mpiio/mpiio.hpp:51
src
core
io
mpiio
mpiio.hpp
Generated on Thu Dec 19 2024 02:13:16 for ESPResSo by
1.9.8