Exemplo n.º 1
0
Arquivo: mpi.go Projeto: rwl/mpi
func Isend_int32(sendbuf []int32, dest, tag int, comm C.MPI_Comm, request *Request) {

	err := C.MPI_Isend(
		unsafe.Pointer(&sendbuf[0]), C.int(len(sendbuf)), INT32,
		C.int(dest), C.int(tag), comm, (*C.MPI_Request)(request))

	if err != 0 {
		log.Fatal(err)
	}
}
Exemplo n.º 2
0
Arquivo: mpi.go Projeto: rwl/mpi
func Isend_float64(sendbuf []float64, dest, tag int, comm C.MPI_Comm, request *Request) {

	err := C.MPI_Isend(
		unsafe.Pointer(&sendbuf[0]), C.int(len(sendbuf)), FLOAT64,
		C.int(dest), C.int(tag), comm, (*C.MPI_Request)(request))

	if err != 0 {
		log.Fatal(err)
	}
}
Exemplo n.º 3
0
//Isend
//Starts a standard-mode, nonblocking send.
func Isend(buffer interface{},
	sendCount int,
	dataType Datatype,
	dest int,
	tag int,
	comm Comm,
	request *Request) int {

	bufferVoidPointer := Get_void_ptr(buffer)
	cRequestPointer := (*C.MPI_Request)(request)

	err := C.MPI_Isend(bufferVoidPointer,
		C.int(sendCount),
		C.MPI_Datatype(dataType),
		C.int(dest),
		C.int(tag),
		C.MPI_Comm(comm),
		cRequestPointer)

	return int(err)
}