Julia features in Intel’s Parallel Universe Magazine

Parallel Universe is Intel’s quarterly publication, known to cover stories on notable and latest innovations in the field of software development, from high performance computing to threading hybrid applications.

Julia received a special mention in the Editor’s (Henry A. Gabb, Senior Principal Engineer at Intel Corporation) letter of Issue 29, the latest publication that came out this week. Henry talks about using Julia and how it gave him startling performance gains, not just with numerically intensive applications, but also with string manipulation applications. He summed this positive mention up saying that Julia has his attention.

The main story on Julia, co-authored by Julia Computing’s Viral Shah, Ranjan Anantharaman and Prof. Alan Edelman, begins on page 23 of the magazine, and comprehensively covers an overview of the language and a summary of it’s powerful features. It also goes on to talk about how Julia solves the “two language problem”, about parallelization in Julia, and ends on a high with coverage on Project Celeste, a joint project of Julia Computing, Lawrence Berkeley Labs, Intel and UC Berkeley researchers, an ambitiously compute intensive project aiming to catalog a digital atlas of the universe.

The link to the magazine is available here

About Henry A. Gabb

Henry A. Gabb, Senior Principal Engineer at Intel Corporation, is a longtime high-performance and parallel
computing practitioner and has published numerous articles on parallel programming. He was editor/coauthor of
“Developing Multithreaded Applications: A Platform Consistent Approach” and was program manager of the Intel/
Microsoft Universal Parallel Computing Research Centers.

About Julia Computing and Julia

Julia Computing was founded in 2015 by the co-creators of the Julia language to provide support to businesses and researchers who use Julia.

Julia is the fastest modern high performance open source computing language for data and analytics. It combines the functionality and ease of use of Python, R, Matlab, SAS and Stata with the speed of Java and C++. Julia delivers dramatic improvements in simplicity, speed, scalability, capacity and productivity. Julia provides parallel computing capabilities out of the box and literally infinite scalability with minimal effort. With more than 1 million downloads and +161% annual growth, Julia adoption is growing rapidly in finance, energy, robotics, genomics and many other fields.

Julia calling C: A more minimal example

Earlier I presented a minimal example of Julia calling C. It mimics how one would go about writing C code, wrapping it a library and then calling it from Julia. Today I came across and even more minimal way of doing that while reading an excellent blog on Julia’s syntactic loop fusion. Associated with the blog was notebook that explores the matter further.

Basically, you an write you C in a string and pass it directly to the compiler. It goes something like

C_code= """
       double mean(double a, double b) {
         return (a+b) / 2;
       }
       """
const Clib=tempname()
open(`gcc -fPIC -O3 -xc -shared -o $(Clib * "." * Libdl.dlext) -`, "w") do f
     print(f, C_code)
end

The tempname function generate a unique temporary file path. On my Linux system Clib will be string like "/tmp/juliaivzRkT". That path is used to generate a library name "/tmp/juliaivzRkT.so" which will then used in the ccall:

julia> x=ccall((:mean,Clib),Float64,(Float64,Float64),2.0,5.0)
3.5

This approach would be be recommended if are writing anything sophisticated in C. However, it fun to experiment with for short bits of C code that you might like to call from Julia. Saves you the hassle of creating a Makefile, compiling, etc…