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
f8c92e57
Commit
f8c92e57
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Remove the part<->gpart link checks. These can be commented back in when debugging.
parent
7e2d978b
No related branches found
No related tags found
1 merge request
!185
Remove the part<->gpart link checks. These can be un-commented back in when debugging.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/engine.c
+30
-32
30 additions, 32 deletions
src/engine.c
src/space.c
+14
-15
14 additions, 15 deletions
src/space.c
with
44 additions
and
47 deletions
src/engine.c
+
30
−
32
View file @
f8c92e57
...
@@ -481,27 +481,26 @@ void engine_redistribute(struct engine *e) {
...
@@ -481,27 +481,26 @@ void engine_redistribute(struct engine *e) {
} */
} */
/* Verify that the links are correct */
/* Verify that the links are correct */
/* MATTHIEU: To be commented out once we are happy */
/* for (size_t k = 0; k < nr_gparts; ++k) { */
for
(
size_t
k
=
0
;
k
<
nr_gparts
;
++
k
)
{
if
(
gparts_new
[
k
].
id
>
0
)
{
/*
if (gparts_new[k].id > 0) {
*/
if
(
gparts_new
[
k
].
part
->
gpart
!=
&
gparts_new
[
k
])
/*
if (gparts_new[k].part->gpart != &gparts_new[k])
*/
error
(
"Linking problem !"
);
/*
error("Linking problem !");
*/
if
(
gparts_new
[
k
].
x
[
0
]
!=
gparts_new
[
k
].
part
->
x
[
0
]
||
/*
if (gparts_new[k].x[0] != gparts_new[k].part->x[0] ||
*/
gparts_new
[
k
].
x
[
1
]
!=
gparts_new
[
k
].
part
->
x
[
1
]
||
/*
gparts_new[k].x[1] != gparts_new[k].part->x[1] ||
*/
gparts_new
[
k
].
x
[
2
]
!=
gparts_new
[
k
].
part
->
x
[
2
])
/*
gparts_new[k].x[2] != gparts_new[k].part->x[2])
*/
error
(
"Linked particles are not at the same position !"
);
/*
error("Linked particles are not at the same position !");
*/
}
/* } */
}
/* } */
for
(
size_t
k
=
0
;
k
<
nr_parts
;
++
k
)
{
/*
for (size_t k = 0; k < nr_parts; ++k) {
*/
if
(
parts_new
[
k
].
gpart
!=
NULL
)
{
/*
if (parts_new[k].gpart != NULL) {
*/
if
(
parts_new
[
k
].
gpart
->
part
!=
&
parts_new
[
k
])
error
(
"Linking problem !"
);
/*
if (parts_new[k].gpart->part != &parts_new[k]) error("Linking problem !");
*/
}
/* } */
}
/* } */
/* Set the new part data, free the old. */
/* Set the new part data, free the old. */
free
(
parts
);
free
(
parts
);
...
@@ -2447,26 +2446,25 @@ void engine_split(struct engine *e, struct partition *initial_partition) {
...
@@ -2447,26 +2446,25 @@ void engine_split(struct engine *e, struct partition *initial_partition) {
if
(
s
->
gparts
[
k
].
id
>
0
)
s
->
gparts
[
k
].
part
->
gpart
=
&
s
->
gparts
[
k
];
if
(
s
->
gparts
[
k
].
id
>
0
)
s
->
gparts
[
k
].
part
->
gpart
=
&
s
->
gparts
[
k
];
/* Verify that the links are correct */
/* Verify that the links are correct */
/* MATTHIEU: To be commented out once we are happy */
/* for (size_t k = 0; k < s->nr_gparts; ++k) { */
for
(
size_t
k
=
0
;
k
<
s
->
nr_gparts
;
++
k
)
{
if
(
s
->
gparts
[
k
].
id
>
0
)
{
/*
if (s->gparts[k].id > 0) {
*/
if
(
s
->
gparts
[
k
].
part
->
gpart
!=
&
s
->
gparts
[
k
])
error
(
"Linking problem !"
);
/*
if (s->gparts[k].part->gpart != &s->gparts[k]) error("Linking problem !");
*/
if
(
s
->
gparts
[
k
].
x
[
0
]
!=
s
->
gparts
[
k
].
part
->
x
[
0
]
||
/*
if (s->gparts[k].x[0] != s->gparts[k].part->x[0] ||
*/
s
->
gparts
[
k
].
x
[
1
]
!=
s
->
gparts
[
k
].
part
->
x
[
1
]
||
/*
s->gparts[k].x[1] != s->gparts[k].part->x[1] ||
*/
s
->
gparts
[
k
].
x
[
2
]
!=
s
->
gparts
[
k
].
part
->
x
[
2
])
/*
s->gparts[k].x[2] != s->gparts[k].part->x[2])
*/
error
(
"Linked particles are not at the same position !"
);
/*
error("Linked particles are not at the same position !");
*/
}
/* } */
}
/* } */
for
(
size_t
k
=
0
;
k
<
s
->
nr_parts
;
++
k
)
{
/*
for (size_t k = 0; k < s->nr_parts; ++k) {
*/
if
(
s
->
parts
[
k
].
gpart
!=
NULL
)
{
/*
if (s->parts[k].gpart != NULL) {
*/
if
(
s
->
parts
[
k
].
gpart
->
part
!=
&
s
->
parts
[
k
])
error
(
"Linking problem !"
);
/*
if (s->parts[k].gpart->part != &s->parts[k]) error("Linking problem !");
*/
}
/* } */
}
/* } */
#else
#else
error
(
"SWIFT was not compiled with MPI support."
);
error
(
"SWIFT was not compiled with MPI support."
);
...
@@ -2485,7 +2483,7 @@ void engine_dump_snapshot(struct engine *e) {
...
@@ -2485,7 +2483,7 @@ void engine_dump_snapshot(struct engine *e) {
if
(
e
->
verbose
)
message
(
"writing snapshot at t=%f."
,
e
->
time
);
if
(
e
->
verbose
)
message
(
"writing snapshot at t=%f."
,
e
->
time
);
/* Dump... */
/* Dump... */
#if defined(WITH_MPI)
#if defined(WITH_MPI)
#if defined(HAVE_PARALLEL_HDF5)
#if defined(HAVE_PARALLEL_HDF5)
write_output_parallel
(
e
,
e
->
snapshotBaseName
,
e
->
snapshotUnits
,
e
->
nodeID
,
write_output_parallel
(
e
,
e
->
snapshotBaseName
,
e
->
snapshotUnits
,
e
->
nodeID
,
...
...
This diff is collapsed.
Click to expand it.
src/space.c
+
14
−
15
View file @
f8c92e57
...
@@ -597,26 +597,25 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
...
@@ -597,26 +597,25 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
free
(
gind
);
free
(
gind
);
/* Verify that the links are correct */
/* Verify that the links are correct */
/* MATTHIEU: To be commented out once we are happy */
/* for (size_t k = 0; k < nr_gparts; ++k) { */
for
(
size_t
k
=
0
;
k
<
nr_gparts
;
++
k
)
{
if
(
s
->
gparts
[
k
].
id
>
0
)
{
/*
if (s->gparts[k].id > 0) {
*/
if
(
s
->
gparts
[
k
].
part
->
gpart
!=
&
s
->
gparts
[
k
])
error
(
"Linking problem !"
);
/*
if (s->gparts[k].part->gpart != &s->gparts[k]) error("Linking problem !");
*/
if
(
s
->
gparts
[
k
].
x
[
0
]
!=
s
->
gparts
[
k
].
part
->
x
[
0
]
||
/*
if (s->gparts[k].x[0] != s->gparts[k].part->x[0] ||
*/
s
->
gparts
[
k
].
x
[
1
]
!=
s
->
gparts
[
k
].
part
->
x
[
1
]
||
/*
s->gparts[k].x[1] != s->gparts[k].part->x[1] ||
*/
s
->
gparts
[
k
].
x
[
2
]
!=
s
->
gparts
[
k
].
part
->
x
[
2
])
/*
s->gparts[k].x[2] != s->gparts[k].part->x[2])
*/
error
(
"Linked particles are not at the same position !"
);
/*
error("Linked particles are not at the same position !");
*/
}
/* } */
}
/* } */
for
(
size_t
k
=
0
;
k
<
nr_parts
;
++
k
)
{
/*
for (size_t k = 0; k < nr_parts; ++k) {
*/
if
(
s
->
parts
[
k
].
gpart
!=
NULL
)
{
/*
if (s->parts[k].gpart != NULL) {
*/
if
(
s
->
parts
[
k
].
gpart
->
part
!=
&
s
->
parts
[
k
])
error
(
"Linking problem !"
);
/*
if (s->parts[k].gpart->part != &s->parts[k]) error("Linking problem !");
*/
}
/* } */
}
/* } */
/* Hook the cells up to the parts. */
/* Hook the cells up to the parts. */
// tic = getticks();
// tic = getticks();
...
...
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