Commit 6c8cb7bd authored by berenger-bramas's avatar berenger-bramas

Make the test kernel/cells/particles based on long long int instead of long to test biggest data.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@258 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 86e28572
......@@ -17,7 +17,7 @@
class FTestCell : public FBasicCell {
protected:
// To store data during upward and downward pass
long dataUp, dataDown;
long long int dataUp, dataDown;
public:
FTestCell(): dataUp(0) , dataDown(0){
}
......@@ -25,19 +25,19 @@ public:
virtual ~FTestCell(){
}
/** When doing the upward pass */
long getDataUp() const {
long long int getDataUp() const {
return this->dataUp;
}
/** When doing the upward pass */
void setDataUp(const long inData){
void setDataUp(const long long int inData){
this->dataUp = inData;
}
/** When doing the downard pass */
long getDataDown() const {
long long int getDataDown() const {
return this->dataDown;
}
/** When doing the downard pass */
void setDataDown(const long inData){
void setDataDown(const long long int inData){
this->dataDown = inData;
}
};
......
......@@ -82,7 +82,7 @@ public:
const ContainerClass* const directNeighborsParticles[26], const int size) {
// Each particles targeted is impacted by the particles sources
long inc = sources->getSize();
long long int inc = sources->getSize();
if(targets == sources){
inc -= 1;
}
......@@ -105,7 +105,7 @@ public:
ContainerClass* const directNeighborsParticles[26], const MortonIndex [26], const int size) {
// Each particles targeted is impacted by the particles sources
long inc = sources->getSize();
long long int inc = sources->getSize();
if(targets == sources){
inc -= 1;
}
......@@ -130,7 +130,7 @@ template< class OctreeClass, class ParticleClass, class CellClass, class Contain
void ValidateFMMAlgo(OctreeClass* const tree){
std::cout << "Check Result\n";
const int TreeHeight = tree->getHeight();
int NbPart = 0;
long long int NbPart = 0;
{ // Check that each particle has been summed with all other
typename OctreeClass::Iterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
......@@ -144,7 +144,7 @@ void ValidateFMMAlgo(OctreeClass* const tree){
{ // Ceck if there is number of NbPart summed at level 1
typename OctreeClass::Iterator octreeIterator(tree);
octreeIterator.moveDown();
long res = 0;
long long int res = 0;
do{
res += octreeIterator.getCurrentCell()->getDataUp();
} while(octreeIterator.moveRight());
......@@ -156,7 +156,7 @@ void ValidateFMMAlgo(OctreeClass* const tree){
typename OctreeClass::Iterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
for(int idxLevel = TreeHeight - 1 ; idxLevel > 1 ; --idxLevel ){
long res = 0;
long long int res = 0;
do{
res += octreeIterator.getCurrentCell()->getDataUp();
} while(octreeIterator.moveRight());
......
......@@ -17,7 +17,7 @@
class FTestParticle : public FBasicParticle {
protected:
// To store data during downard pass
long dataDown;
long long int dataDown;
public:
FTestParticle(): dataDown(0){
}
......@@ -26,11 +26,11 @@ public:
virtual ~FTestParticle(){
}
long getDataDown() const {
long long int getDataDown() const {
return this->dataDown;
}
void setDataDown(const long inData){
void setDataDown(const long long int inData){
this->dataDown = inData;
}
};
......
......@@ -141,7 +141,7 @@ int main(int argc, char ** argv){
std::cout << "Working on particles ..." << std::endl;
counter.tic();
const int PeriodicDeep = 1;
const int PeriodicDeep = 4;
// FTestKernels FBasicKernels
KernelClass kernels;
//FFmmAlgorithm FFmmAlgorithmThread
......
......@@ -197,7 +197,7 @@ void ValidateFMMAlgoProc(OctreeClass* const badTree,
do {
if(octreeIterator.getCurrentListSrc()->getSize() != octreeIterator.getCurrentCell()->getDataUp()){
printf("P2M problem nb part %d data up %ld \n",
printf("P2M problem nb part %d data up %lld \n",
octreeIterator.getCurrentListSrc()->getSize(), octreeIterator.getCurrentCell()->getDataUp());
}
} while( octreeIterator.moveRight() );
......@@ -282,20 +282,20 @@ class TestParticle : public FTestParticle, public FExtendPhysicalValue {
class TestCell : public FTestCell , public FAbstractSendable {
public:
static const int SerializedSizeUp = sizeof(long);
static const int SerializedSizeUp = sizeof(long long int);
void serializeUp(void* const buffer) const {
*(long*)buffer = this->dataUp;
*(long long int*)buffer = this->dataUp;
}
void deserializeUp(const void* const buffer){
this->dataUp = *(long*)buffer;
this->dataUp = *(long long int*)buffer;
}
static const int SerializedSizeDown = sizeof(long);
void serializeDown(void* const buffer) const {
*(long*)buffer = this->dataDown;
*(long long int*)buffer = this->dataDown;
}
void deserializeDown(const void* const buffer){
this->dataDown = *(long*)buffer;
this->dataDown = *(long long int*)buffer;
}
};
......
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