Example #1
0
//Allgather
//Gathers data from all processes and distributes it to all processes.
func Allgather(sendBuffer interface{},
	sendCount int,
	sendType Datatype,
	recvBuffer interface{},
	recvCount int,
	recvType Datatype,
	comm Comm) int {

	sendBufferVoidPointer := Get_void_ptr(sendBuffer)
	recvBufferVoidPointer := Get_void_ptr(recvBuffer)
	err := C.MPI_Allgather(sendBufferVoidPointer,
		C.int(sendCount),
		C.MPI_Datatype(sendType),
		recvBufferVoidPointer,
		C.int(recvCount),
		C.MPI_Datatype(recvType),
		C.MPI_Comm(comm))

	return int(err)
}
Example #2
0
File: mpi.go Project: npadmana/mpi
// AllGatherInt64 : MPI_Allgather for int64
func AllGatherInt64(comm Comm, in, out []int64) {
	C.MPI_Allgather(unsafe.Pointer(&in[0]), C.int(len(in)), MPI_i64, unsafe.Pointer(&out[0]), C.int(len(in)), MPI_i64, comm)
}
Example #3
0
File: mpi.go Project: npadmana/npgo
// AllGatherInt64 : MPI_Allgather for int64
func AllGatherInt64(comm Comm, in, out []int64) {
	C.MPI_Allgather(unsafe.Pointer(&in[0]), C.int(len(in)), C.MPI_Datatype(MPI_i64), unsafe.Pointer(&out[0]), C.int(len(in)), C.MPI_Datatype(MPI_i64), C.MPI_Comm(comm))
}