Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Christopher Rackauckas ChrisRackauckas

🎯
Focusing
View GitHub Profile
View multithreaded_bug2.jl
fjac = (var"##MTIIPVar#585", var"##MTKArg#583")->begin
@inbounds begin
let (u₁ˏ₁ˏ₁, u₂ˏ₁ˏ₁, u₃ˏ₁ˏ₁, u₄ˏ₁ˏ₁, u₅ˏ₁ˏ₁, u₆ˏ₁ˏ₁, u₇ˏ₁ˏ₁, u₈ˏ₁ˏ₁, u₉ˏ₁ˏ₁, u₁₀ˏ₁ˏ₁, u₁₁ˏ₁ˏ₁, u₁₂ˏ₁ˏ₁, u₁₃ˏ₁ˏ₁, u₁₄ˏ₁ˏ₁, u₁₅ˏ₁ˏ₁, u₁₆ˏ₁ˏ₁, u₁ˏ₂ˏ₁, u₂ˏ₂ˏ₁, u₃ˏ₂ˏ₁, u₄ˏ₂ˏ₁, u₅ˏ₂ˏ₁, u₆ˏ₂ˏ₁, u₇ˏ₂ˏ₁, u₈ˏ₂ˏ₁, u₉ˏ₂ˏ₁, u₁₀ˏ₂ˏ₁, u₁₁ˏ₂ˏ₁, u₁₂ˏ₂ˏ₁, u₁₃ˏ₂ˏ₁, u₁₄ˏ₂ˏ₁, u₁₅ˏ₂ˏ₁, u₁₆ˏ₂ˏ₁, u₁ˏ₃ˏ₁, u₂ˏ₃ˏ₁, u₃ˏ₃ˏ₁, u₄ˏ₃ˏ₁, u₅ˏ₃ˏ₁, u₆ˏ₃ˏ₁, u₇ˏ₃ˏ₁, u₈ˏ₃ˏ₁, u₉ˏ₃ˏ₁, u₁₀ˏ₃ˏ₁, u₁₁ˏ₃ˏ₁, u₁₂ˏ₃ˏ₁, u₁₃ˏ₃ˏ₁, u₁₄ˏ₃ˏ₁, u₁₅ˏ₃ˏ₁, u₁₆ˏ₃ˏ₁, u₁ˏ₄ˏ₁, u₂ˏ₄ˏ₁, u₃ˏ₄ˏ₁, u₄ˏ₄ˏ₁, u₅ˏ₄ˏ₁, u₆ˏ₄ˏ₁, u₇ˏ₄ˏ₁, u₈ˏ₄ˏ₁, u₉ˏ₄ˏ₁, u₁₀ˏ₄ˏ₁, u₁₁ˏ₄ˏ₁, u₁₂ˏ₄ˏ₁, u₁₃ˏ₄ˏ₁, u₁₄ˏ₄ˏ₁, u₁₅ˏ₄ˏ₁, u₁₆ˏ₄ˏ₁, u₁ˏ₅ˏ₁, u₂ˏ₅ˏ₁, u₃ˏ₅ˏ₁, u₄ˏ₅ˏ₁, u₅ˏ₅ˏ₁, u₆ˏ₅ˏ₁, u₇ˏ₅ˏ₁, u₈ˏ₅ˏ₁, u₉ˏ₅ˏ₁, u₁₀ˏ₅ˏ₁, u₁₁ˏ₅ˏ₁, u₁₂ˏ₅ˏ₁, u₁₃ˏ₅ˏ₁, u₁₄ˏ₅ˏ₁, u₁₅ˏ₅ˏ₁, u₁₆ˏ₅ˏ₁, u₁ˏ₆ˏ₁, u₂ˏ₆ˏ₁, u₃ˏ₆ˏ₁, u₄ˏ₆ˏ₁, u₅ˏ₆ˏ₁, u₆ˏ₆ˏ₁, u₇ˏ₆ˏ₁, u₈ˏ₆ˏ₁, u₉ˏ₆ˏ₁, u₁₀ˏ₆ˏ₁, u₁₁ˏ₆ˏ₁, u₁₂ˏ₆ˏ₁, u₁₃ˏ₆ˏ₁, u₁₄ˏ₆ˏ₁, u₁₅ˏ₆ˏ₁, u₁₆ˏ₆ˏ₁, u₁ˏ₇ˏ₁, u₂ˏ₇ˏ₁, u₃ˏ₇ˏ₁, u₄ˏ₇ˏ₁, u₅ˏ₇ˏ₁, u₆ˏ₇ˏ₁, u₇ˏ₇ˏ₁, u₈ˏ₇ˏ₁, u₉ˏ₇ˏ₁, u₁₀ˏ₇ˏ₁, u₁₁ˏ₇ˏ₁, u₁₂ˏ₇ˏ₁, u₁₃ˏ₇ˏ₁, u₁₄ˏ₇ˏ
View multithreaded_bug.jl
multithreadedfjac = (var"##MTIIPVar#581", var"##MTKArg#579")->begin
@inbounds begin
let (u₁ˏ₁ˏ₁, u₂ˏ₁ˏ₁, u₃ˏ₁ˏ₁, u₄ˏ₁ˏ₁, u₅ˏ₁ˏ₁, u₆ˏ₁ˏ₁, u₇ˏ₁ˏ₁, u₈ˏ₁ˏ₁, u₉ˏ₁ˏ₁, u₁₀ˏ₁ˏ₁, u₁₁ˏ₁ˏ₁, u₁₂ˏ₁ˏ₁, u₁₃ˏ₁ˏ₁, u₁₄ˏ₁ˏ₁, u₁₅ˏ₁ˏ₁, u₁₆ˏ₁ˏ₁, u₁ˏ₂ˏ₁, u₂ˏ₂ˏ₁, u₃ˏ₂ˏ₁, u₄ˏ₂ˏ₁, u₅ˏ₂ˏ₁, u₆ˏ₂ˏ₁, u₇ˏ₂ˏ₁, u₈ˏ₂ˏ₁, u₉ˏ₂ˏ₁, u₁₀ˏ₂ˏ₁, u₁₁ˏ₂ˏ₁, u₁₂ˏ₂ˏ₁, u₁₃ˏ₂ˏ₁, u₁₄ˏ₂ˏ₁, u₁₅ˏ₂ˏ₁, u₁₆ˏ₂ˏ₁, u₁ˏ₃ˏ₁, u₂ˏ₃ˏ₁, u₃ˏ₃ˏ₁, u₄ˏ₃ˏ₁, u₅ˏ₃ˏ₁, u₆ˏ₃ˏ₁, u₇ˏ₃ˏ₁, u₈ˏ₃ˏ₁, u₉ˏ₃ˏ₁, u₁₀ˏ₃ˏ₁, u₁₁ˏ₃ˏ₁, u₁₂ˏ₃ˏ₁, u₁₃ˏ₃ˏ₁, u₁₄ˏ₃ˏ₁, u₁₅ˏ₃ˏ₁, u₁₆ˏ₃ˏ₁, u₁ˏ₄ˏ₁, u₂ˏ₄ˏ₁, u₃ˏ₄ˏ₁, u₄ˏ₄ˏ₁, u₅ˏ₄ˏ₁, u₆ˏ₄ˏ₁, u₇ˏ₄ˏ₁, u₈ˏ₄ˏ₁, u₉ˏ₄ˏ₁, u₁₀ˏ₄ˏ₁, u₁₁ˏ₄ˏ₁, u₁₂ˏ₄ˏ₁, u₁₃ˏ₄ˏ₁, u₁₄ˏ₄ˏ₁, u₁₅ˏ₄ˏ₁, u₁₆ˏ₄ˏ₁, u₁ˏ₅ˏ₁, u₂ˏ₅ˏ₁, u₃ˏ₅ˏ₁, u₄ˏ₅ˏ₁, u₅ˏ₅ˏ₁, u₆ˏ₅ˏ₁, u₇ˏ₅ˏ₁, u₈ˏ₅ˏ₁, u₉ˏ₅ˏ₁, u₁₀ˏ₅ˏ₁, u₁₁ˏ₅ˏ₁, u₁₂ˏ₅ˏ₁, u₁₃ˏ₅ˏ₁, u₁₄ˏ₅ˏ₁, u₁₅ˏ₅ˏ₁, u₁₆ˏ₅ˏ₁, u₁ˏ₆ˏ₁, u₂ˏ₆ˏ₁, u₃ˏ₆ˏ₁, u₄ˏ₆ˏ₁, u₅ˏ₆ˏ₁, u₆ˏ₆ˏ₁, u₇ˏ₆ˏ₁, u₈ˏ₆ˏ₁, u₉ˏ₆ˏ₁, u₁₀ˏ₆ˏ₁, u₁₁ˏ₆ˏ₁, u₁₂ˏ₆ˏ₁, u₁₃ˏ₆ˏ₁, u₁₄ˏ₆ˏ₁, u₁₅ˏ₆ˏ₁, u₁₆ˏ₆ˏ₁, u₁ˏ₇ˏ₁, u₂ˏ₇ˏ₁, u₃ˏ₇ˏ₁, u₄ˏ₇ˏ₁, u₅ˏ₇ˏ₁, u₆ˏ₇ˏ₁, u₇ˏ₇ˏ₁, u₈ˏ₇ˏ₁, u₉ˏ₇ˏ₁, u₁₀ˏ₇ˏ₁, u₁₁ˏ₇ˏ₁, u₁₂ˏ₇ˏ₁, u₁
View juno
# Atom:
Version: 1.44.0
Dev Mode: false
Official Release: true
{
"http_parser": "2.8.0",
"node": "10.11.0",
"v8": "6.9.427.31-electron.0",
"uv": "1.23.0",
"zlib": "1.2.11",
View sparsity_reaction_diffusion.jl
using OrdinaryDiffEq, RecursiveArrayTools, LinearAlgebra, Test, SparseArrays, SparseDiffTools, Sundials
# Define the constants for the PDE
const α₂ = 1.0
const α₃ = 1.0
const β₁ = 1.0
const β₂ = 1.0
const β₃ = 1.0
const r₁ = 1.0
const r₂ = 1.0
@ChrisRackauckas
ChrisRackauckas / output.md
Last active Dec 27, 2019
SciPy+Numba odeint vs Julia ODE: 500x performance difference on stiff ODE benchmark
View output.md
  • SciPy LSODA through odeint fails at default tolerances
  • SciPy LSODA through odeint takes ~0.36 seconds at tol=1e-6
  • SciPy LSODA through odeint with Numba takes ~0.17 seconds at tol=1e-6
  • DifferentialEquations.jl Rosenbrock23 takes ~300μs at tol=1e-6
  • Demonstrated performance difference: ~1000x from pure SciPy, ~500x from SciPy+Numba
@ChrisRackauckas
ChrisRackauckas / systems_pharmacology.html
Created Dec 15, 2019
How Inexact Models Can Guide Decision Making in Systems Pharmacology
View systems_pharmacology.html
<!DOCTYPE html>
<HTML lang = "en">
<HEAD>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>How Inexact Models Can Guide Decision Making in Systems Pharmacology</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
@ChrisRackauckas
ChrisRackauckas / diffeqflux_differentialequations_vs_torchdiffeq_results.md
Last active May 12, 2020
torchdiffeq (Python) vs DifferentialEquations.jl (Julia) ODE Benchmarks
View diffeqflux_differentialequations_vs_torchdiffeq_results.md

Torchdiffeq vs DifferentialEquations.jl (/ DiffEqFlux.jl) Benchmarks

Benchmark: Solve the Lorenz equations from 0 to 100 with abstol=reltol=1e-8

Absolute Timings

  • DifferentialEquations.jl: 1.675 ms
  • diffeqpy (DifferentialEquations.jl called from Python): 3.473 ms
  • SciPy+Numba: 50.99 ms
  • SciPy: 110.6 ms
@ChrisRackauckas
ChrisRackauckas / neural_ode_animation.jl
Created Nov 25, 2019
Animation of neural ordinary differential equations with DiffEqFlux.jl
View neural_ode_animation.jl
using DiffEqFlux, OrdinaryDiffEq, Flux, Plots
# Generate data from a real ODE
u0 = Float32[2.; 0.]; datasize = 30
tspan = (0.0f0,1.5f0)
function trueODEfunc(du,u,p,t)
true_A = [-0.1 2.0; -2.0 -0.1]
du .= ((u.^3)'true_A)'
end
t = range(tspan[1],tspan[2],length=datasize)
View dirichletbc.jl
struct DirichletBC{T}
l::T
r::T
end
struct BoundaryPaddedArray{T,T2 <: AbstractVector{T}}
l::T
r::T
u::T2
end
View allowed_test_failure.jl
macro test_allowed_failure(ex, kws...)
test_expr!("@test_allowed_failure", ex, kws...)
orig_ex = Expr(:inert, ex)
result = Test.get_test_result(ex, __source__)
# code to call do_test with execution result and original expr
:(do_allowedfailure_test($result, $orig_ex))
end
function do_allowedfailure_test(result::Test.ExecutionResult, orig_expr)
You can’t perform that action at this time.