Skip to content
Snippets Groups Projects
Commit fb8b01dd authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Be more verbose when checking [s]part<->gpart links

parent 907f95f7
No related branches found
No related tags found
1 merge request!310Star particles and gparts links over MPI
...@@ -137,7 +137,12 @@ void part_verify_links(struct part *parts, struct gpart *gparts, ...@@ -137,7 +137,12 @@ void part_verify_links(struct part *parts, struct gpart *gparts,
/* Check that the particles are at the same place */ /* Check that the particles are at the same place */
if (gparts[k].x[0] != part->x[0] || gparts[k].x[1] != part->x[1] || if (gparts[k].x[0] != part->x[0] || gparts[k].x[1] != part->x[1] ||
gparts[k].x[2] != part->x[2]) gparts[k].x[2] != part->x[2])
error("Linked particles are not at the same position !"); error("Linked particles are not at the same position !\n"
"gp->x=[%e %e %e] p->x=[%e %e %e] diff=[%e %e %e]",
gparts[k].x[0], gparts[k].x[1], gparts[k].x[2],
part->x[0], part->x[1], part->x[2],
gparts[k].x[0] - part->x[0], gparts[k].x[1] - part->x[1],
gparts[k].x[2] - part->x[2]);
/* Check that the particles are at the same time */ /* Check that the particles are at the same time */
if (gparts[k].time_bin != part->time_bin) if (gparts[k].time_bin != part->time_bin)
...@@ -159,7 +164,12 @@ void part_verify_links(struct part *parts, struct gpart *gparts, ...@@ -159,7 +164,12 @@ void part_verify_links(struct part *parts, struct gpart *gparts,
/* Check that the particles are at the same place */ /* Check that the particles are at the same place */
if (gparts[k].x[0] != spart->x[0] || gparts[k].x[1] != spart->x[1] || if (gparts[k].x[0] != spart->x[0] || gparts[k].x[1] != spart->x[1] ||
gparts[k].x[2] != spart->x[2]) gparts[k].x[2] != spart->x[2])
error("Linked particles are not at the same position !"); error("Linked particles are not at the same position !\n"
"gp->x=[%e %e %e] p->x=[%e %e %e] diff=[%e %e %e]",
gparts[k].x[0], gparts[k].x[1], gparts[k].x[2],
spart->x[0], spart->x[1], spart->x[2],
gparts[k].x[0] - spart->x[0], gparts[k].x[1] - spart->x[1],
gparts[k].x[2] - spart->x[2]);
/* Check that the particles are at the same time */ /* Check that the particles are at the same time */
if (gparts[k].time_bin != spart->time_bin) if (gparts[k].time_bin != spart->time_bin)
...@@ -212,6 +222,8 @@ void part_verify_links(struct part *parts, struct gpart *gparts, ...@@ -212,6 +222,8 @@ void part_verify_links(struct part *parts, struct gpart *gparts,
} }
} }
} }
message("All links OK");
} }
#ifdef WITH_MPI #ifdef WITH_MPI
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment