diff --git a/examples/test_bh.c b/examples/test_bh.c index 906fcfd4b883399677b8a7e81c59815a2bd9e734..0431479ad07e93c1fbafb909e13ce3a75674b664 100644 --- a/examples/test_bh.c +++ b/examples/test_bh.c @@ -400,7 +400,7 @@ static inline void make_interact_pc(struct part_local *parts, int count, #ifdef SANITY_CHECKS /* Sanity checks */ - if (leaf->count == 0) error("Empty cell!"); + if (count == 0) error("Empty cell!"); /* Sanity check. */ if (cj->new.mass == 0.0) { @@ -791,7 +791,7 @@ static inline void iact_pair_direct(struct cell *ci, struct cell *cj) { /* Copy the local particle data back. */ for (k = 0; k < count_j; k++) { - for (j = 0; j < 3; j++) cj->parts[k].a[j] = parts_j[k].a[j]; + for (j = 0; j < 3; j++) cj->parts[k].a[j] += parts_j[k].a[j]; } } diff --git a/examples/test_fmm.c b/examples/test_fmm.c index 906fcfd4b883399677b8a7e81c59815a2bd9e734..63adabff545f6257034f70c7b5f3d5935821a61c 100644 --- a/examples/test_fmm.c +++ b/examples/test_fmm.c @@ -43,19 +43,19 @@ #define dist_min 0.5 /* Used for legacy walk only */ #define dist_cutoff_ratio 1.5 -#define ICHECK -1 -#define NO_SANITY_CHECKS +#define ICHECK -10000000 +#define SANITY_CHECKS #define NO_COM_AS_TASK -#define NO_COUNTERS +#define COUNTERS /** Data structure for the particles. */ struct part { double x[3]; - union { + // union { float a[3]; float a_legacy[3]; float a_exact[3]; - }; + // }; float mass; int id; }; // __attribute__((aligned(32))); @@ -400,7 +400,7 @@ static inline void make_interact_pc(struct part_local *parts, int count, #ifdef SANITY_CHECKS /* Sanity checks */ - if (leaf->count == 0) error("Empty cell!"); + if (count == 0) error("Empty cell!"); /* Sanity check. */ if (cj->new.mass == 0.0) { @@ -791,7 +791,7 @@ static inline void iact_pair_direct(struct cell *ci, struct cell *cj) { /* Copy the local particle data back. */ for (k = 0; k < count_j; k++) { - for (j = 0; j < 3; j++) cj->parts[k].a[j] = parts_j[k].a[j]; + for (j = 0; j < 3; j++) cj->parts[k].a[j] += parts_j[k].a[j]; } } @@ -1472,7 +1472,7 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) { } message("Average number of parts per leaf is %f.", ((double)N) / nr_leaves); -#if ICHECK > 0 +#if 1//ICHECK > 0 printf("----------------------------------------------------------\n"); /* Do a N^2 interactions calculation */ @@ -1507,7 +1507,7 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) { // FILE *fileTime = fopen(buffer, "w"); /* Loop over the number of runs. */ - for (k = 0; k < 0 /* runs */; k++) { + for (k = 0; k < 1 /* runs */; k++) { countMultipoles = 0; countPairs = 0; @@ -1528,11 +1528,11 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) { // fclose(fileTime); -#if ICHECK >= 0 - message("[check] accel of part %i is [%.3e,%.3e,%.3e]", ICHECK, - root->parts[ICHECK].a_legacy[0], root->parts[ICHECK].a_legacy[1], - root->parts[ICHECK].a_legacy[2]); -#endif +/* #if ICHECK >= 0 */ +/* message("[check] accel of part %i is [%.3e,%.3e,%.3e]", ICHECK, */ +/* root->parts[ICHECK].a_legacy[0], root->parts[ICHECK].a_legacy[1], */ +/* root->parts[ICHECK].a_legacy[2]); */ +/* #endif */ printf("task counts: [ %8s %8s %8s %8s %8s ]\n", "self", "pair", "m-poles", "direct", "CoMs"); printf("task counts: [ %8i %8i %8i %8i %8i ] (legacy).\n", 0, 0,