Exemple #1
0
//Comm_rank
//Determines the rank of the calling process in the communicator.
func Comm_rank(comm Comm) (int, int) {

	var rank C.int
	err := C.MPI_Comm_rank(C.MPI_Comm(comm), &rank)

	return int(rank), int(err)
}
Exemple #2
0
// Rank returns the MPI_Rank
func Rank(comm Comm) (int, error) {
	var r C.int
	perr := C.MPI_Comm_rank(comm, &r)
	if perr != 0 {
		return -1, errors.New("Error calling MPI_Comm_rank")
	}
	return int(r), nil
}
Exemple #3
0
func Comm_rank(comm MPI_Comm) int {
	var rank int
	C.MPI_Comm_rank(comm, (*C.int)(unsafe.Pointer(&rank)))
	return rank
}
Exemple #4
0
Fichier : mpi.go Projet : rwl/mpi
func Comm_rank(comm C.MPI_Comm) int {
	n := C.int(-1)
	C.MPI_Comm_rank(comm, &n)
	return int(n)
}
Exemple #5
0
func Rank() int {
	var rank C.int
	C.MPI_Comm_rank(COMM_WORLD, &rank)
	return int(rank)
}