Fortran OpenMP with subroutines and functions
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Disclaimer: I'm quite certain that this has been answered somewhere, but myself and another person have been searching quite hard to no avail. I've got a code that looks something like this: PROGRAM main !$omp parallel do !$omp private(somestuff) shared(otherstuff) DO i=1,n ... CALL mysubroutine(args) ... a=myfunction(moreargs) ... ENDDO !$omp end parallel do END PROGRAM SUBROUTINE mysubroutine(things) ... END SUBROUTINE FUNCTION myfunction(morethings) ... END FUNCTION I cannot determine where/how to handle private, shared, reduction, etc.