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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/**
* @file communication_mpi.h
* @brief Handles communication between nodes using MPI.
* @author Hanno Rein <hanno@hanno-rein.de>
*
* @details These routines handle the communication between
* different nodes via the Message Passing Interface (MPI).
* There are two different types of communications
* implemented at the moment:
* - Distributing particles to the correct node.
* - Creating, and distributing the essential tree to allow
* other nodes walk remote trees. Note that the opening
* criteria is different for gravity and collision
* tree walks.
*
*
* @section LICENSE
* Copyright (c) 2011 Hanno Rein, Shangfei Liu
*
* This file is part of rebound.
*
* rebound 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.
*
* rebound 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 rebound. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* \defgroup mpistructures Data structures for MPI communication.
* These buffers are used for communicating with other nodes.
* Each buffer is an array with the number of elements being equal
* to the number of nodes.
* The number of particles/cells that have to be send to every other
* node is saved in N_particles_send/N_tree_essential_send. The number
* are different every time and have to be communicated to the other
* nodes before the actual communication of the particles/cells.
* @{
*/
/**
* Initializes MPI and sets up all necessary data structures.
* @param argc Number of command line arguments.
* @param argc Command line arguments.
*/
void ;
/**
* Send particles in buffer particles_send to corresponding node.
* Receives particles from all nodes in buffer particles_recv and adds them
* to the current simulation.
*/
void ;
/**
* Send all particles to all nodes. Does not add particles to simulation.
* Needs manual cleanup. Used for energy calculation.
*/
void ;
// Determine if the root box is local or if it is a copy of a remote node.
int ;
/**
* Send cells in buffer tree_essential_send to corresponding node.
* Receives cells from all nodes in buffer tree_essential_recv and adds them
* to the non-local root boxes.
*/
void ;
/**
* Prepares the essential tree of a root box for communication with other nodes.
* @param root The root cell under investigation.
*/
void ;
/**
* Send cells/particles in buffer tree_essential_send/particles_send to corresponding node.
* Receives cells/particles from all nodes in buffers. Does not insert particles
* into local tree.
*/
void ;
/**
* Prepares the essential tree/particles of a root box for communication with other nodes.
* Adds copy of particles into particles_send.
* @param root The root cell under investigation.
*/
void ;
// MPI
// _COMMUNICATION_MPI_H