Hey guys. My program uses OpenMP at a few parts to do multithreading. It works for the most part, but occasionally stalls and just sits there. So I run it in the debugger, and I find the area it is stalling at. Then I try to examine the current variables, and I get this:
169 if(0<=myPtr[3] && myPtr[3]<=1){//Reassign the velocities.
(gdb) print myPtr[3]
No symbol "myPtr" in current context.
I'm not sure why this is. I can print that when it is only single threaded. I privatized that variable, and I imagine the program wouldn't know which thread I'm referring to when I ask it to print something (even though this http://cc.jct.ac.il/cc-res/online-doc/gdb/gdb_26.html#SEC26 says that there will always be a current thread..?). So, if I choose a single thread, I get the same stuff:
(gdb) info threads
3 process 32970 thread 0x4203 0x90f9846e in __semwait_signal ()
2 process 32970 thread 0x3007 0x90f9846e in __semwait_signal ()
* 1 process 32970 local thread 0x2e03 mover3dsurfaces (.omp_data_i=0xbffff030) at mover3dsurfaces.cpp:174
(gdb) thread 1
[Switching to thread 1 (process 32970 local thread 0x2e03)]
mover3dsurfaces (.omp_data_i=0xbffff030) at mover3dsurfaces.cpp:174
174 partList.velocity(i,3) = velPtr[2];
(gdb) print velPtr[1]
No symbol "velPtr" in current context.
I'm actually a little confused about this part. My machine only has two processors. How can there be 3 threads? I see that the two hex numbers right before __semwait_signal() are the same, but I don't know why they're split up. How can I look at the variables for a single thread?
Thanks!