Skip to content

Instantly share code, notes, and snippets.

Tanmay Mohapatra tanmaykm

View GitHub Profile
tanmaykm /
Created Mar 31, 2017
AMQPClient.jl issue
signal (15): Terminated
while loading /home/tan/.julia/v0.6/AMQPClient/test/test_throughput.jl, in expression starting on line 13
subtype at /data/Work/julia/sources/julia/src/subtype.c:687
exists_subtype at /data/Work/julia/sources/julia/src/subtype.c:867 [inlined]
forall_exists_subtype at /data/Work/julia/sources/julia/src/subtype.c:895
jl_subtype_env at /data/Work/julia/sources/julia/src/subtype.c:948
simple_join at /data/Work/julia/sources/julia/src/subtype.c:261
simple_join at /data/Work/julia/sources/julia/src/subtype.c:247 [inlined]
var_gt at /data/Work/julia/sources/julia/src/subtype.c:396

Julia packages go through a process called compilation on their first use, where the Julia code is compiled to llvm bytecode. The bytecode is cached, and re-used thus making subsequent use faster. Package bundles are special disk volumes that hold Julia packages. They help prepare packages once and use them uniformly across many many containers. They are pre-compiled by a special PkgBuilder job and are mounted as read only volumes to containers that use them. That ensures that when your code starts to use them they are alerady compiled. They are mounted read-only to ensure that they are not modified inadvertendly by some user code.

Preparing a package bundle involves the exact same steps as installaing and loading a package in the Julia REPL, essentially - Pkg.add(...),, and using .... Let's say you wish to build a package bundle with these packages: JSON and Distributions. And you wish to call your package bundle mypkg.

  • Create a volume for it: `~/.julia/v0.5/JuliaRun/scripts/loc
View example_server.jl
# context:
# Use fn to process messages from sock.
# Loop till sock is open and fn returns true.
function processor(fn, sock)
proc = true
while proc && ((nb_available(sock) > 0) || isopen(sock))
proc = fn(sock)
View hea.jl
using Base.Dates
const DEFREQ = 250.
const DEFGAIN = 200.
immutable Record
View zmqtest.jl
#const ENDPOINT = "tcp://localhost:9875"
const ENDPOINT = "ipc:///tmp/testZMQ";
const pid = getpid();
const MSG = "abcdefghijklmnopqrstuvwxyz";
vsz() = parse(Int, split(open(readstring,`ps -p $pid -o vsz`),"\n")[2]);
vsz(s) = println(s, vsz())
vsz("Initial VSZ=");
using ZMQ
tanmaykm /
Last active Jan 3, 2016
kmeans & als parallel mode comparisons
tanmaykm / perfbreeze.scala
Created Oct 18, 2015
scala perf for Julia micro benchmarks
View perfbreeze.scala
import scala.util._
import breeze.linalg._
import breeze.numerics._
import breeze.stats._
import breeze.math._
object PerfBreeze {
final val NITER = 5
tanmaykm / small_demo.jl
Last active Oct 6, 2015
Twitter link graph
View small_demo.jl
using Elly
using HadoopBlocks
@everywhere begin
#const INP = "hdfs://root@" * string(getipaddr()) * ":9000/"
#const COLSEP = '\t'
const INP = "hdfs://root@" * string(getipaddr()) * ":9000/twitter_small.csv"
# const YARNHOST = string(getipaddr()
#const INP = "hdfs://tan@localhost:9000/twitter_small.csv"
const COLSEP = ','
tanmaykm / wshed.jl
Last active Aug 29, 2015
simple watershed
View wshed.jl
using Images, Color, FixedPointNumbers, ImageView
impath = joinpath(Pkg.dir("TestImages"), "images/lena_gray_512.tif")
img = imread(impath);
mask = copy(img);[1:end] = 1;
marks = falses(size(;
View buffon.jl
function buffon_one()
mp = rand()
phi = (rand() * pi) - pi / 2
xrechts = mp + cos(phi)/2
xlinks = mp - cos(phi)/2
xrechts >= 1 || xlinks <= 0
function buffon(m)
hit = 0
You can’t perform that action at this time.