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

Change language to:
English - 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ヘルプ >> Scilab MPI > MPI_Recv

MPI_Recv

ノードからデータを受信する

呼び出し手順

value = MPI_Recv(rank,tag)

引数

rank

ランク. TODO

tag

タグ. TODO

res

MPI_Sendから取得した値.

説明

指定したノードから値を取得します. その値は,通常,関数 MPI_Sendから送信されます.

技術的実装

Scilab/MPIの実装に関する詳細については, 実装に関する技術的詳細を 参照ください.

MPI_Init();
rnk =    MPI_Comm_rank();
sizeNodes =    MPI_Comm_size();
SLV = rnk;                // 便利なショートカット, マスターはランク 0
Master = ~ SLV;            // その他は全てスレーブ
tag=0;
if Master
// マスターノード
for slaveId = 1:sizeNodes-1
// Send data to the slaves
value = rand(100,100) + rand(100,100) * %i;
MPI_Send(value, slaveId);
end
for slaveId = 1:sizeNodes-1
valueBack=MPI_Recv(slaveId, tag);
// スレーブが期待するものを送信したか確認
assert_checkequal(valueBack,value + 1);
end
else
// スレーブ
rankSource=0;
// マスターから情報を受信
value=MPI_Recv(rankSource);
// 値を1つ増加
value=value+1;
// マスターに戻す
MPI_Send(value,0);
end
MPI_Finalize();

参照

  • MPI_Send — ノード間データ送信
Report an issue
<< MPI_Isend Scilab MPI MPI_Send >>

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:
Thu Oct 02 13:58:35 CEST 2014