MPIサブルーチン概要
ここで説明されているサブルーチンは例題で使用したものだけで,全てを網羅しているわけではありせん.MPIの詳細については,MPI標準の公式文書または各実装(MPICH, Open MPIなど)のマニュアルを参照してください.
mpi_get_address(location,address,ierr)
-
type(*), dimension(..), asynchronous :: location
: データの位置integer(kind=mpi_address_kind) intent(out) :: address
: バイトアドレスinteger, optional, intent(out) :: ierr
: エラーコード
location
のバイトアドレスを取得します. mpi_bcast(buf,count,datatype,root,comm,ierr)
-
type(*), dimension(..) :: buf
: 送受信されるデータの先頭位置integer, intent(in) :: count
: 送受信されるデータの数type(mpi_datatype), intent(in) :: datatype
: 送受信されるデータのデータ型integer, intent(in) :: root
: データを送信するプロセッサのランクtype(mpi_comm), intent(in) :: comm
: コミュニケータinteger, optional, intent(out) :: ierr
: エラーコード
root
プロセッサがbuf
をコミュニケータで定義された全てのプロセッサに送信し,コミュニケータ内の他の全てのプロセッサはデータをbuf
に受け取ります. mpi_comm_rank(comm,rank,ierr)
-
type(mpi_comm), intent(in) :: comm
: コミュニケータinteger, intent(out) :: rank
: プロセッサランクinteger, optional, intent(out) :: ierr
: エラーコード
mpi_comm_size(comm,size,ierr)
-
type(mpi_comm), intent(in) :: comm
: コミュニケータinteger, intent(out) :: size
: プロセッサ数integer, optional, intent(out) :: ierr
: エラーコード
mpi_finalize(ierr)
-
integer, optional, intent(out) :: ierr
: エラーコード
mpi_gather(sendbuf,sendcounts,sendtype,recvbuf,recvcounts,recvtype,root,comm,ierr)
-
type(*), dimension(..), intent(in) :: sendbuf
: 各プロセッサから送信されるデータの位置integer, intent(in) :: sendcounts
: 各プロセッサから送信されるデータの数type(mpi_datatype), intent(in) :: sendtype
: 各プロセッサから送信されるデータのデータ型type(*), dimension(..):: recvbuf
:root
プロセッサが受信するデータの先頭位置integer, intent(in) :: recvcounts
:root
プロセッサが各プロセッサから受信するデータの数type(mpi_datatype), intent(in) :: recvtype
:root
プロセッサが受信するデータのデータ型integer, intent(in) :: root
: データを集めるプロセッサのランクtype(mpi_comm), intent(in) :: comm
: コミュニケータinteger, optional, intent(out) :: ierr
: エラーコード
root
プロセッサに集めます.番プロセッサから送信されたデータは,番プロセッサからのデータが保存された位置の隣に保存されます.sendcounts
/sendtype
とrecvcounts
/recvtype
は全プロセッサで同じでなければなりません. mpi_gatherv(sendbuf,sendcounts,sendtype,recvbuf,recvcounts,displs,recvtype,root,comm,ierr)
-
type(*), dimension(..), intent(in) :: sendbuf
: 各プロセッサから送信されるデータの位置integer, intent(in) :: sendcounts
: 各プロセッサから送信されるデータの数type(mpi_datatype), intent(in) :: sendtype
: 各プロセッサから送信されるデータのデータ型type(*), dimension(..) :: recvbuf
:root
プロセッサが受信するデータの先頭位置integer, intent(in) :: recvcounts(*)
:root
プロセッサが各プロセッサから受信するデータの数をあらわす配列integer, intent(in) :: displs(*)
:root
プロセッサが各プロセッサから受信したデータの位置をあらわす配列type(mpi_datatype), intent(in) :: recvtype
:root
プロセッサが受信するデータのデータ型integer, intent(in) :: root
: データを集めるプロセッサのランクtype(mpi_comm), intent(in) :: comm
: コミュニケータinteger, optional, intent(out) :: ierr
: エラーコード
Mpi_gatherv
は各プロセッサから異なるサイズのデータを送信できるようにmpi_gather
を機能拡張したものです.Displs
はroot
プロセッサ上に集められたデータの位置を指定します. mpi_init(ierr)
-
integer, optional, intent(out) :: ierr
: エラーコード
mpi_irecv(buf,count,datatype,source,tag,comm,request,ierr)
-
type(*), dimension(..), asynchronous :: buf
: 受信するデータの先頭位置integer, intent(in) :: count
: 受信するデータの数type(mpi_datatype), intent(in) :: datatype
: 受信するデータのデータ型integer, intent(in) :: source
: データ送信元のプロセッサランクinteger, intent(in) :: tag
: メッセージタグtype(mpi_comm), intent(in) :: comm
: コミュニケータtype(mpi_request), intent(out) :: request
:mpi_wait
で使用するリクエストタグinteger, optional, intent(out) :: ierr
: エラーコード
mpi_recv
. mpi_isend(buf,count,datatype,dest,tag,comm,request,ierr)
-
type(*), dimension(..), intent(in), asynchronous :: buf
: 送信するデータの先頭位置integer, intent(in) :: count
: 送信するデータの数type(mpi_datatype), intent(in) :: datatype
: 送信するデータのデータ型integer, intent(in) :: dest
: データ送信先のプロセッサランクinteger, intent(in) :: tag
: メッセージタグtype(mpi_comm), intent(in) :: comm
: コミュニケータtype(mpi_request), intent(out) :: request
:mpi_wait
で使用するリクエストタグinteger, optional, intent(out) :: ierr
: エラーコード
mpi_send
. mpi_recv(buf,count,datatype,source,tag,comm,status,ierr)
-
type(*), dimension(..) :: buf
: 受信するデータの先頭位置integer, intent(in) :: count
: 受信するデータの数type(mpi_datatype), intent(in) :: datatype
: 受信するデータのデータ型integer, intent(in) :: source
: データ送信元のプロセッサのランクinteger, intent(in) :: tag
: メッセージタグtype(mpi_comm), intent(in) :: comm
: コミュニケータtype(mpi_status) :: status
: 受信したデータの情報integer, optional, intent(out) :: ierr
: エラーコード
source
プロセッサから送られたデータをbuf
に受信します.対応するmpi_send
はmpi_recv
と同じtag
を持たなければなりません.Status
には,送信元のプロセッサランク,メッセージタグ,エラーコードなど,受信したデータの情報が記録されます. mpi_reduce(sendbuf,recvbuf,count,datatype,operator,root,comm,ierr)
-
type(*), dimension(..), intent(in) :: sendbuf
: 演算を施すデータtype(*), dimension(..) :: recvbuf
: 演算結果integer, intent(in) :: count
:sendbuf
/recvbuf
の数type(mpi_datatype), intent(in) :: datatype
:sendbuf
/recvbuf
のデータ型type(mpi_op), intent(in) :: operator
: リダクション演算integer, intent(in) :: root
: 結果を受信するプロセッサのランクtype(mpi_comm), intent(in) :: comm
: コミュニケータinteger, optional, intent(out) :: ierr
: エラーコード
sendbuf
をoperator
で定義された操作を作用させて結合し,root
プロセッサのrecvbuf
に値を返します.operator
にはMPIライブラリで定義されているリダクション演算(mpi_sum
,mpi_max
,mpi_min
など),またはユーザが定義した演算を与えます. mpi_send(buf,count,datatype,dest,tag,comm,ierr)
-
type(*), dimension(..), intent(in) :: buf
: 送信するデータの先頭位置integer, intent(in) :: count
: 送信するデータの数type(mpi_datatype), intent(in) :: datatype
: 送信するデータのデータ型integer, intent(in) :: dest
: データ送信先のプロセッサランクinteger, intent(in) :: tag
: メッセージタグtype(mpi_comm), intent(in) :: comm
: コミュニケータinteger, optional, intent(out) :: ierr
: エラーコード
dest
プロセッサへbuf
を送信します.対応するmpi_recv
はmpi_send
と同じtag
を持たなければなりません. mpi_sendrecv(sendbuf,sendcount,sendtype,dest,sendtag,recvbuf,recvcount,recvtype,source,recvtag,comm,status,ierr)
-
type(*), dimension(..), intent(in) :: sendbuf
: 送信するデータの先頭位置integer, intent(in) :: sendcount
: 送信するデータの数type(mpi_datatype), intent(in) :: sendtype
: 送信するデータのデータ型integer, intent(in) :: dest
: データ送信先のプロセッサランクinteger, intent(in) :: sendtag
: メッセージタグtype(*), dimension(..) :: recvbuf
: 受信するデータの先頭位置integer, intent(in) :: recvcount
: 受信するデータの数type(mpi_datatype), intent(in) :: recvtype
: 受信するデータのデータ型integer, intent(in) :: source
: データ送信元のプロセッサランクinteger, intent(in) :: recvtag
: メッセージタグtype(mpi_comm), intent(in) :: comm
: コミュニケータtype(mpi_status) :: status
: 受信したデータの情報integer, optional, intent(out) :: ierr
: エラーコード
mpi_send
とmpi_recv
の組合せです. mpi_type_commit(newtype,ierr)
-
type(mpi_datatype), intent(in) :: newtype
: 通知される派生型integer, optional, intent(out) :: ierr
: エラーコード
newtype
をMPIに通知します.通知後に新しい派生型newtype
が使用可能になります. mpi_type_create_struct(count,sizes,displacements,types,newtype,ierr)
-
integer, intent(in) :: count
: 新しい派生型の要素数integer, intent(in) :: sizes(count)
: 新しい派生型の各要素の数integer(kind=mpi_address_kind), intent(in) :: displacements(count)
: 新しい派生型の各要素の先頭位置からの変位type(mpi_datatype), intent(in) :: types(count)
: 新しい派生型の各要素のデータ型type(mpi_datatype), intent(out) :: newtype
: 新しい派生型integer, optional, intent(out) :: ierr
: エラーコード
count
,sizes
,displacements
,types
で定義されたデータグループを与える派生型を構築します. mpi_wait(request,status,ierr)
-
type(mpi_requet), intent(inout) :: request
: リクエストタグtype(mpi_status) :: status
: 完了した操作に関する情報integer, optional, intent(out) :: ierr
: エラーコード