diff --git a/tests/testVectorize.c b/tests/testVectorize.c index 78124f00e9b2b11030e1b5d8ee2fa609dd06e7ae..074dd148203d844a029548370eb585d86d4748e7 100644 --- a/tests/testVectorize.c +++ b/tests/testVectorize.c @@ -120,6 +120,7 @@ int main(int argc, char *argv[]) { struct runner runner; char c; static unsigned long long partId = 0; + ticks tic, toc, time; while ((c = getopt(argc, argv, "h:p:r:t:")) != -1) { switch (c) { @@ -172,19 +173,40 @@ int main(int argc, char *argv[]) { zero_particle_fields(ci); zero_particle_fields(cj); + tic = getticks(); + /* Run the test */ runner_dopair1_density(&runner, ci, cj); + toc = getticks(); + time += toc - tic; + /* Dump if necessary */ if (i % 50 == 0) dump_particle_fields("swift_dopair.dat", ci, cj); } + /* Output timing */ + message("SWIFT calculation took %lli ticks." , time / runs); + /* Now perform a brute-force version for accuracy tests */ + + /* Zero the fields */ zero_particle_fields(ci); zero_particle_fields(cj); + + tic = getticks(); + + /* Run the test */ pairs_all_density(&runner, ci, cj); + + toc = getticks(); + + /* Dump */ dump_particle_fields("brute_force.dat", ci, cj); + /* Output timing */ + message("Brute force calculation took %lli ticks." , toc - tic); + /* Clean things to make the sanitizer happy ... */ clean_up(ci); clean_up(cj);