現在地 >> メニュー >> OpenMP >> OMP::single構文

問題


並列処理内で、1つだけのスレッドで出力を行え。

答え


#include <omp.h>
#include <cstdio>

int main()
{


#pragma omp parallel
{

/*ここはシングル*/
#pragma omp single
{
puts("single out put");
}

/*ここは、並列*/
puts("parallel out put");

}

return 0;
}

目次

― その他 ―

Wiki内検索

計測中...(07.10.8〜)

Save The World






▲よろしければ広告のクリックもお願いします


▲ランキングに参加しました

管理人/副管理人のみ編集できます