Categorygithub.com/johannweging/go-mpi
repositorypackage
0.0.0-20140428150640-6544b0739b4f
Repository: https://github.com/johannweging/go-mpi.git
Documentation: pkg.go.dev

# README

go-mpi

go-mpi are GO bindings for the Message Passing Interface <a href=http://www.mpi-forum.org/>(MPI Forum).

Installation

MPI is a standard but the different implementations differ in some details. At the moment go-mpi support <a href=http://www.open-mpi.de/>Open MPI and <a href=http://www.mpich.org/>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)