Commit 4869799b authored by BOUCHERIE Raphael's avatar BOUCHERIE Raphael

renamed pzgeqrfhqr in pzgeqrf_param, modified cmake for libhqr depencies,...

renamed pzgeqrfhqr in pzgeqrf_param, modified cmake for libhqr depencies, added compute file for param, need to change the commentary and add the test file
parent 4726f7e3
......@@ -250,6 +250,7 @@ endif()
#########################
set(CHAMELEON_DEP "")
set(CHAMELEON_USE_LIBHQR 1)
find_package(LIBHQR REQUIRED)
list(INSERT CHAMELEON_DEP 0 ${LIBHQR_LIBRARIES})
include_directories(${LIBHQR_INCLUDE_DIRS})
......
......@@ -105,7 +105,7 @@ set(ZSRC
pzgelqfrh.c
pzgeqrf.c
pzgeqrfrh.c
pzgeqrfhqr.c
pzgeqrf_param.c
pzgetrf_incpiv.c
pzgetrf_nopiv.c
pzlacpy.c
......@@ -138,6 +138,7 @@ set(ZSRC
zgelqf.c
zgelqs.c
zgeqrf.c
zgeqrf_param.c
zgeqrs.c
#zgesv.c
zgesv_incpiv.c
......
......@@ -9,7 +9,7 @@
/**
*
* @file pzgeqrfhqr.c
* @file pzgeqrf_param.c
*
* MORSE auxiliary routines
* MORSE is a software package provided by Univ. of Tennessee,
......@@ -30,26 +30,26 @@
#include "control/common.h"
#include "libhqr.h"
#define A(m,n) A, (m), (n)
#define TS(m,n) TS, (m), (n)
#define TT(m,n) TT, (m), (n)
#define A(m,n) A, (m), (n)
#define TS(m,n) TS, (m), (n)
#define TT(m,n) TT, (m), (n)
#if defined(CHAMELEON_COPY_DIAG)
#define DIAG(m,n) DIAG, (m), (n)
#define D(m,n) D, (m), (n)
#else
#define DIAG(m,n) A, (m), (n)
#define D(m,n) A, (m), (n)
#endif
/***************************************************************************//**
* Parallel tile QR factorization (reduction Householder) - dynamic scheduling
**/
void morse_pzgeqrfhqr( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_t *TS, MORSE_desc_t *TT,
MORSE_sequence_t *sequence, MORSE_request_t *request)
/**
* Parallel tile QR factorization (reduction Householder) - dynamic scheduling
*/
void morse_pzgeqrf_param( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_t *TS, MORSE_desc_t *TT,
MORSE_sequence_t *sequence, MORSE_request_t *request)
{
MORSE_context_t *morse;
MORSE_option_t options;
size_t ws_worker = 0;
size_t ws_host = 0;
MORSE_desc_t *DIAG = NULL;
MORSE_desc_t *D = NULL;
int k, m, n, i, j, p;
int K, M, RD;
......@@ -90,23 +90,6 @@ void morse_pzgeqrfhqr( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_
tiles = (int*)malloc((qrtree->mt)*sizeof(int));
memset( tiles, 0, (qrtree->mt)*sizeof(int) );
#if defined(CHAMELEON_USE_MAGMA)
/* Worker space
*
* zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
* ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
*/
ws_worker = chameleon_max( ws_worker, ib * (ib + A->nb) );
/* Host space
*
* zgeqrt = ib * (A->nb+3*ib) + A->nb )
* ztsqrt = 2 * ib * (A->nb+ib) + A->nb
*/
ws_host = chameleon_max( ws_host, ib * (A->mb + 3 * ib) + A->mb );
ws_host = chameleon_max( ws_host, 2 * ib * (A->nb + ib) + A->nb );
#endif
ws_worker *= sizeof(MORSE_Complex64_t);
ws_host *= sizeof(MORSE_Complex64_t);
......@@ -115,9 +98,8 @@ void morse_pzgeqrfhqr( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_
#if defined(CHAMELEON_COPY_DIAG)
{
/* necessary to avoid dependencies between tasks regarding the diag tile */
int nblk = ( A->mt + BS -1 ) / BS;
DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb, A->p, A->q);
D = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
morse_zdesc_alloc(*D, A->mb, A->nb, A->m, A->n, 0, 0, A->m, A->n, );
}
#endif
......@@ -138,7 +120,7 @@ void morse_pzgeqrfhqr( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_
MORSE_TASK_zgeqrt(
&options,
tempmm, tempkn, ib, TS->nb,
A(m, k), ldam,
A( m, k), ldam,
TS(m, k), TS->mb);
if ( k < (A->nt-1) ) {
#if defined(CHAMELEON_COPY_DIAG)
......@@ -146,13 +128,13 @@ void morse_pzgeqrfhqr( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_
&options,
MorseLower, tempmm, A->nb, A->nb,
A(m, k), ldam,
DIAG(m, k), ldam );
D(m, k), ldam );
#if defined(CHAMELEON_USE_CUDA)
MORSE_TASK_zlaset(
&options,
MorseUpper, tempmm, A->nb,
0., 1.,
DIAG(m, k), ldam );
D(m, k), ldam );
#endif
#endif
}
......@@ -162,9 +144,9 @@ void morse_pzgeqrfhqr( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_
&options,
MorseLeft, MorseConjTrans,
tempmm, tempnn, tempkmin, ib, TS->nb,
DIAG(m, k), ldam,
D( m, k), ldam,
TS(m, k), TS->mb,
A(m, n), ldam);
A( m, n), ldam);
}
}
......@@ -184,8 +166,8 @@ void morse_pzgeqrfhqr( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_
MORSE_TASK_ztsqrt(
&options,
tempmm, tempkn, ib, TS->nb,
A(p, k), ldap,
A(m, k), ldam,
A( p, k), ldap,
A( m, k), ldam,
TS(m, k), TS->mb);
for (n = k+1; n < A->nt; n++) {
......@@ -194,9 +176,9 @@ void morse_pzgeqrfhqr( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_
&options,
MorseLeft, MorseConjTrans,
A->nb, tempnn, tempmm, tempnn, A->nb, ib, TS->nb,
A(p, n), ldap,
A(m, n), ldam,
A(m, k), ldam,
A( p, n), ldap,
A( m, n), ldam,
A( m, k), ldam,
TS(m, k), TS->mb);
}
}
......@@ -206,8 +188,8 @@ void morse_pzgeqrfhqr( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_
MORSE_TASK_zttqrt(
&options,
tempmm, tempkn, ib, TT->nb,
A(p, k), ldap,
A(m, k), ldam,
A( p, k), ldap,
A( m, k), ldam,
TT(m, k), TT->mb);
for (n = k+1; n < A->nt; n++) {
......@@ -216,9 +198,9 @@ void morse_pzgeqrfhqr( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_
&options,
MorseLeft, MorseConjTrans,
A->mb, tempnn, tempmm, tempnn, A->nb, ib, TT->nb,
A(p, n), ldap,
A(m, n), ldam,
A(m, k), ldam,
A( p, n), ldap,
A( m, n), ldam,
A( m, k), ldam,
TT(m, k), TT->mb);
}
}
......@@ -233,8 +215,8 @@ void morse_pzgeqrfhqr( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_
#if defined(CHAMELEON_COPY_DIAG)
MORSE_Sequence_Wait(sequence);
morse_desc_mat_free(DIAG);
free(DIAG);
morse_desc_mat_free(D);
free(D);
#endif
(void)DIAG;
(void)D;
}
......@@ -205,7 +205,8 @@ int MORSE_zgeqrf_Tile(MORSE_desc_t *A, MORSE_desc_t *T)
return status;
}
/***************************************************************************//**
/**
*****************************************************************************
*
* @ingroup MORSE_Complex64_t_Tile_Async
*
......
This diff is collapsed.
......@@ -154,3 +154,8 @@ void morse_pzunmqrrh(MORSE_enum side, MORSE_enum trans, MORSE_desc_t *A, MORSE_d
void morse_pzunmlq(MORSE_enum side, MORSE_enum trans, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_desc_t *T, MORSE_sequence_t *sequence, MORSE_request_t *request);
void morse_pzunmlqrh(MORSE_enum side, MORSE_enum trans, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_desc_t *T, int BS, MORSE_sequence_t *sequence, MORSE_request_t *request);
void morse_pzbuild( MORSE_enum uplo, MORSE_desc_t *A, void *user_data, void* user_build_callback, MORSE_sequence_t *sequence, MORSE_request_t *request );
#if defined(CHAMELEON_USE_LIBHQR)
void morse_pzgeqrf_param( const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_t *TS, MORSE_desc_t *TT,
MORSE_sequence_t *sequence, MORSE_request_t *request);
#endif /* defined(CHAMELEON_USE_LIBHQR) */
......@@ -37,6 +37,9 @@
/* Communication engine */
#cmakedefine CHAMELEON_USE_MPI
/* Householder reduction trees for QR like operations */
#cmakedefine CHAMELEON_USE_LIBHQR
/* GPU Support */
#cmakedefine CHAMELEON_USE_CUDA
#cmakedefine CHAMELEON_USE_CUBLAS
......@@ -45,5 +48,4 @@
/* Simulating */
#cmakedefine CHAMELEON_SIMULATION
#endif /* CHAMELEON_CONFIG_H_HAS_BEEN_INCLUDED */
......@@ -32,7 +32,6 @@
#define MORSE_VERSION_MINOR @MORSE_VERSION_MINOR@
#define MORSE_VERSION_MICRO @MORSE_VERSION_MICRO@
/* ****************************************************************************
* MORSE types and constants
*/
......@@ -122,6 +121,10 @@ int MORSE_Sequence_Wait (MORSE_sequence_t *sequence);
}
#endif
#if defined(CHAMELEON_USE_LIBHQR)
#include "libhqr.h"
#endif /* defined(CHAMELEON_USE_LIBHQR) */
#include "morse_z.h"
#include "morse_c.h"
#include "morse_d.h"
......
......@@ -273,9 +273,17 @@ int MORSE_zunmqr_Tile_Async(MORSE_enum side, MORSE_enum trans, MORSE_desc_t *A,
//int MORSE_zgecfi_Async(int m, int n, MORSE_Complex64_t *A, MORSE_enum f_in, int imb, int inb, MORSE_enum f_out, int omb, int onb, MORSE_sequence_t *sequence, MORSE_request_t *request);
//int MORSE_zgetmi_Async(int m, int n, MORSE_Complex64_t *A, MORSE_enum f_in, int mb, int inb, MORSE_sequence_t *sequence, MORSE_request_t *request);
/** ****************************************************************************
/**
* Declarations of libhqr dependent functions.
*/
#if defined(CHAMELEON_USE_LIBHQR)
int MORSE_zgeqrf_param(const libhqr_tree_t *qrtree, int M, int N, MORSE_Complex64_t *A, int LDA, MORSE_desc_t *descTS, MORSE_desc_t *descTT);
int MORSE_zgeqrf_param_Tile(const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_t *TS, MORSE_desc_t *TT);
int MORSE_zgeqrf_param_Tile_Async(const libhqr_tree_t *qrtree, MORSE_desc_t *A, MORSE_desc_t *TS, MORSE_desc_t *TT, MORSE_sequence_t *sequence, MORSE_request_t *request);
#endif /* defined(CHAMELEON_USE_LIBHQR) */
/**
* Declarations of workspace allocation functions (tile layout) - alphabetical order
**/
*/
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);
......
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