mpi

package
Version: v1.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Gosl. mpi. Message Passing Interface for parallel computing

PkgGoDev

The mpi package is a light wrapper to the OpenMPI C++ library designed to develop algorithms for parallel computing.

This package allows parallel computations over the network.

API

Please see the documentation here

Documentation

Overview

Package mpi wraps the Message Passing Interface for parallel computations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsOn

func IsOn() bool

IsOn tells whether MPI is on or not

NOTE: this returns true even after Stop

func Start

func Start()

Start initialises MPI

func StartThreadSafe added in v1.1.2

func StartThreadSafe() error

StartThreadSafe initialises MPI thread safe

func Stop

func Stop()

Stop finalises MPI

func WorldRank

func WorldRank() (rank int)

WorldRank returns the processor rank/ID within the World communicator

func WorldSize

func WorldSize() (size int)

WorldSize returns the number of processors in the World communicator

Types

type Communicator

type Communicator struct {
	// contains filtered or unexported fields
}

Communicator holds the World communicator or a subset communicator

func NewCommunicator

func NewCommunicator(ranks []int) (o *Communicator)

NewCommunicator creates a new communicator or returns the World communicator

ranks -- World indices of processors in this Communicator.
         use nil or empty to get the World Communicator

func (*Communicator) Abort

func (o *Communicator) Abort()

Abort aborts MPI

func (*Communicator) AllReduceMax

func (o *Communicator) AllReduceMax(dest, orig []float64)

AllReduceMax combines all values from orig into dest picking minimum values

NOTE (important): orig and dest must be different slices

func (*Communicator) AllReduceMaxI

func (o *Communicator) AllReduceMaxI(dest, orig []int)

AllReduceMaxI combines all values from orig into dest picking minimum values (integer version)

NOTE (important): orig and dest must be different slices

func (*Communicator) AllReduceMin

func (o *Communicator) AllReduceMin(dest, orig []float64)

AllReduceMin combines all values from orig into dest picking minimum values

NOTE (important): orig and dest must be different slices

func (*Communicator) AllReduceMinI

func (o *Communicator) AllReduceMinI(dest, orig []int)

AllReduceMinI combines all values from orig into dest picking minimum values (integer version)

NOTE (important): orig and dest must be different slices

func (*Communicator) AllReduceSum

func (o *Communicator) AllReduceSum(dest, orig []float64)

AllReduceSum combines all values from orig into dest summing values

NOTE (important): orig and dest must be different slices

func (*Communicator) AllReduceSumC

func (o *Communicator) AllReduceSumC(dest, orig []complex128)

AllReduceSumC combines all values from orig into dest summing values (complex version)

NOTE (important): orig and dest must be different slices

func (*Communicator) Barrier

func (o *Communicator) Barrier()

Barrier forces synchronisation

func (*Communicator) BcastFromRoot

func (o *Communicator) BcastFromRoot(x []float64)

BcastFromRoot broadcasts slice from root (Rank == 0) to all other processors

func (*Communicator) BcastFromRootC

func (o *Communicator) BcastFromRootC(x []complex128)

BcastFromRootC broadcasts slice from root (Rank == 0) to all other processors (complex version)

func (*Communicator) Rank

func (o *Communicator) Rank() (rank int)

Rank returns the processor rank/ID

func (*Communicator) Recv

func (o *Communicator) Recv(vals []float64, fromID int)

Recv receives values from processor fromId

func (*Communicator) RecvC

func (o *Communicator) RecvC(vals []complex128, fromID int)

RecvC receives values from processor fromId (complex version)

func (*Communicator) RecvI

func (o *Communicator) RecvI(vals []int, fromID int)

RecvI receives values from processor fromId (integer version)

func (*Communicator) RecvOne

func (o *Communicator) RecvOne(fromID int) (val float64)

RecvOne receives one value from processor fromId

func (*Communicator) RecvOneI

func (o *Communicator) RecvOneI(fromID int) (val int)

RecvOneI receives one value from processor fromId (integer version)

func (*Communicator) ReduceSum

func (o *Communicator) ReduceSum(dest, orig []float64)

ReduceSum sums all values in 'orig' to 'dest' in root (Rank == 0) processor

NOTE (important): orig and dest must be different slices

func (*Communicator) ReduceSumC

func (o *Communicator) ReduceSumC(dest, orig []complex128)

ReduceSumC sums all values in 'orig' to 'dest' in root (Rank == 0) processor (complex version)

NOTE (important): orig and dest must be different slices

func (*Communicator) Send

func (o *Communicator) Send(vals []float64, toID int)

Send sends values to processor toID

func (*Communicator) SendC

func (o *Communicator) SendC(vals []complex128, toID int)

SendC sends values to processor toID (complex version)

func (*Communicator) SendI

func (o *Communicator) SendI(vals []int, toID int)

SendI sends values to processor toID (integer version)

func (*Communicator) SendOne

func (o *Communicator) SendOne(val float64, toID int)

SendOne sends one value to processor toID

func (*Communicator) SendOneI

func (o *Communicator) SendOneI(val int, toID int)

SendOneI sends one value to processor toID (integer version)

func (*Communicator) Size

func (o *Communicator) Size() (size int)

Size returns the number of processors

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL