Skip to content

Commit

Permalink
Will rebase later
Browse files Browse the repository at this point in the history
  • Loading branch information
Qinglei Cao committed Oct 18, 2024
1 parent 9a9f153 commit 7a00870
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 32 deletions.
8 changes: 4 additions & 4 deletions src/include/dplasma/dplasma_z.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *params, 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_zlaswp_New( parsec_tiled_matrix_t *A, const parsec_tiled_matrix_t *IPIV, int inc);
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);
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);

/* Sub-kernels to recursive DAGs */
parsec_taskpool_t* dplasma_zgeqrfr_geqrt_New(parsec_tiled_matrix_t *A, parsec_tiled_matrix_t *T, void *work);
Expand Down
9 changes: 8 additions & 1 deletion src/zlascal_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "dplasma.h"
#include "dplasma/types.h"
#include "dplasmaaux.h"
#include "parsec/parsec/data_dist/matrix/apply.h"
#include "cores/core_blas.h"


Expand Down Expand Up @@ -113,7 +114,10 @@ dplasma_zlascal_New( dplasma_enum_t uplo,
dplasma_complex64_t alpha,
parsec_tiled_matrix_t *A )
{
return parsec_apply_New( uplo, A, dplasma_zlascal_operator, (void*)&alpha );
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 );
}

/**
Expand All @@ -139,6 +143,9 @@ dplasma_zlascal_New( dplasma_enum_t uplo,
void
dplasma_zlascal_Destruct( parsec_taskpool_t *tp )
{
if( ((parsec_apply_taskpool_t *)tp)->_g_op_args ) {
free( ((parsec_apply_taskpool_t *)tp)->_g_op_args );
}
parsec_apply_Destruct(tp);
}

Expand Down
16 changes: 12 additions & 4 deletions src/zlaset_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "dplasma.h"
#include "dplasma/types.h"
#include "dplasmaaux.h"
#include "parsec/parsec/data_dist/matrix/apply.h"


static int
Expand Down Expand Up @@ -91,9 +92,15 @@ dplasma_zlaset_operator( parsec_execution_stream_t *es,
******************************************************************************/
parsec_taskpool_t*
dplasma_zlaset_New( dplasma_enum_t uplo,
dplasma_complex64_t *params,
dplasma_complex64_t alpha,
dplasma_complex64_t beta,
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 );
}

Expand All @@ -120,6 +127,9 @@ dplasma_zlaset_New( dplasma_enum_t uplo,
void
dplasma_zlaset_Destruct( parsec_taskpool_t *tp )
{
if( ((parsec_apply_taskpool_t *)tp)->_g_op_args ) {
free( ((parsec_apply_taskpool_t *)tp)->_g_op_args );
}
parsec_apply_Destruct(tp);
}

Expand Down Expand Up @@ -187,9 +197,7 @@ dplasma_zlaset( parsec_context_t *parsec,
return -1;
}

dplasma_complex64_t params[2] = {alpha, beta};

parsec_zlaset = dplasma_zlaset_New(uplo, params, A);
parsec_zlaset = dplasma_zlaset_New(uplo, alpha, beta, A);

if ( parsec_zlaset != NULL ) {
parsec_context_add_taskpool(parsec, (parsec_taskpool_t*)parsec_zlaset);
Expand Down
6 changes: 5 additions & 1 deletion src/zlatms_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,18 @@ dplasma_zlatms( parsec_context_t *parsec,
/* Init the diagonal of A */
{
parsec_taskpool_t *tp;
tp = parsec_apply_New( dplasmaUpperLower, A, dplasma_zlatms_operator, (void *)&cond );
double *condptr = malloc(sizeof( double ));
*condptr = cond;
tp = parsec_apply_New( dplasmaUpperLower, A, dplasma_zlatms_operator, condptr );
if ( tp != NULL ) {
parsec_context_add_taskpool(parsec, tp);
parsec_context_start( parsec );
parsec_context_wait( parsec );
parsec_apply_Destruct(tp);
free(condptr);
}
else {
free(condptr);
return -1;
}
}
Expand Down
16 changes: 11 additions & 5 deletions src/zplghe_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,15 @@ dplasma_zplghe_operator( parsec_execution_stream_t *es,
*
******************************************************************************/
parsec_taskpool_t*
dplasma_zplghe_New( dplasma_enum_t uplo,
dplasma_zplghe_New( double bump, dplasma_enum_t uplo,
parsec_tiled_matrix_t *A,
void *params)
unsigned long long int seed)
{
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 );
}

Expand All @@ -122,6 +127,9 @@ dplasma_zplghe_New( dplasma_enum_t uplo,
void
dplasma_zplghe_Destruct( parsec_taskpool_t *tp )
{
if( ((parsec_apply_taskpool_t *)tp)->_g_op_args ) {
free( ((parsec_apply_taskpool_t *)tp)->_g_op_args );
}
parsec_apply_Destruct(tp);
}

Expand Down Expand Up @@ -186,9 +194,7 @@ dplasma_zplghe( parsec_context_t *parsec,
return -3;
}

zplghe_args_t params = {.bump = bump, .seed = seed};

parsec_zplghe = dplasma_zplghe_New( uplo, A, (void *)&params );
parsec_zplghe = dplasma_zplghe_New( bump, uplo, A, seed );

if ( parsec_zplghe != NULL ) {
parsec_context_add_taskpool(parsec, (parsec_taskpool_t*)parsec_zplghe);
Expand Down
18 changes: 12 additions & 6 deletions src/zplgsy_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "dplasma.h"
#include "dplasma/types.h"
#include "dplasmaaux.h"

#include "parsec/parsec/data_dist/matrix/apply.h"
#include "cores/core_blas.h"

struct zplgsy_args_s {
Expand Down Expand Up @@ -94,10 +94,15 @@ dplasma_zplgsy_operator( parsec_execution_stream_t *es,
*
******************************************************************************/
parsec_taskpool_t*
dplasma_zplgsy_New( dplasma_enum_t uplo,
dplasma_zplgsy_New( dplasma_complex64_t bump, dplasma_enum_t uplo,
parsec_tiled_matrix_t *A,
void *params)
unsigned long long int seed)
{
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 );
}

Expand All @@ -124,6 +129,9 @@ dplasma_zplgsy_New( dplasma_enum_t uplo,
void
dplasma_zplgsy_Destruct( parsec_taskpool_t *tp )
{
if( ((parsec_apply_taskpool_t *)tp)->_g_op_args ) {
free( ((parsec_apply_taskpool_t *)tp)->_g_op_args );
}
parsec_apply_Destruct(tp);
}

Expand Down Expand Up @@ -190,9 +198,7 @@ dplasma_zplgsy( parsec_context_t *parsec,
return -3;
}

zplgsy_args_t params = {.bump = bump, .seed = seed};

parsec_zplgsy = dplasma_zplgsy_New( uplo, A, (void *)&params );
parsec_zplgsy = dplasma_zplgsy_New( bump, uplo, A, seed );

if ( parsec_zplgsy != NULL ) {
parsec_context_add_taskpool(parsec, (parsec_taskpool_t*)parsec_zplgsy);
Expand Down
20 changes: 14 additions & 6 deletions src/zplrnt_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "dplasma.h"
#include "dplasma/types.h"
#include "dplasmaaux.h"

#include "parsec/parsec/data_dist/matrix/apply.h"
#include "cores/core_blas.h"


Expand Down Expand Up @@ -108,10 +108,16 @@ dplasma_zplrnt_operator( parsec_execution_stream_t *es,
*
******************************************************************************/
parsec_taskpool_t*
dplasma_zplrnt_New( parsec_tiled_matrix_t *A,
void *params)
dplasma_zplrnt_New( int diagdom,
parsec_tiled_matrix_t *A,
unsigned long long int seed)
{
return parsec_apply_New( dplasmaUpperLower, A, dplasma_zplrnt_operator, (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 );
}

/**
Expand All @@ -137,6 +143,9 @@ dplasma_zplrnt_New( parsec_tiled_matrix_t *A,
void
dplasma_zplrnt_Destruct( parsec_taskpool_t *tp )
{
if( ((parsec_apply_taskpool_t *)tp)->_g_op_args ) {
free( ((parsec_apply_taskpool_t *)tp)->_g_op_args );
}
parsec_apply_Destruct(tp);
}

Expand Down Expand Up @@ -187,9 +196,8 @@ 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(A, (void *)&params);
parsec_zplrnt = dplasma_zplrnt_New(diagdom, A, seed);

parsec_context_add_taskpool(parsec, (parsec_taskpool_t*)parsec_zplrnt);
dplasma_wait_until_completion(parsec);
Expand Down
12 changes: 7 additions & 5 deletions src/zpltmg_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,22 @@ 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 *params = (zpltmg_args_t*)malloc(sizeof(zpltmg_args_t));

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, (void *)&params );
parsec_zpltmg = parsec_apply_New( dplasmaUpperLower, A, dplasma_zpltmg_generic_operator, params );
if ( parsec_zpltmg != NULL )
{
parsec_context_add_taskpool(parsec, (parsec_taskpool_t*)parsec_zpltmg);
dplasma_wait_until_completion(parsec);
free(params);
parsec_apply_Destruct( parsec_zpltmg );
return 0;
}
free(params);
return -101;
}

Expand Down

0 comments on commit 7a00870

Please sign in to comment.