struct change in parallel section

Use this forum to discuss the book: Using OpenMP - Portable Shared Memory Parallel Programming, by Barbara Chapman, Gabriele Jost and Ruud van der Pas Read the for book info and to download the examples. Post your feedback about the book and examples to this forum
Post Reply

struct change in parallel section

Post by gpone »

I have a structure like this:
struct CSGNode
int type;
int index;
int parentIndex;
int leftChild,rightChild;
int sphereIndex;
Interval * intervals;
int intervalsCount;
BoundingBox bbox;

which stores infos about csg intervals;
I can do in parallel section things like:
Interval it;
CSGNode * csgTree
CSGNode el;

csgTree[el.index].sphereIndex = el.sphereIndex;
it.sphereIndex = el.sphereIndex;
int ind = csgTree[el.index].intervalsCount;
csgTree[el.index].intervals[ind] = it;

but cannot do:
because the program crushes while runtime. Can anyone give me a hint why postincrementation on struct element is not possible and program crushes? If I tried to do
csgTree[el.index].intervalsCount = ind +1; it also crushes ! I don't know why. What is going wrong with struct management in open mp?
Thanks in advance,

Post Reply