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
dfa964db
Commit
dfa964db
authored
11 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
use random tags for cell data.
Former-commit-id: 6b2caa84daa84db5e5ec413861f1fe8bc22d6a39
parent
99d28aa4
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.c
+2
-0
2 additions, 0 deletions
src/cell.c
src/cell.h
+5
-1
5 additions, 1 deletion
src/cell.h
src/engine.c
+6
-18
6 additions, 18 deletions
src/engine.c
with
13 additions
and
19 deletions
src/cell.c
+
2
−
0
View file @
dfa964db
...
...
@@ -94,6 +94,7 @@ int cell_unpack ( struct pcell *pc , struct cell *c , struct space *s ) {
c
->
dt_min
=
pc
->
dt_min
;
c
->
dt_max
=
pc
->
dt_max
;
c
->
count
=
pc
->
count
;
c
->
tag
=
pc
->
tag
;
/* Fill the progeny recursively, depth-first. */
for
(
k
=
0
;
k
<
8
;
k
++
)
...
...
@@ -175,6 +176,7 @@ int cell_pack ( struct cell *c , struct pcell *pc ) {
pc
->
dt_min
=
c
->
dt_min
;
pc
->
dt_max
=
c
->
dt_max
;
pc
->
count
=
c
->
count
;
c
->
tag
=
pc
->
tag
=
rand
()
%
(
1
<<
24
);
/* Fill in the progeny, depth-first recursion. */
for
(
k
=
0
;
k
<
8
;
k
++
)
...
...
This diff is collapsed.
Click to expand it.
src/cell.h
+
5
−
1
View file @
dfa964db
...
...
@@ -30,9 +30,12 @@ struct pcell {
/* Number of particles in this cell. */
int
count
;
/* tag used for MPI communication. */
int
tag
;
/* Relative indices of the cell's progeny. */
int
progeny
[
8
];
};
...
...
@@ -138,6 +141,7 @@ struct cell {
/* Pointer to this cell's packed representation. */
struct
pcell
*
pcell
;
int
pcell_size
;
int
tag
;
}
__attribute__
((
aligned
(
64
)));
...
...
This diff is collapsed.
Click to expand it.
src/engine.c
+
6
−
18
View file @
dfa964db
...
...
@@ -462,7 +462,7 @@ void engine_repartition ( struct engine *e ) {
void
engine_addtasks_send
(
struct
engine
*
e
,
struct
cell
*
ci
,
struct
cell
*
cj
)
{
int
k
,
tag
;
int
k
;
/* Check if any of the density tasks are for the target node. */
for
(
k
=
0
;
k
<
ci
->
nr_density
;
k
++
)
...
...
@@ -473,15 +473,9 @@ void engine_addtasks_send ( struct engine *e , struct cell *ci , struct cell *cj
/* If so, attach send tasks. */
if
(
k
<
ci
->
nr_density
)
{
/* Compute the cell's tag. */
tag
=
(
int
)(
ci
->
loc
[
0
]
/
e
->
s
->
dim
[
0
]
*
512
)
+
((
int
)(
ci
->
loc
[
1
]
/
e
->
s
->
dim
[
1
]
*
512
)
<<
9
)
+
((
int
)(
ci
->
loc
[
2
]
/
e
->
s
->
dim
[
2
]
*
512
)
<<
18
);
tag
=
tag
*
2
;
/* Create the tasks. */
struct
task
*
t_xv
=
scheduler_addtask
(
&
e
->
sched
,
task_type_send_xv
,
task_subtype_none
,
tag
,
0
,
ci
,
cj
,
0
);
struct
task
*
t_rho
=
scheduler_addtask
(
&
e
->
sched
,
task_type_send_rho
,
task_subtype_none
,
tag
+
1
,
0
,
ci
,
cj
,
0
);
struct
task
*
t_xv
=
scheduler_addtask
(
&
e
->
sched
,
task_type_send_xv
,
task_subtype_none
,
2
*
ci
->
tag
,
0
,
ci
,
cj
,
0
);
struct
task
*
t_rho
=
scheduler_addtask
(
&
e
->
sched
,
task_type_send_rho
,
task_subtype_none
,
2
*
ci
->
tag
+
1
,
0
,
ci
,
cj
,
0
);
/* The send_rho task depends on the cell's ghost task. */
task_addunlock
(
ci
->
ghost
,
t_rho
);
...
...
@@ -514,20 +508,14 @@ void engine_addtasks_send ( struct engine *e , struct cell *ci , struct cell *cj
void
engine_addtasks_recv
(
struct
engine
*
e
,
struct
cell
*
c
,
struct
task
*
t_xv
,
struct
task
*
t_rho
)
{
int
k
,
tag
;
int
k
;
/* Do we need to construct a recv task? */
if
(
t_xv
!=
NULL
||
c
->
nr_density
>
0
)
{
/* Compute the cell's tag. */
tag
=
(
int
)(
c
->
loc
[
0
]
/
e
->
s
->
dim
[
0
]
*
512
)
+
((
int
)(
c
->
loc
[
1
]
/
e
->
s
->
dim
[
1
]
*
512
)
<<
9
)
+
((
int
)(
c
->
loc
[
2
]
/
e
->
s
->
dim
[
2
]
*
512
)
<<
18
);
tag
=
tag
*
2
;
/* Create the tasks. */
c
->
recv_xv
=
scheduler_addtask
(
&
e
->
sched
,
task_type_recv_xv
,
task_subtype_none
,
tag
,
0
,
c
,
NULL
,
0
);
c
->
recv_rho
=
scheduler_addtask
(
&
e
->
sched
,
task_type_recv_rho
,
task_subtype_none
,
tag
+
1
,
0
,
c
,
NULL
,
0
);
c
->
recv_xv
=
scheduler_addtask
(
&
e
->
sched
,
task_type_recv_xv
,
task_subtype_none
,
2
*
c
->
tag
,
0
,
c
,
NULL
,
0
);
c
->
recv_rho
=
scheduler_addtask
(
&
e
->
sched
,
task_type_recv_rho
,
task_subtype_none
,
2
*
c
->
tag
+
1
,
0
,
c
,
NULL
,
0
);
/* If there has been a higher-up recv task, then these tasks
are implicit and depend on the higher-up task. */
...
...
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