190
edits
Changes
m
// ***serial***
// set openMP
// set openMP with num of threads
→Walkthrough
= Walkthrough =
==Case A- Using the Thread window==
What you can see in the Thread window under OpenMP project
int main()
{
printf("current using num of thread is %d \n", omp_get_num_threads());
printf("usable num of thread is %d \n", omp_get_max_threads());
#pragma omp parallel
{
#pragma omp single
{ // ***openMP***
printf("current using num of thread is %d \n", omp_get_num_threads());
printf("usable num of thread is %d \n", omp_get_max_threads());
}
}
#pragma omp parallel num_threads(8)
{
#pragma omp single
{ // ***openMP with a setting of the num of threads***
printf("current using num of thread is %d \n", omp_get_num_threads());
printf("usable num of thread is %d \n", omp_get_max_threads());