Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <omp.h>
- int main() {
- #pragma omp parallel
- {
- #pragma omp sections
- {
- #pragma omp section
- {
- printf("*sect1* Thread #%d does this section\n", omp_get_thread_num());
- }
- #pragma omp section
- {
- printf("*sect2* Thread #%d does this section\n", omp_get_thread_num());
- }
- #pragma omp section
- {
- printf("*sect3* Thread #%d does this section\n", omp_get_thread_num());
- }
- #pragma omp section
- {
- printf("*sect4* Thread #%d does this section\n", omp_get_thread_num());
- }
- #pragma omp section
- {
- printf("*sect5* Thread #%d does this section\n", omp_get_thread_num());
- }
- #pragma omp section
- {
- printf("*sect6* Thread #%d does this section\n", omp_get_thread_num());
- }
- }
- printf("*nosect* Thread #%d\n", omp_get_thread_num());
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement