コード例 #1
0
ファイル: misc.go プロジェクト: jmptrader/go-mpi
//Put
//Copies data from the origin memory to the target.
func Put(originAddr interface{}, originCount int, originType Datatype,
	targetRank int, targetDisplacement Aint, targetCount int,
	targetType Datatype, win Win) int {

	originAddrVoidPtr := Get_void_ptr(originAddr)

	err := C.MPI_Put(originAddrVoidPtr,
		C.int(originCount),
		C.MPI_Datatype(originType),
		C.int(targetRank),
		C.MPI_Aint(targetDisplacement),
		C.int(targetCount),
		C.MPI_Datatype(targetType),
		C.MPI_Win(win))

	return int(err)
}
コード例 #2
0
ファイル: comm.go プロジェクト: jmptrader/go-mpi
//Accumulate
//Combines the contents of the origin buffer with that of a target buffer.
func Accumulate(originAddr interface{},
	originCount int,
	originDatatype Datatype,
	targetRank int,
	targetDisp Aint,
	targetCount int,
	targetDatatype Datatype,
	op Op,
	win Win) int {

	originAddrVoidPointer := Get_void_ptr(originAddr)
	return int(
		C.MPI_Accumulate(originAddrVoidPointer,
			C.int(originCount),
			C.MPI_Datatype(originDatatype),
			C.int(targetRank),
			C.MPI_Aint(targetDisp),
			C.int(targetCount),
			C.MPI_Datatype(targetDatatype),
			C.MPI_Op(op),
			C.MPI_Win(win)))
}