/* PARALPLUS124

TESTING parallel CLAUSE .
arrA2[*][BLOCK]
or arrA2[BLOCK][*]
or arrA4[BLOCK][*][*][*]
or arrA4[*][*][*][BLOCK]  etc. */

#include <math.h>
#include <stdlib.h>
#include <stdio.h>

#define Min(a, b) (((a) < (b)) ? (a) : (b))

static void parallel21();
static void parallel22();
static void parallel23();
static void parallel24();
static void parallel25();
static void parallel26();
static void parallel27();
static void parallel28();

static void parallel41();
static void parallel42();
static void parallel43();
static void parallel44();
static void parallel45();
static void parallel46();

static void ansyes(const char tname[]);
static void ansno(const char tname[]);

static int NL = 10000;
static int ER = 100000;
static int PN = 2;
static int erri, NNL, i, j, n, m, ia, ja, na, ma, ib, jb, nb, mb, Avalue, Bvalue, s, cs;

int main(int an, char **as)
{
    printf("===START OF paralplus124========================\n");
/* PARALLEL ON arrA[i][2*j]  stretching along j */
    parallel21();
/* PARALLEL ON arrA[i+4][j]  shift along i */
    parallel22();
/* PARALLEL ON arrA[-i+8][j] reverse on i */
//    parallel23();
/* ARALLEL ON arrA[i+4][j+4]  shift along i and j */
    parallel24();
/* PARALLEL ON arrA[i][2*j]  stretching along j */
    parallel25();
/* PARALLEL ON arrA[i+4][j]  shift along i */
    parallel26();
/* PARALLEL ON arrA[-i+8][j] reverse on i */
//    parallel27();
/* ARALLEL ON arrA[i+4][j+4]  shift along i and j */
    parallel28();

/* PARALLEL ON  arrA[i][2* j][k][3*l] stretching */
    parallel41();
/* PARALLEL ON  arrA[i+2][ j][k][ l+3] */
    parallel42();
/* PARALLEL ON  arrA[i][ j][-k+8][- l+8]  reverse */
//    parallel43();
/* PARALLEL ON  arrA[i][ j][2][ l]
                                              compression             !! */
    parallel44();
/* PARALLEL ON  arrA[i][ j][ ][ k]
                                                replication */
    parallel45();
/* PARALLEL ON  arrA[i][ j][ ][3]
                                               compression and replication */
    parallel46();

    printf("=== END OF paralplus124 =========================\n");
    return 0;
}
/* ---------------------------------------------parallel21 */
/* PARALLEL ON arrA[i][2*j]  stretching along j */
void parallel21()
{
    #define AN1 8
    #define AN2 8
    /*  parameters for PARALLEL arrA2[k1i * i + li][k2j * j + lj] */
    #define k1i 1
    #define k2i 0
    #define li 0
    #define k1j 0
    #define k2j 2
    #define lj 0

    #pragma dvm array distribute[*][block]
    int (*A2)[AN2];
    A2 = (int (*)[AN2])malloc(AN1 * sizeof(int[AN2]));

    char tname[] = "paral+21 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j] on A2[i][j])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            A2[i][j] = i * NL + j;
    } /*end region*/
    #pragma dvm get_actual(A2)
    #pragma dvm parallel([i][j] on  A2[k1i * i + li][k2j * j + lj]) reduction(min(erri)), private(ia, ja)
    for (i = 0; i < ((AN1 - li) / k1i); i++)
        for (j = 0; j < ((AN2 - lj) / k2j); j++) {
            ia = k1i * i + li;
            ja = k2j * j + lj;
            if (A2[ia][ja] != ia * NL + ja)
                erri = Min(erri, ia * NL + ja);
        }
    #pragma dvm get_actual(erri)
    if (erri == ER)
        ansyes(tname);
    else
        ansno(tname);

    free(A2);

    #undef AN1
    #undef AN2
    #undef k1i
    #undef k2i
    #undef li
    #undef k1j
    #undef k2j
    #undef lj
}
/* ---------------------------------------------parallel22 */
/* PARALLEL ON arrA[i+4][j]  shift along i */
void parallel22()
{
    #define AN1 8
    #define AN2 8
    /*  parameters for PARALLEL arrA2[k1i * i + li][k2j * j + lj] */
    #define k1i 1
    #define k2i 0
    #define li 4
    #define k1j 0
    #define k2j 1
    #define lj 0

    #pragma dvm array distribute[*][block]
    int (*A2)[AN2];
    A2 = (int (*)[AN2])malloc(AN1 * sizeof(int[AN2]));

    char tname[] = "paral+22 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j] on A2[i][j])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            A2[i][j] = i * NL + j;
    } /*end region*/
    #pragma dvm get_actual(A2)
    #pragma dvm parallel([i][j] on  A2[k1i * i + li][k2j * j + lj]) reduction(min(erri)), private(ia, ja)
    for (i = 0; i < ((AN1 - li) / k1i); i++)
        for (j = 0; j < ((AN2 - lj) / k2j); j++) {
            ia = k1i * i + li;
            ja = k2j * j + lj;
            if (A2[ia][ja] != ia * NL + ja)
                erri = Min(erri, ia * NL + ja);
        }
    #pragma dvm get_actual(erri)
    if (erri == ER)
        ansyes(tname);
    else
        ansno(tname);

    free(A2);

    #undef AN1
    #undef AN2
    #undef k1i
    #undef k2i
    #undef li
    #undef k1j
    #undef k2j
    #undef lj
}
/* ---------------------------------------------parallel23 */
/* PARALLEL ON arrA[-i+8][j] reverse on i */
void parallel23()
{
    #define AN1 7
    #define AN2 8
    /*  parameters for PARALLEL arrA2[k1i * i + li][k2j * j + lj] */
    #define k1i -1
    #define k2i 0
    #define li 8
    #define k1j 0
    #define k2j 1
    #define lj 0

    #pragma dvm array distribute[*][block]
    int (*A2)[AN2];
    A2 = (int (*)[AN2])malloc(AN1 * sizeof(int[AN2]));

    char tname[] = "paral+23 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j] on A2[i][j])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            A2[i][j] = i * NL + j;
    } /*end region*/
    #pragma dvm get_actual(A2)
