Skip to content

Instantly share code, notes, and snippets.

View jrevels's full-sized avatar

Jarrett Revels jrevels

View GitHub Profile
@jrevels
jrevels / mpi_pagerank_kernel0.jl
Last active July 7, 2016 13:25
An MPI.jl-based implementation of kernel 0 from http://arxiv.org/abs/1603.01876
# execute by running `➜ mpiexec -n $NUM_PROCS julia mpi_pagerank_kernel0.jl`
import MPI
MPI.Init()
######################
# KronGraph500NoPerm #
######################
@everywhere module A
immutable Foo{T}
x::T
end
cross(a::Foo, b::Foo) = Foo(a.x * b.x)
function reload_cross(a, b)
include(joinpath(pwd(), "parallel-reload-bug.jl"))
return A.cross(a, b)
# This file is a naive implementation of numbers of the form x + y*i where i^2 = p
#######################
# GeneralComplex type #
#######################
immutable GeneralComplex{p,T} <: Number
x::T
y::T
end
using ForwardDiff
function check_failure_ratio(test_hessf::Function, input::Array, original::Array, max_iter=10e6)
bad_versions = 0
for iter = 1:max_iter
if maximum(abs(test_hessf(input) - original)) > 1
bad_versions += 1;
end
end
params{T}(::Type{T}) = T.parameters
# Parameterize column types and fields
# by utilizing tuples
type DataFrame{C<:Tuple, F<:Tuple}
columns::C
fields::Type{F}
function DataFrame(columns::C, fields::Type{F})
nrows = length(first(columns))
equallengths = true