func Send(buf interface{}, count int, datatype MPI_Datatype, dest int, tag int, comm MPI_Comm) int { switch ptr := buf.(type) { case *int: ret := C.MPI_Send(unsafe.Pointer(ptr), C.int(count), datatype, C.int(dest), C.int(tag), comm) return int(ret) } return 0 }
func Send_float64(sendbuf []float64, dest, tag int, comm C.MPI_Comm) { err := C.MPI_Send( unsafe.Pointer(&sendbuf[0]), C.int(len(sendbuf)), FLOAT64, C.int(dest), C.int(tag), comm) if err != 0 { log.Fatal(err) } }
func Send_int32(sendbuf []int32, dest, tag int, comm C.MPI_Comm) { err := C.MPI_Send( unsafe.Pointer(&sendbuf[0]), C.int(len(sendbuf)), INT32, C.int(dest), C.int(tag), comm) if err != 0 { log.Fatal(err) } }
//Send //Performs a standard-mode blocking send. func Send(buffer interface{}, count int, dataType Datatype, dest int, tag int, comm Comm) int { bufferVoidPointer := Get_void_ptr(buffer) err := C.MPI_Send(bufferVoidPointer, C.int(count), C.MPI_Datatype(dataType), C.int(dest), C.int(tag), C.MPI_Comm(comm)) return int(err) }
func SendFloat32(data []float32, dest, tag int) int { // sizeof(MPI_FLOAT) == 4 ret := C.MPI_Send(unsafe.Pointer(&data[0]), C.int(len(data)), MPI_FLOAT, C.int(dest), C.int(tag), COMM_WORLD) return int(ret) }
func SendInt32(data []int32, dest, tag int) int { // sizeof(MPI_INTEGER) == 4 ret := C.MPI_Send(unsafe.Pointer(&data[0]), C.int(len(data)), MPI_INTEGER, C.int(dest), C.int(tag), COMM_WORLD) return int(ret) }