Il dépend de tellement de facteurs qu'il est impossible d'obtenir une seule réponse «balle d'argent». Parmi les facteurs sont l'intensité de calcul (FLOPS/byte) et le rapport entre la quantité de données locales à la quantité de données transmises entre les processus. Cela dépend aussi de l'architecture du système. L'intensité de calcul peut être estimée analytiquement ou mesurée avec un outil de profilage comme PAPI, Likwid, etc. L'architecture du système peut être examinée en utilisant l'utilitaire lstopo
, qui fait partie de la bibliothèque hwloc
, fournie avec Open MPI. Malheureusement, lstopo
ne peut pas vous dire à quelle vitesse chaque canal de mémoire est et à quelle vitesse/latente les liens entre les nœuds NUMA sont. Oui, il y a: --report-bindings
fait que chaque rang imprime en sortie d'erreur standard le masque d'affinité qui lui est appliqué. La sortie varie un peu entre les différentes versions ouvertes MPI:
Ouvrir MPI 1.5.x montre la valeur hexadécimale du masque d'affinité:
mpiexec --report-bindings --bind-to-core --bycore
[hostname:00599] [[10634,0],0] odls:default:fork binding child [[10634,1],0] to cpus 0001
[hostname:00599] [[10634,0],0] odls:default:fork binding child [[10634,1],1] to cpus 0002
[hostname:00599] [[10634,0],0] odls:default:fork binding child [[10634,1],2] to cpus 0004
[hostname:00599] [[10634,0],0] odls:default:fork binding child [[10634,1],3] to cpus 0008
Cela montre que Le rang 0 a son masque d'affinité défini à 0001
, ce qui lui permet de fonctionner uniquement sur l'UC 0. Le masque d'affinité du rang 1 est défini sur 0002
, ce qui lui permet de s'exécuter sur le processeur 1 uniquement. Etc.
mpiexec --report-bindings --bind-to-socket --bysocket
[hostname:21302] [[30955,0],0] odls:default:fork binding child [[30955,1],0] to socket 0 cpus 003f
[hostname:21302] [[30955,0],0] odls:default:fork binding child [[30955,1],1] to socket 1 cpus 0fc0
[hostname:21302] [[30955,0],0] odls:default:fork binding child [[30955,1],2] to socket 0 cpus 003f
[hostname:21302] [[30955,0],0] odls:default:fork binding child [[30955,1],3] to socket 1 cpus 0fc0
Dans ce cas, les substituts de masque d'affinité entre 003f
et 0fc0
. 003f
en binaire est 0000000000111111
et un tel masque d'affinité permet à chaque rang même d'exécuter sur les processeurs de 0 à 5. 0fc0
est 0000111111000000
et donc les rangs impairs ne sont prévu sur les CPU 5 à 11.
Ouvrir MPI 1.6.x utilise un affichage graphique plus agréable à la place:
mpiexec --report-bindings --bind-to-core --bycore
[hostname:39646] MCW rank 0 bound to socket 0[core 0]: [B . . . . .][. . . . . .]
[hostname:39646] MCW rank 1 bound to socket 0[core 1]: [. B . . . .][. . . . . .]
[hostname:39646] MCW rank 2 bound to socket 0[core 2]: [. . B . . .][. . . . . .]
[hostname:39646] MCW rank 3 bound to socket 0[core 3]: [. . . B . .][. . . . . .]
mpiexec --report-bindings --bind-to-socket --bysocket
[hostname:13888] MCW rank 0 bound to socket 0[core 0-5]: [B B B B B B][. . . . . .]
[hostname:13888] MCW rank 1 bound to socket 1[core 0-5]: [. . . . . .][B B B B B B]
[hostname:13888] MCW rank 2 bound to socket 0[core 0-5]: [B B B B B B][. . . . . .]
[hostname:13888] MCW rank 3 bound to socket 1[core 0-5]: [. . . . . .][B B B B B B]
Chaque socket est représenté graphiquement sous la forme d'un ensemble de crochets avec chaque cœur représenté par un point. Le ou les noyaux auxquels chaque rang est lié sont/sont désignés par la lettre B
. Les processus sont liés au premier thread matériel uniquement.
Ouvrir MPI 1.7.x est un peu plus bavard et connaît aussi des fils de matériel:
mpiexec --report-bindings --bind-to-core
[hostname:28894] MCW rank 0 bound to socket 0[core 0[hwt 0-1]]: [BB/../../../../..][../../../../../..]
[hostname:28894] MCW rank 1 bound to socket 0[core 1[hwt 0-1]]: [../BB/../../../..][../../../../../..]
[hostname:28894] MCW rank 2 bound to socket 0[core 2[hwt 0-1]]: [../../BB/../../..][../../../../../..]
[hostname:28894] MCW rank 3 bound to socket 0[core 3[hwt 0-1]]: [../../../BB/../..][../../../../../..]
mpiexec --report-bindings --bind-to-socket
[hostname:29807] MCW rank 0 bound to socket 0[core 0[hwt 0-1]], socket 0[core 1[hwt 0-1]], socket 0[core 2[hwt 0-1]], socket 0[core 3[hwt 0-1]], socket 0[core 4[hwt 0-1]], socket 0[core 5[hwt 0-1]]: [BB/BB/BB/BB/BB/BB][../../../../../..]
[hostname:29807] MCW rank 1 bound to socket 1[core 6[hwt 0-1]], socket 1[core 7[hwt 0-1]], socket 1[core 8[hwt 0-1]], socket 1[core 9[hwt 0-1]], socket 1[core 10[hwt 0-1]], socket 1[core 11[hwt 0-1]]: [../../../../../..][BB/BB/BB/BB/BB/BB]
[hostname:29807] MCW rank 2 bound to socket 0[core 0[hwt 0-1]], socket 0[core 1[hwt 0-1]], socket 0[core 2[hwt 0-1]], socket 0[core 3[hwt 0-1]], socket 0[core 4[hwt 0-1]], socket 0[core 5[hwt 0-1]]: [BB/BB/BB/BB/BB/BB][../../../../../..]
[hostname:29807] MCW rank 3 bound to socket 1[core 6[hwt 0-1]], socket 1[core 7[hwt 0-1]], socket 1[core 8[hwt 0-1]], socket 1[core 9[hwt 0-1]], socket 1[core 10[hwt 0-1]], socket 1[core 11[hwt 0-1]]: [../../../../../..][BB/BB/BB/BB/BB/BB]
Ouvrir MPI 1.7.x remplace également les --bycore
et --bysocket
avec des options plus générales --rank-by <policy>
option.
est-ce que --report-bindings imprimerait lui-même quelque chose sur le cmd ou comment utiliser plus loin pour obtenir la liaison réelle utilisée par les processus? Il n'a rien imprimé de plus pour moi! –
Chaque rang imprime sa liaison à la sortie d'erreur standard. –
Je ne reçois rien sur le stderr même après avoir redirigé ceci vers stdout en utilisant ceci; char buf [BUFSIZ]; setbuf (stderr, buf); –