Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

pztrtri.c 5.05 KB
Newer Older
1
/**
2 3
 *
 * @file pztrtri.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 ztrtri parallel algorithm
13
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
14
 * @version 1.0.0
15
 * @comment This file has been automatically generated
Mathieu Faverge's avatar
Mathieu Faverge committed
16
 *          from Plasma 2.5.0 for CHAMELEON 1.0.0
17 18 19 20 21 22 23 24
 * @author Julien Langou
 * @author Henricus Bouwmeester
 * @author Mathieu Faverge
 * @author Emmanuel Agullo
 * @author Cedric Castagnede
 * @date 2010-11-15
 * @precisions normal z -> s d c
 *
25
 */
26
#include "control/common.h"
27 28

#define A(m,n) A,  m,  n
29
/**
30
 *  Parallel tile triangular matrix inverse - dynamic scheduling
31
 */
Mathieu Faverge's avatar
Mathieu Faverge committed
32
void chameleon_pztrtri(cham_uplo_t uplo, cham_diag_t diag, CHAM_desc_t *A,
Mathieu Faverge's avatar
Mathieu Faverge committed
33
                          RUNTIME_sequence_t *sequence, RUNTIME_request_t *request)
34
{
Mathieu Faverge's avatar
Mathieu Faverge committed
35
    CHAM_context_t *chamctxt;
Mathieu Faverge's avatar
Mathieu Faverge committed
36
    RUNTIME_option_t options;
37 38

    int k, m, n;
39 40
    int ldam, ldak;
    int tempkn, tempkm, tempmm, tempnn;
41

Mathieu Faverge's avatar
Mathieu Faverge committed
42 43
    CHAMELEON_Complex64_t zone  = (CHAMELEON_Complex64_t) 1.0;
    CHAMELEON_Complex64_t mzone = (CHAMELEON_Complex64_t)-1.0;
44

Mathieu Faverge's avatar
Mathieu Faverge committed
45
    chamctxt = chameleon_context_self();
Mathieu Faverge's avatar
Mathieu Faverge committed
46
    if (sequence->status != CHAMELEON_SUCCESS)
47
        return;
Mathieu Faverge's avatar
Mathieu Faverge committed
48
    RUNTIME_options_init(&options, chamctxt, sequence, request);
49
    /*
Mathieu Faverge's avatar
Mathieu Faverge committed
50
     *  ChamLower
51
     */
Mathieu Faverge's avatar
Mathieu Faverge committed
52
    if (uplo == ChamLower) {
53
        for (k = 0; k < A->nt; k++) {
Mathieu Faverge's avatar
Mathieu Faverge committed
54
            RUNTIME_iteration_push(chamctxt, k);
55

56 57 58
            tempkn = k == A->nt-1 ? A->n-k*A->nb : A->nb;
            ldak = BLKLDD(A, k);
            for (m = k+1; m < A->mt; m++) {
59 60
                tempmm = m == A->mt-1 ? A->m-m*A->mb : A->mb;
                ldam = BLKLDD(A, m);
Mathieu Faverge's avatar
Mathieu Faverge committed
61
                INSERT_TASK_ztrsm(
62
                    &options,
Mathieu Faverge's avatar
Mathieu Faverge committed
63
                    ChamRight, uplo, ChamNoTrans, diag,
64 65 66
                    tempmm, tempkn, A->mb,
                    mzone, A(k, k), ldak,
                           A(m, k), ldam);
67
            }
68
            for (m = k+1; m < A->mt; m++) {
69 70
                tempmm = m == A->mt-1 ? A->m-m*A->mb : A->mb;
                ldam = BLKLDD(A, m);
71
                for (n = 0; n < k; n++) {
Mathieu Faverge's avatar
Mathieu Faverge committed
72
                    INSERT_TASK_zgemm(
73
                        &options,
Mathieu Faverge's avatar
Mathieu Faverge committed
74
                        ChamNoTrans, ChamNoTrans,
75 76 77 78
                        tempmm, A->nb, tempkn, A->mb,
                        zone, A(m, k), ldam,
                              A(k, n), ldak,
                        zone, A(m, n), ldam);
79
                }
80
                RUNTIME_data_flush( sequence, A(m, k) );
81
            }
82
            for (n = 0; n < k; n++) {
83
                RUNTIME_data_flush( sequence, A(k, n) );
Mathieu Faverge's avatar
Mathieu Faverge committed
84
                INSERT_TASK_ztrsm(
85
                    &options,
Mathieu Faverge's avatar
Mathieu Faverge committed
86
                    ChamLeft, uplo, ChamNoTrans, diag,
87 88 89
                    tempkn, A->nb, A->mb,
                    zone, A(k, k), ldak,
                          A(k, n), ldak);
90
            }
91
            RUNTIME_data_flush( sequence, A(k, k) );
Mathieu Faverge's avatar
Mathieu Faverge committed
92
            INSERT_TASK_ztrtri(
93 94
                &options,
                uplo, diag,
95 96
                tempkn, A->mb,
                A(k, k), ldak, A->nb*k);
97

Mathieu Faverge's avatar
Mathieu Faverge committed
98
            RUNTIME_iteration_pop(chamctxt);
99 100 101
        }
    }
    /*
Mathieu Faverge's avatar
Mathieu Faverge committed
102
     *  ChamUpper
103 104
     */
    else {
105
        for (k = 0; k < A->mt; k++) {
Mathieu Faverge's avatar
Mathieu Faverge committed
106
            RUNTIME_iteration_push(chamctxt, k);
107

108 109 110
            tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
            ldak = BLKLDD(A, k);
            for (n = k+1; n < A->nt; n++) {
111
                tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
Mathieu Faverge's avatar
Mathieu Faverge committed
112
                INSERT_TASK_ztrsm(
113
                    &options,
Mathieu Faverge's avatar
Mathieu Faverge committed
114
                    ChamLeft, uplo, ChamNoTrans, diag,
115 116 117
                    tempkm, tempnn, A->mb,
                    mzone, A(k, k), ldak,
                           A(k, n), ldak);
118
            }
119
            for (n = k+1; n < A->nt; n++) {
120
                tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
121 122
                for (m = 0; m < k; m++) {
                    ldam = BLKLDD(A, m);
Mathieu Faverge's avatar
Mathieu Faverge committed
123
                    INSERT_TASK_zgemm(
124
                        &options,
Mathieu Faverge's avatar
Mathieu Faverge committed
125
                        ChamNoTrans, ChamNoTrans,
126 127 128 129
                        A->mb, tempnn, tempkm, A->mb,
                        zone, A(m, k), ldam,
                              A(k, n), ldak,
                        zone, A(m, n), ldam);
130
                }
131
                RUNTIME_data_flush( sequence, A(k, n) );
132 133 134
            }
            for (m = 0; m < k; m++) {
                ldam = BLKLDD(A, m);
135
                RUNTIME_data_flush( sequence, A(m, k) );
Mathieu Faverge's avatar
Mathieu Faverge committed
136
                INSERT_TASK_ztrsm(
137
                    &options,
Mathieu Faverge's avatar
Mathieu Faverge committed
138
                    ChamRight, uplo, ChamNoTrans, diag,
139 140 141
                    A->mb, tempkm, A->mb,
                    zone, A(k, k), ldak,
                          A(m, k), ldam);
142
            }
143
            RUNTIME_data_flush( sequence, A(k, k) );
Mathieu Faverge's avatar
Mathieu Faverge committed
144
            INSERT_TASK_ztrtri(
145 146
                &options,
                uplo, diag,
147 148
                tempkm, A->mb,
                A(k, k), ldak, A->mb*k);
149

Mathieu Faverge's avatar
Mathieu Faverge committed
150
            RUNTIME_iteration_pop(chamctxt);
151 152
        }
    }
Mathieu Faverge's avatar
Mathieu Faverge committed
153
    RUNTIME_options_finalize(&options, chamctxt);
154
}