Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.1.0 - 日本語


MPI_Bcast

ランクルートを有するプロセスからグループの 他の全プロセスにメッセージをブロードキャストする.

呼び出し手順

res = MPI_Bcast(value,rootID)
res = MPI_Bcast(value, rootID, comm=mpi_comm)

引数

value

全ノードに送信する値.

rootID

メッセージのソース

comm = mpi_comm

If the optional argument "comm" is given, this function will use the MPI communicator created by MPI_Create_comm. If not, the default MPI_COMM_WORLD is used.

res

ブロードキャストされた値

説明

全ノードに変数を送信します. この値は関数MPI_Recvにより ノードで取得されます.

内部的な技術面では,2つのブロードキャストが透過的に 使用されます. 初回はデータの大きさ,2回目はデータ自体を送信します.

MPI_Init();
rnk = MPI_Comm_rank();
sizeNodes = MPI_Comm_size();
SLV = rnk;                // 手軽なショートカット, マスターはランク0です
Master = ~ SLV;            // その他は全てスレーブ
a = -1;
if Master
    // aを宣言
    a = 42
end
b = MPI_Bcast(a, 0);
b == 42
MPI_Finalize();

参照

  • MPI_Recv — ノードからデータを受信する
Report an issue
<< MPI Scilab MPI MPI_Comm_rank >>

Copyright (c) 2022-2024 (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:
Thu May 22 12:57:16 CEST 2025