milupHPC documentation
  • include
  • subdomain_key_tree
subdomain_handler.h
Go to the documentation of this file.
1
10#ifndef MILUPHPC_SUBDOMAIN_HANDLER_H
11#define MILUPHPC_SUBDOMAIN_HANDLER_H
12
13#include "../parameter.h"
14#include "subdomain.cuh"
15#include <boost/mpi.hpp>
16
17//class KeyHandler {
18//};
19
23class SubDomainKeyTreeHandler {
24
25public:
27 integer h_rank;
29 integer h_numProcesses;
31 keyType *h_range;
33 integer *h_procParticleCounter;
34
36 integer *d_rank;
38 integer *d_numProcesses;
40 keyType *d_range;
41 //keyType *d_hilberRange;
43 integer *d_procParticleCounter;
44
46 SubDomainKeyTree *h_subDomainKeyTree;
48 SubDomainKeyTree *d_subDomainKeyTree;
49
53 SubDomainKeyTreeHandler();
54
58 ~SubDomainKeyTreeHandler();
59
65 void reset();
66
74 void copy(To::Target target=To::device, bool range=true, bool counter=true);
75
76};
77
81class DomainListHandler {
82
83public:
85 integer domainListSize;
86
88 integer *d_domainListIndices;
90 integer *d_domainListLevels;
92 integer *d_domainListIndex;
94 integer *d_domainListCounter;
96 keyType *d_domainListKeys;
98 keyType *d_sortedDomainListKeys;
100 integer *d_relevantDomainListIndices;
101 integer *d_relevantDomainListLevels;
102 integer *d_relevantDomainListProcess;
103 integer *d_relevantDomainListOriginalIndex;
104 real *d_borders;
105
107 DomainList *d_domainList;
108
114 DomainListHandler(integer domainListSize);
115
119 ~DomainListHandler();
120
124 void reset();
125
126};
127
128namespace mpi {
137 template <typename T>
138 void messageLengths(SubDomainKeyTree *subDomainKeyTree, T *toSend, T *toReceive) {
139
140 boost::mpi::communicator comm;
141
142 std::vector <boost::mpi::request> reqParticles;
143 std::vector <boost::mpi::status> statParticles;
144
145 for (int proc = 0; proc < subDomainKeyTree->numProcesses; proc++) {
146 if (proc != subDomainKeyTree->rank) {
147 reqParticles.push_back(comm.isend(proc, 17, &toSend[proc], 1));
148 statParticles.push_back(comm.recv(proc, 17, &toReceive[proc], 1));
149 }
150 }
151
152 boost::mpi::wait_all(reqParticles.begin(), reqParticles.end());
153 }
154
155}
156
157#endif //MILUPHPC_SUBDOMAIN_HANDLER_H
DomainListHandler
Definition: subdomain_handler.h:81
DomainListHandler::DomainListHandler
DomainListHandler(integer domainListSize)
Constructor.
Definition: subdomain_handler.cpp:52
DomainListHandler::d_borders
real * d_borders
Definition: subdomain_handler.h:104
DomainListHandler::d_relevantDomainListLevels
integer * d_relevantDomainListLevels
Definition: subdomain_handler.h:101
DomainListHandler::d_sortedDomainListKeys
keyType * d_sortedDomainListKeys
device sorted domain list keys
Definition: subdomain_handler.h:98
DomainListHandler::d_domainListIndices
integer * d_domainListIndices
device domain list indices
Definition: subdomain_handler.h:88
DomainListHandler::d_domainListLevels
integer * d_domainListLevels
device domain list levels
Definition: subdomain_handler.h:90
DomainListHandler::domainListSize
integer domainListSize
length/size of domain list
Definition: subdomain_handler.h:85
DomainListHandler::d_domainListKeys
keyType * d_domainListKeys
device domain list key
Definition: subdomain_handler.h:96
DomainListHandler::d_relevantDomainListIndices
integer * d_relevantDomainListIndices
device relevant domain list indices
Definition: subdomain_handler.h:100
DomainListHandler::d_relevantDomainListProcess
integer * d_relevantDomainListProcess
Definition: subdomain_handler.h:102
DomainListHandler::~DomainListHandler
~DomainListHandler()
Destructor.
Definition: subdomain_handler.cpp:75
DomainListHandler::reset
void reset()
Resetting entries.
Definition: subdomain_handler.cpp:92
DomainListHandler::d_domainList
DomainList * d_domainList
device instance of DomainList class
Definition: subdomain_handler.h:107
DomainListHandler::d_domainListIndex
integer * d_domainListIndex
device domain list index
Definition: subdomain_handler.h:92
DomainListHandler::d_domainListCounter
integer * d_domainListCounter
device domain list counter
Definition: subdomain_handler.h:94
DomainListHandler::d_relevantDomainListOriginalIndex
integer * d_relevantDomainListOriginalIndex
Definition: subdomain_handler.h:103
DomainList
Definition: subdomain.cuh:494
SubDomainKeyTreeHandler
Definition: subdomain_handler.h:23
SubDomainKeyTreeHandler::h_range
keyType * h_range
host range(s)
Definition: subdomain_handler.h:31
SubDomainKeyTreeHandler::SubDomainKeyTreeHandler
SubDomainKeyTreeHandler()
Constructor.
Definition: subdomain_handler.cpp:3
SubDomainKeyTreeHandler::h_rank
integer h_rank
host MPI rank
Definition: subdomain_handler.h:27
SubDomainKeyTreeHandler::d_numProcesses
integer * d_numProcesses
device MPI number of processes
Definition: subdomain_handler.h:38
SubDomainKeyTreeHandler::d_subDomainKeyTree
SubDomainKeyTree * d_subDomainKeyTree
device instance of class SubDomainKeyTree
Definition: subdomain_handler.h:48
SubDomainKeyTreeHandler::~SubDomainKeyTreeHandler
~SubDomainKeyTreeHandler()
Destructor.
Definition: subdomain_handler.cpp:25
SubDomainKeyTreeHandler::h_subDomainKeyTree
SubDomainKeyTree * h_subDomainKeyTree
host instance of class SubDomainKeyTree
Definition: subdomain_handler.h:46
SubDomainKeyTreeHandler::d_range
keyType * d_range
device range(s)
Definition: subdomain_handler.h:40
SubDomainKeyTreeHandler::reset
void reset()
Resetting member variables.
Definition: subdomain_handler.cpp:36
SubDomainKeyTreeHandler::h_procParticleCounter
integer * h_procParticleCounter
host counter for particles in dependence of MPI process belonging
Definition: subdomain_handler.h:33
SubDomainKeyTreeHandler::d_rank
integer * d_rank
device MPI rank
Definition: subdomain_handler.h:36
SubDomainKeyTreeHandler::h_numProcesses
integer h_numProcesses
host MPI number of processes
Definition: subdomain_handler.h:29
SubDomainKeyTreeHandler::d_procParticleCounter
integer * d_procParticleCounter
host counter for particles in dependence of MPI process belonging
Definition: subdomain_handler.h:43
SubDomainKeyTreeHandler::copy
void copy(To::Target target=To::device, bool range=true, bool counter=true)
Copy (parts of the) SubDomainKeyTree instance(s) between host and device.
Definition: subdomain_handler.cpp:43
SubDomainKeyTree
SubDomainKeyTree class handling rank, number of processes and ranges.
Definition: subdomain.cuh:62
SubDomainKeyTree::rank
integer rank
MPI rank.
Definition: subdomain.cuh:66
SubDomainKeyTree::numProcesses
integer numProcesses
MPI number of processes.
Definition: subdomain.cuh:68
mpi
Definition: subdomain_handler.h:128
mpi::messageLengths
void messageLengths(SubDomainKeyTree *subDomainKeyTree, T *toSend, T *toReceive)
Send array with length of number of MPI processes across processes.
Definition: subdomain_handler.h:138
real
double real
Definition: parameter.h:15
keyType
unsigned long keyType
Definition: parameter.h:18
integer
int integer
Definition: parameter.h:17
To::Target
Target
Definition: parameter.h:164
To::device
@ device
Definition: parameter.h:165
subdomain.cuh
Classes and Kernels handling subdomains that distribute the workload among the MPI processes.

milupHPC - include/subdomain_key_tree/subdomain_handler.h Source File
Generated on Wed Aug 31 2022 12:16:52 by Doxygen 1.9.3