Commit daa054a4 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Restore the debugging checks for the time-step All_Reduce in engine_collect_end_of_step()

parent 0635ee28
...@@ -3909,47 +3909,48 @@ void engine_collect_end_of_step(struct engine *e, int apply) { ...@@ -3909,47 +3909,48 @@ void engine_collect_end_of_step(struct engine *e, int apply) {
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
{ {
/* /\* Check the above using the original MPI calls. *\/ */ /* Check the above using the original MPI calls. */
/* integertime_t in_i[1], out_i[1]; */ integertime_t in_i[2], out_i[2];
/* in_i[0] = 0; */ in_i[0] = 0;
/* out_i[0] = data.ti_end_min; */ in_i[1] = 0;
/* if (MPI_Allreduce(out_i, in_i, 1, MPI_LONG_LONG_INT, MPI_MIN, */ out_i[0] = data.ti_hydro_end_min;
/* MPI_COMM_WORLD) != MPI_SUCCESS) */ out_i[1] = data.ti_gravity_end_min;
/* error("Failed to aggregate ti_end_min."); */ if (MPI_Allreduce(out_i, in_i, 2, MPI_LONG_LONG_INT, MPI_MIN,
/* if (in_i[0] != (long long)e->collect_group1.ti_end_min) */ MPI_COMM_WORLD) != MPI_SUCCESS)
/* error("Failed to get same ti_end_min, is %lld, should be %lld", error("Failed to aggregate ti_end_min.");
* in_i[0], */ if (in_i[0] != (long long)e->collect_group1.ti_hydro_end_min)
/* e->collect_group1.ti_end_min); */ error("Failed to get same ti_hydro_end_min, is %lld, should be %lld",
in_i[0], e->collect_group1.ti_hydro_end_min);
/* long long in_ll[3], out_ll[3]; */ if (in_i[1] != (long long)e->collect_group1.ti_gravity_end_min)
/* out_ll[0] = data.updates; */ error("Failed to get same ti_gravity_end_min, is %lld, should be %lld",
/* out_ll[1] = data.g_updates; */ in_i[1], e->collect_group1.ti_gravity_end_min);
/* out_ll[2] = data.s_updates; */
/* if (MPI_Allreduce(out_ll, in_ll, 3, MPI_LONG_LONG_INT, MPI_SUM, */ long long in_ll[3], out_ll[3];
/* MPI_COMM_WORLD) != MPI_SUCCESS) */ out_ll[0] = data.updates;
/* error("Failed to aggregate particle counts."); */ out_ll[1] = data.g_updates;
/* if (in_ll[0] != (long long)e->collect_group1.updates) */ out_ll[2] = data.s_updates;
/* error("Failed to get same updates, is %lld, should be %ld", in_ll[0], if (MPI_Allreduce(out_ll, in_ll, 3, MPI_LONG_LONG_INT, MPI_SUM,
*/ MPI_COMM_WORLD) != MPI_SUCCESS)
/* e->collect_group1.updates); */ error("Failed to aggregate particle counts.");
/* if (in_ll[1] != (long long)e->collect_group1.g_updates) */ if (in_ll[0] != (long long)e->collect_group1.updates)
/* error("Failed to get same g_updates, is %lld, should be %ld", in_ll[1], error("Failed to get same updates, is %lld, should be %ld", in_ll[0],
*/ e->collect_group1.updates);
/* e->collect_group1.g_updates); */ if (in_ll[1] != (long long)e->collect_group1.g_updates)
/* if (in_ll[2] != (long long)e->collect_group1.s_updates) */ error("Failed to get same g_updates, is %lld, should be %ld", in_ll[1],
/* error("Failed to get same s_updates, is %lld, should be %ld", in_ll[2], e->collect_group1.g_updates);
*/ if (in_ll[2] != (long long)e->collect_group1.s_updates)
/* e->collect_group1.s_updates); */ error("Failed to get same s_updates, is %lld, should be %ld", in_ll[2],
e->collect_group1.s_updates);
/* int buff = 0; */
/* if (MPI_Allreduce(&e->forcerebuild, &buff, 1, MPI_INT, MPI_MAX, */ int buff = 0;
/* MPI_COMM_WORLD) != MPI_SUCCESS) */ if (MPI_Allreduce(&e->forcerebuild, &buff, 1, MPI_INT, MPI_MAX,
/* error("Failed to aggregate the rebuild flag across nodes."); */ MPI_COMM_WORLD) != MPI_SUCCESS)
/* if (!!buff != !!e->collect_group1.forcerebuild) */ error("Failed to aggregate the rebuild flag across nodes.");
/* error( */ if (!!buff != !!e->collect_group1.forcerebuild)
/* "Failed to get same rebuild flag from all nodes, is %d," */ error(
/* "should be %d", */ "Failed to get same rebuild flag from all nodes, is %d,"
/* buff, e->collect_group1.forcerebuild); */ "should be %d",
buff, e->collect_group1.forcerebuild);
} }
#endif #endif
#endif #endif
......
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
#include "clocks.h" #include "clocks.h"
#ifdef SWIFT_DEVELOP_MODE #ifdef SWIFT_DEVELOP_MODE
#define swift_abort(errcode) abort() #define swift_abort(errcode) abort()
#else #else
#define swift_abort(errcode) exit(errcode) #define swift_abort(errcode) exit(errcode)
#endif #endif
/** /**
...@@ -60,7 +60,7 @@ extern int engine_rank; ...@@ -60,7 +60,7 @@ extern int engine_rank;
({ \ ({ \
fprintf(stderr, "%s %s:%s():%i: " s "\n", clocks_get_timesincestart(), \ fprintf(stderr, "%s %s:%s():%i: " s "\n", clocks_get_timesincestart(), \
__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__); \ __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
swift_abort(1); \ swift_abort(1); \
}) })
#endif #endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment