A = MPI_Bcast(A, Root)
A = MPI_Bcast(A, Root, Comm)
| Paramètre | Description |
|---|---|
| A | variable Nelson. |
| Root | entier : rang du root de diffusion. |
| Comm | objet MPI_Comm. |
| Paramètre | Description |
|---|---|
| A | tableau diffusé. |
Cette fonction est utilisée pour diffuser un tableau à tous les membres du groupe.
if ~MPI_Initialized()
MPI_Init();
end
my_rank = MPI_Comm_rank();
num_ranks = MPI_Comm_size();
root = 0;
if (my_rank == 0)
buff = 777;
else
buff = 0;
end
disp(['rank: ', int2str(my_rank), ': before Bcast, buff is ', int2str(buff)])
buff = MPI_Bcast(buff, root);
disp(['rank: ', int2str(my_rank), ': after Bcast, buff is ', int2str(buff)])
if MPI_Initialized()
MPI_Finalize();
end
| Version | Description |
|---|---|
| 1.0.0 | version initiale |