Skip to content
This repository was archived by the owner on Sep 29, 2022. It is now read-only.

Commit 325c34f

Browse files
initial omp examples
Signed-off-by: VictorRodriguez <victor.rodriguez.bahena@intel.com>
1 parent 9eec616 commit 325c34f

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

labs/07/hello_omp.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <stdio.h>
2+
#include <omp.h>
3+
4+
int main(int argc, char** argv){
5+
#pragma omp parallel
6+
{
7+
printf("Hello from process: %d\n", omp_get_thread_num());
8+
}
9+
return 0;
10+
}

labs/07/hello_omp_private.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <stdio.h>
2+
#include <omp.h>
3+
4+
int main(int argc, char** argv){
5+
int thread_id;
6+
7+
#pragma omp parallel private(thread_id)
8+
{
9+
thread_id = omp_get_thread_num();
10+
printf("Hello from process: %d\n", thread_id );
11+
}
12+
13+
return 0;
14+
}

0 commit comments

Comments
 (0)