- 例子
#include<stdio.h>
#include<stdlib.h>
int main()
{
#pragma omp parallel
{
puts("Hello");
puts("World");
}
exit(0);
}make hello
./hello
- 写Makefile
CFLAGS+=-Wall -fopenmp
make hello
- 自动检测有多少cpu,有多少开多少线程

#include<stdio.h>
#include<stdlib.h>
int main()
{
#pragma omp parallel
{
puts("Hello");
puts("World");
}
exit(0);
}make hello
./hello
CFLAGS+=-Wall -fopenmp
make hello
