diff --git a/compute/pzgetrf.c b/compute/pzgetrf.c index 108c4a2010849721a5ae0f2efc1291c4a017746f..64552d74636c4919a6283f4a856a10eb5c2f05f2 100644 --- a/compute/pzgetrf.c +++ b/compute/pzgetrf.c @@ -16,7 +16,7 @@ * @author Mathieu Faverge * @author Emmanuel Agullo * @author Matthieu Kuhn - * @date 2023-09-08 + * @date 2024-03-16 * @precisions normal z -> s d c * */ @@ -147,7 +147,7 @@ chameleon_pzgetrf_panel_facto_percol( struct chameleon_pzgetrf_s *ws, if ( h < minmn ) { /* 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, assert( j<= minmn ); if ( j < minmn ) { /* 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, if ( (ws->alg == ChamGetrfNoPivPerColumn) || (ws->alg == ChamGetrfNoPiv ) ) { - RUNTIME_ipiv_init( IPIV ); + INSERT_TASK_ipiv_init( &options, IPIV ); } RUNTIME_options_finalize( &options, chamctxt ); diff --git a/include/chameleon/runtime.h b/include/chameleon/runtime.h index dfe7bb3d91af2f64551928f5b6edbbd4e57b1d01..1ee2e2b0b05b0693264c4f5f7491243d7b3a2c42 100644 --- a/include/chameleon/runtime.h +++ b/include/chameleon/runtime.h @@ -18,7 +18,7 @@ * @author Samuel Thibault * @author Philippe Swartvagher * @author Matthieu Kuhn - * @date 2023-08-31 + * @date 2024-03-16 * */ #ifndef _chameleon_runtime_h_ @@ -707,9 +707,15 @@ void RUNTIME_sdisplay_oneprofile (cham_tasktype_t task); void RUNTIME_ipiv_create ( 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_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_nextpiv_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 ) { } } -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 ); - /** * @} */ diff --git a/include/chameleon/tasks.h b/include/chameleon/tasks.h index b17e6bc32a8bd6b200e0122e4ac2131c12828cc4..aa21e99d8f85c82b9484da1aa7d599d995b66bb4 100644 --- a/include/chameleon/tasks.h +++ b/include/chameleon/tasks.h @@ -16,7 +16,7 @@ * @author Cedric Augonnet * @author Florent Pruvost * @author Matthieu Kuhn - * @date 2024-03-11 + * @date 2024-03-16 * */ #ifndef _chameleon_tasks_h_ @@ -162,6 +162,10 @@ void INSERT_TASK_hgemm( const RUNTIME_option_t *options, const CHAM_desc_t *B, int Bm, int Bn, 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, int m0, int m, int k, const CHAM_ipiv_t *ipivdesc, int ipivk ); diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index fd220cc8905e326f1aef57c261e09751d445d705..e834403398f8bfc2e370d6b475e26e7d89c9312a 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -24,7 +24,7 @@ # @author Florent Pruvost # @author Philippe Virouleau # @author Matthieu Kuhn -# @date 2023-09-11 +# @date 2024-03-16 # ### @@ -126,7 +126,7 @@ set(CODELETS_ZSRC set(CODELETS_SRC codelets/codelet_map.c - codelets/codelet_ipiv_to_perm.c + codelets/codelet_ipiv.c ) # Check for the subdirectories diff --git a/runtime/openmp/codelets/codelet_ipiv_to_perm.c b/runtime/openmp/codelets/codelet_ipiv.c similarity index 68% rename from runtime/openmp/codelets/codelet_ipiv_to_perm.c rename to runtime/openmp/codelets/codelet_ipiv.c index 11233b976dd9e3970743bc8f707afbb693bf55b4..d6386bb58d09d584cc066371cb18bd6be3fad3b7 100644 --- a/runtime/openmp/codelets/codelet_ipiv_to_perm.c +++ b/runtime/openmp/codelets/codelet_ipiv.c @@ -1,6 +1,6 @@ /** * - * @file openmp/codelet_ipiv_to_perm.c + * @file openmp/codelet_ipiv.c * * @copyright 2012-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, * Univ. Bordeaux. All rights reserved. @@ -12,13 +12,31 @@ * @version 1.3.0 * @author Mathieu Faverge * @author Matthieu Kuhn - * @date 2023-08-31 + * @date 2024-03-16 * */ #include "chameleon_openmp.h" #include "chameleon/tasks.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, int m0, int m, int k, const CHAM_ipiv_t *ipivdesc, int ipivk ) diff --git a/runtime/openmp/control/runtime_descriptor_ipiv.c b/runtime/openmp/control/runtime_descriptor_ipiv.c index 0743412c4d521275c5983053cc0878f0ad04b24a..32b74e4504efbb4d4e26a357d0b6556c042e44d9 100644 --- a/runtime/openmp/control/runtime_descriptor_ipiv.c +++ b/runtime/openmp/control/runtime_descriptor_ipiv.c @@ -12,7 +12,7 @@ * @version 1.3.0 * @author Mathieu Faverge * @author Matthieu Kuhn - * @date 2023-08-31 + * @date 2024-03-16 * */ #include "chameleon_openmp.h" @@ -97,22 +97,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence, (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 ) { assert( 0 ); diff --git a/runtime/parsec/codelets/codelet_ipiv_to_perm.c b/runtime/parsec/codelets/codelet_ipiv.c similarity index 79% rename from runtime/parsec/codelets/codelet_ipiv_to_perm.c rename to runtime/parsec/codelets/codelet_ipiv.c index 275200c6e77932c63750b78a7874f1348051e6e4..b9ac7e05468ba805c97dac09f75ef1c37c63f928 100644 --- a/runtime/parsec/codelets/codelet_ipiv_to_perm.c +++ b/runtime/parsec/codelets/codelet_ipiv.c @@ -1,6 +1,6 @@ /** * - * @file parsec/codelet_ipiv_to_perm.c + * @file parsec/codelet_ipiv.c * * @copyright 2023-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, * Univ. Bordeaux. All rights reserved. @@ -12,13 +12,31 @@ * @version 1.3.0 * @author Mathieu Faverge * @author Matthieu Kuhn - * @date 2023-08-31 + * @date 2024-03-16 * */ #include "chameleon_parsec.h" #include "chameleon/tasks.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 CORE_ipiv_to_perm_parsec( parsec_execution_stream_t *context, parsec_task_t *this_task ) diff --git a/runtime/parsec/control/runtime_descriptor_ipiv.c b/runtime/parsec/control/runtime_descriptor_ipiv.c index 970ad741c22247922334198c29bd157527cc354f..b286df9d29cb03c264a5f73715a7b03a0234abd0 100644 --- a/runtime/parsec/control/runtime_descriptor_ipiv.c +++ b/runtime/parsec/control/runtime_descriptor_ipiv.c @@ -12,7 +12,7 @@ * @version 1.3.0 * @author Mathieu Faverge * @author Matthieu Kuhn - * @date 2023-08-31 + * @date 2024-03-16 * */ #include "chameleon_parsec.h" @@ -97,22 +97,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence, (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 ) { assert( 0 ); diff --git a/runtime/quark/codelets/codelet_ipiv_to_perm.c b/runtime/quark/codelets/codelet_ipiv.c similarity index 75% rename from runtime/quark/codelets/codelet_ipiv_to_perm.c rename to runtime/quark/codelets/codelet_ipiv.c index 361c58336266654946ec7678e8f2a265cb5e9c26..ab982faf04523af148f8e8444a6469681a4a0ea6 100644 --- a/runtime/quark/codelets/codelet_ipiv_to_perm.c +++ b/runtime/quark/codelets/codelet_ipiv.c @@ -1,6 +1,6 @@ /** * - * @file quark/codelet_ipiv_to_perm.c + * @file quark/codelet_ipiv.c * * @copyright 2023-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, * Univ. Bordeaux. All rights reserved. @@ -12,13 +12,31 @@ * @version 1.3.0 * @author Mathieu Faverge * @author Matthieu Kuhn - * @date 2023-08-31 + * @date 2024-03-16 * */ #include "chameleon_quark.h" #include "chameleon/tasks.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 CORE_ipiv_to_perm_quark( Quark *quark ) { diff --git a/runtime/quark/control/runtime_descriptor_ipiv.c b/runtime/quark/control/runtime_descriptor_ipiv.c index f3ea5a1135947afd3dad13d31c459bf86e098a0c..6d5208fa238a6eb97af865b3ea889df7adb4be2d 100644 --- a/runtime/quark/control/runtime_descriptor_ipiv.c +++ b/runtime/quark/control/runtime_descriptor_ipiv.c @@ -12,7 +12,7 @@ * @version 1.3.0 * @author Mathieu Faverge * @author Matthieu Kuhn - * @date 2023-08-31 + * @date 2024-03-16 * */ #include "chameleon_quark.h" @@ -97,22 +97,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence, (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 ) { assert( 0 ); diff --git a/runtime/starpu/codelets/codelet_ipiv.c b/runtime/starpu/codelets/codelet_ipiv.c new file mode 100644 index 0000000000000000000000000000000000000000..64e6031391793de8dc829e2ac47eddabfdba7be5 --- /dev/null +++ b/runtime/starpu/codelets/codelet_ipiv.c @@ -0,0 +1,135 @@ +/** + * + * @file starpu/codelet_ipiv.c + * + * @copyright 2012-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, + * Univ. Bordeaux. All rights reserved. + * + *** + * + * @brief Chameleon StarPU codelets to work with ipiv array + * + * @version 1.3.0 + * @author Mathieu Faverge + * @author Matthieu Kuhn + * @date 2024-03-16 + * + */ +#include "chameleon_starpu.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) +static void cl_ipiv_to_perm_cpu_func( void *descr[], void *cl_arg ) +{ + int m0, m, k; + int *ipiv, *perm, *invp; + + starpu_codelet_unpack_args( cl_arg, &m0, &m, &k ); + + ipiv = (int*)STARPU_VECTOR_GET_PTR(descr[0]); + perm = (int*)STARPU_VECTOR_GET_PTR(descr[1]); + invp = (int*)STARPU_VECTOR_GET_PTR(descr[2]); + + CORE_ipiv_to_perm( m0, m, k, ipiv, perm, invp ); +} +#endif /* !defined(CHAMELEON_SIMULATION) */ + +/* +* Codelet definition +*/ +static struct starpu_codelet cl_ipiv_to_perm = { + .where = STARPU_CPU, +#if defined(CHAMELEON_SIMULATION) + .cpu_funcs[0] = (starpu_cpu_func_t)1, +#else + .cpu_funcs[0] = cl_ipiv_to_perm_cpu_func, +#endif + .nbuffers = 3, + .model = NULL, + .name = "ipiv_to_perm" +}; + +void INSERT_TASK_ipiv_to_perm( const RUNTIME_option_t *options, + int m0, int m, int k, + const CHAM_ipiv_t *ipivdesc, int ipivk ) +{ + struct starpu_codelet *codelet = &cl_ipiv_to_perm; + + rt_starpu_insert_task( + codelet, + STARPU_VALUE, &m0, sizeof(int), + STARPU_VALUE, &m, sizeof(int), + STARPU_VALUE, &k, sizeof(int), + STARPU_R, RUNTIME_ipiv_getaddr( ipivdesc, ipivk ), + STARPU_W, RUNTIME_perm_getaddr( ipivdesc, ipivk ), + STARPU_W, RUNTIME_invp_getaddr( ipivdesc, ipivk ), + STARPU_PRIORITY, options->priority, + STARPU_EXECUTE_ON_WORKER, options->workerid, + 0 ); +} diff --git a/runtime/starpu/codelets/codelet_ipiv_to_perm.c b/runtime/starpu/codelets/codelet_ipiv_to_perm.c deleted file mode 100644 index f615e2304bfae1fefda53f04eae2b0b7a40da80a..0000000000000000000000000000000000000000 --- a/runtime/starpu/codelets/codelet_ipiv_to_perm.c +++ /dev/null @@ -1,69 +0,0 @@ -/** - * - * @file starpu/codelet_ipiv_to_perm.c - * - * @copyright 2012-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, - * Univ. Bordeaux. All rights reserved. - * - *** - * - * @brief Chameleon StarPU codelets to convert pivot to permutations - * - * @version 1.3.0 - * @author Mathieu Faverge - * @author Matthieu Kuhn - * @date 2023-08-31 - * - */ -#include "chameleon_starpu.h" -#include "runtime_codelets.h" - -#if !defined(CHAMELEON_SIMULATION) -static void cl_ipiv_to_perm_cpu_func( void *descr[], void *cl_arg ) -{ - int m0, m, k; - int *ipiv, *perm, *invp; - - starpu_codelet_unpack_args( cl_arg, &m0, &m, &k ); - - ipiv = (int*)STARPU_VECTOR_GET_PTR(descr[0]); - perm = (int*)STARPU_VECTOR_GET_PTR(descr[1]); - invp = (int*)STARPU_VECTOR_GET_PTR(descr[2]); - - CORE_ipiv_to_perm( m0, m, k, ipiv, perm, invp ); -} -#endif /* !defined(CHAMELEON_SIMULATION) */ - -/* -* Codelet definition -*/ -static struct starpu_codelet cl_ipiv_to_perm = { - .where = STARPU_CPU, -#if defined(CHAMELEON_SIMULATION) - .cpu_funcs[0] = (starpu_cpu_func_t)1, -#else - .cpu_funcs[0] = cl_ipiv_to_perm_cpu_func, -#endif - .nbuffers = 3, - .model = NULL, - .name = "ipiv_to_perm" -}; - -void INSERT_TASK_ipiv_to_perm( const RUNTIME_option_t *options, - int m0, int m, int k, - const CHAM_ipiv_t *ipivdesc, int ipivk ) -{ - struct starpu_codelet *codelet = &cl_ipiv_to_perm; - - rt_starpu_insert_task( - codelet, - STARPU_VALUE, &m0, sizeof(int), - STARPU_VALUE, &m, sizeof(int), - STARPU_VALUE, &k, sizeof(int), - STARPU_R, RUNTIME_ipiv_getaddr( ipivdesc, ipivk ), - STARPU_W, RUNTIME_perm_getaddr( ipivdesc, ipivk ), - STARPU_W, RUNTIME_invp_getaddr( ipivdesc, ipivk ), - STARPU_PRIORITY, options->priority, - STARPU_EXECUTE_ON_WORKER, options->workerid, - 0 ); -} diff --git a/runtime/starpu/control/runtime_descriptor_ipiv.c b/runtime/starpu/control/runtime_descriptor_ipiv.c index d3a3d82c583f5f77f3e068c2239491ac3c3a1f15..ae4a6f24f324301cef7bcb61138f14513e64e193 100644 --- a/runtime/starpu/control/runtime_descriptor_ipiv.c +++ b/runtime/starpu/control/runtime_descriptor_ipiv.c @@ -12,7 +12,7 @@ * @version 1.3.0 * @author Mathieu Faverge * @author Matthieu Kuhn - * @date 2023-08-31 + * @date 2024-03-16 * */ #include "chameleon_starpu.h" @@ -298,71 +298,6 @@ void RUNTIME_perm_flushk( const RUNTIME_sequence_t *sequence, (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 ) { int64_t mt = desc->mt;