Commit e1129800 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Add cleanup

parent 6a341c23
......@@ -130,12 +130,14 @@ int MORSE_zbuild( MORSE_enum uplo, int M, int N,
/* Call the tile interface */
MORSE_zbuild_Tile_Async(uplo, &descA, user_data, user_build_callback, sequence, &request );
/* Submit the matrix conversion back */
morse_ztile2lap( morse, &descAl, &descAt,
MorseUpperLower, sequence, &request );
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......
......@@ -169,8 +169,9 @@ int MORSE_zgeadd(MORSE_enum trans, int M, int N,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......
......@@ -135,7 +135,8 @@ int MORSE_zgelqf(int M, int N,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......@@ -292,7 +293,7 @@ int MORSE_zgelqf_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *T,
morse_pzgelqfrh(A, T, Dptr, MORSE_RHBLK, sequence, request);
}
if (Dptr != NULL) {
morse_desc_mat_free(Dptr);
morse_ztile2lap_cleanup( morse, &Dptrl, &Dptrt );
}
(void)D;
return MORSE_SUCCESS;
......
......@@ -132,7 +132,8 @@ int MORSE_zgelqf_param(const libhqr_tree_t *qrtree, int M, int N,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......@@ -288,7 +289,7 @@ int MORSE_zgelqf_param_Tile_Async(const libhqr_tree_t *qrtree, MORSE_desc_t *A,
morse_pzgelqf_param(qrtree, A, TS, TT, Dptr, sequence, request);
if (Dptr != NULL) {
morse_desc_mat_free(Dptr);
morse_ztile2lap_cleanup( morse, &Dptrl, &Dptrt );
}
(void)D;
return MORSE_SUCCESS;
......
......@@ -154,8 +154,9 @@ int MORSE_zgelqs(int M, int N, int NRHS,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......@@ -332,7 +333,7 @@ int MORSE_zgelqs_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *T, MORSE_desc_t *B,
}
if (Dptr != NULL) {
morse_desc_mat_free(Dptr);
morse_ztile2lap_cleanup( morse, &Dptrl, &Dptrt );
}
(void)D;
return MORSE_SUCCESS;
......
......@@ -156,8 +156,9 @@ int MORSE_zgelqs_param(const libhqr_tree_t *qrtree, int M, int N, int NRHS,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......@@ -335,7 +336,7 @@ int MORSE_zgelqs_param_Tile_Async(const libhqr_tree_t *qrtree, MORSE_desc_t *A,
morse_pzunmlq_param(qrtree, MorseLeft, MorseConjTrans, A, B, TS, TT, Dptr, sequence, request);
if (Dptr != NULL) {
morse_desc_mat_free(Dptr);
morse_ztile2lap_cleanup( morse, &Dptrl, &Dptrt );
}
(void)D;
return MORSE_SUCCESS;
......
......@@ -196,8 +196,9 @@ int MORSE_zgels(MORSE_enum trans, int M, int N, int NRHS,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......@@ -428,7 +429,7 @@ int MORSE_zgels_Tile_Async(MORSE_enum trans, MORSE_desc_t *A,
free(subB);
if (Dptr != NULL) {
morse_desc_mat_free(Dptr);
morse_ztile2lap_cleanup( morse, &Dptrl, &Dptrt );
}
(void)D;
return MORSE_SUCCESS;
......
......@@ -197,8 +197,9 @@ int MORSE_zgels_param(const libhqr_tree_t *qrtree, MORSE_enum trans, int M, int
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......@@ -416,7 +417,7 @@ int MORSE_zgels_param_Tile_Async(const libhqr_tree_t *qrtree, MORSE_enum trans,
free(subB);
if (Dptr != NULL) {
morse_desc_mat_free(Dptr);
morse_ztile2lap_cleanup( morse, &Dptrl, &Dptrt );
}
(void)D;
return MORSE_SUCCESS;
......
......@@ -228,9 +228,10 @@ int MORSE_zgemm(MORSE_enum transA, MORSE_enum transB, int M, int N, int K,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
morse_desc_mat_free(&descC);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
morse_ztile2lap_cleanup( morse, &descCl, &descCt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......
......@@ -134,7 +134,8 @@ int MORSE_zgeqrf(int M, int N,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......@@ -291,7 +292,7 @@ int MORSE_zgeqrf_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *T,
morse_pzgeqrfrh(A, T, Dptr, MORSE_RHBLK, sequence, request);
}
if (Dptr != NULL) {
morse_desc_mat_free(Dptr);
morse_ztile2lap_cleanup( morse, &Dptrl, &Dptrt );
}
(void)D;
return MORSE_SUCCESS;
......
......@@ -137,7 +137,8 @@ int MORSE_zgeqrf_param(const libhqr_tree_t *qrtree, int M, int N,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......@@ -298,7 +299,7 @@ int MORSE_zgeqrf_param_Tile_Async(const libhqr_tree_t *qrtree, MORSE_desc_t *A,
morse_pzgeqrf_param(qrtree, A, TS, TT, Dptr, sequence, request);
if (Dptr != NULL) {
morse_desc_mat_free(Dptr);
morse_ztile2lap_cleanup( morse, &Dptrl, &Dptrt );
}
(void)D;
return MORSE_SUCCESS;
......
......@@ -154,8 +154,9 @@ int MORSE_zgeqrs(int M, int N, int NRHS,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......@@ -328,7 +329,7 @@ int MORSE_zgeqrs_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *T, MORSE_desc_t *B,
free(subB);
if (Dptr != NULL) {
morse_desc_mat_free(Dptr);
morse_ztile2lap_cleanup( morse, &Dptrl, &Dptrt );
}
(void)D;
return MORSE_SUCCESS;
......
......@@ -149,8 +149,9 @@ int MORSE_zgeqrs_param(const libhqr_tree_t *qrtree, int M, int N, int NRHS,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......@@ -325,7 +326,7 @@ int MORSE_zgeqrs_param_Tile_Async(const libhqr_tree_t *qrtree,
free(subB);
if (Dptr != NULL) {
morse_desc_mat_free(Dptr);
morse_ztile2lap_cleanup( morse, &Dptrl, &Dptrt );
}
(void)D;
return MORSE_SUCCESS;
......
......@@ -153,8 +153,9 @@ int MORSE_zgesv_incpiv(int N, int NRHS,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......
......@@ -152,8 +152,9 @@ int MORSE_zgesv_nopiv(int N, int NRHS,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......
......@@ -227,7 +227,8 @@ int MORSE_zgesvd(MORSE_enum jobu, MORSE_enum jobvt,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......@@ -547,7 +548,7 @@ int MORSE_zgesvd_Tile_Async(MORSE_enum jobu, MORSE_enum jobvt,
fprintf(stderr, "MORSE_zgesvd_Tile_Async: LAPACKE_zgbbrd = %d\n", info );
}
#endif /* !defined(CHAMELEON_SIMULATION) */
morse_desc_mat_free(&descAB);
morse_ztile2lap_cleanup( morse, &descABl, &descABt );
/* Transform U and Vt into tile format */
if ( jobu != MorseNoVec ) {
......@@ -626,7 +627,7 @@ int MORSE_zgesvd_Tile_Async(MORSE_enum jobu, MORSE_enum jobvt,
morse_desc_mat_free( &descVT );
free(E);
if (Dptr != NULL) {
morse_desc_mat_free(Dptr);
morse_ztile2lap_cleanup( morse, &Dptrl, &Dptrt );
}
(void)D;
return MORSE_SUCCESS;
......
......@@ -136,7 +136,8 @@ int MORSE_zgetrf_incpiv(int M, int N,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......
......@@ -129,7 +129,8 @@ int MORSE_zgetrf_nopiv(int M, int N,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......
......@@ -157,8 +157,9 @@ int MORSE_zgetrs_incpiv(MORSE_enum trans, int N, int NRHS,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......
......@@ -151,8 +151,9 @@ int MORSE_zgetrs_nopiv(MORSE_enum trans, int N, int NRHS,
morse_sequence_wait(morse, sequence);
morse_desc_mat_free(&descA);
morse_desc_mat_free(&descB);
/* Cleanup the temporary data */
morse_ztile2lap_cleanup( morse, &descAl, &descAt );
morse_ztile2lap_cleanup( morse, &descBl, &descBt );
status = sequence->status;
morse_sequence_destroy(morse, sequence);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment