OpenMP 的基本使用
也可以实际用一段简单的程序,来弄清楚它的运作方式。
#include <STDIO.H>
#include <STDLIB.H>
void Test(int n) {
for (int i = 0; i < 10000; ++i)
{
//do nothing, just waste time
}
printf("%d, ", n);
}
int main(int argc, char* argv[])
{
for (int i = 0; i < 10; ++i)
Test(i);
system("pause");
}