84
edits
Changes
→Implementation
"strings"
"sync"
)
func multiply(A [][]int, B [][]int) [][]int { sizeA := len(A)
}
}
}
func splitMatrix(nrOfThreads int, matrix [][]int) (matrixes [][][]int) {
for i := 0; i < nrOfThreads; i++ {
matrixes = append(matrixes, matrix[splitter*i:(splitter*(i+1))])
return
}
func multiplyStuff(finalMatrix *[][][]int, matrix1 [][]int, matrix2 [][]int, i int) {
}
func readFile(filePath string) (matrix1 [][]int, matrix2 [][]int) {
scanner := bufio.NewScanner(file)
for scanner.Scan() {
for _, element := range words {
i, err := strconv.Atoi(element)
} else {
matrix2 = append(matrix2, temp)
temp = nil
} else {
}
if err := scanner.Err(); err != nil {
log.Fatal(err)
}
func main() {
debug.SetGCPercent(-1)
if nrOfThreads <= 0 {
}
var wg sync.WaitGroup
matrix1, matrix2 := readFile(file)
log.Fatal("USAGE: " + os.Args[0] + " <file> <nrOfThreads>")
for i := 0; i < nrOfThreads; i++ {
wg.Add(1)
}(i)
}
}
end := time.Now().UnixNano()