Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 95f105e7 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Fix compilation

parent b4d811dd
No related branches found
No related tags found
1 merge request!82Fix issue #43 - Submatrix fields
...@@ -174,21 +174,21 @@ inline static int morse_getblkldd_cm(const MORSE_desc_t *A, int m) { ...@@ -174,21 +174,21 @@ inline static int morse_getblkldd_cm(const MORSE_desc_t *A, int m) {
/** /**
* Internal function to return MPI rank of element A(m,n) with m,n = block indices * Internal function to return MPI rank of element A(m,n) with m,n = block indices
*/ */
inline static int morse_getrankof_2d(const MORSE_desc_t *desc, int m, int n) inline static int morse_getrankof_2d(const MORSE_desc_t *A, int m, int n)
{ {
int mm = m + A->i / A->mb; int mm = m + A->i / A->mb;
int nn = n + A->j / A->nb; int nn = n + A->j / A->nb;
return (mm % desc->p) * desc->q + (nn % desc->q); return (mm % A->p) * A->q + (nn % A->q);
} }
/** /**
* Internal function to return MPI rank of element DIAG(m,0) with m,n = block indices * Internal function to return MPI rank of element DIAG(m,0) with m,n = block indices
*/ */
inline static int morse_getrankof_2d_diag(const MORSE_desc_t *desc, int m, int n) inline static int morse_getrankof_2d_diag(const MORSE_desc_t *A, int m, int n)
{ {
int mm = m + A->i / A->mb; int mm = m + A->i / A->mb;
assert( n == 0 ); assert( n == 0 );
return (mm % desc->p) * desc->q + (mm % desc->q); return (mm % A->p) * A->q + (mm % A->q);
} }
......
...@@ -370,11 +370,11 @@ void RUNTIME_desc_flush( const MORSE_desc_t *desc, ...@@ -370,11 +370,11 @@ void RUNTIME_desc_flush( const MORSE_desc_t *desc,
void RUNTIME_data_flush( const MORSE_sequence_t *sequence, void RUNTIME_data_flush( const MORSE_sequence_t *sequence,
const MORSE_desc_t *A, int m, int n ) const MORSE_desc_t *A, int m, int n )
{ {
int64_t mm = m + (desc->i / desc->mb); int64_t mm = m + (A->i / A->mb);
int64_t nn = n + (desc->j / desc->nb); int64_t nn = n + (A->j / A->nb);
starpu_data_handle_t *ptrtile = desc->schedopt; starpu_data_handle_t *handle = A->schedopt;
ptrtile += ((int64_t)desc->lmt) * nn + mm; handle += ((int64_t)A->lmt) * nn + mm;
if (*handle == NULL) { if (*handle == NULL) {
return; return;
...@@ -419,32 +419,32 @@ void RUNTIME_data_migrate( const MORSE_sequence_t *sequence, ...@@ -419,32 +419,32 @@ void RUNTIME_data_migrate( const MORSE_sequence_t *sequence,
#define STARPU_MAIN_RAM 0 #define STARPU_MAIN_RAM 0
#endif #endif
void *RUNTIME_data_getaddr( const MORSE_desc_t *desc, int m, int n ) void *RUNTIME_data_getaddr( const MORSE_desc_t *A, int m, int n )
{ {
int64_t mm = m + (desc->i / desc->mb); int64_t mm = m + (A->i / A->mb);
int64_t nn = n + (desc->j / desc->nb); int64_t nn = n + (A->j / A->nb);
starpu_data_handle_t *ptrtile = desc->schedopt; starpu_data_handle_t *ptrtile = A->schedopt;
ptrtile += ((int64_t)desc->lmt) * nn + mm; ptrtile += ((int64_t)A->lmt) * nn + mm;
if (*ptrtile == NULL) { if (*ptrtile == NULL) {
int home_node = -1; int home_node = -1;
void *user_ptr = NULL; void *user_ptr = NULL;
int myrank = desc->myrank; int myrank = A->myrank;
int owner = desc->get_rankof( desc, m, n ); int owner = A->get_rankof( A, m, n );
int64_t eltsze = MORSE_Element_Size(desc->dtyp); int64_t eltsze = MORSE_Element_Size(A->dtyp);
int tempmm = (mm == desc->lmt-1) ? (desc->lm - mm * desc->mb) : desc->mb; int tempmm = (mm == A->lmt-1) ? (A->lm - mm * A->mb) : A->mb;
int tempnn = (nn == desc->lnt-1) ? (desc->ln - nn * desc->nb) : desc->nb; int tempnn = (nn == A->lnt-1) ? (A->ln - nn * A->nb) : A->nb;
if ( myrank == owner ) { if ( myrank == owner ) {
user_ptr = desc->get_blkaddr(desc, m, n); user_ptr = A->get_blkaddr(A, m, n);
if ( user_ptr != NULL ) { if ( user_ptr != NULL ) {
home_node = STARPU_MAIN_RAM; home_node = STARPU_MAIN_RAM;
} }
} }
starpu_matrix_data_register( ptrtile, home_node, (uintptr_t) user_ptr, starpu_matrix_data_register( ptrtile, home_node, (uintptr_t) user_ptr,
BLKLDD(desc, m), BLKLDD(A, m),
tempmm, tempnn, eltsze ); tempmm, tempnn, eltsze );
#ifdef HAVE_STARPU_DATA_SET_COORDINATES #ifdef HAVE_STARPU_DATA_SET_COORDINATES
...@@ -453,8 +453,8 @@ void *RUNTIME_data_getaddr( const MORSE_desc_t *desc, int m, int n ) ...@@ -453,8 +453,8 @@ void *RUNTIME_data_getaddr( const MORSE_desc_t *desc, int m, int n )
#if defined(CHAMELEON_USE_MPI) #if defined(CHAMELEON_USE_MPI)
{ {
int64_t block_ind = desc->lmt * nn + mm; int64_t block_ind = A->lmt * nn + mm;
starpu_mpi_data_register(*ptrtile, (desc->id << tag_sep) | (block_ind), owner); starpu_mpi_data_register(*ptrtile, (A->id << tag_sep) | (block_ind), owner);
} }
#endif /* defined(CHAMELEON_USE_MPI) */ #endif /* defined(CHAMELEON_USE_MPI) */
} }
......
...@@ -118,10 +118,13 @@ void RUNTIME_set_reduction_methods(starpu_data_handle_t handle, MORSE_enum dtyp) ...@@ -118,10 +118,13 @@ void RUNTIME_set_reduction_methods(starpu_data_handle_t handle, MORSE_enum dtyp)
#if defined(CHAMELEON_USE_MPI) && defined(HAVE_STARPU_MPI_CACHED_RECEIVE) #if defined(CHAMELEON_USE_MPI) && defined(HAVE_STARPU_MPI_CACHED_RECEIVE)
static inline int static inline int
chameleon_starpu_data_iscached(const MORSE_desc_t *A, int Am, int An) chameleon_starpu_data_iscached(const MORSE_desc_t *A, int m, int n)
{ {
starpu_data_handle_t *ptrtile = (starpu_data_handle_t*)(A->schedopt); int64_t mm = m + (A->i / A->mb);
ptrtile += ((int64_t)(A->lmt) * (int64_t)An + (int64_t)Am); int64_t nn = n + (A->j / A->nb);
starpu_data_handle_t *ptrtile = A->schedopt;
ptrtile += ((int64_t)A->lmt) * nn + mm;
if (!(*ptrtile)) if (!(*ptrtile))
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment