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

Add a test that I forgot in the Parallel Quick Sort.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@163 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 381398bd
......@@ -53,13 +53,6 @@ class FQuickSort {
else return res;
}
static long getOtherRight(const long inSize, const int other, const int inNbProc) {
const double step = (double(inSize) / inNbProc);
const long res = long(ceil(step * (other+1)));
if(res > inSize) return inSize;
else return res;
}
static int getProc(const int position, const long inSize, const int inNbProc) {
const double step = (double(inSize) / inNbProc);
return int(position/step);
......@@ -411,8 +404,9 @@ public:
if(sendToProc + sent > fixes[currentRank].suf){
sendToProc = fixes[currentRank].suf - sent;
}
mpiassert( MPI_Isend(&outputArray[sent + fixes[currentRank].pre], sendToProc * sizeof(SortType), MPI_BYTE , idxProc, 0, currentComm, &requests[iterRequest++]), __LINE__ );
if( sendToProc ){
mpiassert( MPI_Isend(&outputArray[sent + fixes[currentRank].pre], sendToProc * sizeof(SortType), MPI_BYTE , idxProc, 0, currentComm, &requests[iterRequest++]), __LINE__ );
}
sent += sendToProc;
}
}
......@@ -433,8 +427,9 @@ public:
if(sendToProc + sent > fixes[currentRank].pre){
sendToProc = fixes[currentRank].pre - sent;
}
mpiassert( MPI_Isend(&outputArray[sent], sendToProc * sizeof(SortType), MPI_BYTE , idxProc, 0, currentComm, &requests[iterRequest++]), __LINE__ );
if(sendToProc){
mpiassert( MPI_Isend(&outputArray[sent], sendToProc * sizeof(SortType), MPI_BYTE , idxProc, 0, currentComm, &requests[iterRequest++]), __LINE__ );
}
sent += sendToProc;
}
}
......@@ -468,8 +463,9 @@ public:
while( idxProc < currentNbProcs && indexArray < myRightLimit - myLeft){
const int firstIndex = Max(myLeft , (long int) fixesSum[idxProc].pre );
const int endIndex = Min((long int)fixesSum[idxProc + 1].pre, myRightLimit);
mpiassert( MPI_Irecv(&buffer[indexArray], (endIndex - firstIndex) * sizeof(SortType), MPI_BYTE, idxProc, 0, currentComm, &requests[iterRequest++]), __LINE__ );
if( (endIndex - firstIndex) ){
mpiassert( MPI_Irecv(&buffer[indexArray], (endIndex - firstIndex) * sizeof(SortType), MPI_BYTE, idxProc, 0, currentComm, &requests[iterRequest++]), __LINE__ );
}
indexArray += endIndex - firstIndex;
++idxProc;
}
......@@ -502,8 +498,9 @@ public:
while( idxProc < currentNbProcs && indexArray < myRightLimit - myLeft){
const int firstIndex = Max(myLeft , (long int)fixesSum[idxProc].suf );
const int endIndex = Min((long int)fixesSum[idxProc + 1].suf, myRightLimit);
mpiassert( MPI_Irecv(&buffer[indexArray], (endIndex - firstIndex) * sizeof(SortType), MPI_BYTE, idxProc, 0, currentComm, &requests[iterRequest++]), __LINE__ );
if( (endIndex - firstIndex) ){
mpiassert( MPI_Irecv(&buffer[indexArray], (endIndex - firstIndex) * sizeof(SortType), MPI_BYTE, idxProc, 0, currentComm, &requests[iterRequest++]), __LINE__ );
}
indexArray += endIndex - firstIndex;
++idxProc;
}
......
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