Im developping a traffic training simulator for my Ph. D. thesis. I use VC++ 9.0 and some graphic libraries such as Open Scene Graph, Open Dynamics Engine and etc. My CPU is Intel Core i7 930 @ 2.8GHz and my graphics card is Nvidia Quadro FX 1800.
In simulation loop I control the behaviors of vehicles on traffic. But only one core running for this action. So I dont take performance enoughly. I try to use parallel programming with OpenMP (shown below), but it didnt worked.
#pragma omp parallel for private(j)
The Codes as shown above, I control the behaviors of vehicles while moving autonomously.Id like to divide to control vehicles to my core number (8). For example If the number of vehicles is 80, then every core controls 10 vehicles.
How can I do this process by using OpenMP?
Have a good study,
in case it crashes, you should make your source thread safe.
in case there are only 1 thread, it seems you forgot to enable OpenMP support in the project configuration (or /openmp in command line).
Insufficient RAM might also have an effect such as you report. Then there's the question of what is in those functions. If they use any resources which involve serialization (disk file, ......) you could be limited to 1 thread.