开始学习openmp编程
编译器在这下载:gfortran for windowhttp://www.equation.com/servlet/equation.cmd?fa=fortran
第1个程序hello.f90
program hello
integer nthreads,tid,omp_get_num_threads,omp_get_thread_num
!$omp parallel private(tid)
tid=omp_get_thread_num()
print*,'hello world from thread=',tid
if(tid.eq.0) then
nthreads=omp_get_num_threads()
print*,'number of threads=',nthreads
end if
!$omp end parallel
end
编译和运行参见附图
[ 本帖最后由 shirazbj 于 2011-7-21 21:39 编辑 ] 要是有个软件能把自己代码里的do循环自动加!$omp语句并行化就好了。
页:
[1]