Documentation ¶
Index ¶
- Variables
- func Close()
- func GetHash(str string)
- func GetLocalIP() ([]string, error)
- func ReceiveBytes(size uint64, rank uint64) ([]byte, error)
- func SendBytes(buf []byte, rank uint64) error
- func SerializeWorld(world *MPIWorld) []byte
- func SetIPPoolFromFile(filePath string, world *MPIWorld) error
- func SetIPPoolFromKubernetes(world *MPIWorld) error
- type MPIWorld
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetLocalIP ¶
func ReceiveBytes ¶
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 ¶
If Dispatcher calls this function, rank is required If Worker calls this function, rank is not required, it will send to Dispatcher
func SerializeWorld ¶
func SetIPPoolFromFile ¶ added in v0.3.6
func SetIPPoolFromKubernetes ¶ added in v0.3.6
SetIPPoolFromKubernetes dynamically constructs the pool of IP addresses for the MPI world by querying the Kubernetes cluster for pods that match specific criteria. It utilizes the in-cluster configuration to create a clientset, which is then used to access the Kubernetes API and list pods based on a specified label selector. This function iterates over the list of worker pods, extracting their IP addresses and adding them to the world's IPPool. It is designed to run from within a pod inside a Kubernetes cluster. The function assumes that the pod has the necessary permissions to list pods in the Kubernetes API.
Parameters:
world - A pointer to the MPIWorld structure where the pool of IP addresses will be stored.
Returns:
error - Any error encountered while setting up the IPPool from Kubernetes. Returns nil if the operation is successful.
Example Usage:
var myWorld MPIWorld err := SetIPPoolFromKubernetes(&myWorld) if err != nil { // handle error }