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
19f735d0
Commit
19f735d0
authored
Dec 06, 2016
by
Peter W. Draper
Browse files
format.sh applied
parent
1bee0e75
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
19f735d0
...
...
@@ -325,17 +325,15 @@ void engine_redistribute(struct engine *e) {
for
(
int
p
=
0
,
r
=
0
;
p
<
nr_nodes
;
p
++
)
{
for
(
int
s
=
0
;
s
<
nr_nodes
;
s
++
)
{
total
+=
counts
[
r
];
if
(
p
==
s
)
unmoved
+=
counts
[
r
];
if
(
p
==
s
)
unmoved
+=
counts
[
r
];
r
++
;
}
}
message
(
"of %ld particles %ld are not transferred (%.2f%%)"
,
total
,
unmoved
,
100
.
0
*
(
double
)
unmoved
/
(
double
)
total
);
message
(
"of %ld particles %ld are not transferred (%.2f%%)"
,
total
,
unmoved
,
100
.
0
*
(
double
)
unmoved
/
(
double
)
total
);
}
}
/* Get all the g_counts from all the nodes. */
if
(
MPI_Allreduce
(
MPI_IN_PLACE
,
g_counts
,
nr_nodes
*
nr_nodes
,
MPI_INT
,
MPI_SUM
,
MPI_COMM_WORLD
)
!=
MPI_SUCCESS
)
...
...
src/partition.c
View file @
19f735d0
...
...
@@ -402,9 +402,9 @@ static void pick_metis(struct space *s, int nregions, int *vertexw, int *edgew,
struct
indexval
*
ivs
=
malloc
(
sizeof
(
struct
indexval
)
*
keymax
);
bzero
(
ivs
,
sizeof
(
struct
indexval
)
*
keymax
);
for
(
int
k
=
0
;
k
<
ncells
;
k
++
)
{
int
index
=
regionid
[
k
]
+
nregions
*
s
->
cells_top
[
k
].
nodeID
;
ivs
[
index
].
count
++
;
ivs
[
index
].
index
=
index
;
int
index
=
regionid
[
k
]
+
nregions
*
s
->
cells_top
[
k
].
nodeID
;
ivs
[
index
].
count
++
;
ivs
[
index
].
index
=
index
;
}
qsort
(
ivs
,
keymax
,
sizeof
(
struct
indexval
),
indexvalcmp
);
...
...
@@ -413,8 +413,8 @@ static void pick_metis(struct space *s, int nregions, int *vertexw, int *edgew,
int
*
oldmap
=
malloc
(
sizeof
(
int
)
*
nregions
);
int
*
newmap
=
malloc
(
sizeof
(
int
)
*
nregions
);
for
(
int
k
=
0
;
k
<
nregions
;
k
++
)
{
oldmap
[
k
]
=
-
1
;
newmap
[
k
]
=
-
1
;
oldmap
[
k
]
=
-
1
;
newmap
[
k
]
=
-
1
;
}
for
(
int
k
=
0
;
k
<
keymax
;
k
++
)
{
...
...
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