Open main menu

CDOT Wiki β

Changes

OpenMP Debugging in Visual Studio / Team Debug

89 bytes added, 17:22, 8 December 2017
m
Walkthrough
= Walkthrough =
==Case A- Using the Thread window== 
What you can see in the Thread window under OpenMP project
int main()
{
// ***serial***
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());
// set openMP
#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());
}
}
// set openMP with num of 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());
190
edits