//    #pragma dvm parallel([i][j] on  A2[k1i * i + li][k2j * j + lj]) reduction(min(erri)), private(ia, ja)
    for (i = 0; i < ((AN1 - li) / k1i); i++)
        for (j = 0; j < ((AN2 - lj) / k2j); j++) {
            ia = k1i * i + li;
            ja = k2j * j + lj;
            if (A2[ia][ja] != ia * NL + ja)
                erri = Min(erri, ia * NL + ja);
        }
    #pragma dvm get_actual(erri)
    if (erri == ER)
        ansyes(tname);
    else
        ansno(tname);

    free(A2);

    #undef AN1
    #undef AN2
    #undef k1i
    #undef k2i
    #undef li
    #undef k1j
    #undef k2j
    #undef lj
}
/* ---------------------------------------------parallel24 */
/* PARALLEL ON arrA[i+4][j+4]  shift along i and j */
void parallel24()
{
    #define AN1 8
    #define AN2 8
    /*  parameters for PARALLEL arrA2[k1i * i + li][k2j * j + lj] */
    #define k1i 1
    #define k2i 0
    #define li 4
    #define k1j 0
    #define k2j 1
    #define lj 4

    #pragma dvm array distribute[*][block]
    int (*A2)[AN2];
    A2 = (int (*)[AN2])malloc(AN1 * sizeof(int[AN2]));

    char tname[] = "paral+24 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j] on A2[i][j])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            A2[i][j] = i * NL + j;
    } /*end region*/
    #pragma dvm get_actual(A2)
    #pragma dvm parallel([i][j] on  A2[k1i * i + li][k2j * j + lj]) reduction(min(erri)), private(ia, ja)
    for (i = 0; i < ((AN1 - li) / k1i); i++)
        for (j = 0; j < ((AN2 - lj) / k2j); j++) {
            ia = k1i * i + li;
            ja = k2j * j + lj;
            if (A2[ia][ja] != ia * NL + ja)
                erri = Min(erri, ia * NL + ja);
        }
    #pragma dvm get_actual(erri)
    if (erri == ER)
        ansyes(tname);
    else
        ansno(tname);

    free(A2);

    #undef AN1
    #undef AN2
    #undef k1i
    #undef k2i
    #undef li
    #undef k1j
    #undef k2j
    #undef lj
}
/* ---------------------------------------------parallel25 */
/* PARALLEL ON arrA[i][2*j]  stretching along j */
void parallel25()
{
    #define AN1 8
    #define AN2 8
    /*  parameters for PARALLEL arrA2[k1i * i + li][k2j * j + lj] */
    #define k1i 1
    #define k2i 0
    #define li 0
    #define k1j 0
    #define k2j 2
    #define lj 0

    #pragma dvm array distribute[block][*]
    int (*A2)[AN2];
    A2 = (int (*)[AN2])malloc(AN1 * sizeof(int[AN2]));

    char tname[] = "paral+25 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j] on A2[i][j])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            A2[i][j] = i * NL + j;
    } /*end region*/
    #pragma dvm get_actual(A2)
    #pragma dvm parallel([i][j] on  A2[k1i * i + li][k2j * j + lj]) reduction(min(erri)), private(ia, ja)
    for (i = 0; i < ((AN1 - li) / k1i); i++)
        for (j = 0; j < ((AN2 - lj) / k2j); j++) {
            ia = k1i * i + li;
            ja = k2j * j + lj;
            if (A2[ia][ja] != ia * NL + ja)
                erri = Min(erri, ia * NL + ja);
        }
    #pragma dvm get_actual(erri)
    if (erri == ER)
        ansyes(tname);
    else
        ansno(tname);

    free(A2);

    #undef AN1
    #undef AN2
    #undef k1i
    #undef k2i
    #undef li
    #undef k1j
    #undef k2j
    #undef lj
}
/* ---------------------------------------------parallel26 */
/* PARALLEL ON arrA[i+4][j]  shift along i */
void parallel26()
{
    #define AN1 8
    #define AN2 8
    /*  parameters for PARALLEL arrA2[k1i * i + li][k2j * j + lj] */
    #define k1i 1
    #define k2i 0
    #define li 4
    #define k1j 0
    #define k2j 1
    #define lj 0

    #pragma dvm array distribute[block][*]
    int (*A2)[AN2];
    A2 = (int (*)[AN2])malloc(AN1 * sizeof(int[AN2]));

    char tname[] = "paral+26 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j] on A2[i][j])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            A2[i][j] = i * NL + j;
    } /*end region*/
    #pragma dvm get_actual(A2)
    #pragma dvm parallel([i][j] on  A2[k1i * i + li][k2j * j + lj]) reduction(min(erri)), private(ia, ja)
    for (i = 0; i < ((AN1 - li) / k1i); i++)
        for (j = 0; j < ((AN2 - lj) / k2j); j++) {
            ia = k1i * i + li;
            ja = k2j * j + lj;
            if (A2[ia][ja] != ia * NL + ja)
                erri = Min(erri, ia * NL + ja);
        }
    #pragma dvm get_actual(erri)
    if (erri == ER)
        ansyes(tname);
    else
        ansno(tname);

    free(A2);

    #undef AN1
    #undef AN2
    #undef k1i
    #undef k2i
    #undef li
    #undef k1j
    #undef k2j
    #undef lj
}
/* ---------------------------------------------parallel27 */
/* PARALLEL ON arrA[-i+8][j] reverse on i */
void parallel27()
{
    #define AN1 7
    #define AN2 8
    /*  parameters for PARALLEL arrA2[k1i * i + li][k2j * j + lj] */
    #define k1i -1
    #define k2i 0
    #define li 8
    #define k1j 0
    #define k2j 1
    #define lj 0

    #pragma dvm array distribute[block][*]
    int (*A2)[AN2];
    A2 = (int (*)[AN2])malloc(AN1 * sizeof(int[AN2]));

    char tname[] = "paral+27 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j] on A2[i][j])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            A2[i][j] = i * NL + j;
    } /*end region*/
    #pragma dvm get_actual(A2)
