Question

Is it possible to use Xeon Phi using JVM-based language such as Scala? Is there any example?

Was it helpful?

Solution

It is not officially supported, however, you can still build JVM on your own.

I have built JamVM with GNU Classpath and slightly modified version of libffi. You can also try with zero-assembler version of HotSpot. As a result, you can get extremely slow virtual machine - even using 60 threads it was more than 10 times slower than my quad core mobile i7 CPU. On the other hand, it is a great opportunity to test scalability of Java implementations that run on tens of threads simultaneously.

Another idea is to use Aparapi tool - parts of Java bytecode are translated into OpenCL and executed on Phi.

OTHER TIPS

According to their FAQ there is not yet support for Java:

http://software.intel.com/en-us/articles/intelr-xeon-phitm-coprocessor-february-developer-webinar-qa-responses

Q: Is there a Java option for coding? A: Not yet.

While it is certainly a long way from being able to run Java on Xeon Phi cores, one possible way to relatively easily get Xeon-support in your Java program would be to use Aparapi (https://github.com/aparapi/aparapi), a library which can cross-compile a subset of java byte code to OpenCL at runtime and execute it as an OpenCL kernel (Xeon Phi supports OpenCL, as does any modern GPU).

It is a non-trivial process to convert existing Java code to run as Aparapi Kernels (the code called from the Kernel run() method itself needs to be essentially Object-free - fields, parameters and locals must be primitives or arrays of primitives). But if the number of bottlenecks requiring massive parallelisation is low, it will probably not be a tremendous hassle to achieve this.

This would also allow your project to benefit from massive parallelisation on other supercomputing hardware (like Nvidia Tesla).

My suspicion is that running "any old" Java on Xeon Phi is unlikely to ever be supported, and that even if it were, the optimisation of OpenCL on Phi would remain far superior.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top