正在加载图片...
中图种学学计算机科学与术系 University of Science and Technology of China DEPARTMENT。 F COMPUTE三巴 ENCE AND ECHNOLDD OpenMP程存结构 基于c/c+语言的 OpenMP程序的结构 #f include <omp. h main 0{ int varl. var2. var3 /*Serial code*/ /Beginning of parallel section. Fork a team of threads*/ /Specify variable scoping*/ #pragma omp parallel private( varl, var2) shared( var3) /*Parallel section executed by all threads/ /*All threads join master thread and disband*/ /*Resume serial code */ 国家高性能计算中心(合肥) 2021/2/3 12国家高性能计算中心(合肥) 12 2021/2/3 OpenMP程序结构 ▪ 基于c/c++语言的OpenMP程序的结构 #include <omp.h> main (){ int var1, var2, var3; /*Serial code*/ … /*Beginning of parallel section. Fork a team of threads*/ /*Specify variable scoping */ #pragma omp parallel private(var1, var2) shared(var3) { /*Parallel section executed by all threads*/ … /*All threads join master thread and disband*/ } /*Resume serial code */ … }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有