Skip to content

Commit

Permalink
Merge pull request #109 from gvallee/issue103
Browse files Browse the repository at this point in the history
Order the communicator sizes in stats file
  • Loading branch information
gvallee authored Feb 5, 2021
2 parents 9860c1d + a92252d commit b85b063
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/internal/pkg/counts/counts_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@ func WriteDatatypeToFile(fd *os.File, numCalls int, datatypesSend map[int]int, d
return nil
}

// WriteCommunicatorSizesToFile save to a file the data about communicator sizes
func WriteCommunicatorSizesToFile(fd *os.File, numCalls int, commSizes map[int]int) error {
_, err := fd.WriteString("# Communicator size(s)\n\n")
if err != nil {
return err
}
for commSize, n := range commSizes {
_, err = fd.WriteString(fmt.Sprintf("%d/%d calls use a communicator size of %d\n", n, numCalls, commSize))

kvList := format.ConvertIntMapToOrderedArrayByValue(commSizes)
for _, elt := range kvList {
_, err = fd.WriteString(fmt.Sprintf("%d/%d calls use a communicator size of %d\n", elt.Val, numCalls, elt.Key))
if err != nil {
return err
}
Expand All @@ -56,6 +59,7 @@ func WriteCommunicatorSizesToFile(fd *os.File, numCalls int, commSizes map[int]i
return nil
}

// WriteCountStatsToFile writes all the stats to a file
func WriteCountStatsToFile(fd *os.File, numCalls int, sizeThreshold int, cs SendRecvStats) error {
_, err := fd.WriteString("# Message sizes\n\n")
if err != nil {
Expand Down

0 comments on commit b85b063

Please sign in to comment.