I am having problem(segmentation fault) with the following code snippet:
- Code: Select all
//create a pointer to the hitpoint
HitPoint hitPoint;
//loop over all the pixels in the image
#pragma omp parallel for schedule(dynamic,1), private(hitPoint)
for(int y = 0; y < height; ++y)
{
for(int x = 0; x < width; ++x)
{
hitPoint = traceAndCreateHitPoint(x,y);
//store the hit point inside the vector
mHitPoints.push_back(&hitPoint);
}
#pragma omp critical
// Print progress approximately every 5%.
if ((y+1) % (height/20) == 0 || (y+1) == height)
std::cout << (100*(y+1)/height) << "% done" << std::endl;
}
Is there any issue that need to be resolved when using openmp with STL. If i comment the STL command , the code runs fine.
Regards
Sajjadul
