diff --git a/control/control.c b/control/control.c index 859b5eb2470c8ea485db28d596f849e3502b339c..0263c4eb64c5fc3072722624a5156f71d94e7f20 100644 --- a/control/control.c +++ b/control/control.c @@ -143,7 +143,7 @@ int MORSE_Finalize(void) magma_finalize(); #endif morse_context_destroy(); - RUNTIME_distributed_barrier(); + RUNTIME_barrier(morse); #if defined(CHAMELEON_USE_MPI) if (!morse->mpi_outer_init) MPI_Finalize(); @@ -213,7 +213,12 @@ int MORSE_Resume(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; } @@ -231,7 +236,12 @@ int MORSE_Distributed_start(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; } @@ -239,7 +249,7 @@ int MORSE_Distributed_stop(void) * * @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) * \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; } @@ -257,7 +267,7 @@ int MORSE_Distributed_size( int *size ) * * @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 ) * \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; } diff --git a/control/descriptor.c b/control/descriptor.c index 364b9220f0c40695a315e103ac1242ea8c87178d..74a60b56fc98dc5955b73dff348ea2f24cfe3795 100644 --- a/control/descriptor.c +++ b/control/descriptor.c @@ -77,7 +77,7 @@ MORSE_desc_t morse_desc_init(MORSE_enum dtyp, int mb, int nb, int bsiz, desc.alloc_mat = 1; desc.register_mat = 1; - RUNTIME_distributed_rank( &(desc.myrank) ); + RUNTIME_comm_rank( &(desc.myrank) ); // Grid size desc.p = p; @@ -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.register_mat = 1; - RUNTIME_distributed_rank( &(desc.myrank) ); + RUNTIME_comm_rank( &(desc.myrank) ); // Grid size desc.p = p; @@ -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.register_mat = 1; - RUNTIME_distributed_rank( &(desc.myrank) ); + RUNTIME_comm_rank( &(desc.myrank) ); // Grid size desc.p = p; diff --git a/example/lapack_to_morse/step6.c b/example/lapack_to_morse/step6.c index 47fa5457730dbdb411ff830d83d15b5d52021ec5..5723f4a725a589dc04c6e6b103bd3dfd08063aa2 100644 --- a/example/lapack_to_morse/step6.c +++ b/example/lapack_to_morse/step6.c @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) { MORSE_Set(MORSE_INNER_BLOCK_SIZE, iparam[IPARAM_IB] ); #if defined(CHAMELEON_USE_MPI) - MORSE_Distributed_size( &NMPIPROC ); + MORSE_Comm_size( &NMPIPROC ); /* Check P */ if ( (iparam[IPARAM_P] > 1) && (NMPIPROC % iparam[IPARAM_P] != 0) ) { diff --git a/include/runtime.h b/include/runtime.h index cd4db6e6faff23535842c4e675e306759f553d82..3e56cf5626a3cf2e472a519985927345102df099 100644 --- a/include/runtime.h +++ b/include/runtime.h @@ -54,9 +54,8 @@ void RUNTIME_finalize_scheduler (MORSE_context_t*); void RUNTIME_barrier (MORSE_context_t*); void RUNTIME_pause (MORSE_context_t*); void RUNTIME_resume (MORSE_context_t*); -void RUNTIME_distributed_rank (int*); -void RUNTIME_distributed_size (int*); -void RUNTIME_distributed_barrier(void); +void RUNTIME_comm_rank (int*); +void RUNTIME_comm_size (int*); /******************************************************************************* * RUNTIME Descriptor diff --git a/runtime/quark/control/runtime_control.c b/runtime/quark/control/runtime_control.c index dfacd18bd0d27e94ae9984758662ec1dbd320638..2ca4d060ce7177339bfc926edfee89be3526d7d0 100644 --- a/runtime/quark/control/runtime_control.c +++ b/runtime/quark/control/runtime_control.c @@ -90,7 +90,7 @@ void RUNTIME_resume( MORSE_context_t *morse ) /******************************************************************************* * This returns the rank of this process **/ -void RUNTIME_distributed_rank( int *rank ) +void RUNTIME_comm_rank( int *rank ) { *rank = 0; return; @@ -99,16 +99,8 @@ void RUNTIME_distributed_rank( int *rank ) /******************************************************************************* * This returns the size of the distributed computation **/ -void RUNTIME_distributed_size( int *size ) +void RUNTIME_comm_size( int *size ) { *size = 1; return; } - -/******************************************************************************* - * Barrier between processes of the distributed computation - **/ -void RUNTIME_distributed_barrier( void ) -{ - return; -} diff --git a/runtime/starpu/control/runtime_control.c b/runtime/starpu/control/runtime_control.c index 16a55300a414b2a3644a34eef637b2a4188401ef..5cce2d738c161836606c01241d75b6bd7681c106 100644 --- a/runtime/starpu/control/runtime_control.c +++ b/runtime/starpu/control/runtime_control.c @@ -184,7 +184,7 @@ void RUNTIME_resume( MORSE_context_t *morse ) /******************************************************************************* * 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(HAVE_STARPU_MPI_RANK) @@ -201,7 +201,7 @@ void RUNTIME_distributed_rank( int *rank ) /******************************************************************************* * 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(HAVE_STARPU_MPI_RANK) @@ -214,14 +214,3 @@ void RUNTIME_distributed_size( int *size ) #endif 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; -} diff --git a/timing/timing.c b/timing/timing.c index c2a1b490e0b8755d231450b533938d6e3d21ce55..ae12c4f706e0641365f7a6cb0f9af4bf3934f19c 100644 --- a/timing/timing.c +++ b/timing/timing.c @@ -622,7 +622,7 @@ main(int argc, char *argv[]) { MORSE_Enable(MORSE_ERRORS); #if defined(CHAMELEON_USE_MPI) - MORSE_Distributed_size( &nbnode ); + MORSE_Comm_size( &nbnode ); iparam[IPARAM_NMPI] = nbnode; /* Check P */ if ( (iparam[IPARAM_P] > 1) &&