Documentation ¶
Overview ¶
Package mpi wraps the Message Passing Interface for parallel computations
Index ¶
- func IsOn() bool
- func Start()
- 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
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) 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) 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