OpenMP テスト

MinGW GCC 4.4.0 リリース記念、OpenMP 動作テスト. テスト後に libgomp-1.dll が GPL であることに気づき絶望した. pthreadGC2.dll は LGPL なのに・・・.

#include <stdio.h>
#include <omp.h>

int main() {
    int i;
    #pragma omp parallel for
    for(i = 0; i < 20; i++) {
        printf("%02d ", i);
    }
    return 0;
}

コンパイル及びテスト. Core2 Duo E6400 上で動作させたので2スレッド.

>gcc -O2 -fopenmp test.c

>a
00 10 11 01 12 02 13 14 03 15 16 04 17 18 05 19 06 07 08 09