1

Possible Duplicate:
Are pointers private in OpenMP parallel sections?

I want to use a table in a parallel part in a openmp program. I cannot declare it in the parallel part, this gives too much overflow, so I declare it in advance try to declare it private.

Original Program:

 int i,j;
#pragma omp parallel for private(i,j) 
for(i=startvalueX; i<stopvalueX; i++) { 
   for(j=startvalueY; j<stopvalueY; j++) {  
        int *subimage=new int[9];
   }
}

Advance declaration

int i,j;
int *subimage;
#pragma omp parallel for private(i,j,subimage) 
for(i=startvalueX; i<stopvalueX; i++) { 
   for(j=startvalueY; j<stopvalueY; j++) {  
        subimage=new int[9];
   }
}

As output I get a memory dump. Any ideas on how to fix this?

1

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.