Documentation ¶
Overview ¶
Package mpi wraps the Message Passing Interface for parallel computations
Index ¶
- func IsOn() bool
- func Start()
- func StartThreadSafe() error
- func Stop()
- func WorldRank() (rank int)
- func WorldSize() (size int)
- type Communicator
- func (o *Communicator) Abort()
- func (o *Communicator) AllReduceMax(dest, orig []float64)
- func (o *Communicator) AllReduceMaxI(dest, orig []int)
- func (o *Communicator) AllReduceMin(dest, orig []float64)
- func (o *Communicator) AllReduceMinI(dest, orig []int)
- func (o *Communicator) AllReduceSum(dest, orig []float64)
- func (o *Communicator) AllReduceSumC(dest, orig []complex128)
- func (o *Communicator) Barrier()
- func (o *Communicator) BcastFromRoot(x []float64)
- func (o *Communicator) BcastFromRootC(x []complex128)
- func (o *Communicator) Rank() (rank int)
- func (o *Communicator) Recv(vals []float64, fromID int)
- func (o *Communicator) RecvC(vals []complex128, fromID int)
- func (o *Communicator) RecvI(vals []int, fromID int)
- func (o *Communicator) RecvOne(fromID int) (val float64)
- func (o *Communicator) RecvOneI(fromID int) (val int)
- func (o *Communicator) ReduceSum(dest, orig []float64)
- func (o *Communicator) ReduceSumC(dest, orig []complex128)
- func (o *Communicator) Send(vals []float64, toID int)
- func (o *Communicator) SendC(vals []complex128, toID int)
- func (o *Communicator) SendI(vals []int, toID int)
- func (o *Communicator) SendOne(val float64, toID int)
- func (o *Communicator) SendOneI(val int, toID int)
- func (o *Communicator) Size() (size int)
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 StartThreadSafe ¶ added in v1.1.2
func StartThreadSafe() error
StartThreadSafe initialises MPI thread safe
Types ¶
type Communicator ¶ added in v1.0.1
type Communicator struct {
// contains filtered or unexported fields
}
Communicator holds the World communicator or a subset communicator
func NewCommunicator ¶ added in v1.0.1
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) AllReduceMax ¶ added in v1.0.1
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 ¶ added in v1.0.1
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 ¶ added in v1.0.1
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 ¶ added in v1.0.1
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 ¶ added in v1.0.1
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 ¶ added in v1.0.1
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 ¶ added in v1.0.1
func (o *Communicator) Barrier()
Barrier forces synchronisation
func (*Communicator) BcastFromRoot ¶ added in v1.0.1
func (o *Communicator) BcastFromRoot(x []float64)
BcastFromRoot broadcasts slice from root (Rank == 0) to all other processors
func (*Communicator) BcastFromRootC ¶ added in v1.0.1
func (o *Communicator) BcastFromRootC(x []complex128)
BcastFromRootC broadcasts slice from root (Rank == 0) to all other processors (complex version)
func (*Communicator) Rank ¶ added in v1.0.1
func (o *Communicator) Rank() (rank int)
Rank returns the processor rank/ID
func (*Communicator) Recv ¶ added in v1.0.1
func (o *Communicator) Recv(vals []float64, fromID int)
Recv receives values from processor fromId
func (*Communicator) RecvC ¶ added in v1.0.1
func (o *Communicator) RecvC(vals []complex128, fromID int)
RecvC receives values from processor fromId (complex version)
func (*Communicator) RecvI ¶ added in v1.0.1
func (o *Communicator) RecvI(vals []int, fromID int)
RecvI receives values from processor fromId (integer version)
func (*Communicator) RecvOne ¶ added in v1.0.1
func (o *Communicator) RecvOne(fromID int) (val float64)
RecvOne receives one value from processor fromId
func (*Communicator) RecvOneI ¶ added in v1.0.1
func (o *Communicator) RecvOneI(fromID int) (val int)
RecvOneI receives one value from processor fromId (integer version)
func (*Communicator) ReduceSum ¶ added in v1.0.1
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 ¶ added in v1.0.1
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 ¶ added in v1.0.1
func (o *Communicator) Send(vals []float64, toID int)
Send sends values to processor toID
func (*Communicator) SendC ¶ added in v1.0.1
func (o *Communicator) SendC(vals []complex128, toID int)
SendC sends values to processor toID (complex version)
func (*Communicator) SendI ¶ added in v1.0.1
func (o *Communicator) SendI(vals []int, toID int)
SendI sends values to processor toID (integer version)
func (*Communicator) SendOne ¶ added in v1.0.1
func (o *Communicator) SendOne(val float64, toID int)
SendOne sends one value to processor toID
func (*Communicator) SendOneI ¶ added in v1.0.1
func (o *Communicator) SendOneI(val int, toID int)
SendOneI sends one value to processor toID (integer version)
func (*Communicator) Size ¶ added in v1.0.1
func (o *Communicator) Size() (size int)
Size returns the number of processors