Commit 569b4016 authored by PRUVOST Florent's avatar PRUVOST Florent

distribute data for descL in _incpiv algorithms

parent 492df0fa
......@@ -204,7 +204,7 @@ int MORSE_zgetrf_incpiv_Tile(MORSE_desc_t *A, MORSE_desc_t *L, int *IPIV)
MORSE_zgetrf_incpiv_Tile_Async(A, L, IPIV, sequence, &request);
RUNTIME_barrier(morse);
RUNTIME_desc_getoncpu(A);
status = sequence->status;
morse_sequence_destroy(morse, sequence);
return status;
......
......@@ -909,20 +909,20 @@ void MORSE_ALLOC_WORKSPACE_ZGEQRF(int *M, int *N, MORSE_desc_t **T, int *p, int
void MORSE_ALLOC_WORKSPACE_ZGEQRF_TILE(int *M, int *N, MORSE_desc_t **descT, int *p, int *q, int *info)
{ *info = MORSE_Alloc_Workspace_zgeqrf_Tile(*M, *N, descT, *p, *q); }
void MORSE_ALLOC_WORKSPACE_ZGESV_INCPIV(int *N, MORSE_desc_t **descL, int **IPIV, int *info)
{ *info = MORSE_Alloc_Workspace_zgesv_incpiv(*N, descL, IPIV); }
void MORSE_ALLOC_WORKSPACE_ZGESV_INCPIV(int *N, MORSE_desc_t **descL, int **IPIV, int *p, int *q, int *info)
{ *info = MORSE_Alloc_Workspace_zgesv_incpiv(*N, descL, IPIV, *p, *q); }
void MORSE_ALLOC_WORKSPACE_ZGESV_INCPIV_TILE (int *N, MORSE_desc_t **descL, int **IPIV, int *info)
{ *info = MORSE_Alloc_Workspace_zgesv_incpiv_Tile (*N, descL, IPIV); }
void MORSE_ALLOC_WORKSPACE_ZGESV_INCPIV_TILE (int *N, MORSE_desc_t **descL, int **IPIV, int *p, int *q, int *info)
{ *info = MORSE_Alloc_Workspace_zgesv_incpiv_Tile (*N, descL, IPIV, *p, *q); }
//void MORSE_ALLOC_WORKSPACE_ZGESVD(int *M, int *N, MORSE_desc_t **descT, int *info)
//{ *info = MORSE_Alloc_Workspace_zgesvd(*M, *N, descT); }
void MORSE_ALLOC_WORKSPACE_ZGETRF_INCPIV(int *M, int *N, MORSE_desc_t **descL, int **IPIV, int *info)
{ *info = MORSE_Alloc_Workspace_zgetrf_incpiv(*M, *N, descL, IPIV); }
void MORSE_ALLOC_WORKSPACE_ZGETRF_INCPIV(int *M, int *N, MORSE_desc_t **descL, int **IPIV, int *p, int *q, int *info)
{ *info = MORSE_Alloc_Workspace_zgetrf_incpiv(*M, *N, descL, IPIV, *p, *q); }
void MORSE_ALLOC_WORKSPACE_ZGETRF_INCPIV_TILE(int *N, MORSE_desc_t **descL, int **IPIV, int *info)
{ *info = MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(*N, descL, IPIV); }
void MORSE_ALLOC_WORKSPACE_ZGETRF_INCPIV_TILE(int *N, MORSE_desc_t **descL, int **IPIV, int *p, int *q, int *info)
{ *info = MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(*N, descL, IPIV, *p, *q); }
//void MORSE_ALLOC_WORKSPACE_ZGETRI_TILE_ASYNC(MORSE_desc_t *A, MORSE_desc_t *W, int *info)
//{ *info = MORSE_Alloc_Workspace_zgetri_Tile_Async(A, W); }
......
......@@ -2875,7 +2875,7 @@ module morse_z
end interface
interface
function MORSE_Alloc_Workspace_zgesv_incpiv_c(N,descL,IPIV) &
function MORSE_Alloc_Workspace_zgesv_incpiv_c(N,descL,IPIV,p,q) &
& bind(c, name='MORSE_Alloc_Workspace_zgesv_incpiv')
use iso_c_binding
implicit none
......@@ -2883,11 +2883,13 @@ module morse_z
integer(kind=c_int), value :: N
type(c_ptr) :: descL ! descL is **, so pass by reference
type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
integer(kind=c_int), value :: p
integer(kind=c_int), value :: q
end function MORSE_Alloc_Workspace_zgesv_incpiv_c
end interface
interface
function MORSE_Alloc_Workspace_zgesv_incpiv_Tile_c(N,descL,IPIV) &
function MORSE_Alloc_Workspace_zgesv_incpiv_Tile_c(N,descL,IPIV,p,q) &
& bind(c, name='MORSE_Alloc_Workspace_zgesv_incpiv_Tile')
use iso_c_binding
implicit none
......@@ -2895,6 +2897,8 @@ module morse_z
integer(kind=c_int), value :: N
type(c_ptr) :: descL ! descL is **, so pass by reference
type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
integer(kind=c_int), value :: p
integer(kind=c_int), value :: q
end function MORSE_Alloc_Workspace_zgesv_incpiv_Tile_c
end interface
......@@ -2913,7 +2917,7 @@ module morse_z
end interface
interface
function MORSE_Alloc_Workspace_zgetrf_incpiv_c(M,N,descL,IPIV) &
function MORSE_Alloc_Workspace_zgetrf_incpiv_c(M,N,descL,IPIV,p,q) &
& bind(c, name='MORSE_Alloc_Workspace_zgetrf_incpiv')
use iso_c_binding
implicit none
......@@ -2922,11 +2926,13 @@ module morse_z
integer(kind=c_int), value :: N
type(c_ptr) :: descL ! descL is **, so pass by reference
type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
integer(kind=c_int), value :: p
integer(kind=c_int), value :: q
end function MORSE_Alloc_Workspace_zgetrf_incpiv_c
end interface
interface
function MORSE_Alloc_Workspace_zgetrf_incpiv_Tile_c(N,descL,IPIV) &
function MORSE_Alloc_Workspace_zgetrf_incpiv_Tile_c(N,descL,IPIV,p,q) &
& bind(c, name='MORSE_Alloc_Workspace_zgetrf_incpiv_Tile')
use iso_c_binding
implicit none
......@@ -2934,6 +2940,8 @@ module morse_z
integer(kind=c_int), value :: N
type(c_ptr) :: descL ! descL is **, so pass by reference
type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
integer(kind=c_int), value :: p
integer(kind=c_int), value :: q
end function MORSE_Alloc_Workspace_zgetrf_incpiv_Tile_c
end interface
......@@ -5269,17 +5277,19 @@ module morse_z
info = MORSE_Alloc_Workspace_zgeqrf_c(M,N,T)
end subroutine MORSE_Alloc_Workspace_zgeqrf
subroutine MORSE_Alloc_Workspace_zgesv_incpiv(N,L,IPIV,info)
subroutine MORSE_Alloc_Workspace_zgesv_incpiv(N,L,IPIV,p,q,info)
use iso_c_binding
implicit none
integer(kind=c_int), intent(out) :: info
integer(kind=c_int), intent(in) :: N
type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
type(c_ptr) :: L ! L is **, so pass by reference
info = MORSE_Alloc_Workspace_zgesv_incpiv_c(N,L,IPIV)
integer(kind=c_int), value :: p
integer(kind=c_int), value :: q
info = MORSE_Alloc_Workspace_zgesv_incpiv_c(N,L,IPIV,p,q)
end subroutine MORSE_Alloc_Workspace_zgesv_incpiv
subroutine MORSE_Alloc_Workspace_zgetrf_incpiv(M,N,L,IPIV,info)
subroutine MORSE_Alloc_Workspace_zgetrf_incpiv(M,N,L,IPIV,p,q,info)
use iso_c_binding
implicit none
integer(kind=c_int), intent(out) :: info
......@@ -5287,7 +5297,9 @@ module morse_z
integer(kind=c_int), intent(in) :: N
type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
type(c_ptr) :: L ! L is **, so pass by reference
info = MORSE_Alloc_Workspace_zgetrf_incpiv_c(M,N,L,IPIV)
integer(kind=c_int), value :: p
integer(kind=c_int), value :: q
info = MORSE_Alloc_Workspace_zgetrf_incpiv_c(M,N,L,IPIV,p,q)
end subroutine MORSE_Alloc_Workspace_zgetrf_incpiv
subroutine MORSE_Alloc_Workspace_zgeev(N,T,info)
......@@ -5430,24 +5442,28 @@ module morse_z
info = MORSE_Alloc_Workspace_zgeqrf_Tile_c(M,N,descT,p,q)
end subroutine MORSE_Alloc_Workspace_zgeqrf_Tile
subroutine MORSE_Alloc_Workspace_zgesv_incpiv_Tile(N,descL,IPIV,info)
subroutine MORSE_Alloc_Workspace_zgesv_incpiv_Tile(N,descL,IPIV,p,q,info)
use iso_c_binding
implicit none
integer(kind=c_int), intent(out) :: info
integer(kind=c_int), intent(in) :: N
type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
type(c_ptr) :: descL ! descL is **, so pass by reference
info = MORSE_Alloc_Workspace_zgesv_incpiv_Tile_c(N,descL,IPIV)
integer(kind=c_int), value :: p
integer(kind=c_int), value :: q
info = MORSE_Alloc_Workspace_zgesv_incpiv_Tile_c(N,descL,IPIV,p,q)
end subroutine MORSE_Alloc_Workspace_zgesv_incpiv_Tile
subroutine MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(N,descL,IPIV,info)
subroutine MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(N,descL,IPIV,p,q,info)
use iso_c_binding
implicit none
integer(kind=c_int), intent(out) :: info
integer(kind=c_int), intent(in) :: N
type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
type(c_ptr) :: descL ! descL is **, so pass by reference
info = MORSE_Alloc_Workspace_zgetrf_incpiv_Tile_c(N,descL,IPIV)
integer(kind=c_int), value :: p
integer(kind=c_int), value :: q
info = MORSE_Alloc_Workspace_zgetrf_incpiv_Tile_c(N,descL,IPIV,p,q)
end subroutine MORSE_Alloc_Workspace_zgetrf_incpiv_Tile
subroutine MORSE_Alloc_Workspace_zgetri_Tile_Async(A,W,info)
......
......@@ -108,7 +108,7 @@ int morse_alloc_ibnb_tile(int M, int N, MORSE_enum func, int type, MORSE_desc_t
/*******************************************************************************
*
**/
int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc, void **IPIV)
int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc, void **IPIV, int p, int q)
{
int status;
int NB, IB, MT, NT;
......@@ -148,12 +148,11 @@ int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **des
*IPIV = NULL;
return MORSE_SUCCESS;
}
*desc = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
/* TODO: Fix the distribution for IPIV */
*IPIV = (int*)malloc( size );
/* TODO: Fix the distribution for L / IPIV */
**desc = morse_desc_init(type, IB, NB, IB*NB, lm, ln, 0, 0, lm, ln, 1, 1 );
*desc = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
**desc = morse_desc_init(type, IB, NB, IB*NB, lm, ln, 0, 0, lm, ln, p, q );
if ( morse_desc_mat_alloc(*desc) ) {
morse_error("morse_alloc_ipiv", "malloc() failed");
......
......@@ -33,7 +33,7 @@ extern "C" {
* Internal routines
**/
int morse_alloc_ibnb_tile(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc, int p, int q);
int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc, void **IPIV);
int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc, void **IPIV, int p, int q);
#ifdef __cplusplus
}
......
......@@ -333,8 +333,8 @@ int MORSE_Alloc_Workspace_zgelqf_Tile(int M, int N, MORSE_desc_t **descT, int p,
* \retval MORSE_SUCCESS successful exit
*
*****************************************************************************/
int MORSE_Alloc_Workspace_zgesv_incpiv(int N, MORSE_desc_t **descL, int **IPIV) {
return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV); }
int MORSE_Alloc_Workspace_zgesv_incpiv(int N, MORSE_desc_t **descL, int **IPIV, int p, int q) {
return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV, p, q); }
/** ***************************************************************************
*
......@@ -363,9 +363,9 @@ int MORSE_Alloc_Workspace_zgesv_incpiv(int N, MORSE_desc_t **descL, int **IPIV)
* \retval MORSE_SUCCESS successful exit
*
*****************************************************************************/
int MORSE_Alloc_Workspace_zgesv_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV)
int MORSE_Alloc_Workspace_zgesv_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV, int p, int q)
{
return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV);
return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV, p, q);
}
/** ***************************************************************************
*
......@@ -436,8 +436,8 @@ int MORSE_Alloc_Workspace_zgesvd(int M, int N, MORSE_desc_t **descT, int p, int
* @sa MORSE_zgetrf_incpiv_Tile_Async
*
******************************************************************************/
int MORSE_Alloc_Workspace_zgetrf_incpiv(int M, int N, MORSE_desc_t **descL, int **IPIV) {
return morse_alloc_ipiv(M, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV); }
int MORSE_Alloc_Workspace_zgetrf_incpiv(int M, int N, MORSE_desc_t **descL, int **IPIV, int p, int q) {
return morse_alloc_ipiv(M, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV, p, q); }
/** ***************************************************************************
*
......@@ -465,8 +465,8 @@ int MORSE_Alloc_Workspace_zgetrf_incpiv(int M, int N, MORSE_desc_t **descL, int
* \retval MORSE_SUCCESS successful exit
*
******************************************************************************/
int MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV) {
return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV); }
int MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV, int p, int q) {
return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV, p, q); }
/** ***************************************************************************
*
......
......@@ -261,8 +261,8 @@ int MORSE_zunmqr_Tile_Async(MORSE_enum side, MORSE_enum trans, MORSE_desc_t *A,
/** ****************************************************************************
* Declarations of workspace allocation functions (tile layout) - alphabetical order
**/
int MORSE_Alloc_Workspace_zgesv_incpiv( int N, MORSE_desc_t **descL, int **IPIV);
int MORSE_Alloc_Workspace_zgetrf_incpiv(int M, int N, MORSE_desc_t **descL, int **IPIV);
int MORSE_Alloc_Workspace_zgesv_incpiv( int N, MORSE_desc_t **descL, int **IPIV, int p, int q);
int MORSE_Alloc_Workspace_zgetrf_incpiv(int M, int N, MORSE_desc_t **descL, int **IPIV, int p, int q);
int MORSE_Alloc_Workspace_zgebrd(int M, int N, MORSE_desc_t **descT, int p, int q);
int MORSE_Alloc_Workspace_zgeev( int N, MORSE_desc_t **descT, int p, int q);
......@@ -286,8 +286,8 @@ int MORSE_Alloc_Workspace_zgetri_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *W);
int MORSE_Alloc_Workspace_zgelqf_Tile(int M, int N, MORSE_desc_t **descT, int p, int q);
int MORSE_Alloc_Workspace_zgels_Tile( int M, int N, MORSE_desc_t **descT, int p, int q);
int MORSE_Alloc_Workspace_zgeqrf_Tile(int M, int N, MORSE_desc_t **descT, int p, int q);
int MORSE_Alloc_Workspace_zgesv_incpiv_Tile (int N, MORSE_desc_t **descL, int **IPIV);
int MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV);
int MORSE_Alloc_Workspace_zgesv_incpiv_Tile (int N, MORSE_desc_t **descL, int **IPIV, int p, int q);
int MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV, int p, int q);
/** ****************************************************************************
* Auxiliary function prototypes
......
......@@ -220,7 +220,7 @@ int testing_zgesv_incpiv(int argc, char **argv)
B2[LDB*j+i] = B1[LDB*j+i];
/* MORSE ZGESV */
MORSE_Alloc_Workspace_zgesv_incpiv(N, &L, &IPIV);
MORSE_Alloc_Workspace_zgesv_incpiv(N, &L, &IPIV, 1, 1);
MORSE_zgesv_incpiv(N, NRHS, A2, LDA, L, IPIV, B2, LDB);
printf("\n");
......
......@@ -45,7 +45,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
MORSE_zplrnt( N, N, A, LDA, 51 );
MORSE_zplrnt( N, NRHS, X, LDB, 5673 );
MORSE_Alloc_Workspace_zgesv_incpiv(N, &L, &piv);
MORSE_Alloc_Workspace_zgesv_incpiv(N, &L, &piv, P, Q);
/* Save A and b */
PASTE_CODE_ALLOCATE_COPY( Acpy, check, MORSE_Complex64_t, A, LDA, N );
......
......@@ -30,12 +30,12 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
MORSE_desc_t *descL;
int *piv;
PASTE_CODE_IPARAM_LOCALS( iparam );
if ( M != N ) {
fprintf(stderr, "This timing works only with M == N\n");
return -1;
}
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, MORSE_Complex64_t, MorseComplexDouble, LDA, N, N );
PASTE_CODE_ALLOCATE_MATRIX_TILE( descX, 1, MORSE_Complex64_t, MorseComplexDouble, LDB, N, NRHS );
......@@ -54,12 +54,12 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
}
/* Allocate Workspace */
MORSE_Alloc_Workspace_zgesv_incpiv_Tile(N, &descL, &piv);
MORSE_Alloc_Workspace_zgesv_incpiv_Tile(N, &descL, &piv, P, Q);
START_TIMING();
MORSE_zgesv_incpiv_Tile( descA, descL, piv, descX );
STOP_TIMING();
/* Allocate Workspace */
MORSE_Dealloc_Workspace(&descL);
......
......@@ -31,7 +31,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
MORSE_desc_t *L;
int *piv;
PASTE_CODE_IPARAM_LOCALS( iparam );
if ( M != N && check ) {
fprintf(stderr, "Check cannot be perfomed with M != N\n");
check = 0;
......@@ -39,12 +39,12 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX( A, 1, MORSE_Complex64_t, LDA, N );
/* Initialize Data */
MORSE_zplrnt(M, N, A, LDA, 3456);
/* Allocate Workspace */
MORSE_Alloc_Workspace_zgesv_incpiv( min(M,N), &L, &piv);
MORSE_Alloc_Workspace_zgesv_incpiv( min(M,N), &L, &piv, P, Q);
/* Save AT in lapack layout for check */
PASTE_CODE_ALLOCATE_COPY( Acpy, check, MORSE_Complex64_t, A, LDA, N );
......@@ -52,7 +52,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
START_TIMING();
MORSE_zgetrf_incpiv( M, N, A, LDA, L, piv );
STOP_TIMING();
/* Check the solution */
if ( check )
{
......@@ -66,7 +66,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
&(dparam[IPARAM_ANORM]),
&(dparam[IPARAM_BNORM]),
&(dparam[IPARAM_XNORM]));
free( Acpy ); free( B ); free( X );
}
......
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