Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: use the new parsec dtd api #116

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/utils/dplasma_arena_datatype.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,10 @@ int dplasma_cleanup_datatype( parsec_datatype_t *dtt )
#ifdef REUSE_ARENA_DATATYPE
/* The key of a datatype can only be constructed with the arguments used during creation.
* Thus, datatypes will be cleaned during callback during parsec context at fini.
* Set the pointer to PARSEC_DATATYPE_NULL (so that adt_destruct doesn't complain) but
* the actual datatype shall remain as it is still referenced from the hashtable.
*/
(void)dtt;
*dtt = PARSEC_DATATYPE_NULL;
return 0;
#else
return parsec_type_free( dtt );
Expand Down
11 changes: 7 additions & 4 deletions tests/testing_zgemm_dtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ int main(int argc, char ** argv)
parsec_taskpool_t *dtd_tp = parsec_dtd_taskpool_new();

/* Default type */
parsec_arena_datatype_t *tile_full = parsec_dtd_create_arena_datatype(parsec, &TILE_FULL);

parsec_arena_datatype_t *tile_full = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_tile( tile_full,
dcA.super.mb*dcA.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcA.super.mb );
parsec_dtd_attach_arena_datatype(parsec, tile_full, &TILE_FULL);

/* matrix generation */
if(loud > 2) printf("+++ Generate matrices ... ");
Expand Down Expand Up @@ -261,7 +263,7 @@ int main(int argc, char ** argv)

/* Cleaning data arrays we allocated for communication */
dplasma_matrix_del2arena( tile_full );
parsec_dtd_destroy_arena_datatype(parsec, TILE_FULL);
parsec_dtd_free_arena_datatype(parsec, TILE_FULL);
parsec_dtd_data_collection_fini( (parsec_data_collection_t *)&dcA );

parsec_data_free(dcA.mat);
Expand Down Expand Up @@ -321,11 +323,12 @@ int main(int argc, char ** argv)

/* Allocating data arrays to be used by comm engine */
/* Default type */
parsec_arena_datatype_t *tile_full = parsec_dtd_create_arena_datatype(parsec, &TILE_FULL);
parsec_arena_datatype_t *tile_full = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_tile( tile_full,
dcA.super.mb*dcA.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcA.super.mb );
parsec_dtd_attach_arena_datatype(parsec, tile_full, &TILE_FULL);

dplasma_zplrnt( parsec, 0, (parsec_tiled_matrix_t *)&dcA, Aseed);
dplasma_zplrnt( parsec, 0, (parsec_tiled_matrix_t *)&dcB, Bseed);
Expand Down Expand Up @@ -505,7 +508,7 @@ int main(int argc, char ** argv)

/* Cleaning data arrays we allocated for communication */
dplasma_matrix_del2arena( tile_full );
parsec_dtd_destroy_arena_datatype(parsec, TILE_FULL);
parsec_dtd_free_arena_datatype(parsec, TILE_FULL);
parsec_dtd_data_collection_fini( (parsec_data_collection_t *)&dcA );

parsec_data_free(dcA.mat);
Expand Down
10 changes: 6 additions & 4 deletions tests/testing_zgeqrf_dtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,19 @@ int main(int argc, char **argv)

/* Allocating data arrays to be used by comm engine */
/* Default type */
parsec_arena_datatype_t *tile_full = parsec_dtd_create_arena_datatype(parsec, &TILE_FULL);
parsec_arena_datatype_t *tile_full = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_tile( tile_full,
dcA.super.mb*dcA.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcA.super.mb );
parsec_dtd_attach_arena_datatype(parsec, tile_full, &TILE_FULL);

parsec_arena_datatype_t *tile_rectangle = parsec_dtd_create_arena_datatype(parsec, &TILE_RECTANGLE);
parsec_arena_datatype_t *tile_rectangle = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_rectangle( tile_rectangle,
dcT.super.mb*dcT.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcT.super.mb, dcT.super.nb, -1);
parsec_dtd_attach_arena_datatype(parsec, tile_rectangle, &TILE_RECTANGLE);

/* Registering the handle with parsec context */
parsec_context_add_taskpool(parsec, dtd_tp);
Expand Down Expand Up @@ -399,9 +401,9 @@ int main(int argc, char **argv)

/* Cleaning data arrays we allocated for communication */
dplasma_matrix_del2arena( tile_full );
parsec_dtd_destroy_arena_datatype(parsec, TILE_FULL);
parsec_dtd_free_arena_datatype(parsec, TILE_FULL);
dplasma_matrix_del2arena( tile_rectangle );
parsec_dtd_destroy_arena_datatype(parsec, TILE_RECTANGLE);
parsec_dtd_free_arena_datatype(parsec, TILE_RECTANGLE);

parsec_dtd_data_collection_fini( (parsec_data_collection_t *)&dcA );
parsec_dtd_data_collection_fini( (parsec_data_collection_t *)&dcT );
Expand Down
20 changes: 12 additions & 8 deletions tests/testing_zgeqrf_dtd_untied.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,31 +341,35 @@ int main(int argc, char ** argv)

/* Allocating data arrays to be used by comm engine */
/* Default type */
parsec_arena_datatype_t *tile_full = parsec_dtd_create_arena_datatype(parsec, &TILE_FULL);
parsec_arena_datatype_t *tile_full = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_tile( tile_full,
dcA.super.mb*dcA.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcA.super.mb );
parsec_dtd_attach_arena_datatype(parsec, tile_full, &TILE_FULL);

/* Lower triangular part of tile without diagonal */
parsec_arena_datatype_t *tile_lower = parsec_dtd_create_arena_datatype(parsec, &TILE_LOWER);
parsec_arena_datatype_t *tile_lower = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_lower( tile_lower,
dcA.super.mb*dcA.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcA.super.mb, 0 );
parsec_dtd_attach_arena_datatype(parsec, tile_lower, &TILE_LOWER);

/* Upper triangular part of tile with diagonal */
parsec_arena_datatype_t *tile_upper = parsec_dtd_create_arena_datatype(parsec, &TILE_UPPER);
parsec_arena_datatype_t *tile_upper = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_upper( tile_upper,
dcA.super.mb*dcA.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcA.super.mb, 1 );
parsec_dtd_attach_arena_datatype(parsec, tile_upper, &TILE_UPPER);

parsec_arena_datatype_t *tile_rectangle = parsec_dtd_create_arena_datatype(parsec, &TILE_RECTANGLE);
parsec_arena_datatype_t *tile_rectangle = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_rectangle( tile_rectangle,
dcT.super.mb*dcT.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcT.super.mb, dcT.super.nb, -1);
parsec_dtd_attach_arena_datatype(parsec, tile_rectangle, &TILE_RECTANGLE);

/* Registering the handle with parsec context */
parsec_context_add_taskpool(parsec, dtd_tp);
Expand Down Expand Up @@ -448,13 +452,13 @@ int main(int argc, char ** argv)

/* Cleaning data arrays we allocated for communication */
dplasma_matrix_del2arena( tile_full );
parsec_dtd_destroy_arena_datatype(parsec, TILE_FULL);
parsec_dtd_free_arena_datatype(parsec, TILE_FULL);
dplasma_matrix_del2arena( tile_lower );
parsec_dtd_destroy_arena_datatype(parsec, TILE_LOWER);
parsec_dtd_free_arena_datatype(parsec, TILE_LOWER);
dplasma_matrix_del2arena( tile_upper );
parsec_dtd_destroy_arena_datatype(parsec, TILE_UPPER);
parsec_dtd_free_arena_datatype(parsec, TILE_UPPER);
dplasma_matrix_del2arena( tile_rectangle );
parsec_dtd_destroy_arena_datatype(parsec, TILE_RECTANGLE);
parsec_dtd_free_arena_datatype(parsec, TILE_RECTANGLE);

parsec_dtd_data_collection_fini( (parsec_data_collection_t *)&dcA );
parsec_dtd_data_collection_fini( (parsec_data_collection_t *)&dcT );
Expand Down
15 changes: 9 additions & 6 deletions tests/testing_zgetrf_incpiv_dtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,25 +245,28 @@ int main(int argc, char ** argv)

/* Allocating data arrays to be used by comm engine */
/* A */
parsec_arena_datatype_t *tile_full = parsec_dtd_create_arena_datatype(parsec, &TILE_FULL);
parsec_arena_datatype_t *tile_full = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_tile( tile_full,
dcA.super.mb*dcA.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcA.super.mb );
parsec_dtd_attach_arena_datatype(parsec, tile_full, &TILE_FULL);

/* IPIV */
parsec_arena_datatype_t *tile_rectangle = parsec_dtd_create_arena_datatype(parsec, &TILE_RECTANGLE);
parsec_arena_datatype_t *tile_rectangle = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_rectangle( tile_rectangle,
dcA.super.mb*sizeof(int),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_int_t, dcA.super.mb, 1, -1 );
parsec_dtd_attach_arena_datatype(parsec, tile_rectangle, &TILE_RECTANGLE);

