Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.2 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
However, this page did not exist in the previous stable version.

Scilab Help >> Scilab MPI > MPI_Bcast

MPI_Bcast

Broadcasts a message from the process with rank root to all other processes of the group.

Calling Sequence

res = MPI_Bcast(value,rootID)

Arguments

value

The value to be sent to all nodes.

rootID

The source of the message

res

The broadcasted value

Description

Send a variable to all nodes. The value should be retrieved by the node with the function MPI_Recv.

On the internal technical side, two broadcasts are used transparently. The first one sends the size of the data, the second the data themself.

Examples

MPI_Init();
rnk =    MPI_Comm_rank();
sizeNodes =    MPI_Comm_size();

SLV = rnk;                // handy shortcuts, master is rank 0
Master = ~ SLV;            // slaves are all other
a=-1
if Master
// Declare a
a=42
end
b=MPI_Bcast(a, 0);
assert_checkequal(b,42);
MPI_Finalize();

See Also

Report an issue
<< Scilab MPI Scilab MPI MPI_Init >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Apr 01 10:14:08 CEST 2015