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

Added timing information to the vectorization test

parent 0378bf24
Branches
Tags
1 merge request!64Agreed upon version of the density vectorization test
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment