Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Automated multithreaded sparse Jacobians in Julia via ModeingToolkit.jl
:((var"##MTIIPVar#414", var"##MTKArg#412")->begin
@inbounds begin
@sync begin
let (u₁, u₂, u₃, u₄, u₅, u₆, u₇, u₈, u₉, u₁₀) = (var"##MTKArg#412"[1], var"##MTKArg#412"[2], var"##MTKArg#412"[3], var"##MTKArg#412"[4], var"##MTKArg#412"[5], var"##MTKArg#412"[6], var"##MTKArg#412"[7], var"##MTKArg#412"[8], var"##MTKArg#412"[9], var"##MTKArg#412"[10])
begin
Threads.@spawn begin
(var"##MTIIPVar#414").nzval[1] = -2
(var"##MTIIPVar#414").nzval[2] = 1
(var"##MTIIPVar#414").nzval[3] = 1
(var"##MTIIPVar#414").nzval[4] = -2
(var"##MTIIPVar#414").nzval[5] = 1
end
end
begin
Threads.@spawn begin
(var"##MTIIPVar#414").nzval[6] = 1
(var"##MTIIPVar#414").nzval[7] = -2
(var"##MTIIPVar#414").nzval[8] = 1
(var"##MTIIPVar#414").nzval[9] = 1
(var"##MTIIPVar#414").nzval[10] = -2
end
end
begin
Threads.@spawn begin
(var"##MTIIPVar#414").nzval[11] = 1
(var"##MTIIPVar#414").nzval[12] = 1
(var"##MTIIPVar#414").nzval[13] = -2
(var"##MTIIPVar#414").nzval[14] = 1
(var"##MTIIPVar#414").nzval[15] = 1
end
end
begin
Threads.@spawn begin
(var"##MTIIPVar#414").nzval[16] = -2
(var"##MTIIPVar#414").nzval[17] = 1
(var"##MTIIPVar#414").nzval[18] = 1
(var"##MTIIPVar#414").nzval[19] = -2
(var"##MTIIPVar#414").nzval[20] = 1
end
end
begin
Threads.@spawn begin
(var"##MTIIPVar#414").nzval[21] = 1
(var"##MTIIPVar#414").nzval[22] = -2
(var"##MTIIPVar#414").nzval[23] = 1
(var"##MTIIPVar#414").nzval[24] = 1
(var"##MTIIPVar#414").nzval[25] = -2
end
end
begin
Threads.@spawn begin
(var"##MTIIPVar#414").nzval[26] = 1
(var"##MTIIPVar#414").nzval[27] = 1
(var"##MTIIPVar#414").nzval[28] = -2
end
end
end
end
end
nothing
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment