mpi

package
v0.0.0-...-9a30dd0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SelfRank                   uint64
	DispatcherToWorkerTCPConn  []*net.Conn
	WorkerToDispatcherTCPConn  *net.Conn
	DispatcherToWorkerListener []*net.Listener
	WorkerOutputs              []bytes.Buffer
	WorkerOutputsErr           []bytes.Buffer
	BytesSent                  uint64
	BytesReceived              uint64
	WorldSize                  uint64
)

Functions

func Close

func Close()

func ConfigureDispatcher

func ConfigureDispatcher(hostFilePath, configFilePath string, world *MPIWorld)

func ConfigureWorker

func ConfigureWorker(world *MPIWorld)

func GetHash

func GetHash(str string)

func GetLocalIP

func GetLocalIP() ([]string, error)

func NewHostGroup

func NewHostGroup(filePath string) (*hostGroup, error)

func ParseConfig

func ParseConfig(ConfigFilePath string) (*config, error)

ParseConfig parses the config JSON file

 {
 user: string
 keyfile: string
 verbose: bool
}

func ReceiveBytes

func ReceiveBytes(size uint64, rank uint64) ([]byte, error)

If Dispatcher calls this function, rank is required, it will receive from rank-th worker If Worker calls this function, rank is not required, it will receive from Dispatcher

func SendBytes

func SendBytes(buf []byte, rank uint64) error

func SerializeWorld

func SerializeWorld(world *MPIWorld) []byte

func SetIPPool

func SetIPPool(filePath string, world *MPIWorld) (*hostGroup, error)

SetIPPool unpacks the json file `filePath` and unrolls the ip groups into the world and sets the rank and size as appropriate.

Types

type MPIWorld

type MPIWorld struct {
	IPPool []string
	Port   []uint64
	// contains filtered or unexported fields
}

func DeserializeWorld

func DeserializeWorld(buf []byte) *MPIWorld

func WorldInit

func WorldInit(hostFilePath, configFilePath string) *MPIWorld

WorldInit initializes the TCP connections between the main node and the worker nodes. It takes as input the HostFilePath which is a newline delimited sequence of IP addresses with the host IP first. The format for this file is as follows:

localhost:9998
localhost:9999

The second paramter allows for the specification of the config file which allows for the configuration of the worker nodes. An example of this configuration can be seen as follows:

{
user "my_username"
keyfile "$HOME/.ssh/private_key_file
verbose true
}

func (*MPIWorld) Serialize

func (w *MPIWorld) Serialize() []byte

Jump to

Keyboard shortcuts

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