From 1314a0ea1a06f96a21a532547c020df9ae075b89 Mon Sep 17 00:00:00 2001 From: Qinglei Cao Date: Fri, 11 Oct 2024 20:06:35 +0000 Subject: [PATCH] Update the parsec_apply because of the changes in PaRSEC PR#676 --- src/include/dplasma/dplasma_z.h | 8 ++++---- src/zlascal_wrapper.c | 5 +---- src/zlaset_wrapper.c | 12 ++++-------- src/zlatms_wrapper.c | 4 +--- src/zplghe_wrapper.c | 13 +++++-------- src/zplgsy_wrapper.c | 13 +++++-------- src/zplrnt_wrapper.c | 15 +++++---------- src/zpltmg_wrapper.c | 10 +++++----- 8 files changed, 30 insertions(+), 50 deletions(-) diff --git a/src/include/dplasma/dplasma_z.h b/src/include/dplasma/dplasma_z.h index 0ab5a08f..2a3e192f 100644 --- a/src/include/dplasma/dplasma_z.h +++ b/src/include/dplasma/dplasma_z.h @@ -188,11 +188,11 @@ parsec_taskpool_t* dplasma_zlanm2_New( const parsec_tiled_matrix_t *A, double *n parsec_taskpool_t* dplasma_zlansy_New( dplasma_enum_t ntype, dplasma_enum_t uplo, const parsec_tiled_matrix_t *A, double *result); parsec_taskpool_t* dplasma_zlantr_New( dplasma_enum_t ntype, dplasma_enum_t uplo, dplasma_enum_t diag, const parsec_tiled_matrix_t *A, double *result); parsec_taskpool_t* dplasma_zlascal_New( dplasma_enum_t type, dplasma_complex64_t alpha, parsec_tiled_matrix_t *A); -parsec_taskpool_t* dplasma_zlaset_New( dplasma_enum_t uplo, dplasma_complex64_t alpha, dplasma_complex64_t beta, parsec_tiled_matrix_t *A); +parsec_taskpool_t* dplasma_zlaset_New( dplasma_enum_t uplo, dplasma_complex64_t *params, parsec_tiled_matrix_t *A); parsec_taskpool_t* dplasma_zlaswp_New( parsec_tiled_matrix_t *A, const parsec_tiled_matrix_t *IPIV, int inc); -parsec_taskpool_t* dplasma_zplghe_New( double bump, dplasma_enum_t uplo, parsec_tiled_matrix_t *A, unsigned long long int seed); -parsec_taskpool_t* dplasma_zplgsy_New( dplasma_complex64_t bump, dplasma_enum_t uplo, parsec_tiled_matrix_t *A, unsigned long long int seed); -parsec_taskpool_t* dplasma_zplrnt_New( int diagdom, parsec_tiled_matrix_t *A, unsigned long long int seed); +parsec_taskpool_t* dplasma_zplghe_New( dplasma_enum_t uplo, parsec_tiled_matrix_t *A, void *params); +parsec_taskpool_t* dplasma_zplgsy_New( dplasma_enum_t uplo, parsec_tiled_matrix_t *A, void *params); +parsec_taskpool_t* dplasma_zplrnt_New( parsec_tiled_matrix_t *A, void *params); /* Sub-kernels to recursive DAGs */ parsec_taskpool_t* dplasma_zgeqrfr_geqrt_New(parsec_tiled_matrix_t *A, parsec_tiled_matrix_t *T, void *work); diff --git a/src/zlascal_wrapper.c b/src/zlascal_wrapper.c index 955717a2..ea30052d 100644 --- a/src/zlascal_wrapper.c +++ b/src/zlascal_wrapper.c @@ -113,10 +113,7 @@ dplasma_zlascal_New( dplasma_enum_t uplo, dplasma_complex64_t alpha, parsec_tiled_matrix_t *A ) { - dplasma_complex64_t *a = (dplasma_complex64_t*)malloc(sizeof(dplasma_complex64_t)); - *a = alpha; - - return parsec_apply_New( uplo, A, dplasma_zlascal_operator, (void*)a ); + return parsec_apply_New( uplo, A, dplasma_zlascal_operator, (void*)&alpha ); } /** diff --git a/src/zlaset_wrapper.c b/src/zlaset_wrapper.c index aee6e782..c744fd67 100644 --- a/src/zlaset_wrapper.c +++ b/src/zlaset_wrapper.c @@ -91,15 +91,9 @@ dplasma_zlaset_operator( parsec_execution_stream_t *es, ******************************************************************************/ parsec_taskpool_t* dplasma_zlaset_New( dplasma_enum_t uplo, - dplasma_complex64_t alpha, - dplasma_complex64_t beta, + dplasma_complex64_t *params, parsec_tiled_matrix_t *A ) { - dplasma_complex64_t *params = (dplasma_complex64_t*)malloc(2 * sizeof(dplasma_complex64_t)); - - params[0] = alpha; - params[1] = beta; - return parsec_apply_New( uplo, A, dplasma_zlaset_operator, params ); } @@ -193,7 +187,9 @@ dplasma_zlaset( parsec_context_t *parsec, return -1; } - parsec_zlaset = dplasma_zlaset_New(uplo, alpha, beta, A); + dplasma_complex64_t params[2] = {alpha, beta}; + + parsec_zlaset = dplasma_zlaset_New(uplo, params, A); if ( parsec_zlaset != NULL ) { parsec_context_add_taskpool(parsec, (parsec_taskpool_t*)parsec_zlaset); diff --git a/src/zlatms_wrapper.c b/src/zlatms_wrapper.c index d5dab702..0b0a7f27 100644 --- a/src/zlatms_wrapper.c +++ b/src/zlatms_wrapper.c @@ -117,9 +117,7 @@ dplasma_zlatms( parsec_context_t *parsec, /* Init the diagonal of A */ { parsec_taskpool_t *tp; - double *condptr = malloc(sizeof( double )); - *condptr = cond; - tp = parsec_apply_New( dplasmaUpperLower, A, dplasma_zlatms_operator, condptr ); + tp = parsec_apply_New( dplasmaUpperLower, A, dplasma_zlatms_operator, (void *)&cond ); if ( tp != NULL ) { parsec_context_add_taskpool(parsec, tp); parsec_context_start( parsec ); diff --git a/src/zplghe_wrapper.c b/src/zplghe_wrapper.c index 6e10f335..0abfbd71 100644 --- a/src/zplghe_wrapper.c +++ b/src/zplghe_wrapper.c @@ -92,15 +92,10 @@ dplasma_zplghe_operator( parsec_execution_stream_t *es, * ******************************************************************************/ parsec_taskpool_t* -dplasma_zplghe_New( double bump, dplasma_enum_t uplo, +dplasma_zplghe_New( dplasma_enum_t uplo, parsec_tiled_matrix_t *A, - unsigned long long int seed) + void *params) { - zplghe_args_t *params = (zplghe_args_t*)malloc(sizeof(zplghe_args_t)); - - params->bump = bump; - params->seed = seed; - return parsec_apply_New( uplo, A, dplasma_zplghe_operator, params ); } @@ -191,7 +186,9 @@ dplasma_zplghe( parsec_context_t *parsec, return -3; } - parsec_zplghe = dplasma_zplghe_New( bump, uplo, A, seed ); + zplghe_args_t params = {.bump = bump, .seed = seed}; + + parsec_zplghe = dplasma_zplghe_New( uplo, A, (void *)¶ms ); if ( parsec_zplghe != NULL ) { parsec_context_add_taskpool(parsec, (parsec_taskpool_t*)parsec_zplghe); diff --git a/src/zplgsy_wrapper.c b/src/zplgsy_wrapper.c index 37a407bb..d785a0ec 100644 --- a/src/zplgsy_wrapper.c +++ b/src/zplgsy_wrapper.c @@ -94,15 +94,10 @@ dplasma_zplgsy_operator( parsec_execution_stream_t *es, * ******************************************************************************/ parsec_taskpool_t* -dplasma_zplgsy_New( dplasma_complex64_t bump, dplasma_enum_t uplo, +dplasma_zplgsy_New( dplasma_enum_t uplo, parsec_tiled_matrix_t *A, - unsigned long long int seed) + void *params) { - zplgsy_args_t *params = (zplgsy_args_t*)malloc(sizeof(zplgsy_args_t)); - - params->bump = bump; - params->seed = seed; - return parsec_apply_New( uplo, A, dplasma_zplgsy_operator, params ); } @@ -195,7 +190,9 @@ dplasma_zplgsy( parsec_context_t *parsec, return -3; } - parsec_zplgsy = dplasma_zplgsy_New( bump, uplo, A, seed ); + zplgsy_args_t params = {.bump = bump, .seed = seed}; + + parsec_zplgsy = dplasma_zplgsy_New( uplo, A, (void *)¶ms ); if ( parsec_zplgsy != NULL ) { parsec_context_add_taskpool(parsec, (parsec_taskpool_t*)parsec_zplgsy); diff --git a/src/zplrnt_wrapper.c b/src/zplrnt_wrapper.c index 770ec063..86fb2763 100644 --- a/src/zplrnt_wrapper.c +++ b/src/zplrnt_wrapper.c @@ -108,16 +108,10 @@ dplasma_zplrnt_operator( parsec_execution_stream_t *es, * ******************************************************************************/ parsec_taskpool_t* -dplasma_zplrnt_New( int diagdom, - parsec_tiled_matrix_t *A, - unsigned long long int seed) +dplasma_zplrnt_New( parsec_tiled_matrix_t *A, + void *params) { - zplrnt_args_t *params = (zplrnt_args_t*)malloc(sizeof(zplrnt_args_t)); - - params->diagdom = diagdom; - params->seed = seed; - - return parsec_apply_New( dplasmaUpperLower, A, dplasma_zplrnt_operator, params ); + return parsec_apply_New( dplasmaUpperLower, A, dplasma_zplrnt_operator, (void *)params ); } /** @@ -193,8 +187,9 @@ dplasma_zplrnt( parsec_context_t *parsec, unsigned long long int seed) { parsec_taskpool_t *parsec_zplrnt = NULL; + zplrnt_args_t params = {.diagdom = diagdom, .seed = seed}; - parsec_zplrnt = dplasma_zplrnt_New(diagdom, A, seed); + parsec_zplrnt = dplasma_zplrnt_New(A, (void *)¶ms); parsec_context_add_taskpool(parsec, (parsec_taskpool_t*)parsec_zplrnt); dplasma_wait_until_completion(parsec); diff --git a/src/zpltmg_wrapper.c b/src/zpltmg_wrapper.c index 3597dd2a..7d475dcc 100644 --- a/src/zpltmg_wrapper.c +++ b/src/zpltmg_wrapper.c @@ -114,13 +114,13 @@ dplasma_zpltmg_generic( parsec_context_t *parsec, unsigned long long int seed) { parsec_taskpool_t *parsec_zpltmg = NULL; - zpltmg_args_t *params = (zpltmg_args_t*)malloc(sizeof(zpltmg_args_t)); + zpltmg_args_t params; - params->mtxtype = mtxtype; - params->seed = seed; - params->W = W; + params.mtxtype = mtxtype; + params.seed = seed; + params.W = W; - parsec_zpltmg = parsec_apply_New( dplasmaUpperLower, A, dplasma_zpltmg_generic_operator, params ); + parsec_zpltmg = parsec_apply_New( dplasmaUpperLower, A, dplasma_zpltmg_generic_operator, (void *)¶ms ); if ( parsec_zpltmg != NULL ) { parsec_context_add_taskpool(parsec, (parsec_taskpool_t*)parsec_zpltmg);