pzplgsy.c 2.73 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.
7 8
 * @copyright 2012-2016 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
 *                      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
    RUNTIME_options_init(&options, chamctxt, sequence, request);
48 49 50 51

    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
52

53
        /*
Mathieu Faverge's avatar
Mathieu Faverge committed
54
         * ChamLower
55
         */
Mathieu Faverge's avatar
Mathieu Faverge committed
56
        if (uplo == ChamLower) {
57 58
            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
59

60
                options.priority = m + n;
Mathieu Faverge's avatar
Mathieu Faverge committed
61
                INSERT_TASK_zplgsy(
62 63 64 65 66 67
                    &options,
                    bump, tempmm, tempnn, A(m, n), ldam,
                    A->m, m*A->mb, n*A->nb, seed );
            }
        }
        /*
Mathieu Faverge's avatar
Mathieu Faverge committed
68
         * ChamUpper
69
         */
Mathieu Faverge's avatar
Mathieu Faverge committed
70
        else if (uplo == ChamUpper) {
71 72 73 74
            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
75
                INSERT_TASK_zplgsy(
76 77 78 79 80 81
                    &options,
                    bump, tempmm, tempnn, A(m, n), ldam,
                    A->m, m*A->mb, n*A->nb, seed );
            }
        }
        /*
Mathieu Faverge's avatar
Mathieu Faverge committed
82
         * ChamUpperLower
83 84
         */
        else {
Mathieu Faverge's avatar
Mathieu Faverge committed
85 86
            for (n = 0; n < A->nt; n++) {
                tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
87

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