Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 1.19 KB

README.md

File metadata and controls

43 lines (32 loc) · 1.19 KB

go-mpi

go-mpi are GO bindings for the Message Passing Interface (MPI Forum).

Installation

MPI is a standard but the different implementations differ in some details. At the moment go-mpi support Open MPI and MPICH version 2.

To tell go where to look for the MPI library use the CGO_LDFALG environment variable. The following instructions uses the default path for Open MPI and MPICH.

For Open MPI:

export CGO_LDFLAGS='-L/usr/lib/openmpi -lmpi'
go get -tags openmpi github.com/JohannWeging/go-mpi

For MPICH:

export CGO_LDFLAGS='-L/usr/lib/ -lmpich'
go get -tags mpich github.com/JohannWeging/go-mpi

Syntax

The syntax is similar to the C syntax of MPI.

<package_name>.Mpi_function(arguments)

If the bindings are imported as "MPI":

  err = MPI.Init(os.Args)

Output parameter like request objects are returned by the function and not passed as pointers inside the arguments.

  C:
  err = MPI_Irecv(recvBuffer, count, MPI_INT, 0, 1, MPI_COMM_WROLD, &request)

  GO:
  err = MPI.Irecv(recvBuffer, count, MPI.INT, 0, 1, MPI.COMM_WORLD, &request)