Skip to content

Parallelization Issues #5

@Premas

Description

@Premas

I tried to parallelize the below code using Par4all and I am able to get the parallelized code. But you can see that in the parallelized code, "n" is assigned with value 1410065407, instead of 1.0E10. Pls help me to solve the issue.

/** input code fragment **/

#define n 10000000000
for(i = 0 ; i < n ; i++)
A[i] = i;
for(i = 0 ; i < n ; i++)
sum += A[i];

/Parallelized code/
#pragma omp parallel for
for(i = 0; i <= 1410065407; i += 1)
A[i] = i;

#pragma omp parallel for reduction(+:sum)
for(i = 0; i <= 1410065407; i += 1)
sum += A[i];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions