Une nouvelle version du portail de gestion des comptes externes sera mise en production lundi 09 août. Elle permettra d'allonger la validité d'un compte externe jusqu'à 3 ans. Pour plus de détails sur cette version consulter : https://doc-si.inria.fr/x/FCeS

pzgebrd_ge2gb.c 4.08 KB
Newer Older
1
/**
2 3
 *
 * @file pzgebrd_ge2gb.c
4
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
5 6
 * @copyright 2009-2014 The University of Tennessee and The University of
 *                      Tennessee Research Foundation. All rights reserved.
Mathieu Faverge's avatar
Mathieu Faverge committed
7
 * @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8
 *                      Univ. Bordeaux. All rights reserved.
9
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
10
 ***
11
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
12
 * @brief Chameleon zgebrd_ge2gb parallel algorithm
13
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
14
 * @version 1.0.0
15 16 17 18 19
 * @author Hatem Ltaief
 * @author Azzam Haidar
 * @date 2010-11-15
 * @precisions normal z -> s d c
 *
20
 */
21 22
#include "control/common.h"

23 24
void chameleon_pzgebrd_ge2gb( int genD, CHAM_desc_t *A, CHAM_desc_t *T, CHAM_desc_t *D,
                              RUNTIME_sequence_t *sequence, RUNTIME_request_t *request )
25 26 27
{
    int k;
    int tempkm, tempkn;
Mathieu Faverge's avatar
Mathieu Faverge committed
28
    CHAM_desc_t *A1, *A2, *T1, *D1 = NULL;
29

30
    if (A->m >= A->n){
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
31 32
        for (k = 0; k < A->nt; k++) {
            tempkn = k == A->nt-1 ? A->n-k*A->nb : A->nb;
33

Mathieu Faverge's avatar
Mathieu Faverge committed
34 35 36
            A1 = chameleon_desc_submatrix(A, k*A->mb,     k*A->nb, A->m-k*A->mb, tempkn);
            A2 = chameleon_desc_submatrix(A, k*A->mb, (k+1)*A->nb, A->m-k*A->mb, A->n-(k+1)*A->nb);
            T1 = chameleon_desc_submatrix(T, k*T->mb,     k*T->nb, T->m-k*T->mb, T->nb );
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
37
            if ( D != NULL ) {
Mathieu Faverge's avatar
Mathieu Faverge committed
38
                D1 = chameleon_desc_submatrix(D, k*D->mb, k*D->nb, D->m-k*D->mb, tempkn);
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
39
            }
40

41 42
            chameleon_pzgeqrf( genD, A1, T1, D1,
                               sequence, request);
43

44 45 46
            chameleon_pzunmqr( 0, ChamLeft, ChamConjTrans,
                               A1, A2, T1, D1,
                               sequence, request);
47

Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
48
            if (k+1 < A->nt){
49
                tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
50

Mathieu Faverge's avatar
Mathieu Faverge committed
51 52 53
                A1 = chameleon_desc_submatrix(A,     k*A->mb, (k+1)*A->nb, tempkm,           A->n-(k+1)*A->nb);
                A2 = chameleon_desc_submatrix(A, (k+1)*A->mb, (k+1)*A->nb, A->m-(k+1)*A->mb, A->n-(k+1)*A->nb);
                T1 = chameleon_desc_submatrix(T,     k*T->mb, (k+1)*T->nb, T->mb,            T->n-(k+1)*T->nb);
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
54
                if ( D != NULL ) {
Mathieu Faverge's avatar
Mathieu Faverge committed
55
                    D1 = chameleon_desc_submatrix(D, k*D->mb, (k+1)*D->nb, tempkm,           D->n-(k+1)*D->nb);
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
56
                }
57

58 59
                chameleon_pzgelqf( genD, A1, T1, D1,
                                   sequence, request);
60

61 62 63
                chameleon_pzunmlq( 0, ChamRight, ChamConjTrans,
                                   A1, A2, T1, D1,
                                   sequence, request);
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
64 65
            }
        }
66 67
    }
    else{
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
68 69
        for (k = 0; k < A->mt; k++) {
            tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
70

Mathieu Faverge's avatar
Mathieu Faverge committed
71 72 73
            A1 = chameleon_desc_submatrix(A,     k*A->mb, k*A->nb, tempkm,           A->n-k*A->nb);
            A2 = chameleon_desc_submatrix(A, (k+1)*A->mb, k*A->nb, A->m-(k+1)*A->mb, A->n-k*A->nb);
            T1 = chameleon_desc_submatrix(T,     k*T->mb, k*T->nb, T->mb,            T->n-k*T->nb);
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
74
            if ( D != NULL ) {
Mathieu Faverge's avatar
Mathieu Faverge committed
75
                D1 = chameleon_desc_submatrix(D, k*D->mb, k*D->nb, tempkm,           D->n-k*D->nb);
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
76
            }
77 78
            chameleon_pzgelqf( genD, A1, T1, D1,
                               sequence, request);
79

80 81 82
            chameleon_pzunmlq( 0, ChamRight, ChamConjTrans,
                               A1, A2, T1, D1,
                               sequence, request);
83

Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
84
            if (k+1 < A->mt){
85
                tempkn = k == A->nt-1 ? A->n-k*A->nb : A->nb;
86

Mathieu Faverge's avatar
Mathieu Faverge committed
87 88 89
                A1 = chameleon_desc_submatrix(A, (k+1)*A->mb,     k*A->nb, A->m-(k+1)*A->mb, tempkn);
                A2 = chameleon_desc_submatrix(A, (k+1)*A->mb, (k+1)*A->nb, A->m-(k+1)*A->mb, A->n-(k+1)*A->nb);
                T1 = chameleon_desc_submatrix(T, (k+1)*T->mb,     k*T->nb, T->m-(k+1)*T->mb, T->nb );
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
90
                if ( D != NULL ) {
Mathieu Faverge's avatar
Mathieu Faverge committed
91
                    D1 = chameleon_desc_submatrix(D, (k+1)*D->mb, k*D->nb, D->m-(k+1)*D->mb, tempkn);
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
92
                }
93

94 95
                chameleon_pzgeqrf( genD, A1, T1, D1,
                                   sequence, request);
96

97 98 99
                chameleon_pzunmqr( 0, ChamLeft, ChamConjTrans,
                                   A1, A2, T1, D1,
                                   sequence, request);
Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
100 101
            }
        }
102 103
    }
}