Browse Source

Make more examples compatible with simgrid

Samuel Thibault 10 years ago
parent
commit
c631e5ed44

+ 5 - 5
examples/audio/starpu_audio_processing.c

@@ -59,8 +59,8 @@ float *A;
 starpu_data_handle_t A_handle;
 
 /* For performance evaluation */
-static struct timeval start;
-static struct timeval end;
+static double start;
+static double end;
 static unsigned task_per_worker[STARPU_NMAXWORKERS] = {0};
 
 /* 
@@ -426,7 +426,7 @@ int main(int argc, char **argv)
 	for (iter = 0; iter < niter; iter++)
 		starpu_data_set_wt_mask(starpu_data_get_sub_data(A_handle, 1, iter), 1<<0);
 
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	for (iter = 0; iter < niter; iter++)
 	{
@@ -435,9 +435,9 @@ int main(int argc, char **argv)
 
 	starpu_task_wait_for_all();
 
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
-	double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+	double timing = end - start;
 	fprintf(stderr, "Computation took %2.2f ms\n", timing/1000);
 
 	int worker;

+ 5 - 6
examples/axpy/axpy.c

@@ -166,10 +166,10 @@ int main(int argc, char **argv)
 	starpu_data_partition(_handle_x, &block_filter);
 	starpu_data_partition(_handle_y, &block_filter);
 
-	struct timeval start;
-	struct timeval end;
+	double start;
+	double end;
 
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	unsigned b;
 	for (b = 0; b < NBLOCKS; b++)
@@ -202,9 +202,8 @@ enodev:
 	starpu_data_unregister(_handle_x);
 	starpu_data_unregister(_handle_y);
 
-	gettimeofday(&end, NULL);
-        double timing = (double)((end.tv_sec - start.tv_sec)*1000000 +
-                                        (end.tv_usec - start.tv_usec));
+	end = starpu_timing_now();
+        double timing = end - start;
 
 	FPRINTF(stderr, "timing -> %2.2f us %2.2f MB/s\n", timing, 3*N*sizeof(TYPE)/timing);
 

+ 6 - 6
examples/cg/cg.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2012  Université de Bordeaux 1
+ * Copyright (C) 2010-2012, 2014  Université de Bordeaux 1
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -294,9 +294,9 @@ static int cg(void)
 	FPRINTF(stderr, "*************** INITIAL ************ \n");
 	FPRINTF(stderr, "Delta 0: %e\n", delta_new);
 
-	struct timeval start;
-	struct timeval end;
-	gettimeofday(&start, NULL);
+	double start;
+	double end;
+	start = starpu_timing_now();
 
 	while ((i < i_max) && ((double)delta_new > (double)(eps*eps*delta_0)))
 	{
@@ -351,9 +351,9 @@ static int cg(void)
 		i++;
 	}
 
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
-	double timing = (double)(((double)end.tv_sec - (double)start.tv_sec)*10e6 + ((double)end.tv_usec - (double)start.tv_usec));
+	double timing = end - start;
 	FPRINTF(stderr, "Total timing : %2.2f seconds\n", timing/10e6);
 	FPRINTF(stderr, "Seconds per iteration : %2.2e\n", timing/10e6/i);
 	return 0;

+ 15 - 15
examples/heat/dw_factolu.c

@@ -25,17 +25,17 @@
 #define debug(fmt, ...)
 #endif
 
-struct starpu_perfmodel model_11;
-struct starpu_perfmodel model_12;
-struct starpu_perfmodel model_21;
-struct starpu_perfmodel model_22;
+static struct starpu_perfmodel model_11;
+static struct starpu_perfmodel model_12;
+static struct starpu_perfmodel model_21;
+static struct starpu_perfmodel model_22;
 
-unsigned *advance_11; /* size nblocks, whether the 11 task is done */
-unsigned *advance_12_21; /* size nblocks*nblocks */
-unsigned *advance_22; /* array of nblocks *nblocks*nblocks */
+static unsigned *advance_11; /* size nblocks, whether the 11 task is done */
+static unsigned *advance_12_21; /* size nblocks*nblocks */
+static unsigned *advance_22; /* array of nblocks *nblocks*nblocks */
 
