Example #1
0
//Get_elements
//Returns the number of basic elements in a data type.
func Get_elements(status Status, datatype Datatype) (int, int) {

	cStatus := C.MPI_Status(status)
	var cCount C.int

	err := C.MPI_Get_elements(&cStatus, C.MPI_Datatype(datatype), &cCount)

	return int(cCount), int(err)
}
Example #2
0
//Status_set_elements
//Modifies opaque part of status to allow MPI_Get_elements to return count.
func Status_set_elements(status Status, datatype Datatype, count int) (Status, int) {

	cStatus := C.MPI_Status(status)

	err := C.MPI_Status_set_elements(&cStatus,
		C.MPI_Datatype(datatype),
		C.int(count))

	return Status(cStatus), int(err)
}
Example #3
0
//Get_count
//Gets the number of top-level elements received.
func Get_count(status Status, dataType Datatype) (int, int) {

	var count C.int
	var cStatus C.MPI_Status
	cStatus = C.MPI_Status(status)

	err := C.MPI_Get_count(&cStatus, C.MPI_Datatype(dataType), &count)

	return int(count), int(err)
}
Example #4
0
//Status_set_cancelled
//Sets status to indicate a request has been canceled.
func Status_set_canelled(status Status, flag bool) (Status, int) {

	cStatus := C.MPI_Status(status)
	cFlag := C.int(0)
	if flag {
		cFlag = C.int(1)
	}

	err := C.MPI_Status_set_cancelled(&cStatus, cFlag)

	return Status(cStatus), int(err)
}
Example #5
0
//Test_cancelled
//Tests whether a request was canceled.
func Test_cancelled(status Status) (bool, int) {

	cStatus := C.MPI_Status(status)
	var cFlag C.int
	flag := false

	err := C.MPI_Test_cancelled(&cStatus, &cFlag)

	if int(cFlag) != 0 {
		flag = true
	}

	return flag, int(err)
}