(2) 但是如果在开头使用"use omp_lib",则不需要声明。 但是在某些程序中还是得到 线程数 线程号为浮点数的现象 ??? 原因:子程序里面没有重复声明use omp_lib.
fortran+omp:必须在程序的开头声明OMP_GET_NUM_THREADS,OMP_GET_THREAD_NUM,(1)programtest1c!$useomp_libINTEGERTID,OMP_GET_THREAD_NUM!$ompparallelprivate(i)TID=OMP_GET_THREAD_NU...
According to the implicit typing rules of Fortran, a variable/function starting with (A-H, O-Z) is of type real. Thus, the integer result returned by the function is being interpreted as an IEEE real, which produces the NaNs that you saw.Either USE the OMP module as TimP told you, ...
$OMP MASTER NP = omp_get_thread_num() CALL WORK('in master', NP) !$OMP END MASTER !$OMP END PARALLEL END SUBROUTINE WORK(msg, THD_NUM) INTEGER THD_NUM character(*) msg PRINT *, msg, THD_NUM END Output: in parallel 1 in parallel 3 in parallel 2 in parallel 0 in master 0...
$OMP MASTER NP = omp_get_thread_num() CALL WORK('in master', NP) !$OMP END MASTER !$OMP END PARALLEL END SUBROUTINE WORK(msg, THD_NUM) INTEGER THD_NUM character(*) msg PRINT *, msg, THD_NUM END Output: in parallel 1 in parallel 3 in parallel 2 in parallel 0 in master 0...
若是不声明OMP_GET_THREAD_NUM,OMP_GET_NUM_THREADS那么不会得到正确的线程号和总线程数。 原因:??? (2) 但是如果在开头使用"use omp_lib",则不需要声明。 但是在某些程序中还是得到 线程数 线程号为浮点数的现象 ??? 原因:子程序里面没有重复声明use omp_lib....
fortran+omp:必须在程序的开头声明OMP_GET_NUM_THREADS,OMP_GET_THREAD_NUM 2012-03-12 15:36 −... 唐僧吃肉 0 1643 OMP算法代码学习 2017-10-23 14:03 −正交匹配追踪(OMP)算法的MATLAB函数代码并给出单次测试例程代码 测量数M与重构成功概率关系曲线绘制例程代码 信号稀疏度K与重构成功概率关系曲线绘制...
C/C++ and Fortran community Connect with business and technical experts Open XL compilers Read the documentation Edit online Purpose Theomp_get_ancestor_thread_numfunction returns the thread number of the ancestor at a given nested level of the current thread. ...