MPI_ERR_TRUNCATE: Beim Broadcast
ich habe einint
Ich beabsichtige, von root aus zu senden (rank==(FIELD=0)
).
int winner
if (rank == FIELD) {
winner = something;
}
MPI_Barrier(MPI_COMM_WORLD);
MPI_Bcast(&winner, 1, MPI_INT, FIELD, MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD);
if (rank != FIELD) {
cout << rank << " informed that winner is " << winner << endl;
}
Aber es scheint, ich verstehe
[JM:6892] *** An error occurred in MPI_Bcast
[JM:6892] *** on communicator MPI_COMM_WORLD
[JM:6892] *** MPI_ERR_TRUNCATE: message truncated
[JM:6892] *** MPI_ERRORS_ARE_FATAL: your MPI job will now abort
Gefunden, dass ich die Puffergröße in erhöhen kannBcast
MPI_Bcast(&winner, NUMPROCS, MPI_INT, FIELD, MPI_COMM_WORLD);
WoherNUMPROCS
ist die Anzahl der laufenden Prozesse. (Scheint eigentlich so, als müsste es nur 2 sein). Dann läuft es, gibt aber unerwartete Ausgabe ...
1 informed that winner is 103
2 informed that winner is 103
3 informed that winner is 103
5 informed that winner is 103
4 informed that winner is 103
Wenn ichcout
daswinner
, es sollte sein-1