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

pzplgsy.c 2.74 KB
Newer Older
1
/**
2 3
 *
 * @file pzplgsy.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 zplgsy parallel algorithm
13
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
14
 * @version 1.0.0
15 16
 * @comment This file is a copy of pzplgsy.c,
            wich has been automatically generated
Mathieu Faverge's avatar
Mathieu Faverge committed
17
 *          from Plasma 2.5.0 for CHAMELEON 1.0.0
18 19 20
 * @author Mathieu Faverge
 * @author Emmanuel Agullo
 * @author Cedric Castagnede
21 22 23
 * @author Rade Mathis
 * @author Florent Pruvost
 * @date 2016-08-01
24 25
 * @precisions normal z -> c d s
 *
26
 */
27
#include "control/common.h"
28 29

#define A(m,n) A,  m,  n
30
/**
Mathieu Faverge's avatar
Mathieu Faverge committed
31
 *  chameleon_pzplgsy - Generate a random symmetric (positive definite if 'bump' is large enough) half-matrix by tiles.
32
 */
Mathieu Faverge's avatar
Mathieu Faverge committed
33
void chameleon_pzplgsy( CHAMELEON_Complex64_t bump, cham_uplo_t uplo, CHAM_desc_t *A,
34
                    unsigned long long int seed,
Mathieu Faverge's avatar
Mathieu Faverge committed
35
                    RUNTIME_sequence_t *sequence, RUNTIME_request_t *request )
36
{
Mathieu Faverge's avatar
Mathieu Faverge committed
37
    CHAM_context_t *chamctxt;
Mathieu Faverge's avatar
Mathieu Faverge committed
38
    RUNTIME_option_t options;
39 40 41 42 43

    int m, n;
    int ldam;
    int tempmm, tempnn;

Mathieu Faverge's avatar
Mathieu Faverge committed
44
    chamctxt = chameleon_context_self();
Mathieu Faverge's avatar
Mathieu Faverge committed
45
    if (sequence->status != CHAMELEON_SUCCESS) {
46
        return;
Mathieu Faverge's avatar
Mathieu Faverge committed
47
    }
Mathieu Faverge's avatar
Mathieu Faverge committed
48
    RUNTIME_options_init(&options, chamctxt, sequence, request);
49 50 51 52

    for (m = 0; m < A->mt; m++) {
        tempmm = m == A->mt-1 ? A->m-m*A->mb : A->mb;
        ldam = BLKLDD(A, m);
Mathieu Faverge's avatar
Mathieu Faverge committed
53

54
        /*
Mathieu Faverge's avatar
Mathieu Faverge committed
55
         * ChamLower
56
         */
Mathieu Faverge's avatar
Mathieu Faverge committed
57
        if (uplo == ChamLower) {
58 59
            for (n = 0; n <= m; n++) {
                tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
Mathieu Faverge's avatar
Mathieu Faverge committed
60

61
                options.priority = m + n;
Mathieu Faverge's avatar
Mathieu Faverge committed
62
                INSERT_TASK_zplgsy(
63 64 65 66 67 68
                    &options,
                    bump, tempmm, tempnn, A(m, n), ldam,
                    A->m, m*A->mb, n*A->nb, seed );
            }
        }
        /*
Mathieu Faverge's avatar
Mathieu Faverge committed
69
         * ChamUpper
70
         */
Mathieu Faverge's avatar
Mathieu Faverge committed
71
        else if (uplo == ChamUpper) {
72 73 74 75
            for (n = m; n < A->nt; n++) {
                tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;

                options.priority = m + n;
Mathieu Faverge's avatar
Mathieu Faverge committed
76
                INSERT_TASK_zplgsy(
77 78 79 80 81 82
                    &options,
                    bump, tempmm, tempnn, A(m, n), ldam,
                    A->m, m*A->mb, n*A->nb, seed );
            }
        }
        /*
Mathieu Faverge's avatar
Mathieu Faverge committed
83
         * ChamUpperLower
84 85
         */
        else {
Mathieu Faverge's avatar
Mathieu Faverge committed
86 87
            for (n = 0; n < A->nt; n++) {
                tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
88

Mathieu Faverge's avatar
Mathieu Faverge committed
89
                INSERT_TASK_zplgsy(
Mathieu Faverge's avatar
Mathieu Faverge committed
90 91 92 93
                    &options,
                    bump, tempmm, tempnn, A(m, n), ldam,
                    A->m, m*A->mb, n*A->nb, seed );
            }
94 95
        }
    }
Mathieu Faverge's avatar
Mathieu Faverge committed
96
    RUNTIME_options_finalize(&options, chamctxt);
97
}