/* L */
parsec_arena_datatype_t *l_tile_rectangle = parsec_dtd_create_arena_datatype(parsec, &L_TILE_RECTANGLE);
parsec_arena_datatype_t *l_tile_rectangle = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_rectangle( l_tile_rectangle,
dcL.super.mb*dcL.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcL.super.mb, dcL.super.nb, -1);
parsec_dtd_attach_arena_datatype(parsec, l_tile_rectangle, &L_TILE_RECTANGLE);

/* Registering the handle with parsec context */
parsec_context_add_taskpool( parsec, dtd_tp );
Expand Down Expand Up @@ -448,11 +451,11 @@ int main(int argc, char ** argv)

/* Cleaning data arrays we allocated for communication */
dplasma_matrix_del2arena( tile_full );
parsec_dtd_destroy_arena_datatype(parsec, TILE_FULL);
parsec_dtd_free_arena_datatype(parsec, TILE_FULL);
dplasma_matrix_del2arena( tile_rectangle );
parsec_dtd_destroy_arena_datatype(parsec, TILE_RECTANGLE);
parsec_dtd_free_arena_datatype(parsec, TILE_RECTANGLE);
dplasma_matrix_del2arena( l_tile_rectangle );
parsec_dtd_destroy_arena_datatype(parsec, L_TILE_RECTANGLE);
parsec_dtd_free_arena_datatype(parsec, L_TILE_RECTANGLE);

parsec_dtd_data_collection_fini( (parsec_data_collection_t *)&dcA );
parsec_dtd_data_collection_fini( (parsec_data_collection_t *)&dcL );
Expand Down
5 changes: 3 additions & 2 deletions tests/testing_zpotrf_dtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ int main(int argc, char **argv)
parsec_taskpool_t *dtd_tp = parsec_dtd_taskpool_new();

/* Allocating data arrays to be used by comm engine */
parsec_arena_datatype_t *tile_full = parsec_dtd_create_arena_datatype(parsec, &TILE_FULL);
parsec_arena_datatype_t *tile_full = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_tile( tile_full,
dcA.super.mb*dcA.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcA.super.mb );
parsec_dtd_attach_arena_datatype(parsec, tile_full, &TILE_FULL);

/* Registering the handle with parsec context */
parsec_context_add_taskpool( parsec, dtd_tp );
Expand Down Expand Up @@ -377,7 +378,7 @@ int main(int argc, char **argv)

/* Cleaning data arrays we allocated for communication */
dplasma_matrix_del2arena( tile_full );
parsec_dtd_destroy_arena_datatype(parsec, TILE_FULL);
parsec_dtd_free_arena_datatype(parsec, TILE_FULL);
parsec_dtd_data_collection_fini( (parsec_data_collection_t *)&dcA );

parsec_data_free(dcA.mat); dcA.mat = NULL;
Expand Down
5 changes: 3 additions & 2 deletions tests/testing_zpotrf_dtd_untied.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,12 @@ int main(int argc, char **argv)
parsec_taskpool_t *dtd_tp = parsec_dtd_taskpool_new( );

/* Default type */
parsec_arena_datatype_t *tile_full = parsec_dtd_create_arena_datatype(parsec, &TILE_FULL);
parsec_arena_datatype_t *tile_full = PARSEC_OBJ_NEW(parsec_arena_datatype_t);
dplasma_add2arena_tile( tile_full,
dcA.super.mb*dcA.super.nb*sizeof(dplasma_complex64_t),
PARSEC_ARENA_ALIGNMENT_SSE,
parsec_datatype_double_complex_t, dcA.super.mb );
parsec_dtd_attach_arena_datatype(parsec, tile_full, &TILE_FULL);

/* Registering the handle with parsec context */
parsec_context_add_taskpool( parsec, dtd_tp );
Expand Down Expand Up @@ -477,7 +478,7 @@ int main(int argc, char **argv)
}

dplasma_matrix_del2arena( tile_full );
parsec_dtd_destroy_arena_datatype(parsec, TILE_FULL);
parsec_dtd_free_arena_datatype(parsec, TILE_FULL);
parsec_dtd_data_collection_fini( (parsec_data_collection_t *)&dcA );
parsec_data_free(dcA.mat); dcA.mat = NULL;
parsec_tiled_matrix_destroy( (parsec_tiled_matrix_t*)&dcA);
Expand Down
Loading