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
01f51f70
Commit
01f51f70
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Post-merge fixes
parent
24e3b63a
No related branches found
No related tags found
2 merge requests
!212
Gravity infrastructure
,
!172
[WIP] Self gravity (Barnes-Hut version)
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/engine.c
+30
-5
30 additions, 5 deletions
src/engine.c
src/partition.c
+1
-2
1 addition, 2 deletions
src/partition.c
src/runner.c
+4
-0
4 additions, 0 deletions
src/runner.c
src/task.c
+4
-1
4 additions, 1 deletion
src/task.c
with
39 additions
and
8 deletions
src/engine.c
+
30
−
5
View file @
01f51f70
...
...
@@ -1265,6 +1265,23 @@ void engine_count_and_link_tasks(struct engine *e) {
}
}
/**
* @brief Creates the dependency network for the gravity tasks of a given cell.
*
* @param sched The #scheduler.
* @param gravity The gravity task to link.
* @param c The cell.
*/
static
inline
void
engine_make_gravity_dependencies
(
struct
scheduler
*
sched
,
struct
task
*
gravity
,
struct
cell
*
c
)
{
/* init --> gravity --> kick */
/* grav_up --> gravity ( --> kick) */
scheduler_addunlock
(
sched
,
c
->
super
->
init
,
gravity
);
scheduler_addunlock
(
sched
,
c
->
super
->
grav_up
,
gravity
);
scheduler_addunlock
(
sched
,
gravity
,
c
->
super
->
kick
);
}
/**
* @brief Creates all the task dependencies for the gravity
...
...
@@ -1285,6 +1302,8 @@ void engine_link_gravity_tasks(struct engine *e) {
struct
task
*
fft
=
scheduler_addtask
(
sched
,
task_type_grav_fft
,
task_subtype_none
,
0
,
0
,
NULL
,
NULL
,
0
);
scheduler_addunlock
(
sched
,
gather
,
fft
);
for
(
int
k
=
0
;
k
<
nr_tasks
;
k
++
)
{
/* Get a pointer to the task. */
...
...
@@ -1296,7 +1315,6 @@ void engine_link_gravity_tasks(struct engine *e) {
/* Multipole construction */
if
(
t
->
type
==
task_type_grav_up
)
{
scheduler_addunlock
(
sched
,
t
,
gather
);
scheduler_addunlock
(
sched
,
t
,
fft
);
}
/* Long-range interaction */
...
...
@@ -1332,15 +1350,22 @@ void engine_link_gravity_tasks(struct engine *e) {
}
/* Otherwise, sub interaction? */
else
if
(
t
->
type
==
task_type_sub
&&
t
->
subtype
==
task_subtype_grav
)
{
/* Otherwise, sub-self interaction? */
else
if
(
t
->
type
==
task_type_sub_self
&&
t
->
subtype
==
task_subtype_grav
)
{
if
(
t
->
ci
->
nodeID
==
nodeID
)
{
engine_make_gravity_dependencies
(
sched
,
t
,
t
->
ci
);
}
}
/* Otherwise, sub-pair interaction? */
else
if
(
t
->
type
==
task_type_sub_pair
&&
t
->
subtype
==
task_subtype_grav
)
{
if
(
t
->
ci
->
nodeID
==
nodeID
)
{
engine_make_gravity_dependencies
(
sched
,
t
,
t
->
ci
);
}
if
(
t
->
cj
!=
NULL
&&
t
->
cj
->
nodeID
==
nodeID
&&
t
->
ci
->
super
!=
t
->
cj
->
super
)
{
if
(
t
->
cj
->
nodeID
==
nodeID
&&
t
->
ci
->
super
!=
t
->
cj
->
super
)
{
engine_make_gravity_dependencies
(
sched
,
t
,
t
->
cj
);
}
...
...
This diff is collapsed.
Click to expand it.
src/partition.c
+
1
−
2
View file @
01f51f70
...
...
@@ -504,8 +504,7 @@ static void repart_edge_metis(int partweights, int bothweights, int nodeID,
}
/* Pair? */
else
if
(
t
->
type
==
task_type_pair
||
(
t
->
type
==
task_type_sub_pair
))
{
else
if
(
t
->
type
==
task_type_pair
||
(
t
->
type
==
task_type_sub_pair
))
{
/* In-cell pair? */
if
(
ci
==
cj
)
{
/* Add weight to vertex for ci. */
...
...
This diff is collapsed.
Click to expand it.
src/runner.c
+
4
−
0
View file @
01f51f70
...
...
@@ -1087,6 +1087,8 @@ void *runner_main(void *data) {
runner_dosub_self1_density
(
r
,
ci
,
1
);
else
if
(
t
->
subtype
==
task_subtype_force
)
runner_dosub_self2_force
(
r
,
ci
,
1
);
else
if
(
t
->
subtype
==
task_subtype_grav
)
runner_dosub_grav
(
r
,
ci
,
cj
,
1
);
else
error
(
"Unknown task subtype."
);
break
;
...
...
@@ -1095,6 +1097,8 @@ void *runner_main(void *data) {
runner_dosub_pair1_density
(
r
,
ci
,
cj
,
t
->
flags
,
1
);
else
if
(
t
->
subtype
==
task_subtype_force
)
runner_dosub_pair2_force
(
r
,
ci
,
cj
,
t
->
flags
,
1
);
else
if
(
t
->
subtype
==
task_subtype_grav
)
runner_dosub_grav
(
r
,
ci
,
cj
,
1
);
else
error
(
"Unknown task subtype."
);
break
;
...
...
This diff is collapsed.
Click to expand it.
src/task.c
+
4
−
1
View file @
01f51f70
...
...
@@ -142,7 +142,6 @@ void task_unlock(struct task *t) {
}
break
;
case
task_type_grav_mm
:
cell_gunlocktree
(
ci
);
break
;
...
...
@@ -218,6 +217,10 @@ int task_lock(struct task *t) {
}
break
;
case
task_type_grav_mm
:
cell_glocktree
(
ci
);
break
;
default:
break
;
}
...
...
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