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
6844c9b4
Commit
6844c9b4
authored
Aug 08, 2015
by
Pedro Gonnet
Browse files
add extra debugging info when computing stray part indices.
Former-commit-id: 152f63e8c3a6154086fc09c1225a165c374f9338
parent
e181790b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
6844c9b4
...
...
@@ -843,9 +843,12 @@ int engine_exchange_strays ( struct engine *e , int offset , int *ind , int N )
/* Put the parts into the corresponding proxies. */
for
(
k
=
0
;
k
<
N
;
k
++
)
{
pid
=
e
->
proxy_ind
[
e
->
s
->
cells
[
ind
[
k
]
].
nodeID
];
int
node_id
=
e
->
s
->
cells
[
ind
[
k
]
].
nodeID
;
if
(
node_id
<
0
||
node_id
>=
e
->
nr_nodes
)
error
(
"Bad node ID %i."
,
node_id
);
pid
=
e
->
proxy_ind
[
node_id
];
if
(
pid
<
0
)
error
(
"Do not have a proxy for the requested nodeID
."
);
error
(
"Do not have a proxy for the requested nodeID
%i."
,
node_id
);
proxy_parts_load
(
&
e
->
proxies
[
pid
]
,
&
s
->
parts
[
offset
+
k
]
,
&
s
->
xparts
[
offset
+
k
]
,
1
);
}
...
...
src/space.c
View file @
6844c9b4
...
...
@@ -336,6 +336,8 @@ void space_rebuild ( struct space *s , double cell_max ) {
else
if
(
p
->
x
[
j
]
>=
dim
[
j
]
)
p
->
x
[
j
]
-=
dim
[
j
];
ind
[
k
]
=
cell_getid
(
cdim
,
p
->
x
[
0
]
*
ih
[
0
]
,
p
->
x
[
1
]
*
ih
[
1
]
,
p
->
x
[
2
]
*
ih
[
2
]
);
if
(
ind
[
k
]
<
0
||
ind
[
k
]
>=
s
->
nr_cells
)
error
(
"Bad cell id %i."
,
ind
[
k
]);
atomic_inc
(
&
cells
[
ind
[
k
]
].
count
);
}
// message( "getting particle indices took %.3f ms." , (double)(getticks() - tic) / CPU_TPS * 1000 );
...
...
@@ -344,24 +346,25 @@ void space_rebuild ( struct space *s , double cell_max ) {
#ifdef WITH_MPI
/* Move non-local parts to the end of the list. */
int
nodeID
=
s
->
e
->
nodeID
;
int
nr_local_parts
=
s
->
nr_parts
;
for
(
k
=
0
;
k
<
nr_parts
;
k
++
)
if
(
cells
[
ind
[
k
]
].
nodeID
!=
nodeID
)
{
cells
[
ind
[
k
]
].
count
-=
1
;
nr_parts
-=
1
;
nr_
local_
parts
-=
1
;
struct
part
tp
=
parts
[
k
];
parts
[
k
]
=
parts
[
nr_parts
];
parts
[
nr_parts
]
=
tp
;
parts
[
k
]
=
parts
[
nr_
local_
parts
];
parts
[
nr_
local_
parts
]
=
tp
;
struct
xpart
txp
=
xparts
[
k
];
xparts
[
k
]
=
xparts
[
nr_parts
];
xparts
[
nr_parts
]
=
txp
;
xparts
[
k
]
=
xparts
[
nr_
local_
parts
];
xparts
[
nr_
local_
parts
]
=
txp
;
int
t
=
ind
[
k
];
ind
[
k
]
=
ind
[
nr_parts
];
ind
[
nr_parts
]
=
t
;
ind
[
k
]
=
ind
[
nr_
local_
parts
];
ind
[
nr_
local_
parts
]
=
t
;
}
/* Exchange the strays, note that this potentially re-allocates
the parts arrays. */
s
->
nr_parts
=
nr_parts
+
engine_exchange_strays
(
s
->
e
,
nr_parts
,
&
ind
[
nr_parts
]
,
s
->
nr_parts
-
nr_parts
);
s
->
nr_parts
=
nr_
local_
parts
+
engine_exchange_strays
(
s
->
e
,
nr_
local_
parts
,
&
ind
[
nr_parts
]
,
nr_parts
-
nr_
local_
parts
);
parts
=
s
->
parts
;
xparts
=
s
->
xparts
;
...
...
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