example_packages/metapackage_dep_parent/app/main.f90
raw| 1 | program main |
| 2 | use metapackage_dep_child, only: get_num_threads |
| 3 | use omp_lib |
| 4 | implicit none |
| 5 | |
| 6 | integer :: n |
| 7 | |
| 8 | ! This uses the child module which requires openmp |
| 9 | n = get_num_threads() |
| 10 | print '(a,i0)', "Threads from child module: ", n |
| 11 | |
| 12 | ! This also uses omp_lib directly - should work because openmp |
| 13 | ! metapackage is propagated from the child dependency |
| 14 | print '(a,i0)', "Max threads available: ", omp_get_max_threads() |
| 15 | |
| 16 | end program main |