24#ifndef HEMOCELLFUNCTIONAL_H
25#define HEMOCELLFUNCTIONAL_H
30#include "atomicBlock/dataProcessingFunctional3D.hh"
31#include "core/globalDefs.h"
32#include "multiBlock/multiDataProcessorWrapper3D.hh"
40 for (
pluint i = 0; i < isWritten.size(); i++) {
44 plb::BlockDomain::DomainT
appliesTo()
const {
return plb::BlockDomain::bulk; }
46 for (
pluint i = 0; i < modified.size(); i++) {
47 modified[i] = plb::modif::nothing;
53template<
class GatherType>
57 unsigned char b[
sizeof(int)];
70 for (
pluint i = 0; i < isWritten.size(); i++) {
74 plb::BlockDomain::DomainT
appliesTo()
const {
return plb::BlockDomain::bulk; }
76 for (
pluint i = 0; i < modified.size(); i++) {
77 modified[i] = plb::modif::nothing;
84 std::vector<unsigned char> sendbuffer(sendsize);
88 for (
unsigned int i = 0; i <
sizeof(int) ; i++) {
89 sendbuffer[be] = local_number.
b[i];
100 std::vector<int> sendcounts(plb::global::mpi().getSize());
101 MPI_Allgather(&sendsize,
sizeof(
int),MPI_BYTE,&sendcounts[0],
sizeof(
int),MPI_BYTE,MPI_COMM_WORLD);
104 std::vector<int> displacements(1,0);
105 for (
int & size : sendcounts) {
107 displacements.push_back(displacements.back() + size);
109 displacements.pop_back();
110 std::vector<unsigned char> receivebuffer(receivesize);
112 MPI_Allgatherv(&sendbuffer[0],sendsize,MPI_BYTE,&receivebuffer[0],&sendcounts[0],&displacements[0],MPI_BYTE,MPI_COMM_WORLD);
115 for (
int j = 0 ; j < plb::global::mpi().getSize() ; j++) {
116 be = displacements[j];
117 for (
unsigned int i = 0; i <
sizeof(int) ; i++) {
118 local_number.
b[i] = receivebuffer[be];
121 for (
int i = 0 ; i < local_number.
i ; i++) {
Definition hemoCellFunctional.h:36
void getModificationPattern(std::vector< bool > &isWritten) const
Definition hemoCellFunctional.h:39
HemoCellFunctional()
Definition hemoCellFunctional.h:38
void getTypeOfModification(std::vector< plb::modif::ModifT > &modified) const
Definition hemoCellFunctional.h:45
plb::BlockDomain::DomainT appliesTo() const
Definition hemoCellFunctional.h:44
Definition hemoCellFunctional.h:54
void getTypeOfModification(std::vector< plb::modif::ModifT > &modified) const
Definition hemoCellFunctional.h:75
void getModificationPattern(std::vector< bool > &isWritten) const
Definition hemoCellFunctional.h:69
std::map< int, GatherType > & gatherValues
Definition hemoCellFunctional.h:132
static void gather(std::map< int, GatherType > &gatherValues)
Definition hemoCellFunctional.h:81
plb::BlockDomain::DomainT appliesTo() const
Definition hemoCellFunctional.h:74
HemoCellGatheringFunctional(std::map< int, GatherType > &gatherValues_)
Definition hemoCellFunctional.h:67
long unsigned int pluint
Definition constant_defaults.h:130
Definition hemoCellFunctional.h:60
GatherType g
Definition hemoCellFunctional.h:62
int ID
Definition hemoCellFunctional.h:61
Definition hemoCellFunctional.h:56
unsigned char b[sizeof(int)]
Definition hemoCellFunctional.h:57
int i
Definition hemoCellFunctional.h:58