Commit d4c7ef69 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

limit parallelism.


Former-commit-id: 8b79fd206af30e488ab8d8a8e25548536bd1437a
parent d9fb8582
......@@ -589,16 +589,33 @@ void parts_sort_rec ( struct part *parts , int *ind , int N , int min , int max
error( "Sorting failed (>pivot)." );
} */
/* Recurse on the left? */
if ( j > 0 && pivot > min ) {
#pragma omp task untied
parts_sort( parts , ind , j+1 , min , pivot );
/* Bother going parallel? */
if ( N < 100 ) {
/* Recurse on the left? */
if ( j > 0 && pivot > min )
parts_sort( parts , ind , j+1 , min , pivot );
/* Recurse on the right? */
if ( i < N && pivot+1 < max )
parts_sort( &parts[i], &ind[i], N-i , pivot+1 , max );
}
else {
/* Recurse on the left? */
if ( j > 0 && pivot > min ) {
#pragma omp task untied
parts_sort( parts , ind , j+1 , min , pivot );
}
/* Recurse on the right? */
if ( i < N && pivot+1 < max ) {
#pragma omp task untied
parts_sort( &parts[i], &ind[i], N-i , pivot+1 , max );
/* Recurse on the right? */
if ( i < N && pivot+1 < max ) {
#pragma omp task untied
parts_sort( &parts[i], &ind[i], N-i , pivot+1 , max );
}
}
}
......
Supports Markdown
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