#include<omp.h>intmain(){omp_set_num_threads(16);// OPTIONAL - Can also use // OMP_NUM_THREADS environment variable#pragma omp parallel{printf("hello, world!\n");// Execute in parallel}// Implicity joinreturn0;}
#include<omp.h>intmain(){omp_set_num_threads(16);// OPTIONAL - Can also use // OMP_NUM_THREADS environment variable#pragma omp parallel num_threads(8) // Restrict team size locally{printf("hello, world!\n");// Execute in parallel}// Implicity joinreturn0;}