Selaa lähdekoodia

mp/examples/cholesky: code cleaning

Nathalie Furmento 13 vuotta sitten
vanhempi
commit
f641bbcf02

+ 2 - 2
mpi/examples/cholesky/mpi_cholesky.c

@@ -161,7 +161,7 @@ static void dw_cholesky(float ***matA, unsigned size, unsigned ld, unsigned nblo
 		double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
 		fprintf(stderr, "Computation took (in ms)\n");
 		fprintf(stdout, "%2.2f\n", timing/1000);
-	
+
 		double flop = (1.0f*size*size*size)/3.0f;
 		fprintf(stderr, "Synthetic GFlops : %2.2f\n", (flop/timing/1000.0f));
 	}
@@ -181,7 +181,7 @@ int main(int argc, char **argv)
 
 	struct starpu_conf conf;
 	starpu_conf_init(&conf);
-	
+
 	conf.sched_policy_name = "heft";
 	conf.calibrate = 1;
 

+ 0 - 39
mpi/examples/cholesky/mpi_cholesky.h

@@ -18,7 +18,6 @@
 #ifndef __DW_CHOLESKY_H__
 #define __DW_CHOLESKY_H__
 
-#include <semaphore.h>
 #include <string.h>
 #include <math.h>
 #include <sys/time.h>
@@ -31,42 +30,8 @@
 #include <common/blas.h>
 #include <starpu.h>
 
-#define NMAXBLOCKS	32
-
-#define TAG11(k)	((starpu_tag_t)( (1ULL<<60) | (unsigned long long)(k)))
-#define TAG21(k,j)	((starpu_tag_t)(((3ULL<<60) | (((unsigned long long)(k))<<32)	\
-					| (unsigned long long)(j))))
-#define TAG22(k,i,j)	((starpu_tag_t)(((4ULL<<60) | ((unsigned long long)(k)<<32) 	\
-					| ((unsigned long long)(i)<<16)	\
-					| (unsigned long long)(j))))
-
-
-
-#define TAG11_AUX(k, prefix)	((starpu_tag_t)( (((unsigned long long)(prefix))<<60)  |  (1ULL<<56) | (unsigned long long)(k)))
-#define TAG21_AUX(k,j, prefix)	((starpu_tag_t)( (((unsigned long long)(prefix))<<60)  			\
-					|  ((3ULL<<56) | (((unsigned long long)(k))<<32)	\
-					| (unsigned long long)(j))))
-#define TAG22_AUX(k,i,j, prefix)    ((starpu_tag_t)(  (((unsigned long long)(prefix))<<60)	\
-					|  ((4ULL<<56) | ((unsigned long long)(k)<<32)  	\
-					| ((unsigned long long)(i)<<16) 			\
-					| (unsigned long long)(j))))
-
 #define BLOCKSIZE	(size/nblocks)
 
-
-#define BLAS3_FLOP(n1,n2,n3)    \
-        (2*((uint64_t)n1)*((uint64_t)n2)*((uint64_t)n3))
-
-typedef struct {
-	starpu_data_handle dataA;
-	unsigned i;
-	unsigned j;
-	unsigned k;
-	unsigned nblocks;
-	unsigned *remaining;
-	sem_t *sem;
-} cl_args;
-
 static unsigned size = 4*1024;
 static unsigned nblocks = 16;
 static unsigned nbigblocks = 8;
@@ -83,10 +48,6 @@ void chol_cublas_codelet_update_u21(void *descr[], void *_args);
 void chol_cublas_codelet_update_u22(void *descr[], void *_args);
 #endif
 
-extern struct starpu_perfmodel_t chol_model_11;
-extern struct starpu_perfmodel_t chol_model_21;
-extern struct starpu_perfmodel_t chol_model_22;
-
 static void __attribute__((unused)) parse_args(int argc, char **argv)
 {
 	int i;

+ 2 - 1
mpi/examples/cholesky/mpi_cholesky_distributed.c

@@ -81,6 +81,7 @@ static void dw_cholesky(float ***matA, unsigned size, unsigned ld, unsigned nblo
 
 	starpu_mpi_barrier(MPI_COMM_WORLD);
 	gettimeofday(&start, NULL);
+
         for(x = 0; x < nblocks ;  x++) {
                 for (y = 0; y < nblocks; y++) {
                         int mpi_rank = my_distrib(x, y, nodes);
@@ -160,7 +161,7 @@ static void dw_cholesky(float ***matA, unsigned size, unsigned ld, unsigned nblo
 		double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
 		fprintf(stderr, "Computation took (in ms)\n");
 		fprintf(stdout, "%2.2f\n", timing/1000);
-	
+
 		double flop = (1.0f*size*size*size)/3.0f;
 		fprintf(stderr, "Synthetic GFlops : %2.2f\n", (flop/timing/1000.0f));
 	}

+ 1 - 6
mpi/examples/cholesky/mpi_cholesky_models.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * 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
@@ -18,11 +18,6 @@
 #include "mpi_cholesky_models.h"
 
 /*
- * As a convention, in that file, descr[0] is represented by A,
- * 				  descr[1] is B ...
- */
-
-/*
  *	Number of flops of Gemm 
  */
 

+ 5 - 1
mpi/examples/cholesky/mpi_cholesky_models.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * 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
@@ -20,4 +20,8 @@
 
 #include <starpu.h>
 
+extern struct starpu_perfmodel_t chol_model_11;
+extern struct starpu_perfmodel_t chol_model_21;
+extern struct starpu_perfmodel_t chol_model_22;
+
 #endif // __DW_CHOLESKY_MODELS_H__