-struct timeval start;
-struct timeval end;
+static double start;
+static double end;
 
 static unsigned no_prio = 0;
 
@@ -618,7 +618,7 @@ void dw_codelet_facto(starpu_data_handle_t dataA, unsigned nblocks)
 	args->nblocks = nblocks;
 	args->dataA = dataA;
 
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	/* inject a new task with this codelet into the system */ 
 	struct starpu_task *task = starpu_task_create();
@@ -635,9 +635,9 @@ void dw_codelet_facto(starpu_data_handle_t dataA, unsigned nblocks)
 
 	starpu_task_wait_for_all();
 
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
-	double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+	double timing = end - start;
 	FPRINTF(stderr, "Computation took (in ms)\n");
 	FPRINTF(stdout, "%2.2f\n", timing/1000);
 
@@ -664,7 +664,7 @@ void dw_codelet_facto_v2(starpu_data_handle_t dataA, unsigned nblocks)
 	args->nblocks = nblocks;
 	args->dataA = dataA;
 
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	/* inject a new task with this codelet into the system */ 
 	struct starpu_task *task = starpu_task_create();
@@ -685,9 +685,9 @@ void dw_codelet_facto_v2(starpu_data_handle_t dataA, unsigned nblocks)
 
 	starpu_task_wait_for_all();
 
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
-	double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+	double timing = end - start;
 	FPRINTF(stderr, "Computation took (in ms)\n");
 	FPRINTF(stdout, "%2.2f\n", timing/1000);
 

+ 6 - 6
examples/heat/dw_factolu_grain.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010-2011, 2014  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
@@ -345,18 +345,18 @@ void dw_factoLU_grain(float *matA, unsigned size, unsigned ld, unsigned nblocks,
 	memcpy(Asaved, matA, ld*ld*sizeof(float));
 #endif
 
-	struct timeval start;
-	struct timeval end;
+	double start;
+	double end;
 
 	/* schedule the codelet */
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	/* that's only ok for powers of 2 yet ! */
 	dw_factoLU_grain_inner(matA, size, (size/nblocks) * nbigblocks, ld, size/nblocks, 0);
 
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
-	double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+	double timing = end - start;
 	FPRINTF(stderr, "Computation took (in ms)\n");
 	FPRINTF(stdout, "%2.2f\n", timing/1000);
 

+ 6 - 6
examples/heat/dw_factolu_tag.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010-2011, 2014  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
@@ -222,8 +222,8 @@ static void dw_codelet_facto_v3(starpu_data_handle_t dataA, unsigned nblocks)
 {
 	int ret;
 
-	struct timeval start;
-	struct timeval end;
+	double start;
+	double end;
 
 	struct starpu_task *entry_task = NULL;
 
@@ -261,7 +261,7 @@ static void dw_codelet_facto_v3(starpu_data_handle_t dataA, unsigned nblocks)
 	}
 
 	/* schedule the codelet */
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 	ret = starpu_task_submit(entry_task);
 	if (STARPU_UNLIKELY(ret == -ENODEV))
 	{
@@ -274,9 +274,9 @@ static void dw_codelet_facto_v3(starpu_data_handle_t dataA, unsigned nblocks)
 	/* stall the application until the end of computations */
 	starpu_tag_wait(TAG11(nblocks-1));
 
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
-	double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+	double timing = end - start;
 	FPRINTF(stderr, "Computation took (in ms)\n");
 	printf("%2.2f\n", timing/1000);
 

+ 5 - 6
examples/incrementer/incrementer.c

@@ -80,10 +80,10 @@ int main(int argc, char **argv)
 		.name = "increment"
 	};
 
-	struct timeval start;
-	struct timeval end;
+	double start;
+	double end;
 
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	unsigned i;
 	for (i = 0; i < niter; i++)
@@ -109,7 +109,7 @@ int main(int argc, char **argv)
 	/* update the array in RAM */
 	starpu_data_unregister(float_array_handle);
 
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
 	FPRINTF(stderr, "array -> %f, %f, %f, %f\n", float_array[0],
                 float_array[1], float_array[2], float_array[3]);
@@ -120,8 +120,7 @@ int main(int argc, char **argv)
 		ret = 1;
 	}
 
