Commit 8be93c3b authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille

Added the example file for using MPI API

parent 758cd9ce
...@@ -371,8 +371,7 @@ void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes, const FSize ...@@ -371,8 +371,7 @@ void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes, const FSize
double Phi = reinterpret_cast<UserData *>(inKernel)->myPhyValues[indSource[i]]; double Phi = reinterpret_cast<UserData *>(inKernel)->myPhyValues[indSource[i]];
tempContSources[idSource]->push(pos,indSource[i],Phi); tempContSources[idSource]->push(pos,indSource[i],Phi);
} }
} } else{
else{
tempContSources[idSource] = nullptr; tempContSources[idSource] = nullptr;
} }
} }
......
...@@ -179,13 +179,17 @@ public: ...@@ -179,13 +179,17 @@ public:
if(kernel.p2p_full){ if(kernel.p2p_full){
//Create the arrays of size and indexes //Create the arrays of size and indexes
FSize * nbPartPerNeighbors = new FSize[size]; if(size != 0){
const FSize ** indicesPerNeighbors = new const FSize*[size]; FSize * nbPartPerNeighbors = new FSize[size];
for(int idx=0 ; idx<size ; ++idx){ const FSize ** indicesPerNeighbors = new const FSize*[size];
nbPartPerNeighbors[idx] = neighbors[idx]->getNbParticles(); for(int idx=0 ; idx<size ; ++idx){
indicesPerNeighbors[idx] = neighbors[idx]->getIndexes().data(); nbPartPerNeighbors[idx] = neighbors[idx]->getNbParticles();
indicesPerNeighbors[idx] = neighbors[idx]->getIndexes().data();
}
kernel.p2p_full(targets->getNbParticles(),targets->getIndexes().data(),indicesPerNeighbors,nbPartPerNeighbors,sourcePosition,size,userData);
}else{
kernel.p2p_full(targets->getNbParticles(),targets->getIndexes().data(),nullptr,nullptr,sourcePosition,0,userData);
} }
kernel.p2p_full(targets->getNbParticles(),targets->getIndexes().data(),indicesPerNeighbors,nbPartPerNeighbors,sourcePosition,size,userData);
} }
if(kernel.p2p_sym){ if(kernel.p2p_sym){
for(int idx = 0 ; ((idx < size) && (sourcePosition[idx] < 14)) ; ++idx){ for(int idx = 0 ; ((idx < size) && (sourcePosition[idx] < 14)) ; ++idx){
......
This diff is collapsed.
...@@ -73,6 +73,7 @@ typedef struct myUserDatas{ ...@@ -73,6 +73,7 @@ typedef struct myUserDatas{
double ** forcesComputed; double ** forcesComputed;
//In the same way we store multiples forces array. //In the same way we store multiples forces array.
double ** potentials; double ** potentials;
double totalEnergy;
}UserData; }UserData;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment