Skip to content
GitLab
Menu
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
6b062019
Commit
6b062019
authored
Mar 24, 2016
by
Matthieu Schaller
Browse files
Removed debugging information
parent
b6beeed3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
6b062019
...
...
@@ -212,12 +212,9 @@ void engine_redistribute(struct engine *e) {
/* We need to re-link the gpart partners of parts. */
int
current_dest
=
dest
[
0
];
size_t
count_this_dest
=
0
;
size_t
count_links
=
0
;
for
(
size_t
k
=
0
;
k
<
s
->
nr_parts
;
++
k
)
{
if
(
s
->
parts
[
k
].
gpart
!=
NULL
)
{
++
count_links
;
/* As the addresses will be invalidated by the communications, we will */
/* instead store the absolute index from the start of the sub-array */
/* of particles to be sent to a given node. */
...
...
@@ -228,16 +225,15 @@ void engine_redistribute(struct engine *e) {
count_this_dest
=
0
;
}
if
(
s
->
parts
[
k
].
gpart
->
id
<
0
)
error
(
"Trying to link a partnerless gpart !"
);
/* Debug */
/* if(s->parts[k].gpart->id < 0) */
/* error("Trying to link a partnerless gpart !"); */
s
->
parts
[
k
].
gpart
->
id
=
count_this_dest
;
count_this_dest
++
;
}
}
message
(
"Got %zd gparts with a link (n_parts=%zd n_gparts=%zd)"
,
count_links
,
s
->
nr_parts
,
s
->
nr_gparts
);
/* Get destination of each g-particle */
for
(
size_t
k
=
0
;
k
<
s
->
nr_gparts
;
k
++
)
{
...
...
@@ -262,13 +258,6 @@ void engine_redistribute(struct engine *e) {
/* Sort the gparticles according to their cell index. */
space_gparts_sort
(
gparts
,
g_dest
,
s
->
nr_gparts
,
0
,
nr_nodes
-
1
);
count_links
=
0
;
for
(
size_t
k
=
0
;
k
<
s
->
nr_gparts
;
++
k
)
{
if
(
gparts
[
k
].
id
>=
0
)
++
count_links
;
}
message
(
"Got %zd gparts with a link (n_parts=%zd n_gparts=%zd)"
,
count_links
,
s
->
nr_parts
,
s
->
nr_gparts
);
/* Get all the counts from all the nodes. */
if
(
MPI_Allreduce
(
MPI_IN_PLACE
,
counts
,
nr_nodes
*
nr_nodes
,
MPI_INT
,
MPI_SUM
,
MPI_COMM_WORLD
)
!=
MPI_SUCCESS
)
...
...
@@ -324,8 +313,8 @@ void engine_redistribute(struct engine *e) {
/* Are we sending any part/xpart ? */
if
(
counts
[
ind_send
]
>
0
)
{
message
(
"Sending %d part to node %d"
,
counts
[
ind_send
],
k
);
/*
message("Sending %d part to node %d", counts[ind_send], k);
*/
/* If the send is to the same node, just copy */
if
(
k
==
nodeID
)
{
memcpy
(
&
parts_new
[
offset_recv
],
&
s
->
parts
[
offset_send
],
...
...
@@ -352,7 +341,7 @@ void engine_redistribute(struct engine *e) {
/* Are we sending any gpart ? */
if
(
g_counts
[
ind_send
]
>
0
)
{
message
(
"Sending %d gpart to node %d"
,
g_counts
[
ind_send
],
k
);
/*
message("Sending %d gpart to node %d", g_counts[ind_send], k);
*/
/* If the send is to the same node, just copy */
if
(
k
==
nodeID
)
{
...
...
@@ -444,13 +433,10 @@ void engine_redistribute(struct engine *e) {
/* Verify that the links are correct */
/* MATTHIEU: To be commented out once we are happy */
count_links
=
0
;
for
(
size_t
k
=
0
;
k
<
nr_gparts
;
++
k
)
{
if
(
gparts_new
[
k
].
id
>
0
)
{
++
count_links
;
if
(
gparts_new
[
k
].
part
->
gpart
!=
&
gparts_new
[
k
])
error
(
"Linking problem !"
);
...
...
@@ -460,19 +446,13 @@ void engine_redistribute(struct engine *e) {
error
(
"Linked particles are not at the same position !"
);
}
}
message
(
"Got %zd gparts with a link (n_parts=%zd n_gparts=%zd)"
,
count_links
,
nr_parts
,
nr_gparts
);
for
(
size_t
k
=
0
;
k
<
nr_parts
;
++
k
)
{
if
(
parts_new
[
k
].
gpart
!=
NULL
)
{
if
(
parts_new
[
k
].
gpart
->
part
!=
&
parts_new
[
k
])
error
(
"Linking problem !"
);
error
(
"Linking problem !"
);
}
}
/* Set the new part data, free the old. */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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