瀏覽代碼

mpi/examples/cholesky: fix default value for parameters dblocky and dblockx

Nathalie Furmento 13 年之前
父節點
當前提交
5a5e9bd49a
共有 2 個文件被更改,包括 17 次插入3 次删除
  1. 14 0
      mpi/examples/cholesky/mpi_cholesky.c
  2. 3 3
      mpi/examples/cholesky/mpi_cholesky.h

+ 14 - 0
mpi/examples/cholesky/mpi_cholesky.c

@@ -202,6 +202,20 @@ int main(int argc, char **argv)
 	starpu_mpi_initialize_extended(&rank, &nodes);
 	starpu_helper_cublas_init();
 
+	if (dblockx == -1 || dblocky == -1)
+	{
+	     if (nodes % 2 == 0)
+	     {
+		  dblockx = nodes/2;
+		  dblocky = 2;
+	     }
+	     else
+	     {
+		  dblockx = nodes;
+		  dblocky = 1;
+	     }
+	}
+
 	unsigned i,j,x,y;
 	bmat = malloc(nblocks * sizeof(float *));
 	for(x=0 ; x<nblocks ; x++)

+ 3 - 3
mpi/examples/cholesky/mpi_cholesky.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  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
@@ -37,8 +37,8 @@ static unsigned nblocks = 16;
 static unsigned nbigblocks = 2;
 static unsigned noprio = 0;
 static unsigned display = 0;
-static unsigned dblockx = 2;
-static unsigned dblocky = 2;
+static unsigned dblockx = -1;
+static unsigned dblocky = -1;
 
 void chol_cpu_codelet_update_u11(void **, void *);
 void chol_cpu_codelet_update_u21(void **, void *);