mirror of
https://github.com/fverdugo/XM_40017.git
synced 2025-12-30 02:38:31 +01:00
Automatically convert images to base64
This commit is contained in:
File diff suppressed because one or more lines are too long
1269
docs/src/notebooks/julia_distributed_test.ipynb
Normal file
1269
docs/src/notebooks/julia_distributed_test.ipynb
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
60
docs/src/notebooks/sol_matrix_matrix.ipynb
Normal file
60
docs/src/notebooks/sol_matrix_matrix.ipynb
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d6d12733",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Solution to Matrix Multiplication Exercises\n",
|
||||
"\n",
|
||||
"## Implementation of Algorithm 3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "be73e87a",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"function matmul_dist_3!(C,A,B)\n",
|
||||
" m = size(C,1)\n",
|
||||
" n = size(C,2)\n",
|
||||
" l = size(A,2)\n",
|
||||
" @assert size(A,1) == m\n",
|
||||
" @assert size(B,2) == n\n",
|
||||
" @assert size(B,1) == l\n",
|
||||
" @assert mod(m,nworkers()) == 0\n",
|
||||
" # Implement here\n",
|
||||
" nrows_w = div(m,nworkers())\n",
|
||||
" @sync for (i,w) in enumerate(workers())\n",
|
||||
" rows_w = (1:nrows_w) .+ (i-1)*nrows_w\n",
|
||||
" Aw = A[rows_w,:]\n",
|
||||
" ftr = @spawnat w begin\n",
|
||||
" Cw = similar(Aw,nrows_w,n)\n",
|
||||
" matmul_seq!(Cw,Aw,B)\n",
|
||||
" Cw\n",
|
||||
" end\n",
|
||||
" @async C[rows_w,:] = fetch(ftr)\n",
|
||||
" end\n",
|
||||
" C\n",
|
||||
"end"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Julia 1.9.1",
|
||||
"language": "julia",
|
||||
"name": "julia-1.9"
|
||||
},
|
||||
"language_info": {
|
||||
"file_extension": ".jl",
|
||||
"mimetype": "application/julia",
|
||||
"name": "julia",
|
||||
"version": "1.9.1"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
Reference in New Issue
Block a user