-	double timing = (double)((end.tv_sec - start.tv_sec)*1000000 +
-					(end.tv_usec - start.tv_usec));
+	double timing = end - start;
 
 	FPRINTF(stderr, "%u elems took %f ms\n", niter, timing/1000);
 

+ 5 - 5
examples/mandelbrot/mandelbrot.c

@@ -506,10 +506,10 @@ int main(int argc, char **argv)
 
 	unsigned iter = 0;
 
-	struct timeval start, end;
+	double start, end;
 
 	if (demo)
-		gettimeofday(&start, NULL);
+		start = starpu_timing_now();
 
 	while (niter-- != 0)
 	{
@@ -573,15 +573,15 @@ int main(int argc, char **argv)
 				topY = -49.35016705749115;
 				bottomY = 49.64891691946615;
 
-				gettimeofday(&end, NULL);
-				double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+				end = starpu_timing_now();
+				double timing = end - start;
 
 				fprintf(stderr, "Time to generate %u frames : %f s\n", iter, timing/1000000.0);
 				fprintf(stderr, "Average FPS: %f\n", ((double)iter*1e+6)/timing);
 
 				/* Reset counters */
 				iter = 0;
-				gettimeofday(&start, NULL);
+				start = starpu_timing_now();
 			}
 			else
 			{

+ 6 - 6
examples/pi/pi.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011, 2013  Université de Bordeaux 1
+ * Copyright (C) 2010-2011, 2013-2014  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
@@ -156,10 +156,10 @@ int main(int argc, char **argv)
 	
 	starpu_data_partition(cnt_array_handle, &f);
 
-	struct timeval start;
-	struct timeval end;
+	double start;
+	double end;
 
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	for (i = 0; i < ntasks; i++)
 	{
@@ -188,9 +188,9 @@ int main(int argc, char **argv)
 	for (i = 0; i < ntasks; i++)
 		total_cnt += cnt_array[i];
 
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
-	double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+	double timing = end - start;
 
 	unsigned long total_shot_cnt = ntasks * nshot_per_task;
 

+ 5 - 5
examples/pi/pi_redux.c

@@ -340,8 +340,8 @@ int main(int argc, char **argv)
 	starpu_data_set_reduction_methods(shot_cnt_handle,
 					&redux_codelet, &init_codelet);
 
-	struct timeval start;
-	struct timeval end;
+	double start;
+	double end;
 
 	for (i = 0; i < ntasks_warmup; i++)
 	{
@@ -357,7 +357,7 @@ int main(int argc, char **argv)
 	}
 
 
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	for (i = 0; i < ntasks; i++)
 	{
@@ -375,8 +375,8 @@ int main(int argc, char **argv)
 	starpu_data_unregister(shot_cnt_handle);
 	starpu_data_unregister(xy_scratchpad_handle);
 
-	gettimeofday(&end, NULL);
-	double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+	end = starpu_timing_now();
+	double timing = end - start;
 	/* Total surface : Pi * r^ 2 = Pi*1^2, total square surface : 2^2 = 4,
 	 * probability to impact the disk: pi/4 */
 	unsigned long total = (ntasks + ntasks_warmup)*nshot_per_task;

+ 10 - 10
examples/ppm_downscaler/yuv_downscaler.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011, 2013  Université de Bordeaux 1
+ * Copyright (C) 2010-2011, 2013-2014  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
@@ -27,13 +27,13 @@
 
 #include "yuv_downscaler.h"
 
-struct timeval start;
-struct timeval end;
+static double start;
+static double end;
 
-const char *filename_in_default = "hugefile.2s.yuv";
-const char *filename_out_default = "hugefile.2s.out.yuv";
-char filename_in[1024];
-char filename_out[1024];
+static const char *filename_in_default = "hugefile.2s.yuv";
+static const char *filename_out_default = "hugefile.2s.out.yuv";
+static char filename_in[1024];
+static char filename_out[1024];
 
 void parse_args(int argc, char **argv)
 {
@@ -206,7 +206,7 @@ int main(int argc, char **argv)
 	unsigned ntasks = (nblocks_y + 2*nblocks_uv)*nframes;
 
 	fprintf(stderr, "Start computation: there will be %u tasks for %u frames\n", ntasks, nframes);
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	/* do the computation */
 	for (frame = 0; frame < nframes; frame++)
@@ -275,9 +275,9 @@ int main(int argc, char **argv)
 	/* There is an implicit barrier: the unregister methods will block
 	 * until the computation is done and that the result was put back into
 	 * memory. */
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
-	double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+	double timing = end - start;
 	fprintf(stderr, "Computation took %f seconds\n", timing/1000000);
 	fprintf(stderr, "FPS %f\n", (1000000*nframes)/timing);
 

+ 16 - 16
examples/spmv/dw_block_spmv.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2012  Université de Bordeaux 1
+ * Copyright (C) 2009-2012, 2014  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
@@ -21,25 +21,25 @@
 #include "matrix_market/mm_to_bcsr.h"
 #define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
 
-struct timeval start;
-struct timeval end;
+static double start;
+static double end;
 
-sem_t sem;
+static sem_t sem;
 
-unsigned c = 256;
-unsigned r = 256;
+static unsigned c = 256;
+static unsigned r = 256;
 
-unsigned remainingtasks = -1;
+static unsigned remainingtasks = -1;
 
-starpu_data_handle_t sparse_matrix;
-starpu_data_handle_t vector_in, vector_out;
+static starpu_data_handle_t sparse_matrix;
+static starpu_data_handle_t vector_in, vector_out;
 
-uint32_t size;
-char *inputfile;
-bcsr_t *bcsr_matrix;
+static uint32_t size;
+static char *inputfile;
+static bcsr_t *bcsr_matrix;
 
-float *vector_in_ptr;
-float *vector_out_ptr;
+static float *vector_in_ptr;
+static float *vector_out_ptr;
 
 void create_data(void)
 {
@@ -96,7 +96,7 @@ void init_problem_callback(void *arg)
 	if ( val == 0 )
 	{
 		printf("DONE ...\n");
-		gettimeofday(&end, NULL);
+		end = starpu_timing_now();
 
 /*		starpu_data_unpartition(sparse_matrix, STARPU_MAIN_RAM); */
 		starpu_data_unpartition(vector_out, STARPU_MAIN_RAM);
@@ -181,7 +181,7 @@ void launch_spmv_codelets(void)
 	uint32_t *rowptr = starpu_bcsr_get_local_rowptr(sparse_matrix);
 	uint32_t *colind = starpu_bcsr_get_local_colind(sparse_matrix);
 
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	unsigned loop;
 	for (loop = 0; loop < NSPMV; loop++)

+ 4 - 4
examples/spmv/spmv.c

@@ -115,7 +115,7 @@ int main(int argc, char **argv)
 	int ret;
 	unsigned part;
 	double timing;
-	struct timeval start, end;
+	double start, end;
 	unsigned row, pos;
 	unsigned ind;
 
@@ -213,7 +213,7 @@ int main(int argc, char **argv)
 	compile_spmv_opencl_kernel();
 #endif
 
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	/*
 	 *	Create and submit StarPU tasks
@@ -236,7 +236,7 @@ int main(int argc, char **argv)
 	}
 
 	starpu_task_wait_for_all();
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
 	/*
 	 *	Unregister the CSR matrix and the output vector
@@ -270,7 +270,7 @@ int main(int argc, char **argv)
 	 */
 	starpu_shutdown();
 
-	timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+	timing = end - start;
 	FPRINTF(stderr, "Computation took (in ms)\n");
 	FPRINTF(stdout, "%2.2f\n", timing/1000);
 

+ 5 - 5
mpi/examples/matrix_decomposition/mpi_cholesky_codelets.c

@@ -67,8 +67,8 @@ static struct starpu_codelet cl22 =
  */
 void dw_cholesky(float ***matA, unsigned ld, int rank, int nodes, double *timing, double *flops)
 {
-	struct timeval start;
-	struct timeval end;
+	double start;
+	double end;
 	starpu_data_handle_t **data_handles;
 	unsigned x,y,i,j,k;
 
@@ -104,7 +104,7 @@ void dw_cholesky(float ***matA, unsigned ld, int rank, int nodes, double *timing
 	}
 
 	starpu_mpi_barrier(MPI_COMM_WORLD);
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	for (k = 0; k < nblocks; k++)
 	{
@@ -161,11 +161,11 @@ void dw_cholesky(float ***matA, unsigned ld, int rank, int nodes, double *timing
 	free(data_handles);
 
 	starpu_mpi_barrier(MPI_COMM_WORLD);
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
 	if (rank == 0)
 	{
-		*timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+		*timing = end - start;
 		*flops = (1.0f*size*size*size)/3.0f;
 	}
 }

+ 6 - 6
mpi/examples/mpi_lu/pxlu.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011  Université de Bordeaux 1
+ * Copyright (C) 2010, 2011, 2014  Université de Bordeaux 1
  * Copyright (C) 2010, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -821,8 +821,8 @@ static void wait_termination(void)
 
 double STARPU_PLU(plu_main)(unsigned _nblocks, int _rank, int _world_size)
 {
-	struct timeval start;
-	struct timeval end;
+	double start;
+	double end;
 
 	nblocks = _nblocks;
 	rank = _rank;
@@ -854,15 +854,15 @@ double STARPU_PLU(plu_main)(unsigned _nblocks, int _rank, int _world_size)
 	STARPU_ASSERT(barrier_ret == MPI_SUCCESS);
 
 	/* schedule the codelet */
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	starpu_tag_notify_from_apps(STARPU_TAG_INIT);
 
 	wait_termination();
 	
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
-	double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+	double timing = end - start;
 	
 //	fprintf(stderr, "RANK %d -> took %f ms\n", rank, timing/1000);
 	

+ 5 - 5
mpi/examples/mpi_lu/pxlu_implicit.c

@@ -115,8 +115,8 @@ static void create_task_22(unsigned k, unsigned i, unsigned j)
 
 double STARPU_PLU(plu_main)(unsigned _nblocks, int _rank, int _world_size)
 {
-	struct timeval start;
-	struct timeval end;
+	double start;
+	double end;
 
 	nblocks = _nblocks;
 	rank = _rank;
@@ -127,7 +127,7 @@ double STARPU_PLU(plu_main)(unsigned _nblocks, int _rank, int _world_size)
 
 	starpu_mpi_barrier(MPI_COMM_WORLD);
 
-	gettimeofday(&start, NULL);
+	start = starpu_timing_now();
 
 	for (k = 0; k < nblocks; k++)
 	{
@@ -160,9 +160,9 @@ double STARPU_PLU(plu_main)(unsigned _nblocks, int _rank, int _world_size)
 
 	starpu_mpi_barrier(MPI_COMM_WORLD);
 
-	gettimeofday(&end, NULL);
+	end = starpu_timing_now();
 
-	double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+	double timing = end - start;
 	
 //	fprintf(stderr, "RANK %d -> took %f ms\n", rank, timing/1000);