Commit cf022782 authored by berenger-bramas's avatar berenger-bramas
Browse files

Improve: M2L optimization.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@237 2616d619-271b-44dc-8df4-d4a8f33a7222
parent f65a6e34
......@@ -41,6 +41,14 @@ public:
FTreeCoordinate(const FTreeCoordinate& other):x(other.x), y(other.y), z(other.z){
}
/**
* Copy constructor
* @param other the source class to copy
*/
FTreeCoordinate(const FTreeCoordinate& other, const int inOffset)
: x(other.x + inOffset), y(other.y + inOffset), z(other.z + inOffset){
}
/**
* Copy constructor
* @param other the source class to copy
......
......@@ -840,6 +840,8 @@ public:
const FTreeCoordinate& coordCenter = pole->getCoordinate();
const FTreeCoordinate coordCenterHalphSizeDim(coordCenter, halphSize1Dim);
for(int idxSize = 0 ; idxSize < size ; ++idxSize){
const FTreeCoordinate& coordNeighbors = distantNeighbors[idxSize]->getCoordinate();
......@@ -848,9 +850,9 @@ public:
//printf("\tidxSize = %d\tleve = %d\tMorton = %lld\n",idxSize,inLevel,distantNeighbors[idxSize]->getMortonIndex());
const FComplexe* const M2L_transfer = transferM2L[inLevel]
[(coordCenter.getX()+halphSize1Dim-coordNeighbors.getX())]
[(coordCenter.getY()+halphSize1Dim-coordNeighbors.getY())]
[(coordCenter.getZ()+halphSize1Dim-coordNeighbors.getZ())];
[(coordCenterHalphSizeDim.getX() - coordNeighbors.getX())]
[(coordCenterHalphSizeDim.getY() - coordNeighbors.getY())]
[(coordCenterHalphSizeDim.getZ() - coordNeighbors.getZ())];
/*printf("level = %d\tx=%ld\ty=%ld\tz=%ld\n", inLevel,
(coordCenter.getX()-coordNeighbors.getX()),
(coordCenter.getY()-coordNeighbors.getY()),
......@@ -1333,7 +1335,6 @@ public:
ParticleClass& target = iterTarget.data();
for(int idxDirectNeighbors = 0 ; idxDirectNeighbors < size ; ++idxDirectNeighbors){
Prefetch_Write(directNeighbors[idxDirectNeighbors+2]);
if(inCurrentIndex < inNeighborsIndex[idxDirectNeighbors] ){
typename ContainerClass::BasicIterator iterSource(*directNeighbors[idxDirectNeighbors]);
while( iterSource.hasNotFinished() ){
......
......@@ -1394,7 +1394,6 @@ public:
while( iterTarget.hasNotFinished() ){
for(int idxDirectNeighbors = 0 ; idxDirectNeighbors < size ; ++idxDirectNeighbors){
Prefetch_Write(directNeighbors[idxDirectNeighbors+2]);
if(inCurrentIndex < inNeighborsIndex[idxDirectNeighbors] ){
typename ContainerClass::BasicIterator iterSource(*directNeighbors[idxDirectNeighbors]);
while( iterSource.hasNotFinished() ){
......
......@@ -1645,7 +1645,6 @@ public:
while( iterTarget.hasNotFinished() ){
for(int idxDirectNeighbors = 0 ; idxDirectNeighbors < size ; ++idxDirectNeighbors){
Prefetch_Write(directNeighbors[idxDirectNeighbors+2]);
if(inCurrentIndex < inNeighborsIndex[idxDirectNeighbors] ){
typename ContainerClass::BasicIterator iterSource(*directNeighbors[idxDirectNeighbors]);
while( iterSource.hasNotFinished() ){
......
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