2 years ago

#71347

test-img

Nicola Comerci

Compiler Error C2065 using OpenMP clause Private

My problem in the follows. I am implementing the assembly of the stiffness matrix (finite elements and surroundings) and I am doing it using the OpenMP directives. Beyond the specific problem, the compiler complains about the C2065 error:

'k' : undeclared identifier

Reading different guides in the examples that were reported the syntax was the same as mine. The main problem is that it doesn't recognize the variable that is set as private. Can anyone help me understand why? (of course I used #include <omp.h>)

#pragma omp parallel num_threads(2)
{
    #pragma omp for private(k)
    for (int k = 0; k < nElem; k++)
    {
        coeff = matricesAssemblingCSR(topol, coeff, A_loc, ja, iat, k);
        matrix = matricesAssembling(topol, matrix, A_loc, k);
    }
    
}

c++

openmp

0 Answers

Your Answer

Accepted video resources