//    #pragma dvm parallel([i][j] on  A2[k1i * i + li][k2j * j + lj]) reduction(min(erri)), private(ia, ja)
    for (i = 0; i < ((AN1 - li) / k1i); i++)
        for (j = 0; j < ((AN2 - lj) / k2j); j++) {
            ia = k1i * i + li;
            ja = k2j * j + lj;
            if (A2[ia][ja] != ia * NL + ja)
                erri = Min(erri, ia * NL + ja);
        }
    #pragma dvm get_actual(erri)
    if (erri == ER)
        ansyes(tname);
    else
        ansno(tname);

    free(A2);

    #undef AN1
    #undef AN2
    #undef k1i
    #undef k2i
    #undef li
    #undef k1j
    #undef k2j
    #undef lj
}
/* ---------------------------------------------parallel28 */
/* PARALLEL ON arrA[i+4][j+4]  shift along i and j */
void parallel28()
{
    #define AN1 8
    #define AN2 8
    /*  parameters for PARALLEL arrA2[k1i * i + li][k2j * j + lj] */
    #define k1i 1
    #define k2i 0
    #define li 4
    #define k1j 0
    #define k2j 1
    #define lj 4

    #pragma dvm array distribute[block][*]
    int (*A2)[AN2];
    A2 = (int (*)[AN2])malloc(AN1 * sizeof(int[AN2]));

    char tname[] = "paral+28 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j] on A2[i][j])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            A2[i][j] = i * NL + j;
    } /*end region*/
    #pragma dvm get_actual(A2)
    #pragma dvm parallel([i][j] on  A2[k1i * i + li][k2j * j + lj]) reduction(min(erri)), private(ia, ja)
    for (i = 0; i < ((AN1 - li) / k1i); i++)
        for (j = 0; j < ((AN2 - lj) / k2j); j++) {
            ia = k1i * i + li;
            ja = k1j * j + lj;
            if (A2[ia][ja] != ia * NL + ja)
                erri = Min(erri, ia * NL + ja);
        }
    #pragma dvm get_actual(erri)
    if (erri == ER)
        ansyes(tname);
    else
        ansno(tname);

    free(A2);

    #undef AN1
    #undef AN2
    #undef k1i
    #undef k2i
    #undef li
    #undef k1j
    #undef k2j
    #undef lj
}
/* ---------------------------------------------parallel41 */
/* arrA4[*][*] [BLOCK] [*]
        PARALLEL ON  arrA[i][2* j][k][3*l] stretching */
