Skip to content
Snippets Groups Projects
Commit fbd79397 authored by Mactavish Zhan's avatar Mactavish Zhan
Browse files

add hello-world solution

parent 27ed452f
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ VPATH += solutions ...@@ -4,7 +4,7 @@ VPATH += solutions
CC = gcc CC = gcc
CFLAGS = -fopenmp CFLAGS = -fopenmp
LIBS = LIBS =
BINS = hello pi pi_spmd_simple pi_spmd_optimized pi_spmd_atomic pi_loop BINS = hello pi hello_pra pi_spmd_simple pi_spmd_optimized pi_spmd_atomic pi_loop
ifeq ($(UNAME), Darwin) ifeq ($(UNAME), Darwin)
CFLAGS = -Xpreprocessor -fopenmp CFLAGS = -Xpreprocessor -fopenmp
......
#include <omp.h>
#include <stdio.h>
int main() {
#pragma omp parallel
{
int ID = omp_get_thread_num();
printf("hello(%d)", ID);
printf("world(%d) \n", ID);
}
printf("After all threads finished");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment