Commit 1aed88db authored by Martin Perdacher's avatar Martin Perdacher

timer

parent 4ff3ea06
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <boost/lockfree/queue.hpp> #include <boost/lockfree/queue.hpp>
#include <boost/atomic.hpp> #include <boost/atomic.hpp>
#include "measure/timer.h"
#include "util/allocation.h" #include "util/allocation.h"
#include "util/arguments.h" #include "util/arguments.h"
#include "util/dataIo.h" #include "util/dataIo.h"
...@@ -37,6 +38,7 @@ int main(int argc, char** argv) { ...@@ -37,6 +38,7 @@ int main(int argc, char** argv) {
size_t M=200; size_t M=200;
size_t blocksize=4000, joinCounts=0; size_t blocksize=4000, joinCounts=0;
double EPS=0.2; double EPS=0.2;
CUtilTimer timer;
parsing_args(argc, argv, &N, &EPS, &D, &threads, &blocksize, filename, &isBinary); parsing_args(argc, argv, &N, &EPS, &D, &threads, &blocksize, filename, &isBinary);
...@@ -56,11 +58,13 @@ int main(int argc, char** argv) { ...@@ -56,11 +58,13 @@ int main(int argc, char** argv) {
read_file(x, N, D, filename, isBinary); read_file(x, N, D, filename, isBinary);
} }
timer.start();
#ifdef COUNT_ONLY #ifdef COUNT_ONLY
blasSelfJoinCountOnly( x, N, D, EPS, threads, blocksize, &joinCounts); blasSelfJoinCountOnly( x, N, D, EPS, threads, blocksize, &joinCounts);
#else #else
blasSelfJoinStoreResults( x, N, D, EPS, threads, blocksize, &joinCounts, queue); blasSelfJoinStoreResults( x, N, D, EPS, threads, blocksize, &joinCounts, queue);
#endif #endif
timer.stop();
#ifndef COUNT_ONLY #ifndef COUNT_ONLY
// if we materialize with a non-blocking linked list, then joincounts are zero // if we materialize with a non-blocking linked list, then joincounts are zero
...@@ -74,7 +78,7 @@ int main(int argc, char** argv) { ...@@ -74,7 +78,7 @@ int main(int argc, char** argv) {
#pragma omp parallel #pragma omp parallel
{ {
if ( omp_get_thread_num() == 0 ){ if ( omp_get_thread_num() == 0 ){
printf("%ld;%ld;%2.12f;%ld;%d;%lu\n", N, D, EPS, blocksize, omp_get_num_threads(), joinCounts); printf("%ld;%ld;%2.12f;%ld;%d;%f;%lu\n", N, D, EPS, blocksize, omp_get_num_threads(), timer.get_time(), joinCounts);
} }
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <boost/lockfree/queue.hpp> #include <boost/lockfree/queue.hpp>
#include <boost/atomic.hpp> #include <boost/atomic.hpp>
#include "measure/timer.h"
#include "util/allocation.h" #include "util/allocation.h"
#include "util/arguments.h" #include "util/arguments.h"
#include "util/dataIo.h" #include "util/dataIo.h"
...@@ -39,6 +40,7 @@ int main(int argc, char** argv) { ...@@ -39,6 +40,7 @@ int main(int argc, char** argv) {
size_t M=200; size_t M=200;
size_t blocksize=4000, joinCounts=0; size_t blocksize=4000, joinCounts=0;
double EPS=0.2; double EPS=0.2;
CUtilTimer timer;
parsing_args_join(argc, argv, &N, &M, &EPS, &D, &threads, &blocksize, filename, filename2, &isBinary); parsing_args_join(argc, argv, &N, &M, &EPS, &D, &threads, &blocksize, filename, filename2, &isBinary);
...@@ -62,12 +64,13 @@ int main(int argc, char** argv) { ...@@ -62,12 +64,13 @@ int main(int argc, char** argv) {
read_file(x2, M, D, filename, isBinary); read_file(x2, M, D, filename, isBinary);
} }
timer.start();
#ifdef COUNT_ONLY #ifdef COUNT_ONLY
blasJoinCountOnly( x1, N, x2, M, D, EPS, threads, blocksize, &joinCounts); blasJoinCountOnly( x1, N, x2, M, D, EPS, threads, blocksize, &joinCounts);
#else #else
// blasJoinStoreResults( x, N, D, EPS, threads, blocksize, &joinCounts, queue); // blasJoinStoreResults( x, N, D, EPS, threads, blocksize, &joinCounts, queue);
#endif #endif
timer.stop();
#ifndef COUNT_ONLY #ifndef COUNT_ONLY
// if we materialize with a non-blocking linked list, then joincounts are zero // if we materialize with a non-blocking linked list, then joincounts are zero
...@@ -81,7 +84,7 @@ int main(int argc, char** argv) { ...@@ -81,7 +84,7 @@ int main(int argc, char** argv) {
#pragma omp parallel #pragma omp parallel
{ {
if ( omp_get_thread_num() == 0 ){ if ( omp_get_thread_num() == 0 ){
printf("%ld;%ld;%2.12f;%ld;%d;%lu\n", N, D, EPS, blocksize, omp_get_num_threads(), joinCounts); printf("%ld;%ld;%2.12f;%ld;%d;%f;%lu\n", N, D, EPS, blocksize, omp_get_num_threads(), timer.get_time(), joinCounts);
} }
} }
......
Markdown is supported
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