如何从Freetran的下一行继续执行OpenMP指令? [英] How to continue an OpenMP directive on the next line in free-from Fortran?
问题描述
我有一行Fortran代码,例如
I have a line of a Fortran code, e.g.,
!$omp do private(aa, bb, cc) schedule(dynamic) reduction(+:alpha, beta, gamma)
假设此行包含多个参数,并且长度超过132个字符,gfortran将导致错误消息.我试图使用&
打破常规.但是我不确定如何开始下一行.在其他情况下,直接在没有!
的情况下开始下一行会导致 Error:OpenMP变量列表中(1)的语法错误.
Suppose this line contains several arguments and the length exceeds 132 characters, gfortran will lead to error message. I tried to use &
to break the line. But I am not sure how to start the next line. As other case, directly start the next line without !
leads to Error: Syntax error in OpenMP variable list at (1)
.
如何打破omp行的132个字符的限制?
How to break the 132 characters limit for omp line?
推荐答案
您可以通过以&
结尾并以 $ omp
开头的换行符来编写多行omp语句.
You can write multiline omp statements by ending with &
and staring a newline with $omp
.
示例
!$omp do private(aa, bb, cc) &
!$omp schedule(dynamic) &
!$omp reduction(+:alpha, beta, gamma)
...
!$omp end do
这篇关于如何从Freetran的下一行继续执行OpenMP指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!