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
31e752ef
Commit
31e752ef
authored
9 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
fixed engine.c and engine.h some more.
parent
a04ce3c7
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!136
Master
,
!114
size_t
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/engine.c
+7
-6
7 additions, 6 deletions
src/engine.c
with
7 additions
and
6 deletions
src/engine.c
+
7
−
6
View file @
31e752ef
...
...
@@ -154,7 +154,8 @@ void engine_redistribute(struct engine *e) {
/* Start by sorting the particles according to their nodes and
getting the counts. The counts array is indexed as
count[from * nr_nodes + to]. */
int
*
counts
,
*
dest
;
int
*
counts
;
size_t
*
dest
;
double
ih
[
3
],
dim
[
3
];
ih
[
0
]
=
s
->
ih
[
0
];
ih
[
1
]
=
s
->
ih
[
1
];
...
...
@@ -163,7 +164,7 @@ void engine_redistribute(struct engine *e) {
dim
[
1
]
=
s
->
dim
[
1
];
dim
[
2
]
=
s
->
dim
[
2
];
if
((
counts
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
nr_nodes
*
nr_nodes
))
==
NULL
||
(
dest
=
(
in
t
*
)
malloc
(
sizeof
(
in
t
)
*
s
->
nr_parts
))
==
NULL
)
(
dest
=
(
size_
t
*
)
malloc
(
sizeof
(
size_
t
)
*
s
->
nr_parts
))
==
NULL
)
error
(
"Failed to allocate count and dest buffers."
);
bzero
(
counts
,
sizeof
(
int
)
*
nr_nodes
*
nr_nodes
);
struct
part
*
parts
=
s
->
parts
;
...
...
@@ -650,9 +651,9 @@ int engine_exchange_strays(struct engine *e, int offset, size_t *ind, size_t N)
/* Count the total number of incoming particles and make sure we have
enough space to accommodate them. */
in
t
count_in
=
0
;
size_
t
count_in
=
0
;
for
(
k
=
0
;
k
<
e
->
nr_proxies
;
k
++
)
count_in
+=
e
->
proxies
[
k
].
nr_parts_in
;
if
(
e
->
verbose
)
message
(
"sent out %i particles, got %i back."
,
N
,
count_in
);
if
(
e
->
verbose
)
message
(
"sent out %
z
i particles, got %
z
i back."
,
N
,
count_in
);
if
(
offset
+
count_in
>
s
->
size_parts
)
{
s
->
size_parts
=
(
offset
+
count_in
)
*
1
.
05
;
struct
part
*
parts_new
=
NULL
;
...
...
@@ -1778,8 +1779,8 @@ void engine_split(struct engine *e, struct partition *initial_partition) {
/* Re-allocate the local parts. */
if
(
e
->
nodeID
==
0
)
message
(
"Re-allocating parts array from %i to %i."
,
s
->
size_parts
,
(
in
t
)(
s
->
nr_parts
*
1
.
2
));
message
(
"Re-allocating parts array from %
z
i to %
z
i."
,
s
->
size_parts
,
(
size_
t
)(
s
->
nr_parts
*
1
.
2
));
s
->
size_parts
=
s
->
nr_parts
*
1
.
2
;
struct
part
*
parts_new
=
NULL
;
struct
xpart
*
xparts_new
=
NULL
;
...
...
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