Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
d4c7ef69
Commit
d4c7ef69
authored
May 27, 2013
by
Pedro Gonnet
Browse files
limit parallelism.
Former-commit-id: 8b79fd206af30e488ab8d8a8e25548536bd1437a
parent
d9fb8582
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/space.c
View file @
d4c7ef69
...
...
@@ -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
);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment