Commit 95f105e7 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Fix compilation

parent b4d811dd
......@@ -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
*/
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 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
*/
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;
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,
void RUNTIME_data_flush( const MORSE_sequence_t *sequence,
const MORSE_desc_t *A, int m, int n )
{
int64_t mm = m + (desc->i / desc->mb);
int64_t nn = n + (desc->j / desc->nb);
int64_t mm = m + (A->i / A->mb);
int64_t nn = n + (A->j / A->nb);
starpu_data_handle_t *ptrtile = desc->schedopt;
ptrtile += ((int64_t)desc->lmt) * nn + mm;
starpu_data_handle_t *handle = A->schedopt;
handle += ((int64_t)A->lmt) * nn + mm;
if (*handle == NULL) {
return;
......@@ -419,32 +419,32 @@ void RUNTIME_data_migrate( const MORSE_sequence_t *sequence,
#define STARPU_MAIN_RAM 0
#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 nn = n + (desc->j / desc->nb);
int64_t mm = m + (A->i / A->mb);
int64_t nn = n + (A->j / A->nb);
starpu_data_handle_t *ptrtile = desc->schedopt;
ptrtile += ((int64_t)desc->lmt) * nn + mm;
starpu_data_handle_t *ptrtile = A->schedopt;
ptrtile += ((int64_t)A->lmt) * nn + mm;
if (*ptrtile == NULL) {
int home_node = -1;
void *user_ptr = NULL;
int myrank = desc->myrank;
int owner = desc->get_rankof( desc, m, n );
int64_t eltsze = MORSE_Element_Size(desc->dtyp);
int tempmm = (mm == desc->lmt-1) ? (desc->lm - mm * desc->mb) : desc->mb;
int tempnn = (nn == desc->lnt-1) ? (desc->ln - nn * desc->nb) : desc->nb;
int myrank = A->myrank;
int owner = A->get_rankof( A, m, n );
int64_t eltsze = MORSE_Element_Size(A->dtyp);
int tempmm = (mm == A->lmt-1) ? (A->lm - mm * A->mb) : A->mb;
int tempnn = (nn == A->lnt-1) ? (A->ln - nn * A->nb) : A->nb;
if ( myrank == owner ) {
user_ptr = desc->get_blkaddr(desc, m, n);
user_ptr = A->get_blkaddr(A, m, n);
if ( user_ptr != NULL ) {
home_node = STARPU_MAIN_RAM;
}
}
starpu_matrix_data_register( ptrtile, home_node, (uintptr_t) user_ptr,
BLKLDD(desc, m),
BLKLDD(A, m),
tempmm, tempnn, eltsze );
#ifdef HAVE_STARPU_DATA_SET_COORDINATES
......@@ -453,8 +453,8 @@ void *RUNTIME_data_getaddr( const MORSE_desc_t *desc, int m, int n )
#if defined(CHAMELEON_USE_MPI)
{
int64_t block_ind = desc->lmt * nn + mm;
starpu_mpi_data_register(*ptrtile, (desc->id << tag_sep) | (block_ind), owner);
int64_t block_ind = A->lmt * nn + mm;
starpu_mpi_data_register(*ptrtile, (A->id << tag_sep) | (block_ind), owner);
}
#endif /* defined(CHAMELEON_USE_MPI) */
}
......
......@@ -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)
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);
ptrtile += ((int64_t)(A->lmt) * (int64_t)An + (int64_t)Am);
int64_t mm = m + (A->i / A->mb);
int64_t nn = n + (A->j / A->nb);
starpu_data_handle_t *ptrtile = A->schedopt;
ptrtile += ((int64_t)A->lmt) * nn + mm;
if (!(*ptrtile))
return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment