Commit 0dfdbfdf authored by BRAMAS Berenger's avatar BRAMAS Berenger

Debug quicksort mpi and add a unit test

parent 398c5f08
......@@ -133,7 +133,7 @@ private:
// sort particles
if(type == QuickSort){
FQuickSortMpi<IndexedParticle,MortonIndex, FSize>::QsMpi(realParticlesIndexed, size, *outputArray, *outputSize,communicator);
FQuickSortMpi<IndexedParticle,MortonIndex, FSize>::QsMpi(realParticlesIndexed, size, outputArray, outputSize,communicator);
delete [] (realParticlesIndexed);
}
else {
......
......@@ -218,7 +218,7 @@ public:
MPI_Group_free(&previousGroup);
reset();
delete procsIdArray ;
delete[] procsIdArray ;
}
};
......
......@@ -76,31 +76,6 @@ protected:
return left;
}
/* A local iteration of qs */
static void QsLocal(SortType array[], const CompareType& pivot,
IndexType myLeft, IndexType myRight,
IndexType& prefix, IndexType& sufix){
IndexType leftIter = myLeft;
IndexType rightIter = myRight;
while(true){
while(CompareType(array[leftIter]) <= pivot && leftIter < rightIter){
++leftIter;
}
while(leftIter <= rightIter && pivot < CompareType(array[rightIter])){
--rightIter;
}
if(rightIter < leftIter) break;
Swap(array[leftIter],array[rightIter]);
++leftIter;
--rightIter;
}
prefix = leftIter - myLeft;
sufix = myRight - myLeft - prefix + 1;
}
/* The sequential qs */
static void QsSequentialStep(SortType array[], const IndexType left, const IndexType right){
......
This diff is collapsed.
......@@ -16,6 +16,7 @@
#ifndef UTESTER_HPP
#define UTESTER_HPP
#include "ScalFmmConfig.h"
#include <iostream>
#include <list>
......@@ -24,10 +25,10 @@
#define TestClass(X)\
int main(void){\
int main(void){\
X Controller;\
return Controller.Run();\
}\
}\
/**
......
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
#ifndef UTESTMPIQS_HPP
#define UTESTMPIQS_HPP
......
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