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

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_Send

MPI_Send

ノード間データ送信

呼び出し手順

res = MPI_Send(value,node)

引数

value

特定のノードに送信する値.

node

データを送信するノード

res

処理結果 (成功時にtrue,失敗した場合に false)

説明

変数を特定のノードに送信します. この値は,関数MPI_Recvにより 取得します.

MPI_Init();
rnk =    MPI_Comm_rank();
sizeNodes =    MPI_Comm_size();
SLV = rnk;                // handy shortcuts, master is rank 0
Master = ~ SLV;            // slaves are all other
tag=0;
if Master
// The master node
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);
// Check that the slaves gaves us what we expected
assert_checkequal(valueBack,value + 1);
end
else
// The slaves
rankSource=0;
// Receive the information from the master
value=MPI_Recv(rankSource);
// Increment all the values by one
value=value+1;
// Send back to the master
MPI_Send(value,0);
end
MPI_Finalize();

参照

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

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:25:14 CEST 2015