Java towards High Performance Architecture (HPA) Implementation

Interesting to come across this article on Javaworld… Lift language opens the door to cross-platform parallelism | JavaWorld It’s main aim is to create code for OpenCL targeting different platforms with automatic optimization for dedicated HPA. It uses Scala as code base. Not tested it or used it. Wanted to mention it.

One thing I noticed during 2016 is the progress towards the push for java design especially the java vm on HPA utilization with value types through Project Valhalla… https://wiki.openjdk.java.net/display/valhalla/MainProject Valhalla – Value Types – Jesper de Jong and improving the old JNI architecture in accessing other languages, offheap memory allocation (Unsafe class methods for such are being migrated to accessible API such as VarHandles) through Project Panama… OpenJDK: Panama. All these changes will probably see them in jdk10. Pertaining to value types, Brian Goetz who is the team leader of Project Valhalla has made great progress in which the latest mailing list (can’t seem to access the openjdk mailing list), he has published a proposal that allows not much change in the jvm architecture.

The following link showcase the possibilities of value types once they are implemented… www.oracle.com/technetwork/java/jvmls2016-graves-3125549.pptx

Reminds me of Googles “RenderScript”.
A C-like language to program hardware (CPU/GPU) independent parallel fast code.

Yes, there have been some interesting developments recently!

Before saying anything further, a disclaimer: I’m not sooo deeply involved in all this. Everything that I say may be wrong and/or plainly stupid.

I have read about the ValueTypes when they have first been proposed (I think in 2014, [http://cr.openjdk.java.net/~jrose/values/values-0.html%2Bvalue+types+java+proposals&client=firefox-b-ab&gbv=1&hl=de&ct=clnk]Value](http://webcache.googleusercontent.com/search?q=cache:KIDWdT8beeYJ:[url) Types for Java - the website currently seems to be unreachable), and tried to follow the updated proposals to some extent. Some aspects of this are going veeery deeply into the VM architecture, and the articles about this by Brian Goetz are humbling, in this regard, but (at least for me seem to) make clear that some people who really know their stuff are trying to find sustainable solutions there.

Similarly, for the Panama project. I’m subsribed to the mailing list, and receive the updates accordingly (although I have to admit that I’ve not been able to closely track all the developments). In addition to ValueTypes and Panama, there is also OpenJDK: Project Sumatra . Although this basically seems to be anandoned right now, I think it was also at least some sort of ““playground””, where people experimented with targeting different platforms, and I assume that they at least gained valuable insights for the development in Panama. This might be a misperception, but for me it seems like the developments of Panama and Sumatra are now “converging” in the Panama branch…

So I think that there are several “branches” of development now: Each of them may be “interesting”, but their combination can mean a HUGE leap forward for Java and the JVM. The ValueTypes would be nice. The Vector API would be nice. Targeting CPUs and GPUs with the JIT would be nice. But when this is combined, the JVM could become an unrivaled platform for high-performance computing.

I had a quick look at the introductory article of the Lift language, but haven’t read the paper yet (I need more time for this). From quickly glancing at some of the samples, it seems like there are some API constructs for map-reduce patterns, but that there is still a lot of OpenCL code (in form of Strings) in the source code. That’s OK-ish. Something similar could be achieved with a high-level wrapper for OpenCL/JOCL. In any case, it seems to have a strong relationship to https://github.com/nativelibs4java/ScalaCL (but again: I’m not deeply enough involved in either of them to say anything profound here).

In general (even though this may be a rather bold statement, considering my limited overview) : For me, it seems like many people are currently gaining “insights” and re-inventing the wheel that Guy Blelloch invented in the 1990s: I’d recommend everyone to have a look at NESL: A Parallel Programming Language and the PhD thesis by Guy Blelloch. The analysis, approach, usage patterns, the cocept of work and depth (Work and Depth) and many other ideas that he presented in his work more than 25 years ago may look spookily familiar (and somehow pre-cognitive) in view of the latest developments in the GPU/Java world…

EDIT: A side note: It seems that some vectorizations (that are “”“trivial”"" compared to the efforts of the aforementioned projects) are already finding their paths into JDK 9 - at least, this is suggested by a recent stackoverflow answer: http://stackoverflow.com/a/41154761/3182664 - see http://hg.openjdk.java.net/jdk9/jdk9/hotspot/file/00edf368e99b/src/cpu/x86/vm/macroAssembler_x86.cpp#l9328