# L-11 MCS 507 Fri 15 Sep 2023 : matmatmulmt.jl # Illustrates multithreaded matrix multiplication. # Run at the command prompt with as arguments the # dimension of the matrix and the number of threads. using LinearAlgebra if length(ARGS) < 2 println("use as") print(" julia ") print(PROGRAM_FILE) println(" dimension nthreads") else n = parse(Int, ARGS[1]) p = parse(Int, ARGS[2]) BLAS.set_num_threads(p) A = rand(n, n) B = rand(n, n) C = similar(B) @time mul!(C, A, B) end