Open main menu

CDOT Wiki β

Changes

OpenMP Debugging in Visual Studio / Team Debug

116 bytes added, 11:35, 8 December 2017
Walkthrough
==Case A==
How to use Process window and thread What you can see in the Thread window under multiple OpenMP project
1. set config OpenMP
2. create multiple subprojects in one projectset OpenMP
3. set up multiple start up
4. how debug windows shows the status of multiple projects
 
5. how you can use each tool to find helpful info
 
project1: test1.cpp
#include <iostream>
#include <stdio.h>
#include <omp.h>
using namespace std;
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 for single { for printf(int i = 0"current using num of thread is %d \n", omp_get_num_threads()); i < 10; i++) cout << printf(" now i at test1= usable num of thread is %d \n" << i << endl, omp_get_max_threads()); }
}
} Project2: test2.cpp  #include <iostream> using namespace std; int main() { // set openMP with num of threads #pragma omp parallel num_threads(8)
{
#pragma omp for single { for printf(int j = 0"current using num of thread is %d \n", omp_get_num_threads()); j < 10; j++) cout << printf(" now j at test2= usable num of thread is %d \n" << j << endl, omp_get_max_threads()); }
}
return 0;
}
190
edits