Mentions légales du service

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

ipiv: Rename ipiv_init and ipiv_reducek functions as INSERT_TASK and make...

ipiv: Rename ipiv_init and ipiv_reducek functions as INSERT_TASK  and make them match the INSERT_TASK API
parent 815fc8c2
No related branches found
No related tags found
1 merge request!434Feature mpi comm user
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* @author Mathieu Faverge * @author Mathieu Faverge
* @author Emmanuel Agullo * @author Emmanuel Agullo
* @author Matthieu Kuhn * @author Matthieu Kuhn
* @date 2023-09-08 * @date 2024-03-16
* @precisions normal z -> s d c * @precisions normal z -> s d c
* *
*/ */
...@@ -147,7 +147,7 @@ chameleon_pzgetrf_panel_facto_percol( struct chameleon_pzgetrf_s *ws, ...@@ -147,7 +147,7 @@ chameleon_pzgetrf_panel_facto_percol( struct chameleon_pzgetrf_s *ws,
if ( h < minmn ) { if ( h < minmn ) {
/* Reduce globally (between MPI processes) */ /* Reduce globally (between MPI processes) */
RUNTIME_ipiv_reducek( options, ipiv, k, h ); INSERT_TASK_ipiv_reducek( options, ipiv, k, h );
} }
} }
...@@ -208,7 +208,7 @@ chameleon_pzgetrf_panel_facto_blocked( struct chameleon_pzgetrf_s *ws, ...@@ -208,7 +208,7 @@ chameleon_pzgetrf_panel_facto_blocked( struct chameleon_pzgetrf_s *ws,
assert( j<= minmn ); assert( j<= minmn );
if ( j < minmn ) { if ( j < minmn ) {
/* Reduce globally (between MPI processes) */ /* Reduce globally (between MPI processes) */
RUNTIME_ipiv_reducek( options, ipiv, k, j ); INSERT_TASK_ipiv_reducek( options, ipiv, k, j );
} }
} }
} }
...@@ -400,7 +400,7 @@ void chameleon_pzgetrf( struct chameleon_pzgetrf_s *ws, ...@@ -400,7 +400,7 @@ void chameleon_pzgetrf( struct chameleon_pzgetrf_s *ws,
if ( (ws->alg == ChamGetrfNoPivPerColumn) || if ( (ws->alg == ChamGetrfNoPivPerColumn) ||
(ws->alg == ChamGetrfNoPiv ) ) (ws->alg == ChamGetrfNoPiv ) )
{ {
RUNTIME_ipiv_init( IPIV ); INSERT_TASK_ipiv_init( &options, IPIV );
} }
RUNTIME_options_finalize( &options, chamctxt ); RUNTIME_options_finalize( &options, chamctxt );
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* @author Samuel Thibault * @author Samuel Thibault
* @author Philippe Swartvagher * @author Philippe Swartvagher
* @author Matthieu Kuhn * @author Matthieu Kuhn
* @date 2023-08-31 * @date 2024-03-16
* *
*/ */
#ifndef _chameleon_runtime_h_ #ifndef _chameleon_runtime_h_
...@@ -707,9 +707,15 @@ void RUNTIME_sdisplay_oneprofile (cham_tasktype_t task); ...@@ -707,9 +707,15 @@ void RUNTIME_sdisplay_oneprofile (cham_tasktype_t task);
void RUNTIME_ipiv_create ( CHAM_ipiv_t *ipiv ); void RUNTIME_ipiv_create ( CHAM_ipiv_t *ipiv );
void RUNTIME_ipiv_destroy( CHAM_ipiv_t *ipiv ); void RUNTIME_ipiv_destroy( CHAM_ipiv_t *ipiv );
void RUNTIME_ipiv_init ( CHAM_ipiv_t *ipiv );
void RUNTIME_ipiv_gather ( CHAM_ipiv_t *desc, int *ipiv, int node ); void RUNTIME_ipiv_gather ( CHAM_ipiv_t *desc, int *ipiv, int node );
void RUNTIME_ipiv_flushk( const RUNTIME_sequence_t *sequence,
const CHAM_ipiv_t *ipiv, int m );
void RUNTIME_ipiv_flush ( const CHAM_ipiv_t *ipiv,
const RUNTIME_sequence_t *sequence );
void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence,
const CHAM_ipiv_t *ipiv, int m );
void *RUNTIME_ipiv_getaddr ( const CHAM_ipiv_t *ipiv, int m ); void *RUNTIME_ipiv_getaddr ( const CHAM_ipiv_t *ipiv, int m );
void *RUNTIME_nextpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h ); void *RUNTIME_nextpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h );
void *RUNTIME_prevpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h ); void *RUNTIME_prevpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h );
...@@ -726,15 +732,6 @@ RUNTIME_pivot_getaddr( CHAM_ipiv_t *ipiv, int m, int h ) { ...@@ -726,15 +732,6 @@ RUNTIME_pivot_getaddr( CHAM_ipiv_t *ipiv, int m, int h ) {
} }
} }
void RUNTIME_ipiv_flushk ( const RUNTIME_sequence_t *sequence,
const CHAM_ipiv_t *ipiv, int m );
void RUNTIME_ipiv_flush ( const CHAM_ipiv_t *ipiv,
const RUNTIME_sequence_t *sequence );
void RUNTIME_ipiv_reducek( const RUNTIME_option_t *options,
CHAM_ipiv_t *ws, int k, int h );
void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence,
const CHAM_ipiv_t *ipiv, int m );
/** /**
* @} * @}
*/ */
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* @author Cedric Augonnet * @author Cedric Augonnet
* @author Florent Pruvost * @author Florent Pruvost
* @author Matthieu Kuhn * @author Matthieu Kuhn
* @date 2024-03-11 * @date 2024-03-16
* *
*/ */
#ifndef _chameleon_tasks_h_ #ifndef _chameleon_tasks_h_
...@@ -162,6 +162,10 @@ void INSERT_TASK_hgemm( const RUNTIME_option_t *options, ...@@ -162,6 +162,10 @@ void INSERT_TASK_hgemm( const RUNTIME_option_t *options,
const CHAM_desc_t *B, int Bm, int Bn, const CHAM_desc_t *B, int Bm, int Bn,
CHAMELEON_Real16_t beta, const CHAM_desc_t *C, int Cm, int Cn ); CHAMELEON_Real16_t beta, const CHAM_desc_t *C, int Cm, int Cn );
void INSERT_TASK_ipiv_init ( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv );
void INSERT_TASK_ipiv_reducek( const RUNTIME_option_t *options,
CHAM_ipiv_t *ws, int k, int h );
void INSERT_TASK_ipiv_to_perm( const RUNTIME_option_t *options, void INSERT_TASK_ipiv_to_perm( const RUNTIME_option_t *options,
int m0, int m, int k, int m0, int m, int k,
const CHAM_ipiv_t *ipivdesc, int ipivk ); const CHAM_ipiv_t *ipivdesc, int ipivk );
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
# @author Florent Pruvost # @author Florent Pruvost
# @author Philippe Virouleau # @author Philippe Virouleau
# @author Matthieu Kuhn # @author Matthieu Kuhn
# @date 2023-09-11 # @date 2024-03-16
# #
### ###
...@@ -126,7 +126,7 @@ set(CODELETS_ZSRC ...@@ -126,7 +126,7 @@ set(CODELETS_ZSRC
set(CODELETS_SRC set(CODELETS_SRC
codelets/codelet_map.c codelets/codelet_map.c
codelets/codelet_ipiv_to_perm.c codelets/codelet_ipiv.c
) )
# Check for the subdirectories # Check for the subdirectories
......
/** /**
* *
* @file openmp/codelet_ipiv_to_perm.c * @file openmp/codelet_ipiv.c
* *
* @copyright 2012-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, * @copyright 2012-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved. * Univ. Bordeaux. All rights reserved.
...@@ -12,13 +12,31 @@ ...@@ -12,13 +12,31 @@
* @version 1.3.0 * @version 1.3.0
* @author Mathieu Faverge * @author Mathieu Faverge
* @author Matthieu Kuhn * @author Matthieu Kuhn
* @date 2023-08-31 * @date 2024-03-16
* *
*/ */
#include "chameleon_openmp.h" #include "chameleon_openmp.h"
#include "chameleon/tasks.h" #include "chameleon/tasks.h"
#include "coreblas.h" #include "coreblas.h"
void INSERT_TASK_ipiv_init( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv )
{
assert( 0 );
(void)options;
(void)ipiv;
}
void INSERT_TASK_ipiv_reducek( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv, int k, int h )
{
assert( 0 );
(void)options;
(void)ipiv;
(void)k;
(void)h;
}
void INSERT_TASK_ipiv_to_perm( const RUNTIME_option_t *options, void INSERT_TASK_ipiv_to_perm( const RUNTIME_option_t *options,
int m0, int m, int k, int m0, int m, int k,
const CHAM_ipiv_t *ipivdesc, int ipivk ) const CHAM_ipiv_t *ipivdesc, int ipivk )
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* @version 1.3.0 * @version 1.3.0
* @author Mathieu Faverge * @author Mathieu Faverge
* @author Matthieu Kuhn * @author Matthieu Kuhn
* @date 2023-08-31 * @date 2024-03-16
* *
*/ */
#include "chameleon_openmp.h" #include "chameleon_openmp.h"
...@@ -97,22 +97,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence, ...@@ -97,22 +97,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence,
(void)m; (void)m;
} }
void RUNTIME_ipiv_reducek( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv, int k, int h )
{
assert( 0 );
(void)options;
(void)ipiv;
(void)k;
(void)h;
}
void RUNTIME_ipiv_init( CHAM_ipiv_t *ipiv )
{
assert( 0 );
(void)ipiv;
}
void RUNTIME_ipiv_gather( CHAM_ipiv_t *desc, int *ipiv, int node ) void RUNTIME_ipiv_gather( CHAM_ipiv_t *desc, int *ipiv, int node )
{ {
assert( 0 ); assert( 0 );
......
/** /**
* *
* @file parsec/codelet_ipiv_to_perm.c * @file parsec/codelet_ipiv.c
* *
* @copyright 2023-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, * @copyright 2023-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved. * Univ. Bordeaux. All rights reserved.
...@@ -12,13 +12,31 @@ ...@@ -12,13 +12,31 @@
* @version 1.3.0 * @version 1.3.0
* @author Mathieu Faverge * @author Mathieu Faverge
* @author Matthieu Kuhn * @author Matthieu Kuhn
* @date 2023-08-31 * @date 2024-03-16
* *
*/ */
#include "chameleon_parsec.h" #include "chameleon_parsec.h"
#include "chameleon/tasks.h" #include "chameleon/tasks.h"
#include "coreblas.h" #include "coreblas.h"
void INSERT_TASK_ipiv_init( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv )
{
assert( 0 );
(void)options;
(void)ipiv;
}
void INSERT_TASK_ipiv_reducek( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv, int k, int h )
{
assert( 0 );
(void)options;
(void)ipiv;
(void)k;
(void)h;
}
static inline int static inline int
CORE_ipiv_to_perm_parsec( parsec_execution_stream_t *context, CORE_ipiv_to_perm_parsec( parsec_execution_stream_t *context,
parsec_task_t *this_task ) parsec_task_t *this_task )
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* @version 1.3.0 * @version 1.3.0
* @author Mathieu Faverge * @author Mathieu Faverge
* @author Matthieu Kuhn * @author Matthieu Kuhn
* @date 2023-08-31 * @date 2024-03-16
* *
*/ */
#include "chameleon_parsec.h" #include "chameleon_parsec.h"
...@@ -97,22 +97,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence, ...@@ -97,22 +97,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence,
(void)m; (void)m;
} }
void RUNTIME_ipiv_reducek( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv, int k, int h )
{
assert( 0 );
(void)options;
(void)ipiv;
(void)k;
(void)h;
}
void RUNTIME_ipiv_init( CHAM_ipiv_t *ipiv )
{
assert( 0 );
(void)ipiv;
}
void RUNTIME_ipiv_gather( CHAM_ipiv_t *desc, int *ipiv, int node ) void RUNTIME_ipiv_gather( CHAM_ipiv_t *desc, int *ipiv, int node )
{ {
assert( 0 ); assert( 0 );
......
/** /**
* *
* @file quark/codelet_ipiv_to_perm.c * @file quark/codelet_ipiv.c
* *
* @copyright 2023-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, * @copyright 2023-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved. * Univ. Bordeaux. All rights reserved.
...@@ -12,13 +12,31 @@ ...@@ -12,13 +12,31 @@
* @version 1.3.0 * @version 1.3.0
* @author Mathieu Faverge * @author Mathieu Faverge
* @author Matthieu Kuhn * @author Matthieu Kuhn
* @date 2023-08-31 * @date 2024-03-16
* *
*/ */
#include "chameleon_quark.h" #include "chameleon_quark.h"
#include "chameleon/tasks.h" #include "chameleon/tasks.h"
#include "coreblas.h" #include "coreblas.h"
void INSERT_TASK_ipiv_init( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv )
{
assert( 0 );
(void)options;
(void)ipiv;
}
void INSERT_TASK_ipiv_reducek( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv, int k, int h )
{
assert( 0 );
(void)options;
(void)ipiv;
(void)k;
(void)h;
}
static inline void static inline void
CORE_ipiv_to_perm_quark( Quark *quark ) CORE_ipiv_to_perm_quark( Quark *quark )
{ {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* @version 1.3.0 * @version 1.3.0
* @author Mathieu Faverge * @author Mathieu Faverge
* @author Matthieu Kuhn * @author Matthieu Kuhn
* @date 2023-08-31 * @date 2024-03-16
* *
*/ */
#include "chameleon_quark.h" #include "chameleon_quark.h"
...@@ -97,22 +97,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence, ...@@ -97,22 +97,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence,
(void)m; (void)m;
} }
void RUNTIME_ipiv_reducek( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv, int k, int h )
{
assert( 0 );
(void)options;
(void)ipiv;
(void)k;
(void)h;
}
void RUNTIME_ipiv_init( CHAM_ipiv_t *ipiv )
{
assert( 0 );
(void)ipiv;
}
void RUNTIME_ipiv_gather( CHAM_ipiv_t *desc, int *ipiv, int node ) void RUNTIME_ipiv_gather( CHAM_ipiv_t *desc, int *ipiv, int node )
{ {
assert( 0 ); assert( 0 );
......
/** /**
* *
* @file starpu/codelet_ipiv_to_perm.c * @file starpu/codelet_ipiv.c
* *
* @copyright 2012-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, * @copyright 2012-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved. * Univ. Bordeaux. All rights reserved.
* *
*** ***
* *
* @brief Chameleon StarPU codelets to convert pivot to permutations * @brief Chameleon StarPU codelets to work with ipiv array
* *
* @version 1.3.0 * @version 1.3.0
* @author Mathieu Faverge * @author Mathieu Faverge
* @author Matthieu Kuhn * @author Matthieu Kuhn
* @date 2023-08-31 * @date 2024-03-16
* *
*/ */
#include "chameleon_starpu.h" #include "chameleon_starpu.h"
#include "runtime_codelets.h" #include "runtime_codelets.h"
static void cl_ipiv_init_cpu_func(void *descr[], void *cl_arg)
{
int *ipiv = (int *)STARPU_VECTOR_GET_PTR(descr[0]);
#if !defined(CHAMELEON_SIMULATION)
{
int i, m0, n;
starpu_codelet_unpack_args( cl_arg, &m0, &n );
for( i=0; i<n; i++ ) {
ipiv[i] = m0 + i + 1;
}
}
#endif
}
struct starpu_codelet cl_ipiv_init = {
.where = STARPU_CPU,
.cpu_func = cl_ipiv_init_cpu_func,
.nbuffers = 1,
};
void INSERT_TASK_ipiv_init( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv )
{
int64_t mt = ipiv->mt;
int64_t mb = ipiv->mb;
int m;
for (m = 0; m < mt; m++) {
starpu_data_handle_t ipiv_src = RUNTIME_ipiv_getaddr( ipiv, m );
int m0 = m * mb;
int n = (m == (mt-1)) ? ipiv->m - m0 : mb;
rt_starpu_insert_task(
&cl_ipiv_init,
STARPU_VALUE, &m0, sizeof(int),
STARPU_VALUE, &n, sizeof(int),
STARPU_W, ipiv_src,
0);
}
}
void INSERT_TASK_ipiv_reducek( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv, int k, int h )
{
starpu_data_handle_t prevpiv = RUNTIME_pivot_getaddr( ipiv, k, h-1 );
#if defined(HAVE_STARPU_MPI_REDUX) && defined(CHAMELEON_USE_MPI)
#if !defined(HAVE_STARPU_MPI_REDUX_WRAPUP)
starpu_data_handle_t nextpiv = RUNTIME_pivot_getaddr( ipiv, k, h );
if ( h < ipiv->n ) {
starpu_mpi_redux_data_prio_tree( options->sequence->comm, nextpiv,
options->priority, 2 /* Binary tree */ );
}
#endif
#endif
/* Invalidate the previous pivot structure for correct initialization in later reuse */
if ( h > 0 ) {
starpu_data_invalidate_submit( prevpiv );
}
(void)options;
}
#if !defined(CHAMELEON_SIMULATION) #if !defined(CHAMELEON_SIMULATION)
static void cl_ipiv_to_perm_cpu_func( void *descr[], void *cl_arg ) static void cl_ipiv_to_perm_cpu_func( void *descr[], void *cl_arg )
{ {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* @version 1.3.0 * @version 1.3.0
* @author Mathieu Faverge * @author Mathieu Faverge
* @author Matthieu Kuhn * @author Matthieu Kuhn
* @date 2023-08-31 * @date 2024-03-16
* *
*/ */
#include "chameleon_starpu.h" #include "chameleon_starpu.h"
...@@ -298,71 +298,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence, ...@@ -298,71 +298,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence,
(void)m; (void)m;
} }
void RUNTIME_ipiv_reducek( const RUNTIME_option_t *options,
CHAM_ipiv_t *ipiv, int k, int h )
{
starpu_data_handle_t nextpiv = RUNTIME_pivot_getaddr( ipiv, k, h );
starpu_data_handle_t prevpiv = RUNTIME_pivot_getaddr( ipiv, k, h-1 );
#if defined(HAVE_STARPU_MPI_REDUX) && defined(CHAMELEON_USE_MPI)
#if !defined(HAVE_STARPU_MPI_REDUX_WRAPUP)
if ( h < ipiv->n ) {
starpu_mpi_redux_data_prio_tree( MPI_COMM_WORLD, nextpiv,
options->priority, 2 /* Binary tree */ );
}
#endif
#endif
/* Invalidate the previous pivot structure for correct initialization in later reuse */
if ( h > 0 ) {
starpu_data_invalidate_submit( prevpiv );
}
(void)options;
}
static void cl_ipiv_init_cpu_func(void *descr[], void *cl_arg)
{
int *ipiv = (int *)STARPU_VECTOR_GET_PTR(descr[0]);
#if !defined(CHAMELEON_SIMULATION)
{
int i, m0, n;
starpu_codelet_unpack_args( cl_arg, &m0, &n );
for( i=0; i<n; i++ ) {
ipiv[i] = m0 + i + 1;
}
}
#endif
}
struct starpu_codelet cl_ipiv_init = {
.where = STARPU_CPU,
.cpu_func = cl_ipiv_init_cpu_func,
.nbuffers = 1,
};
void RUNTIME_ipiv_init( CHAM_ipiv_t *ipiv )
{
int64_t mt = ipiv->mt;
int64_t mb = ipiv->mb;
int m;
for (m = 0; m < mt; m++) {
starpu_data_handle_t ipiv_src = RUNTIME_ipiv_getaddr( ipiv, m );
int m0 = m * mb;
int n = (m == (mt-1)) ? ipiv->m - m0 : mb;
rt_starpu_insert_task(
&cl_ipiv_init,
STARPU_VALUE, &m0, sizeof(int),
STARPU_VALUE, &n, sizeof(int),
STARPU_W, ipiv_src,
0);
}
}
void RUNTIME_ipiv_gather( CHAM_ipiv_t *desc, int *ipiv, int node ) void RUNTIME_ipiv_gather( CHAM_ipiv_t *desc, int *ipiv, int node )
{ {
int64_t mt = desc->mt; int64_t mt = desc->mt;
......
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