Kaynağa Gözat

mpi/examples/matrix_decomposition/: move my_distrib from mpi_cholesky_codelets to mpi_decomposition_matrix

Nathalie Furmento 12 yıl önce
ebeveyn
işleme
6de8e5b0f4

+ 1 - 7
mpi/examples/matrix_decomposition/mpi_cholesky_codelets.c

@@ -18,6 +18,7 @@
 #include <starpu_mpi.h>
 #include <common/blas.h>
 #include "mpi_decomposition_params.h"
+#include "mpi_decomposition_matrix.h"
 #include "mpi_cholesky_models.h"
 #include "mpi_cholesky_codelets.h"
 #include "mpi_cholesky_kernels.h"
@@ -62,13 +63,6 @@ static struct starpu_codelet cl22 =
 	.model = &chol_model_22
 };
 
-/* Returns the MPI node number where data indexes index is */
-int my_distrib(int x, int y, int nb_nodes)
-{
-	//return (x+y) % nb_nodes;
-	return (x%dblockx)+(y%dblocky)*dblockx;
-}
-
 /*
  *	code to bootstrap the factorization
  *	and construct the DAG

+ 0 - 3
mpi/examples/matrix_decomposition/mpi_cholesky_codelets.h

@@ -19,9 +19,6 @@
 #define __MPI_CHOLESKY_CODELETS_H__
 
 
-/* Returns the MPI node number where data indexes index is */
-int my_distrib(int x, int y, int nb_nodes);
-
 /*
  *	code to bootstrap the factorization
  *	and construct the DAG

+ 8 - 0
mpi/examples/matrix_decomposition/mpi_decomposition_matrix.c

@@ -21,6 +21,14 @@
 #include "mpi_decomposition_params.h"
 #include "mpi_cholesky_codelets.h"
 
+/* Returns the MPI node number where data indexes index is */
+int my_distrib(int x, int y, int nb_nodes)
+{
+	//return (x+y) % nb_nodes;
+	return (x%dblockx)+(y%dblocky)*dblockx;
+}
+
+
 void matrix_display(float ***bmat, int rank)
 {
 	unsigned i,j,x,y;

+ 3 - 0
mpi/examples/matrix_decomposition/mpi_decomposition_matrix.h

@@ -19,6 +19,9 @@
 #ifndef __MPI_CHOLESKY_MATRIX_H__
 #define __MPI_CHOLESKY_MATRIX_H__
 
+/* Returns the MPI node number where data indexes index is */
+int my_distrib(int x, int y, int nb_nodes);
+
 void matrix_display(float ***bmat, int rank);
 void matrix_init(float ****bmat, int rank, int nodes, int alloc_everywhere);
 void matrix_free(float ****bmat, int rank, int nodes, int alloc_everywhere);