Esempio n. 1
0
File: mpi.go Progetto: rwl/mpi
func Irecv_int32(recvbuf []int32, source, tag int, comm C.MPI_Comm, request *Request) {

	err := C.MPI_Irecv(
		unsafe.Pointer(&recvbuf[0]), C.int(len(recvbuf)), INT32,
		C.int(source), C.int(tag), comm, (*C.MPI_Request)(request))

	if err != 0 {
		log.Fatal(err)
	}
}
Esempio n. 2
0
File: mpi.go Progetto: rwl/mpi
func Irecv_float64(recvbuf []float64, source, tag int, comm C.MPI_Comm, request *Request) {

	err := C.MPI_Irecv(
		unsafe.Pointer(&recvbuf[0]), C.int(len(recvbuf)), FLOAT64,
		C.int(source), C.int(tag), comm, (*C.MPI_Request)(request))

	if err != 0 {
		log.Fatal(err)
	}
}
Esempio n. 3
0
// Irecv
// Begins a nonblocking receive
func Irecv(buffer interface{},
	count int,
	datatype Datatype,
	source int,
	tag int,
	comm Comm,
	request *Request) int {

	recvBufferVoidPointer := Get_void_ptr(buffer)

	err := C.MPI_Irecv(recvBufferVoidPointer,
		C.int(count),
		C.MPI_Datatype(datatype),
		C.int(source),
		C.int(tag),
		C.MPI_Comm(comm),
		(*C.MPI_Request)(request))
	return int(err)
}