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
d2982c1e
Commit
d2982c1e
authored
9 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Add checks for all nodes being present in new partition
Some tests of cosmo volume fail with this issue
parent
560a0191
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/engine.c
+31
-9
31 additions, 9 deletions
src/engine.c
with
31 additions
and
9 deletions
src/engine.c
+
31
−
9
View file @
d2982c1e
...
...
@@ -96,12 +96,12 @@ void engine_check_cell(struct cell *c, void *data) {
//}
/* Check the particles. */
for
(
int
k
=
0
;
k
<
c
->
count
;
k
++
)
{
if
(
engine_check_part
(
&
c
->
parts
[
k
]))
{
print_cell
(
c
);
error
(
"Bad particle in cell."
);
}
}
//
for (int k = 0; k < c->count; k++) {
//
if (engine_check_part(&c->parts[k])) {
//
print_cell(c);
//
error("Bad particle in cell.");
//
}
//
}
/* Check that the progeny, if any, contain all the particles. */
if
(
c
->
split
)
{
...
...
@@ -255,6 +255,9 @@ void engine_redistribute(struct engine *e) {
/* Get the new number of parts for this node, be generous in allocating. */
int
nr_parts
=
0
;
for
(
int
k
=
0
;
k
<
nr_nodes
;
k
++
)
nr_parts
+=
counts
[
k
*
nr_nodes
+
nodeID
];
if
(
nr_parts
==
0
)
{
error
(
"node will have no parts, no point in continuing..."
);
}
struct
part
*
parts_new
;
struct
xpart
*
xparts_new
,
*
xparts
=
s
->
xparts
;
if
(
posix_memalign
((
void
**
)
&
parts_new
,
part_align
,
...
...
@@ -715,10 +718,29 @@ void engine_repartition(struct engine *e) {
error
(
"Call to METIS_PartGraphKway failed."
);
/* Dump the 3d array of cell IDs. */
/* printf( "engine_repartition:
nodeIDs = reshape( [" );
message
(
"
nodeIDs = reshape( ["
);
for
(
i
=
0
;
i
<
cdim
[
0
]
*
cdim
[
1
]
*
cdim
[
2
]
;
i
++
)
printf( "%i " , (int)nodeIDs[ i ] );
printf("] ,%i,%i,%i);\n",cdim[0],cdim[1],cdim[2]); */
printf
(
"%i "
,
(
int
)
nodeIDs
[
i
]
);
printf
(
"] ,%i,%i,%i);
\n
"
,
cdim
[
0
],
cdim
[
1
],
cdim
[
2
]
);
/* Sanity check, all nodes should be present. */
int
present
[
nr_nodes
];
for
(
i
=
0
;
i
<
nr_nodes
;
i
++
)
{
present
[
i
]
=
0
;
}
for
(
i
=
0
;
i
<
cdim
[
0
]
*
cdim
[
1
]
*
cdim
[
2
]
;
i
++
)
{
present
[
nodeIDs
[
i
]]
++
;
}
int
stop
=
0
;
for
(
i
=
0
;
i
<
nr_nodes
;
i
++
)
{
if
(
present
[
i
]
==
0
)
{
stop
=
1
;
message
(
"Node %d is not present after partition"
,
i
);
}
}
if
(
stop
)
{
error
(
"METIS repartition has failed"
);
}
}
/* Broadcast the result of the partition. */
...
...
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