- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
hi all,
This a program, I had written in fortran.
!dir$ offload begin target(mic)
call omp_set_num_threads(240)
!dir$ end offload
!dir$ offload begin target(mic)
!$omp parallel
print *,The number of threads are',omp_get_num_threads()
!$omp end parallel
!dir$ end offload
However in the final output I still get
The number of threads are 1
why? How do I set more threads?
Enlace copiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I did not compile with -openmp option as well
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hello aketh,
Can you please clarify what are you trying to achieve. You mentioned you want to setup the openmp number of threads to 240 but you are not compiling with -openmp flag. Can you please try the following:
program testset
include 'omp_lib.h'
!dir$ offload begin target(mic)
call omp_set_num_threads(240)
!dir$ end offload
!dir$ offload begin target(mic)
!$omp parallel
print *,'The number of threads are',omp_get_num_threads()
!$omp end parallel
!dir$ end offload
end program testset
Compile with
ifort -openmp -o testSet testSet.f90
and execute
./testSet
Let me know if you still do not see number of threads set to 240.
Thanks
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hi,
It worked. thank you. what I meant was I forgot to use -openmp option.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
A slight side issue, but... explicitly forcing 240 threads is a bad idea on multiple grounds.
- In offload one core is heavily loaded by the system transferring data, and your code would be better not using it
- Forcing the number of threads makes your code non-portable (what if you try to run it on a card with fewer cores?)
The system uses sensible defaults, so until you really understand what you're doing, don't change them! (And, when you do, use the envirables (KMP_PLACE_THREADS, KMP_AFFINITY), don't hard-wire these things into your code).
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla