test125cells dopair2_force interactions
To time the breakdown of the dopair2 interactions I needed to work out which interaction occurred: edge, corner, face. So I printed the sid out, but I'm confused by the results because it says that there are an incorrect number of edge/face/corner interactions.
Code in question:
int ctr = 0;
/* Do the pairs (for the central 27 cells) */
for (int i = 1; i < 4; i++) {
for (int j = 1; j < 4; j++) {
for (int k = 1; k < 4; k++) {
struct cell *cj = cells[i * 25 + j * 5 + k];
if (main_cell == cj) message("Main cell: %d",i * 25 + j * 5 + k);
if (main_cell != cj) {
double shift[3] = {0.0, 0.0, 0.0};
const int sid = space_getsid(runner.e->s, &main_cell, &cj, shift);
const ticks sub_tic = getticks();
message("sid: %d", sid);
if(sort_is_face(sid)) message("Face interaction: %d", ctr);
else if(sort_is_edge(sid)) message("Edge interaction: %d", ctr);
else if(sort_is_corner(sid)) message("Corner interaction: %d", ctr);
runner_dopair2_force(&runner, main_cell, cj);
const ticks sub_toc = getticks();
timings[ctr++] += sub_toc - sub_tic;
}
}
}
}
Output:
[00000.1] main: sid: 0
[00000.1] main: Corner interaction: 0
[00000.1] main: sid: 12
[00000.1] main: Face interaction: 1
[00000.1] main: sid: 12
[00000.1] main: Face interaction: 2
[00000.1] main: sid: 9
[00000.1] main: Edge interaction: 3
[00000.1] main: sid: 11
[00000.1] main: Edge interaction: 4
[00000.1] main: sid: 10
[00000.1] main: Face interaction: 5
[00000.1] main: sid: 11
[00000.1] main: Edge interaction: 6
[00000.1] main: sid: 12
[00000.1] main: Face interaction: 7
[00000.1] main: sid: 12
[00000.1] main: Face interaction: 8
[00000.1] main: sid: 0
[00000.1] main: Corner interaction: 9
[00000.1] main: sid: 2
[00000.1] main: Corner interaction: 10
[00000.1] main: sid: 1
[00000.1] main: Edge interaction: 11
[00000.1] main: sid: 6
[00000.1] main: Corner interaction: 12
[00000.1] main: sid: 8
[00000.1] main: Corner interaction: 13
[00000.1] main: sid: 7
[00000.1] main: Edge interaction: 14
[00000.1] main: sid: 3
[00000.1] main: Edge interaction: 15
[00000.1] main: sid: 5
[00000.1] main: Edge interaction: 16
[00000.1] main: sid: 4
[00000.1] main: Face interaction: 17
[00000.1] main: sid: 8
[00000.1] main: Corner interaction: 18
[00000.1] main: sid: 12
[00000.1] main: Face interaction: 19
[00000.1] main: sid: 12
[00000.1] main: Face interaction: 20
[00000.1] main: sid: 9
[00000.1] main: Edge interaction: 21
[00000.1] main: sid: 11
[00000.1] main: Edge interaction: 22
[00000.1] main: sid: 10
[00000.1] main: Face interaction: 23
[00000.1] main: sid: 11
[00000.1] main: Edge interaction: 24
[00000.1] main: sid: 12
[00000.1] main: Face interaction: 25
[00000.1] main: sid: 12
[00000.1] main: Face interaction: 26
Am I doing something wrong or is this a bug?