Commit a5069068 authored by THIBAULT Samuel's avatar THIBAULT Samuel

Rename distributed_size/rank into comm_size/rank, and use RUNTIME_barrier

instead of introducing RUNTIME_distributed_barrier
parent 91e7e27a
...@@ -143,7 +143,7 @@ int MORSE_Finalize(void) ...@@ -143,7 +143,7 @@ int MORSE_Finalize(void)
magma_finalize(); magma_finalize();
#endif #endif
morse_context_destroy(); morse_context_destroy();
RUNTIME_distributed_barrier(); RUNTIME_barrier(morse);
#if defined(CHAMELEON_USE_MPI) #if defined(CHAMELEON_USE_MPI)
if (!morse->mpi_outer_init) if (!morse->mpi_outer_init)
MPI_Finalize(); MPI_Finalize();
...@@ -213,7 +213,12 @@ int MORSE_Resume(void) ...@@ -213,7 +213,12 @@ int MORSE_Resume(void)
*****************************************************************************/ *****************************************************************************/
int MORSE_Distributed_start(void) int MORSE_Distributed_start(void)
{ {
RUNTIME_distributed_barrier (); MORSE_context_t *morse = morse_context_self();
if (morse == NULL) {
morse_error("MORSE_Finalize()", "MORSE not initialized");
return MORSE_ERR_NOT_INITIALIZED;
}
RUNTIME_barrier (morse);
return MORSE_SUCCESS; return MORSE_SUCCESS;
} }
...@@ -231,7 +236,12 @@ int MORSE_Distributed_start(void) ...@@ -231,7 +236,12 @@ int MORSE_Distributed_start(void)
*****************************************************************************/ *****************************************************************************/
int MORSE_Distributed_stop(void) int MORSE_Distributed_stop(void)
{ {
RUNTIME_distributed_barrier (); MORSE_context_t *morse = morse_context_self();
if (morse == NULL) {
morse_error("MORSE_Finalize()", "MORSE not initialized");
return MORSE_ERR_NOT_INITIALIZED;
}
RUNTIME_barrier (morse);
return MORSE_SUCCESS; return MORSE_SUCCESS;
} }
...@@ -239,7 +249,7 @@ int MORSE_Distributed_stop(void) ...@@ -239,7 +249,7 @@ int MORSE_Distributed_stop(void)
* *
* @ingroup Control * @ingroup Control
* *
* MORSE_Distributed_size - Return the size of the distributed computation * MORSE_Comm_size - Return the size of the distributed computation
* *
****************************************************************************** ******************************************************************************
* *
...@@ -247,9 +257,9 @@ int MORSE_Distributed_stop(void) ...@@ -247,9 +257,9 @@ int MORSE_Distributed_stop(void)
* \retval MORSE_SUCCESS successful exit * \retval MORSE_SUCCESS successful exit
* *
*****************************************************************************/ *****************************************************************************/
int MORSE_Distributed_size( int *size ) int MORSE_Comm_size( int *size )
{ {
RUNTIME_distributed_size (size); RUNTIME_comm_size (size);
return MORSE_SUCCESS; return MORSE_SUCCESS;
} }
...@@ -257,7 +267,7 @@ int MORSE_Distributed_size( int *size ) ...@@ -257,7 +267,7 @@ int MORSE_Distributed_size( int *size )
* *
* @ingroup Control * @ingroup Control
* *
* MORSE_Distributed_rank - Return the rank of the distributed computation * MORSE_Comm_rank - Return the rank of the distributed computation
* *
****************************************************************************** ******************************************************************************
* *
...@@ -265,8 +275,8 @@ int MORSE_Distributed_size( int *size ) ...@@ -265,8 +275,8 @@ int MORSE_Distributed_size( int *size )
* \retval MORSE_SUCCESS successful exit * \retval MORSE_SUCCESS successful exit
* *
*****************************************************************************/ *****************************************************************************/
int MORSE_Distributed_rank( int *rank ) int MORSE_Comm_rank( int *rank )
{ {
RUNTIME_distributed_rank (rank); RUNTIME_comm_rank (rank);
return MORSE_SUCCESS; return MORSE_SUCCESS;
} }
...@@ -77,7 +77,7 @@ MORSE_desc_t morse_desc_init(MORSE_enum dtyp, int mb, int nb, int bsiz, ...@@ -77,7 +77,7 @@ MORSE_desc_t morse_desc_init(MORSE_enum dtyp, int mb, int nb, int bsiz,
desc.alloc_mat = 1; desc.alloc_mat = 1;
desc.register_mat = 1; desc.register_mat = 1;
RUNTIME_distributed_rank( &(desc.myrank) ); RUNTIME_comm_rank( &(desc.myrank) );
// Grid size // Grid size
desc.p = p; desc.p = p;
...@@ -162,7 +162,7 @@ MORSE_desc_t morse_desc_init_diag(MORSE_enum dtyp, int mb, int nb, int bsiz, ...@@ -162,7 +162,7 @@ MORSE_desc_t morse_desc_init_diag(MORSE_enum dtyp, int mb, int nb, int bsiz,
desc.alloc_mat = 1; desc.alloc_mat = 1;
desc.register_mat = 1; desc.register_mat = 1;
RUNTIME_distributed_rank( &(desc.myrank) ); RUNTIME_comm_rank( &(desc.myrank) );
// Grid size // Grid size
desc.p = p; desc.p = p;
...@@ -250,7 +250,7 @@ MORSE_desc_t morse_desc_init_user(MORSE_enum dtyp, int mb, int nb, int bsiz, ...@@ -250,7 +250,7 @@ MORSE_desc_t morse_desc_init_user(MORSE_enum dtyp, int mb, int nb, int bsiz,
desc.alloc_mat = 1; desc.alloc_mat = 1;
desc.register_mat = 1; desc.register_mat = 1;
RUNTIME_distributed_rank( &(desc.myrank) ); RUNTIME_comm_rank( &(desc.myrank) );
// Grid size // Grid size
desc.p = p; desc.p = p;
......
...@@ -110,7 +110,7 @@ int main(int argc, char *argv[]) { ...@@ -110,7 +110,7 @@ int main(int argc, char *argv[]) {
MORSE_Set(MORSE_INNER_BLOCK_SIZE, iparam[IPARAM_IB] ); MORSE_Set(MORSE_INNER_BLOCK_SIZE, iparam[IPARAM_IB] );
#if defined(CHAMELEON_USE_MPI) #if defined(CHAMELEON_USE_MPI)
MORSE_Distributed_size( &NMPIPROC ); MORSE_Comm_size( &NMPIPROC );
/* Check P */ /* Check P */
if ( (iparam[IPARAM_P] > 1) && if ( (iparam[IPARAM_P] > 1) &&
(NMPIPROC % iparam[IPARAM_P] != 0) ) { (NMPIPROC % iparam[IPARAM_P] != 0) ) {
......
...@@ -54,9 +54,8 @@ void RUNTIME_finalize_scheduler (MORSE_context_t*); ...@@ -54,9 +54,8 @@ void RUNTIME_finalize_scheduler (MORSE_context_t*);
void RUNTIME_barrier (MORSE_context_t*); void RUNTIME_barrier (MORSE_context_t*);
void RUNTIME_pause (MORSE_context_t*); void RUNTIME_pause (MORSE_context_t*);
void RUNTIME_resume (MORSE_context_t*); void RUNTIME_resume (MORSE_context_t*);
void RUNTIME_distributed_rank (int*); void RUNTIME_comm_rank (int*);
void RUNTIME_distributed_size (int*); void RUNTIME_comm_size (int*);
void RUNTIME_distributed_barrier(void);
/******************************************************************************* /*******************************************************************************
* RUNTIME Descriptor * RUNTIME Descriptor
......
...@@ -90,7 +90,7 @@ void RUNTIME_resume( MORSE_context_t *morse ) ...@@ -90,7 +90,7 @@ void RUNTIME_resume( MORSE_context_t *morse )
/******************************************************************************* /*******************************************************************************
* This returns the rank of this process * This returns the rank of this process
**/ **/
void RUNTIME_distributed_rank( int *rank ) void RUNTIME_comm_rank( int *rank )
{ {
*rank = 0; *rank = 0;
return; return;
...@@ -99,16 +99,8 @@ void RUNTIME_distributed_rank( int *rank ) ...@@ -99,16 +99,8 @@ void RUNTIME_distributed_rank( int *rank )
/******************************************************************************* /*******************************************************************************
* This returns the size of the distributed computation * This returns the size of the distributed computation
**/ **/
void RUNTIME_distributed_size( int *size ) void RUNTIME_comm_size( int *size )
{ {
*size = 1; *size = 1;
return; return;
} }
/*******************************************************************************
* Barrier between processes of the distributed computation
**/
void RUNTIME_distributed_barrier( void )
{
return;
}
...@@ -184,7 +184,7 @@ void RUNTIME_resume( MORSE_context_t *morse ) ...@@ -184,7 +184,7 @@ void RUNTIME_resume( MORSE_context_t *morse )
/******************************************************************************* /*******************************************************************************
* This returns the rank of this process * This returns the rank of this process
**/ **/
void RUNTIME_distributed_rank( int *rank ) void RUNTIME_comm_rank( int *rank )
{ {
#if defined(CHAMELEON_USE_MPI) #if defined(CHAMELEON_USE_MPI)
# if defined(HAVE_STARPU_MPI_RANK) # if defined(HAVE_STARPU_MPI_RANK)
...@@ -201,7 +201,7 @@ void RUNTIME_distributed_rank( int *rank ) ...@@ -201,7 +201,7 @@ void RUNTIME_distributed_rank( int *rank )
/******************************************************************************* /*******************************************************************************
* This returns the size of the distributed computation * This returns the size of the distributed computation
**/ **/
void RUNTIME_distributed_size( int *size ) void RUNTIME_comm_size( int *size )
{ {
#if defined(CHAMELEON_USE_MPI) #if defined(CHAMELEON_USE_MPI)
# if defined(HAVE_STARPU_MPI_RANK) # if defined(HAVE_STARPU_MPI_RANK)
...@@ -214,14 +214,3 @@ void RUNTIME_distributed_size( int *size ) ...@@ -214,14 +214,3 @@ void RUNTIME_distributed_size( int *size )
#endif #endif
return; return;
} }
/*******************************************************************************
* Barrier between processes of the distributed computation
**/
void RUNTIME_distributed_barrier( void )
{
#if defined(CHAMELEON_USE_MPI)
starpu_mpi_barrier(MPI_COMM_WORLD);
#endif
return;
}
...@@ -622,7 +622,7 @@ main(int argc, char *argv[]) { ...@@ -622,7 +622,7 @@ main(int argc, char *argv[]) {
MORSE_Enable(MORSE_ERRORS); MORSE_Enable(MORSE_ERRORS);
#if defined(CHAMELEON_USE_MPI) #if defined(CHAMELEON_USE_MPI)
MORSE_Distributed_size( &nbnode ); MORSE_Comm_size( &nbnode );
iparam[IPARAM_NMPI] = nbnode; iparam[IPARAM_NMPI] = nbnode;
/* Check P */ /* Check P */
if ( (iparam[IPARAM_P] > 1) && if ( (iparam[IPARAM_P] > 1) &&
......
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