Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
76f86ea0
Commit
76f86ea0
authored
11 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
bound splitting depth.
Former-commit-id: a14a4574dd6e3ad9d78a6adc7d4b49f69be0eaae
parent
8d16a7f2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cell.h
+1
-1
1 addition, 1 deletion
src/cell.h
src/space.c
+10
-8
10 additions, 8 deletions
src/space.c
src/space.h
+1
-0
1 addition, 0 deletions
src/space.h
with
12 additions
and
9 deletions
src/cell.h
+
1
−
1
View file @
76f86ea0
...
...
@@ -55,7 +55,7 @@ struct cell {
float
dx_max
;
/* The depth of this cell in the tree. */
int
depth
,
split
;
int
depth
,
split
,
maxdepth
;
/* Nr of parts. */
int
count
;
...
...
This diff is collapsed.
Click to expand it.
src/space.c
+
10
−
8
View file @
76f86ea0
...
...
@@ -922,7 +922,7 @@ void space_splittasks ( struct space *s ) {
if
(
ci
->
split
)
{
/* Make a sub? */
if
(
space_dosub
&&
ci
->
count
<
space_subsize
)
{
if
(
space_dosub
&&
ci
->
count
<
space_subsize
&&
ci
->
maxdepth
-
ci
->
depth
<
space_maxsubdepth
)
{
/* convert to a self-subtask. */
t
->
type
=
task_type_sub
;
...
...
@@ -981,6 +981,7 @@ void space_splittasks ( struct space *s ) {
/* Replace by a single sub-task? */
if
(
space_dosub
&&
ci
->
count
<
space_subsize
&&
cj
->
count
<
space_subsize
&&
ci
->
maxdepth
-
ci
->
depth
<
space_maxsubdepth
&&
cj
->
maxdepth
-
cj
->
depth
<
space_maxsubdepth
&&
sid
!=
0
&&
sid
!=
2
&&
sid
!=
6
&&
sid
!=
8
)
{
/* Make this task a sub task. */
...
...
@@ -1344,7 +1345,7 @@ void space_maketasks ( struct space *s , int do_sort ) {
void
space_split
(
struct
space
*
s
,
struct
cell
*
c
)
{
int
k
,
count
=
c
->
count
;
int
k
,
count
=
c
->
count
,
maxdepth
=
0
;
float
h
,
h_max
=
0
.
0
f
,
dt
,
dt_min
=
c
->
parts
[
0
].
dt
,
dt_max
=
dt_min
;
double
x
[
3
];
struct
cell
*
temp
;
...
...
@@ -1397,16 +1398,16 @@ void space_split ( struct space *s , struct cell *c ) {
}
else
{
space_split
(
s
,
c
->
progeny
[
k
]
);
if
(
c
->
progeny
[
k
]
->
h_max
>
h_max
)
h_max
=
c
->
progeny
[
k
]
->
h_max
;
if
(
c
->
progeny
[
k
]
->
dt_min
<
dt_min
)
dt_min
=
c
->
progeny
[
k
]
->
dt_min
;
if
(
c
->
progeny
[
k
]
->
dt_max
>
dt_max
)
dt_max
=
c
->
progeny
[
k
]
->
dt_max
;
h_max
=
fmaxf
(
h_max
,
c
->
progeny
[
k
]
->
h_max
);
dt_min
=
fminf
(
dt_min
,
c
->
progeny
[
k
]
->
dt_min
);
dt_max
=
fmaxf
(
dt_max
,
c
->
progeny
[
k
]
->
dt_max
);
if
(
c
->
progeny
[
k
]
->
maxdepth
>
maxdepth
)
maxdepth
=
c
->
progeny
[
k
]
->
maxdepth
;
}
c
->
h_max
=
h_max
;
c
->
dt_min
=
dt_min
;
c
->
dt_max
=
dt_max
;
c
->
maxdepth
=
maxdepth
;
}
...
...
@@ -1416,6 +1417,7 @@ void space_split ( struct space *s , struct cell *c ) {
/* Clear the progeny. */
bzero
(
c
->
progeny
,
sizeof
(
struct
cell
*
)
*
8
);
c
->
split
=
0
;
c
->
maxdepth
=
c
->
depth
;
/* Get dt_min/dt_max. */
...
...
This diff is collapsed.
Click to expand it.
src/space.h
+
1
−
0
View file @
76f86ea0
...
...
@@ -26,6 +26,7 @@
#define space_splitratio 0.875f
#define space_splitsize_default 400
#define space_subsize_default 5000
#define space_maxsubdepth 3
#define space_dosub 1
#define space_stretch 1.05f
#define space_maxtaskspercell 31
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment