Skip to content

Commit

Permalink
Change metadata to map
Browse files Browse the repository at this point in the history
Signed-off-by: Ritika Srivastava <[email protected]>
  • Loading branch information
ritikasrivastava committed Oct 18, 2024
1 parent e9a4633 commit 4695286
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Vertex struct {
Name string
ID string
Vertices map[string]*Vertex
Metadata string
Metadata map[string]string
}

func (v *Vertex) String() string {
Expand Down
14 changes: 5 additions & 9 deletions pkg/providers/baremetal/mnnvl.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ import (
"strings"
)

const (
BlockTopologyHeader = `##################################################################
# Slurm's network topology configuration file for use with the
# topology/block plugin
##################################################################
`
)

// domain contains map of each domainID(clusterUUID) -> list of nodeNames in that domain
// Each domain will be a separate NVL Domain
type domain struct {
Expand Down Expand Up @@ -73,6 +65,7 @@ func getClusterOutput(ctx context.Context, domainMap map[string]domain, nodes []
func toSlurm(domainMap map[string]domain) *common.Vertex {
root := &common.Vertex{
Vertices: make(map[string]*common.Vertex),
Metadata: make(map[string]string),
}
blockSize := -1
for domainName, domain := range domainMap {
Expand All @@ -90,7 +83,10 @@ func toSlurm(domainMap map[string]domain) *common.Vertex {
}
root.Vertices[domainName] = tree
}
root.Metadata = strconv.Itoa(blockSize)
// add root metadata
root.Metadata["engine"] = "slurm"
root.Metadata["plugin"] = "topology/block"
root.Metadata[blocksize] = strconv.Itoa(blockSize)

Check failure on line 89 in pkg/providers/baremetal/mnnvl.go

View workflow job for this annotation

GitHub Actions / check

undefined: blocksize

Check failure on line 89 in pkg/providers/baremetal/mnnvl.go

View workflow job for this annotation

GitHub Actions / test

undefined: blocksize
return root
}

Expand Down

0 comments on commit 4695286

Please sign in to comment.