0
C++로 프로그래밍하고 OpenMP를 사용하여 병렬 처리합니다. 이 기계에는 각 소켓 당 2 개의 CPU 소켓과 8 개의 코어가 있습니다. OpenMP는 멀티 소켓/멀티 코어 시스템에서 단일 코어 만 감지합니다.
내가 인텔 컴파일러로 컴파일 이후
, 나는 바이너리를 실행할 때 나는 다음과 같은 메시지를 볼 수 있습니다, 자세한 옵션을 다음과 같은 환경 변수를export KMP_AFFINITY=verbose,scatter
을 설정합니다. 당신이 볼 수 있듯이
[0] OMP: Info #204: KMP_AFFINITY: decoding x2APIC ids.
[0] OMP: Info #202: KMP_AFFINITY: Affinity capable, using global cpuid leaf 11 info
[0] OMP: Info #154: KMP_AFFINITY: Initial OS proc set respected: {0}
[0] OMP: Info #156: KMP_AFFINITY: 1 available OS procs
[0] OMP: Info #157: KMP_AFFINITY: Uniform topology
[0] OMP: Info #159: KMP_AFFINITY: 1 packages x 1 cores/pkg x 1 threads/core (1 total cores)
[0] OMP: Info #206: KMP_AFFINITY: OS proc to physical thread map:
[0] OMP: Info #171: KMP_AFFINITY: OS proc 0 maps to package 0
[0] OMP: Info #242: KMP_AFFINITY: pid 12759 thread 0 bound to OS proc set {0}
[0] OMP: Info #242: KMP_AFFINITY: pid 12759 thread 14 bound to OS proc set {0}
[0] OMP: Info #242: KMP_AFFINITY: pid 12759 thread 15 bound to OS proc set {0}
[0] OMP: Info #242: KMP_AFFINITY: pid 12759 thread 11 bound to OS proc set {0}
[0] OMP: Info #242: KMP_AFFINITY: pid 12759 thread 6 bound to OS proc set {0}
[0] OMP: Info #242: KMP_AFFINITY: pid 12759 thread 7 bound to OS proc set {0}
[0] OMP: Info #242: KMP_AFFINITY: pid 12759 thread 8 bound to OS proc set {0}
[0] OMP: Info #242: KMP_AFFINITY: pid 12759 thread 9 bound to OS proc set {0}
[0] OMP: Info #242: KMP_AFFINITY: pid 12759 thread 10 bound to OS proc set {0}
[0] OMP: Info #242: KMP_AFFINITY: pid 12759 thread 13 bound to OS proc set {0}
[0] OMP: Info #242: KMP_AFFINITY: pid 12759 thread 12 bound to OS proc set {0}
는 OMP는 패키지 당 패키지 (소켓) 및 코어의 정확한 수를 감지 할 수 없습니다. 결과적으로 모든 스레드가 단일 코어에 고정됩니다.
이 문제를 어떻게 해결할 수 있습니까? 어디에서 시작해야합니까?