Changes between Version 4 and Version 5 of YMU110509/Lab2


Ignore:
Timestamp:
May 9, 2011, 12:04:11 PM (13 years ago)
Author:
jazz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • YMU110509/Lab2

    v4 v5  
    1212 * GCC 4.2 以上版本就有支援 OpenMP 了....用 "gcc '''-fopenmp'''" 就可以編譯
    1313
    14 = OpenMP =
     14= Example 1 : HelloWorld ==
     15
     16 * 首先從 [https://computing.llnl.gov/tutorials/openMP/exercise.html OpenMP Exercise] 下載 omp_hello.c
     17{{{
     18~$ wget https://computing.llnl.gov/tutorials/openMP/samples/C/omp_hello.c
     19}}}
     20 * 確認目前 gcc 版本,須大於 4.2 以後的版本
     21{{{
     22~$ gcc -v
     23Using built-in specs.
     24Target: x86_64-linux-gnu
     25Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
     26Thread model: posix
     27gcc version 4.4.5 (Debian 4.4.5-8)
     28}}}
     29 * 使用 GCC 編譯 omp_hello.c
     30{{{
     31~$ gcc -o omp_hello -fopenmp omp_hello.c
     32}}}
     33 * 執行 omp_hello 執行檔
     34{{{
     35~$ ./omp_hello
     36Hello World from thread = 2
     37Hello World from thread = 3
     38Hello World from thread = 0
     39Number of threads = 4
     40Hello World from thread = 1
     41}}}
     42
     43= OpenMP 參考資料 =
    1544
    1645 * 多核心平行化程式設計 Multi-Cores Programming