empi

package
v1.0.22 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: BSD-3-Clause Imports: 8 Imported by: 22

Documentation

Overview

Package empi wraps the Message Passing Interface for distributed memory data sharing across a collection of processors (procs).

It also contains some useful abstractions and error logging support in Go.

The wrapping code was initially copied from https://github.com/cpmech/gosl/mpi and significantly modified.

All standard Go types are supported using the apache arrow tmpl generation tool. Int is assumed to be 64bit and is defined as a []int because that is typically more convenient.

Index

Constants

View Source
const (
	Version     = "v1.0.22"
	GitCommit   = "4d37da0"          // the commit JUST BEFORE the release
	VersionDate = "2023-07-11 20:19" // UTC
)

Variables

This section is empty.

Functions

func AllocN added in v1.0.3

func AllocN(n int) (st, end int, err error)

Alloc allocates n items to current mpi proc based on WorldSize and WorldRank. Returns start and end (exclusive) range for current proc.

func GatherTableRows

func GatherTableRows(dest, src *etable.Table, comm *mpi.Comm)

GatherTableRows does an MPI AllGather on given src table data, gathering into dest. dest will have np * src.Rows Rows, filled with each processor's data, in order. dest must be a clone of src: if not same number of cols, will be configured from src.

func GatherTensorRows

func GatherTensorRows(dest, src etensor.Tensor, comm *mpi.Comm) error

GatherTensorRows does an MPI AllGather on given src tensor data, gathering into dest, using a row-based tensor organization (as in an etable.Table). dest will have np * src.Rows Rows, filled with each processor's data, in order. dest must have same overall shape as src at start, but rows will be enforced.

func GatherTensorRowsString

func GatherTensorRowsString(dest, src *etensor.String, comm *mpi.Comm) error

GatherTensorRowsString does an MPI AllGather on given String src tensor data, gathering into dest, using a row-based tensor organization (as in an etable.Table). dest will have np * src.Rows Rows, filled with each processor's data, in order. dest must have same overall shape as src at start, but rows will be enforced.

func RandCheck added in v1.0.11

func RandCheck(comm *mpi.Comm) error

RandCheck checks that the current random numbers generated across each MPI processor are identical. Most emergent simulations depend on this being true, so it is good to check periodically to ensure!

func ReduceTable added in v1.0.6

func ReduceTable(dest, src *etable.Table, comm *mpi.Comm, op mpi.Op)

ReduceTable does an MPI AllReduce on given src table data using given operation, gathering into dest. each processor must have the same table organization -- the tensor values are just aggregated directly across processors. dest will be a clone of src if not the same (cos & rows), does nothing for strings.

func ReduceTensor added in v1.0.6

func ReduceTensor(dest, src etensor.Tensor, comm *mpi.Comm, op mpi.Op) error

ReduceTensor does an MPI AllReduce on given src tensor data, using given operation, gathering into dest. dest must have same overall shape as src -- will be enforced. IMPORTANT: src and dest must be different slices! each processor must have the same shape and organization for this to make sense. does nothing for strings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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