Beispiel #1
0
Datei: mpi.go Projekt: rwl/mpi
)

/*
implementational details:
all #define values within mpi.h cannot be accessed directly, so
go needs c-wrappers. below there is a small subsection of all
values, which have to be extended, if needed.
(mth: I implemented currently only things I need)
*/
var (

	//communication structures
	COMM_WORLD C.MPI_Comm = C.get_MPI_COMM_WORLD()

	//datatypes
	INT     C.MPI_Datatype = C.get_MPI_Datatype(0)
	INT32   C.MPI_Datatype = C.get_MPI_Datatype(0)
	INT64   C.MPI_Datatype = C.get_MPI_Datatype(1)
	FLOAT32 C.MPI_Datatype = C.get_MPI_Datatype(2)
	FLOAT64 C.MPI_Datatype = C.get_MPI_Datatype(3)

	//operations
	MAX  C.MPI_Op = C.get_MPI_Op(0)
	MIN  C.MPI_Op = C.get_MPI_Op(1)
	SUM  C.MPI_Op = C.get_MPI_Op(2)
	PROD C.MPI_Op = C.get_MPI_Op(3)
)

// now mpi has also some types, which we directly map
type Request C.MPI_Request
type Status C.MPI_Status
Beispiel #2
0
Datei: mpi.go Projekt: gonuts/mpi
	"unsafe"
)

/*
all #define values within mpi.h cannot be accessed directly, so
go needs c-wrappers. below there is a small subsection of all
values, which have to be extended, if needed.
(mth: I support currently only things I need)
*/
var (

	//communication structures
	COMM_WORLD C.MPI_Comm = C.get_MPI_COMM_WORLD()

	//datatypes
	INT     C.MPI_Datatype = C.get_MPI_Datatype(0)
	FLOAT64 C.MPI_Datatype = C.get_MPI_Datatype(1)

	//operations
	MAX  C.MPI_Op = C.get_MPI_Op(0)
	MIN  C.MPI_Op = C.get_MPI_Op(1)
	SUM  C.MPI_Op = C.get_MPI_Op(2)
	PROD C.MPI_Op = C.get_MPI_Op(3)
)

/*
now mpi has also some types, which we directly map
*/
type Request C.MPI_Request
type Status C.MPI_Status