void parallel41()
{
    #define AN1 6
    #define AN2 6
    #define AN3 6
    #define AN4 6
    /*  parameters for PARALLEL ON  arrA[k1i*i+li][k2j*j+lj][k3n*n+ln][k4m*m+lm] */
    #define k1i 1
    #define k2i 0
    #define k3i 0
    #define k4i 0
    #define li 0
    #define k1j 0
    #define k2j 2
    #define k3j 0
    #define k4j 0
    #define lj 0
    #define k1n 0
    #define k2n 0
    #define k3n 1
    #define k4n 0
    #define ln 0
    #define k1m 0
    #define k2m 0
    #define k3m 0
    #define k4m 3
    #define lm 0

    #pragma dvm array distribute[*][block][*][*]
    int (*A4)[AN2][AN3][AN4];
    A4 = (int (*)[AN2][AN3][AN4])malloc(AN1 * sizeof(int[AN2][AN3][AN4]));

    char tname[] = "paral+41 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j][n][m] on A4[i][j][n][m])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            for (n = 0; n < AN3; n++)
                for (m = 0; m < AN4; m++)
                    A4[i][j][n][m] = i * NL / 10 + j * NL / 100 + n * NL / 1000 + m;
    } /*end region*/
    #pragma dvm get_actual(A4)
    #pragma dvm parallel([i][j][n][m] on  A4[k1i * i + li][k2j * j + lj][k3n * n + ln][k4m * m + lm]) reduction(min(erri)), private(ia, ja, na, ma)
    for (i = 0; i < ((AN1 - li) / k1i); i++)
        for (j = 0; j < ((AN2 - lj) / k2j); j++)
            for (n = 0; n < ((AN3 - ln) / k3n); n++)
                for (m = 0; m < ((AN4 - lm) / k4m); m++){
                    ia = k1i * i + li;
                    ja = k2j * j + lj;
                    na = k3n * n + ln;
                    ma = k4m * m + lm;
                    if (A4[ia][ja][na][ma] != ia * NL / 10 + ja * NL / 100 + na * NL / 1000 + ma)
                        erri = Min(erri, i * NL / 10 + j * NL / 100 + n * NL / 1000 + m);
                }
    #pragma dvm get_actual(erri)
    s = 0;
    cs = 0;
    if (erri == ER && s == cs)
        ansyes(tname);
    else
        ansno(tname);

    free(A4);

    #undef AN1
    #undef AN2
    #undef AN3
    #undef AN4
    #undef k1i
    #undef k2i
    #undef k3i
    #undef k4i
    #undef li
    #undef k1j
    #undef k2j
    #undef k3j
    #undef k4j
    #undef lj
    #undef k1n
    #undef k2n
    #undef k3n
    #undef k4n
    #undef ln
    #undef k1m
    #undef k2m
    #undef k3m
    #undef k4m
    #undef lm
}
/* ---------------------------------------------parallel42 */
/* PARALLEL ON  arrA[i+2][ j][k][ l+3]  shift */
void parallel42()
{
    #define AN1 6
    #define AN2 6
    #define AN3 6
    #define AN4 6
    /*  parameters for PARALLEL ON  arrA[k1i*i+li][k2j*j+lj][k3n*n+ln][k4m*m+lm] */
    #define k1i 1
    #define k2i 0
    #define k3i 0
    #define k4i 0
    #define li 2
    #define k1j 0
    #define k2j 1
    #define k3j 0
    #define k4j 0
    #define lj 0
    #define k1n 0
    #define k2n 0
    #define k3n 1
    #define k4n 0
    #define ln 0
    #define k1m 0
    #define k2m 0
    #define k3m 0
    #define k4m 1
    #define lm 3

    #pragma dvm array distribute[*][block][*][*]
    int (*A4)[AN2][AN3][AN4];
    A4 = (int (*)[AN2][AN3][AN4])malloc(AN1 * sizeof(int[AN2][AN3][AN4]));

    char tname[] = "paral+42 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j][n][m] on A4[i][j][n][m])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            for (n = 0; n < AN3; n++)
                for (m = 0; m < AN4; m++)
                    A4[i][j][n][m] = i * NL / 10 + j * NL / 100 + n * NL / 1000 + m;
    } /*end region*/
    #pragma dvm get_actual(A4)
    #pragma dvm parallel([i][j][n][m] on  A4[k1i * i + li][k2j * j + lj][k3n * n + ln][k4m * m + lm]) reduction(min(erri)), private(ia, ja, na, ma)
    for (i = 0; i < ((AN1 - li) / k1i); i++)
        for (j = 0; j < ((AN2 - lj) / k2j); j++)
            for (n = 0; n < ((AN3 - ln) / k3n); n++)
                for (m = 0; m < ((AN4 - lm) / k4m); m++){
                    ia = k1i * i + li;
                    ja = k2j * j + lj;
                    na = k3n * n + ln;
                    ma = k4m * m + lm;
                    if (A4[ia][ja][na][ma] != ia * NL / 10 + ja * NL / 100 + na * NL / 1000 + ma)
                        erri = Min(erri, i * NL / 10 + j * NL / 100 + n * NL / 1000 + m);
                }
    #pragma dvm get_actual(erri)
    s = 0;
    cs = 0;
    if (erri == ER && s == cs)
        ansyes(tname);
    else
        ansno(tname);

    free(A4);

    #undef AN1
    #undef AN2
    #undef AN3
    #undef AN4
    #undef k1i
    #undef k2i
    #undef k3i
    #undef k4i
    #undef li
    #undef k1j
    #undef k2j
    #undef k3j
    #undef k4j
    #undef lj
    #undef k1n
    #undef k2n
    #undef k3n
    #undef k4n
    #undef ln
    #undef k1m
    #undef k2m
    #undef k3m
    #undef k4m
    #undef lm
}
/* ---------------------------------------------parallel43 */
/* PARALLEL ON  arrA[i][ j][-k+8][- l+8]  reverse */
void parallel43()
{
    #define AN1 6
    #define AN2 6
    #define AN3 6
    #define AN4 6
    /*  parameters for PARALLEL ON  arrA[k1i*i+li][k2j*j+lj][k3n*n+ln][k4m*m+lm] */
    #define k1i 1
    #define k2i 0
    #define k3i 0
    #define k4i 0
    #define li 0
    #define k1j 0
    #define k2j 1
    #define k3j 0
    #define k4j 0
    #define lj 0
    #define k1n 0
    #define k2n 0
    #define k3n -1
    #define k4n 0
    #define ln 8
    #define k1m 0
    #define k2m 0
    #define k3m 0
    #define k4m -1
    #define lm 8

    #pragma dvm array distribute[*][block][*][*]
    int (*A4)[AN2][AN3][AN4];
    A4 = (int (*)[AN2][AN3][AN4])malloc(AN1 * sizeof(int[AN2][AN3][AN4]));

    char tname[] = "paral+43 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j][n][m] on A4[i][j][n][m])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            for (n = 0; n < AN3; n++)
                for (m = 0; m < AN4; m++)
                    A4[i][j][n][m] = i * NL / 10 + j * NL / 100 + n * NL / 1000 + m;
    } /*end region*/
    #pragma dvm get_actual(A4)
    //#pragma dvm parallel([i][j][n][m] on  A4[k1i * i + li][k2j * j + lj][k3n * n + ln][k4m * m + lm]) reduction(min(erri)), private(ia, ja, na, ma)
    for (i = 0; i < ((AN1 - li) / k1i); i++)
        for (j = 0; j < ((AN2 - lj) / k2j); j++)
            for (n = 0; n < ((AN3 - ln) / k3n); n++)
                for (m = 0; m < ((AN4 - lm) / k4m); m++){
                    ia = k1i * i + li;
                    ja = k2j * j + lj;
                    na = k3n * n + ln;
                    ma = k4m * m + lm;
                    if (A4[ia][ja][na][ma] != ia * NL / 10 + ja * NL / 100 + na * NL / 1000 + ma)
                        erri = Min(erri, i * NL / 10 + j * NL / 100 + n * NL / 1000 + m);
                }
    #pragma dvm get_actual(erri)
    s = 0;
    cs = 0;
    if (erri == ER && s == cs)
        ansyes(tname);
    else
        ansno(tname);

    free(A4);

    #undef AN1
    #undef AN2
    #undef AN3
    #undef AN4
    #undef k1i
    #undef k2i
    #undef k3i
    #undef k4i
    #undef li
    #undef k1j
    #undef k2j
    #undef k3j
    #undef k4j
    #undef lj
    #undef k1n
    #undef k2n
    #undef k3n
    #undef k4n
    #undef ln
    #undef k1m
    #undef k2m
    #undef k3m
    #undef k4m
    #undef lm
}
/* ---------------------------------------------parallel44 */
/* PARALLEL ON  arrA[i][ j][2][ l] */
void parallel44()
{
    #define AN1 6
    #define AN2 6
    #define AN3 6
    #define AN4 6
    #define BN1 3
    #define BN2 3
    #define BN3 3
    #define BN4 3
    /*  parameters for PARALLEL ON  arrA[k1i*i+li][k2j*j+lj][k3n*n+ln][k4m*m+lm] */
    #define k1i 1
    #define k2i 0
    #define k3i 0
    #define k4i 0
    #define li 0
    #define k1j 0
    #define k2j 1
    #define k3j 0
    #define k4j 0
    #define lj 0
    #define k1n 0
    #define k2n 0
    #define k3n 0
    #define k4n 0
    #define ln 2
    #define k1m 0
    #define k2m 0
    #define k3m 0
    #define k4m 1
    #define lm 0

    #pragma dvm array distribute[*][*][*][block]
    int (*A4)[AN2][AN3][AN4];
    A4 = (int (*)[AN2][AN3][AN4])malloc(AN1 * sizeof(int[AN2][AN3][AN4]));
    #pragma dvm array
    int (*B4)[BN2][BN3][BN4];
    B4 = (int (*)[BN2][BN3][BN4])malloc(BN1*sizeof(int[BN2][BN3][BN4]));
    #pragma dvm realign(B4[i][j][n][m] with A4[k1i*i+li][k2j*j+lj][ln][k4m*m+lm])


    char tname[] = "paral+44 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j][n][m] on B4[i][j][n][m])
    for (i = 0; i < BN1; i++)
        for (j = 0; j < BN2; j++)
            for (n = 0; n < BN3; n++)
                for (m = 0; m < BN4; m++)
                    B4[i][j][n][m] = i * NL / 10 + j * NL / 100 + n * NL / 1000 + m;
    #pragma dvm parallel([i][j][n][m] on A4[i][j][n][m])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            for (n = 0; n < AN3; n++)
                for (m = 0; m < AN4; m++)
                    A4[i][j][n][m] = i * NL / 10 + j * NL / 100 + n * NL / 1000 + m;
    } /*end region*/
    #pragma dvm get_actual(B4)
    #pragma dvm parallel([i][j][n][m] on  A4[k1i * i + li][k2j * j + lj][ln][k4m * m + lm]) reduction(min(erri))
    for (i = 0; i < BN1; i++)
        for (j = 0; j < BN2; j++)
            for (n = 0; n < BN3; n++)
                for (m = 0; m < BN4; m++)
                    if (B4[i][j][n][m] != i * NL / 10 + j * NL / 100 + n * NL / 1000 + m)
                        erri = Min(erri, i * NL / 10 + j * NL / 100 + n * NL / 1000 + m);
    #pragma dvm get_actual(erri)
    s = 0;
    cs = 0;
    if (erri == ER && s == cs)
        ansyes(tname);
    else
        ansno(tname);

    free(B4);
    free(A4);

    #undef AN1
    #undef AN2
    #undef AN3
    #undef AN4
    #undef BN1
    #undef BN2
    #undef BN3
    #undef BN4
    #undef k1i
    #undef k2i
    #undef k3i
    #undef k4i
    #undef li
    #undef k1j
    #undef k2j
    #undef k3j
    #undef k4j
    #undef lj
    #undef k1n
    #undef k2n
    #undef k3n
    #undef k4n
    #undef ln
    #undef k1m
    #undef k2m
    #undef k3m
    #undef k4m
    #undef lm
}
/* ---------------------------------------------parallel45 */
/* PARALLEL ON  arrA[i][ j][ ][ k] */
void parallel45()
{
    #define AN1 6
    #define AN2 6
    #define AN3 6
    #define AN4 6
    #define BN1 3
    #define BN2 3
    #define BN3 3
    #define BN4 3
    /*  parameters for PARALLEL ON  arrA[k1i*i+li][k2j*j+lj][k3n*n+ln][k4m*m+lm] */
    #define k1i 1
    #define k2i 0
    #define k3i 0
    #define k4i 0
    #define li 0
    #define k1j 0
    #define k2j 1
    #define k3j 0
    #define k4j 0
    #define lj 0
    #define k1n 0
    #define k2n 0
    #define k3n 0
    #define k4n 0
    #define ln 0
    #define k1m 0
    #define k2m 0
    #define k3m 0
    #define k4m 1
    #define lm 0

    #pragma dvm array distribute[*][*][block][*]
    int (*A4)[AN2][AN3][AN4];
    A4 = (int (*)[AN2][AN3][AN4])malloc(AN1 * sizeof(int[AN2][AN3][AN4]));
    #pragma dvm array
    int (*B4)[BN2][BN3][BN4];
    B4 = (int (*)[BN2][BN3][BN4])malloc(BN1*sizeof(int[BN2][BN3][BN4]));
    #pragma dvm realign(B4[i][j][n][m] with A4[k1i*i+li][k2j*j+lj][][k4m*m+lm])

    char tname[] = "paral+45 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j][n][m] on B4[i][j][n][m])
    for (i = 0; i < BN1; i++)
        for (j = 0; j < BN2; j++)
            for (n = 0; n < BN3; n++)
                for (m = 0; m < BN4; m++)
                    B4[i][j][n][m] = i * NL / 10 + j * NL / 100 + n * NL / 1000 + m;
    #pragma dvm parallel([i][j][n][m] on A4[i][j][n][m])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            for (n = 0; n < AN3; n++)
                for (m = 0; m < AN4; m++)
                    A4[i][j][n][m] = i * NL / 10 + j * NL / 100 + n * NL / 1000 + m;
    } /*end region*/
    #pragma dvm get_actual(B4)
    #pragma dvm parallel([i][j][n][m] on  A4[k1i * i + li][k2j * j + lj][][k4m * m + lm]) reduction(min(erri))
    for (i = 0; i < BN1; i++)
        for (j = 0; j < BN2; j++)
            for (n = 0; n < BN3; n++)
                for (m = 0; m < BN4; m++)
                    if (B4[i][j][n][m] != i * NL / 10 + j * NL / 100 + n * NL / 1000 + m)
                        erri = Min(erri, i * NL / 10 + j * NL / 100 + n * NL / 1000 + m);
    #pragma dvm get_actual(erri)
    s = 0;
    cs = 0;
    if (erri == ER && s == cs)
        ansyes(tname);
    else
        ansno(tname);

    free(B4);
    free(A4);

    #undef AN1
    #undef AN2
    #undef AN3
    #undef AN4
    #undef BN1
    #undef BN2
    #undef BN3
    #undef BN4
    #undef k1i
    #undef k2i
    #undef k3i
    #undef k4i
    #undef li
    #undef k1j
    #undef k2j
    #undef k3j
    #undef k4j
    #undef lj
    #undef k1n
    #undef k2n
    #undef k3n
    #undef k4n
    #undef ln
    #undef k1m
    #undef k2m
    #undef k3m
    #undef k4m
    #undef lm
}
/* ---------------------------------------------parallel46 */
/* PARALLEL ON  arrA[i][ j][ ][3] */
void parallel46()
{
    #define AN1 6
    #define AN2 6
    #define AN3 6
    #define AN4 6
    #define BN1 3
    #define BN2 3
    #define BN3 3
    #define BN4 3
    /*  parameters for PARALLEL ON  arrA[k1i*i+li][k2j*j+lj][k3n*n+ln][k4m*m+lm] */
    #define k1i 1
    #define k2i 0
    #define k3i 0
    #define k4i 0
    #define li 0
    #define k1j 0
    #define k2j 1
    #define k3j 0
    #define k4j 0
    #define lj 0
    #define k1n 0
    #define k2n 0
    #define k3n 0
    #define k4n 0
    #define ln 0
    #define k1m 0
    #define k2m 0
    #define k3m 0
    #define k4m 0
    #define lm 3

    #pragma dvm array distribute[*][*][block][*]
    int (*A4)[AN2][AN3][AN4];
    A4 = (int (*)[AN2][AN3][AN4])malloc(AN1 * sizeof(int[AN2][AN3][AN4]));
    #pragma dvm array
    int (*B4)[BN2][BN3][BN4];
    B4 = (int (*)[BN2][BN3][BN4])malloc(BN1*sizeof(int[BN2][BN3][BN4]));
    #pragma dvm realign(B4[i][j][n][m] with A4[k1i*i+li][k2j*j+lj][][lm])

    char tname[] = "paral+46 ";
    erri = ER;
    NNL = NL;
    #pragma dvm actual(erri)
    #pragma dvm region
    {
    #pragma dvm parallel([i][j][n][m] on B4[i][j][n][m])
    for (i = 0; i < BN1; i++)
        for (j = 0; j < BN2; j++)
            for (n = 0; n < BN3; n++)
                for (m = 0; m < BN4; m++)
                    B4[i][j][n][m] = i * NL / 10 + j * NL / 100 + n * NL / 1000 + m;
    #pragma dvm parallel([i][j][n][m] on A4[i][j][n][m])
    for (i = 0; i < AN1; i++)
        for (j = 0; j < AN2; j++)
            for (n = 0; n < AN3; n++)
                for (m = 0; m < AN4; m++)
                    A4[i][j][n][m] = i * NL / 10 + j * NL / 100 + n * NL / 1000 + m;
    } /*end region*/
    #pragma dvm get_actual(B4)
    #pragma dvm parallel([i][j][n][m] on  A4[k1i * i + li][k2j * j + lj][][lm]) reduction(min(erri))
    for (i = 0; i < BN1; i++)
        for (j = 0; j < BN2; j++)
            for (n = 0; n < BN3; n++)
                for (m = 0; m < BN4; m++)
                    if (B4[i][j][n][m] != i * NL / 10 + j * NL / 100 + n * NL / 1000 + m)
                        erri = Min(erri, i * NL / 10 + j * NL / 100 + n * NL / 1000 + m);
    #pragma dvm get_actual(erri)
    s = 0;
    cs = 0;
    if (erri == ER && s == cs)
        ansyes(tname);
    else
        ansno(tname);

    free(B4);
    free(A4);

    #undef AN1
    #undef AN2
    #undef AN3
    #undef AN4
    #undef BN1
    #undef BN2
    #undef BN3
    #undef BN4
    #undef k1i
    #undef k2i
    #undef k3i
    #undef k4i
    #undef li
    #undef k1j
    #undef k2j
    #undef k3j
    #undef k4j
    #undef lj
    #undef k1n
    #undef k2n
    #undef k3n
    #undef k4n
    #undef ln
    #undef k1m
    #undef k2m
    #undef k3m
    #undef k4m
    #undef lm
}
/*-------------------------------------------------------*/
void ansyes(const char name[])
{
    printf ("%s  -  complete\n", name);
}

void ansno(const char name[])
{
    printf("%s  -  ***error\n", name);
}
