Changes

Jump to: navigation, search

OpenMP Debugging in Visual Studio / Team Debug

82 bytes added, 14:01, 10 December 2017
Case A - Using the Thread window
The Thread Window shows Thread list with the detailed information in your application, You can filter thread list and see the particular information.
[[File:thread_windowthread_window2.png|1000px|center|Thread window2window]]
#include <iostream>
#include <stdio.h>
#include <omp.h>
 
using namespace std;
int main()
{ // ***serial*** printf("current using num of default usable thread is %d \n\n", omp_get_num_threadsomp_get_max_threads()); // serial ver printf("usable num of thread currently using is %d \n", omp_get_max_threadsomp_get_num_threads());
printf("working thread num is %d \n", omp_get_thread_num()); printf("\n"); #pragma omp parallel
{
#pragma omp single // set openMP ver { // ***openMP*** printf("current using num of thread currently using is %d \n", omp_get_num_threads()); printf("usable num of thread is %d \n", omp_get_max_threads());
}
printf("working thread num is %d \n", omp_get_thread_num());
}
printf("\n"); #pragma omp parallel num_threads(8) { #pragma omp single { // ***set openMP with a setting of the num of threads***ver { printf("current using num of thread currently using is %d \n", omp_get_num_threads()); printf("usable num of thread is %d \n", omp_get_max_threads());
}
printf("working thread num is %d \n", omp_get_thread_num());
}
printf("\n");
return 0;
}
190
edits

Navigation menu