diff --git a/docs/openmp.md b/docs/openmp.md index 1f0b3ac..4193127 100644 --- a/docs/openmp.md +++ b/docs/openmp.md @@ -8,7 +8,26 @@ program hello !$omp parallel print*,'hello',omp_get_thread_num() !$omp end parallel - print*,'' +end program hello +``` + +``` +$ ./a.out + hello 0 + hello 7 + hello 3 + hello 4 + hello 1 + hello 2 + hello 6 + hello 5 +``` + +``` bash +program hello + implicit none + integer::omp_get_thread_num + call omp_set_num_threads(4) !$omp parallel print*,'hello',omp_get_thread_num() @@ -39,3 +58,4 @@ get : function, set : subroutine hello 0 hello 1 ``` +