Here is the basic code:
- Code: Select all
int wins_c_Kalaha(char whole, __gameboard__ board)
#pragma omp parallel for private(i) schedule(dynamic)
for(i=8;i<14;i++) if(board.s[i]) min_win=((j=wins_c_Kalaha(i,board)) < min_win ? j : min_win;
The result is working but if there are 6 possibilieties in the first turn, it uses 6 Thread at all if there are 2 only two and it gets not more multiplicated in one of the subrutines. Is there a way to tell it to start as long as there is a thread free new threads in this subcall. What did I wrong that this is happend and for what is that private(i) needed, that I took only out of a discription somewhere.
May someone more expirenced whith this OpenMP tell me this small informations. Thanks for help, because I like to understand all I programm more to sort out faults in other programs where there must not be a fault.