LabWindows/CVI

Content Type
Programming Language
Current manual

copyin Clause

copyin Clause

Specifies that the value of the master thread's threadprivate variable or list of threadprivate variables is copied to the threadprivate variable of the other threads in the parallel region.

Format

copyin (list)

Example

#ifdef _OPENMP
#include <omp.h>
#endif
#include <stdlib.h>

float* work;
int size;
float tol;

#pragma omp threadprivate(work,size,tol)

void a32( float t, int n )
{
   tol = t;
   size = n;
   #pragma omp parallel copyin(tol,size)
   {
      build();
   }
}

void build();
{
   int i;

   work = (float*)malloc(sizeof(float)*size);
   for(i=0;i<size;++1) work [i] = tol;
}

In This Section
Was this information helpful?

Previous

ordered

Previous

ordered