Exercise 3 for the course "Parallel and distributed systems" of THMMY in AUTH university.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
1.0 KiB

#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include "serial_declarations.h"
int DEVIATION = 31000;
int NUMBER_OF_POINTS = 5000;
int DIMENSIONS = 2;
char* POINTS_FILENAME = "../data/s4";
char* LABELS_FILENAME = "../data/L.bin";
struct timeval startwtime, endwtime;
double seq_time;
int main(int argc, char **argv){
double **vectors, **shifted_points;
char *labels;
parameters params;
//get_args(argc, argv); commented out while in development
init(&vectors, &labels, &params);
//save_matrix(vectors, 0);
// tic
gettimeofday (&startwtime, NULL);
int iterations = meanshift(vectors, &shifted_points, DEVIATION, &params);
printf("Total iterations = %d\n", iterations);
// toc
gettimeofday (&endwtime, NULL);
seq_time = (double)((endwtime.tv_usec - startwtime.tv_usec)/1.0e6 + endwtime.tv_sec - startwtime.tv_sec);
printf("%s wall clock time = %f\n","Mean Shift", seq_time);
//TODO write output points to file -> plot later
//save_matrix(shifted_points, iterations);
}