このスレ過疎り過ぎ
GCC4.5.0 (MinGW) だとforループ中でbreakが使えないんだけど、解決する定石とかある?
とりあえずフラグ立てて解決したんだけどなにかいい方法があれば教えてくれ

// サンプル:指定された"TARGET"が見つかるまでのループ数を表示するプログラム
#include <stdio.h>
#include <omp.h>
#define FIN 100
#define TARGET 70

int main(){
int i, flag=0, cnt=0;
#pragma omp parallel for reduction(+:cnt)
for(i = 0;i < FIN;i++){
printf("%d: %d\n", omp_get_thread_num(), i);
cnt++;

if(flag){
printf("%d: break\n", omp_get_thread_num());
i+=FIN;
}

if(i == TARGET){
printf("%d: found and break\n", omp_get_thread_num());
flag = 1;
#pragma omp flush(flag)
i+=FIN;
}
}
printf("total %d loops\n",cnt);
return 0;
}