<commit_before>package main

import (
	"fmt"
	"github.com/swpecht/GoMM"
	"time"
)

func main() {
	numNodes := 10

	factory := GoMM.ClientFactory{}
	headName := "0.0.0.0:7946"
	clients := GoMM.GetLocalClients(numNodes, headName)

	for i := range clients {
		clients[i].Start()
	}

	// Don't have the root node join itsself
	for i := 1; i < len(clients); i++ {
		clients[i].Join(headName)
	}

	// Activate the pending memebers
	clients[0].UpdateActiveMembers()

	// Wait for all members to activate
	for i := 0; i < len(clients); i++ {
		clients[i].WaitActive()
	}

	start := time.Now()
	for i := 0; i < numNodes; i++ {
		fmt.Println("Hello, world.\n", factory, "\n")
		// Run a barrier, maybe have a client output to a channel when it
		// recieves the message, will allow for timing.
		// May require some knowledge of which one will get the message last.
	}
	elapsed := time.Since(start)
	fmt.Println("Benchmakr took", elapsed)

}<commit_msg>Implemented initial benchmark for broadcast.<commit_after>package main

import (
	"fmt"
	"github.com/swpecht/GoMM"
	"time"
)

func main() {
	numNodes := 2
	numIterations := 50

	headName := "0.0.0.0:7946"
	clients := GoMM.GetLocalClients(numNodes, headName)

	for i := range clients {
		clients[i].Start()
	}

	// Don't have the root node join itsself
	for i := 1; i < len(clients); i++ {
		clients[i].Join(headName)
	}

	// Activate the pending memebers
	clients[0].UpdateActiveMembers()

	// Wait for all members to activate
	for i := 0; i < len(clients); i++ {
		clients[i].WaitActive()
	}

	stringData := []string{"Hello", "World"}
	floatData := []float64{2.0, 48182.2}

	start := time.Now()
	for i := 0; i < numIterations; i++ {
		clients[0].Broadcast(stringData, floatData)
		ReceiveAllMessages(clients)
	}
	elapsed := time.Since(start)
	fmt.Println("Benchmakr took", elapsed, "for", numIterations, "iterations")
	fmt.Println("Average seconds per iteration:", elapsed.Seconds()/float64(numIterations))
}

// Receive messages all on clients but the root node
func ReceiveAllMessages(clients []GoMM.Client) {
	for i := 1; i < len(clients); i++ {
		<-clients[1].BroadcastChannel
	}
}
{'fraction_non_alphanumeric': 0.15406294034758103, 'fraction_numerical': 0.020666979802724285, 'mean_word_length': 3.885321100917431, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2439143', 'n_tokens_mistral': 836, 'n_tokens_neox': 772, 'n_words': 210}